Topic: Blender to .mod scripts are there any working?  (Read 46816 times)

0 Members and 4 Guests are viewing this topic.

Offline marstone

  • Because I can
  • Commander
  • *
  • Posts: 3014
  • Gender: Male
  • G.E.C.K. - The best kit to have
    • Ramblings on the Q3, blog
Re: Blender to .mod scripts are there any working?
« Reply #40 on: February 28, 2010, 11:43:57 am »
Well, I feel like an idiot so far.  I don't seem to be able to figure out how to get blender to find my script I am working on.  So I will do more in just straight python first.  Then add the stuff that is needed to make it a blender script. 

If anyone has the patience to explain how to get blender to find my script (and where to access it from blender) I would appreciate it.  Explain it like you are talking to a five year old, I'm feeling stupid in my old age.
The smell of printer ink in the morning,
Tis the smell of programming.

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: Blender to .mod scripts are there any working?
« Reply #41 on: February 28, 2010, 12:47:28 pm »
Put your script here:
C:\blender\.blender\scripts
Or depending on how you installed blender the .blender folder may be in a user dir.

make sure it starts like so:
Code: [Select]
#!BPY

"""
Name: 'StarFleet Command (.mod)...'
Blender: 249
Group: 'Export'
Tooltip: 'Export to SFC file format (.mod).'
"""

It should then be accessible through the file...export menu. (Similarly for import scripts)

Offline marstone

  • Because I can
  • Commander
  • *
  • Posts: 3014
  • Gender: Male
  • G.E.C.K. - The best kit to have
    • Ramblings on the Q3, blog
Re: Blender to .mod scripts are there any working?
« Reply #42 on: February 28, 2010, 01:08:25 pm »
yep,yep,yep.  I remember that part now.  The sample I was working with as a base didn't have the header on it. (but yeah, I did read about it a few days ago, grrr).
The smell of printer ink in the morning,
Tis the smell of programming.

Offline Tus-XC

  • Capt
  • XenoCorp® Member
  • Commander
  • *
  • Posts: 2788
  • Gender: Male
Re: Blender to .mod scripts are there any working?
« Reply #43 on: February 28, 2010, 02:34:08 pm »
ya know, its nice having two resident code geniuses here ;)
Rob

"Elige Sortem Tuam"

Offline marstone

  • Because I can
  • Commander
  • *
  • Posts: 3014
  • Gender: Male
  • G.E.C.K. - The best kit to have
    • Ramblings on the Q3, blog
Re: Blender to .mod scripts are there any working?
« Reply #44 on: March 01, 2010, 01:58:22 am »
Alright, it finds the script.  It can open a file and start to read it. 

First version I am shooting to just read in the verts and faces.  No textures or bones(hardpoints)

speaking of the hardpoints, what does blender hold them as?
The smell of printer ink in the morning,
Tis the smell of programming.

Offline Tus-XC

  • Capt
  • XenoCorp® Member
  • Commander
  • *
  • Posts: 2788
  • Gender: Male
Re: Blender to .mod scripts are there any working?
« Reply #45 on: March 01, 2010, 04:42:06 am »
hardpoints should be dummy objects, in 3ds max they are dummy cubes... from what i can tell blender has something similar.   From my understanding (and what i surmise) is that the dummy objects are simply placeholders for the hardpoints, so that when the ship is exported, the export programs know what to name the hardpoints and where to position them.  So I would imagine any dummy object in blender would do.
Rob

"Elige Sortem Tuam"

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: Blender to .mod scripts are there any working?
« Reply #46 on: March 01, 2010, 04:54:39 am »
I thought that hardpoints were stored as joints since the model is not animated. (?) (could be mistaken)

THere's a thread on the subject with an appropriate title in the models forum. joints, hardpoints and something... ah here it is:
http://www.dynaverse.net/forum/index.php/topic,163372956.0.html
in the context of milkshape... might be relevant to blender too?

Where's that pdf from Heaven's Eagle?
« Last Edit: March 01, 2010, 05:06:27 am by Bonk »

Offline Tus-XC

  • Capt
  • XenoCorp® Member
  • Commander
  • *
  • Posts: 2788
  • Gender: Male
Re: Blender to .mod scripts are there any working?
« Reply #47 on: March 01, 2010, 04:58:12 am »
For 3ds Max, the HP and DP are all stored as dummy objects.  what the equivalent in blender is, i don't know (empty object maybe?)

edit:  from my quick playing with blender it seems that empty objects (add empty) are similary to what a dummy object is.   for all i know though i could be adding a vertex lol

edit2:  From some quick checking of the wiki, I'm like.. 80 % sure that empy objects are what we are looking for (either the empty or empty mesh) either one of those could be used to represent the hard points
« Last Edit: March 01, 2010, 05:13:31 am by Tus-XC »
Rob

"Elige Sortem Tuam"

Offline Tus-XC

  • Capt
  • XenoCorp® Member
  • Commander
  • *
  • Posts: 2788
  • Gender: Male
Re: Blender to .mod scripts are there any working?
« Reply #48 on: March 01, 2010, 04:59:01 am »
I thought that hardpoints were stored as joints since the model is not animated. (?) (could be mistaken)

THere's a thread on the subject with an appropriate title in the models forum. joints, hardpoints and something... ah here it is:
http://www.dynaverse.net/forum/index.php/topic,163372956.0.html
in the context of milkshape... might be relevant to blender too?


yes, that is because MS does not support dummy objects, thus another method had to be developed to get the same effect
Rob

"Elige Sortem Tuam"

Offline marstone

  • Because I can
  • Commander
  • *
  • Posts: 3014
  • Gender: Male
  • G.E.C.K. - The best kit to have
    • Ramblings on the Q3, blog
Re: Blender to .mod scripts are there any working?
« Reply #49 on: March 01, 2010, 05:19:04 am »
alright, sounds good so far for the hardpoints.  In the MOD format they are stored as a name reference and a 3d point.  When I get to worrying about adding them, then we can figure out what is best to hold the spot on the ship.  I should have the vertices worked out when I get home from work today, and the faces hopefully shortly after that.  (faces have alot of information on them that I have to sort through to just get the three verts that make up the face)


Well, finish work, and see what I can do.

*edit*
Okay, going alittle slower then I wanted.  I am now ready to start to read in the verts.   Was hoping to have this part done before heading off to the second job (in ten minutes)

*edit*
just heading off to work (again), but have it reading all the verts in (not doing anything with them yet, but they are in an array now).  I figure since the converter for 3DS was written in C++ the references to the array of verts for the faces will start with number zero.  I will get those read in when I get back from work, and see if I can get a wire frame up in Blender.
« Last Edit: March 01, 2010, 10:24:31 am by marstone »
The smell of printer ink in the morning,
Tis the smell of programming.

Offline FoaS_XC

  • Photorps, Sammiches, woot woot.
  • Global Moderator
  • Commander
  • *
  • Posts: 4571
  • Gender: Male
    • Robinomicon
Re: Blender to .mod scripts are there any working?
« Reply #50 on: March 01, 2010, 06:14:31 pm »
I would think that it doesn't matter what type of object you make the hardpoint/damage point, so long as the exporter script that objects A through G are hardpoints, and then places their XYZ coordinates into the MOD format in the right place. (the easiest way of designating hardpoint coordinates is to use a "for x in objects where classof x == dummy do..." type dealy.
Robinomicon
"When I was 5 years old, my mom always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down “happy.” They told me I didn’t understand the assignment and I told them they didn’t understand life."

Offline marstone

  • Because I can
  • Commander
  • *
  • Posts: 3014
  • Gender: Male
  • G.E.C.K. - The best kit to have
    • Ramblings on the Q3, blog
Re: Blender to .mod scripts are there any working?
« Reply #51 on: March 01, 2010, 09:46:56 pm »
I would think that it doesn't matter what type of object you make the hardpoint/damage point, so long as the exporter script that objects A through G are hardpoints, and then places their XYZ coordinates into the MOD format in the right place. (the easiest way of designating hardpoint coordinates is to use a "for x in objects where classof x == dummy do..." type dealy.
yeah, something like that.  :crazy2:  Feeling alittle sick right now so got some sleep.  Example code had two ways of doing the verts, and neither stuck out to me.  So will diddle tonight at work.  Python is interesting language, abit weird for me, but interesting.

*edit*
okay found a function that will add the verts and faces in easily.  Now to reading in faces.
« Last Edit: March 01, 2010, 10:53:17 pm by marstone »
The smell of printer ink in the morning,
Tis the smell of programming.

Offline marstone

  • Because I can
  • Commander
  • *
  • Posts: 3014
  • Gender: Male
  • G.E.C.K. - The best kit to have
    • Ramblings on the Q3, blog
Re: Blender to .mod scripts are there any working?
« Reply #52 on: March 02, 2010, 12:18:13 am »
okay, question.  why is that stupid square in the middle of my blender screen?  It gets in the way of seeing the fighter model I just loaded.

MOD_Import.py

Next is to work on the textures. Then the hardpoints.
Also will start to work on the export version.

*edit*
Oh, if you get an earge to look at the code, it has been programmed in an Italian dinner style. 
« Last Edit: March 02, 2010, 02:28:29 am by marstone »
The smell of printer ink in the morning,
Tis the smell of programming.

Offline Rod ONeal

  • D.Net Beta Tester
  • Commander
  • *
  • Posts: 3592
  • Gender: Male
Re: Blender to .mod scripts are there any working?
« Reply #53 on: March 02, 2010, 01:56:26 am »
Great going, Marstone!
If Romulans aren't cowards, then why do they taste like chicken?

Offline marstone

  • Because I can
  • Commander
  • *
  • Posts: 3014
  • Gender: Male
  • G.E.C.K. - The best kit to have
    • Ramblings on the Q3, blog
Re: Blender to .mod scripts are there any working?
« Reply #54 on: March 02, 2010, 02:26:32 am »
Thx, It's coming along.  Although I am feeling like Charlie Brown trying to kick the football, working on this material/texture stuff.  As a graphicly challenged individual, this is not the most fun reading (tho it is interesting, I vaguely remember this stuff from way earlier).  Now am I reading it right, that for SFC I have a normal texture (diffuse) and an illumination  texture (not sure of the spcific name).  I can just forget about all the rest right?

You know if I had a clue, and maybe some talent, I could be dangerous.
The smell of printer ink in the morning,
Tis the smell of programming.

Offline Tus-XC

  • Capt
  • XenoCorp® Member
  • Commander
  • *
  • Posts: 2788
  • Gender: Male
Re: Blender to .mod scripts are there any working?
« Reply #55 on: March 02, 2010, 04:56:06 am »
SFC supports only Diffuse and Illumination maps, though I think the .mod file does store more information than just that - its just the game doesn't read it.
Rob

"Elige Sortem Tuam"

Offline marstone

  • Because I can
  • Commander
  • *
  • Posts: 3014
  • Gender: Male
  • G.E.C.K. - The best kit to have
    • Ramblings on the Q3, blog
Re: Blender to .mod scripts are there any working?
« Reply #56 on: March 02, 2010, 10:31:56 am »
coughing up a lung.  Will be a day or so before I am back on this.

*edit*
A peek behind the curtain of how I work on decoding this stuff (and the Q3).

Note the mountain dew throwback, a much needed tool.
Other side note, note the lack of a computer in the area.  ;)
« Last Edit: March 02, 2010, 01:01:10 pm by marstone »
The smell of printer ink in the morning,
Tis the smell of programming.

Offline marstone

  • Because I can
  • Commander
  • *
  • Posts: 3014
  • Gender: Male
  • G.E.C.K. - The best kit to have
    • Ramblings on the Q3, blog
Re: Blender to .mod scripts are there any working?
« Reply #57 on: March 04, 2010, 02:23:33 am »
Question for those that know.  When putting an illum map on a ship what material/texture settings are used?  Is the texture an Opacity?  The standard material seems to be a Diffuse texture. 
The smell of printer ink in the morning,
Tis the smell of programming.

Offline FoaS_XC

  • Photorps, Sammiches, woot woot.
  • Global Moderator
  • Commander
  • *
  • Posts: 4571
  • Gender: Male
    • Robinomicon
Re: Blender to .mod scripts are there any working?
« Reply #58 on: March 04, 2010, 10:50:06 am »
normal material = Diffuse (aka: color)
the illum map should be called something like Lighting, Self-Illumination. Blender might use the term ambient (even if it is inaccurate for such things).
Robinomicon
"When I was 5 years old, my mom always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down “happy.” They told me I didn’t understand the assignment and I told them they didn’t understand life."

Offline marstone

  • Because I can
  • Commander
  • *
  • Posts: 3014
  • Gender: Male
  • G.E.C.K. - The best kit to have
    • Ramblings on the Q3, blog
Re: Blender to .mod scripts are there any working?
« Reply #59 on: March 04, 2010, 12:31:57 pm »
Okay, thanks.  Will look and see what I can find as the type for the illum map.  I should have a version out that does the basic texture in a day or two. (then have to look into the break models also, grrr)
The smell of printer ink in the morning,
Tis the smell of programming.