Hard Light Productions Forums
Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: JediMasterTim on January 02, 2008, 01:54:22 pm
-
What exactly is the process of getting a model from Blender into Freespace? I have a really simple UV mapped model (just a flat plane) that I want to make into a ship. Are their any tutorials on this anywhere?
-
Here's how I do it. Once you have the model done press tab to go into object mode, select the model so that there is a pink outline around it and select from the top bar menu: export->.3ds and go to truespace and select import and import that .3ds. Apply whatever you need and then save it as a .cob file (not a scene). You can now edit it using pcs (or pcs 2) to give it gunpoints and such. Just remember to convert the models and it will be fine. You're basically just going.
.blend->.3ds->.cob->.pof
Also, remember to put the name of your new model into the .ships tbl or it won't be loaded by the game!
Clear as mud? Good. Have fun!
-
Thanks for replying. I did as you said and exported it as a 3DS. I then imported it into Truespace, but it says it is unable to find the texture map. Am I going to have to retexture it in Truespace or am I doing something wrong?
-
That's because truespace only looks for files in it's own texture folder, you can either a. just select browse, find the image you used for the texture map and click it or b. move the file through a lot of folders and place it into the correct one. I personally just do a. but it's really up to you.
-
trueSpace didn't get texture path searching and appending until (IIRC) 4.2 or 4.3. With 3.2 it's easiest to just toss all your textures into the default textures path.
-
you get killed by me in a ritual sacrifice - that is how :P
-
Well yeah bu I use a later version so thats how I do it :p
-
Been out of the loop for a few days or I would have replied to this earlier. Firstly to remind Kaz that his skewed opinion of blender is soley based on a small error in the export function of a bizzare outdated format that was fixed the version later and has been fixed for the past 6 years or so, and I'd also like to point out that PCS1 produced faulty collision detection data long after the DXF export error was fixed anyway. :p
As for the export method, Warp Shadow's will work, but there is now a COB-export python script modified by Water that saves a COB that can be directly converted to POF using PCS2. It can't correctly export hierarchy, but it does keep the objects correctly separate. This means we can bypass truecrap and all the pain, misery and instabilities it brings and just do the hierarchy in PCS2. All the cobs I've converted using this method have been 100% stable collision mesh data-wise as far as I've been able to tell.
The one thing you might have a bit of trouble with is that before export, you need to apply the scaling and rotation (ctrl+A) that has been applied to the objects in the ship or they will return to their original size and orientation during export.
The python file is here: http://www.sectorgame.com/ti-file-dump/VasudanAdmiral/truespace_FS2_basic-export.py
Put it in your "<blender install directory>\.blender\scripts" folder and it will add "Truespace Basic -FS2- (.cob)" to your export list.
If for whatever reason you absolutely need to get your ship into truecrap before conversion, the best way to do it is either directly open the cob the script exports, or use the Direct X format (.X) and save it as a cob using 3d exploration. This method retains everything but the hierarchy.
-
Yeah. Now I feel a little silly because I'm stuck with truespace 3.2 for a while and now I have NO idea how to get my texture from blender into truecrap. Will that python script save the texture too? Oh and how do you actually download it. All I get is a bunch of text and no .py files.
-
Yeah. Now I feel a little silly because I'm stuck with truespace 3.2 for a while and now I have NO idea how to get my texture from blender into truecrap. Will that python script save the texture too? Oh and how do you actually download it. All I get is a bunch of text and no .py files.
Don't just click on the link - use "save link as" (or equivalant)
No the script won't save the texture but all you have to do is move it to Truespaces texture directory, so it can find it.
-
You see though, it keeps asking for a .scene file for it and I guess that is something that gets saved when you make it in 3ds max but blender doesn't make one of those. I guess the entire problem would be completely avoided if I just exported to .cob though.
edit: I tried doing what you said but when I try to export it as a .cob I get an error and a message to check the console.
-
The blender console is that dos window that opens up with blender - check there for what the error says.
-
edit: I tried doing what you said but when I try to export it as a .cob I get an error and a message to check the console.
umm oops - For that script you may need to install Python on your machine.
python.org
-
Thanks a lot for the script. I ended up using LithUnwrap to export the COB, but this is much easier. Now I just need to figure out turrets and I'll be all set. :)
-
Once you have the model done press tab to go into object mode, select the model so that there is a pink outline around it and select from the top bar menu: export->.3ds and go to truespace and select import and import that .3ds.
.blend->.3ds->.cob->.pof
Also, remember to put the name of your new model into the .ships tbl or it won't be loaded by the game!
Clear as mud? Good. Have fun!
I have two things i would like to discuss, the first being that when i do the .3ds -> .cob step of this conversion from blender, trueCrap asks me for a file called "tor_". does anybody know what the hell trueCrap is asking me for?
Second, I've tried blender's .cob exporter, and i can make it work, its just that when the file is converted to .pof, all the subobjects now have the same object center as the main hull and fail to act as turrets. Any ideas on how to remedy this? All comments and advice is greatly appreciated.
-
Water has a new hierarchy exporter for blender - prolly help keeping the objects separated for turreting appropriately.
Just a noob here and just working thru the blender to pcs hierarchy fighter setup myself (and struggling) so i haven't much help to offer... - other than this link....
http://www.hard-light.net/forums/index.php/topic,52264.0.html
it has the newer blender cob exporter on the second page- gl
nex
-
Second, I've tried blender's .cob exporter, and i can make it work, its just that when the file is converted to .pof, all the subobjects now have the same object center as the main hull and fail to act as turrets. Any ideas on how to remedy this? All comments and advice is greatly appreciated.
For cap ship Turrets, this is the export script to use.
http://files.filefront.com/truespace+FS2+Hierarchy+etzip/;9692727;/fileinfo.html (http://files.filefront.com/truespace+FS2+Hierarchy+etzip/;9692727;/fileinfo.html)
Needs heirarchy setup in the Blend file to function. In Blender, CTRL-p to make the last object selected the parent and ALT-p to clear parent.
Here is a test model with heirarchy (Blend 2.65mb)
http://files.filefront.com/yamato100zip/;9756708;/fileinfo.html (http://files.filefront.com/yamato100zip/;9756708;/fileinfo.html)
It has 27 turrets with arms, so it's a bit over the top. May be useful to look at though. It shows the turret setup and naming and the use of lamps, which PCS2 will turn into firepoints.
-
wowie. Thanks a lot. I can get the turrets to appear properly after much flipflopping in the base blender model now, but the firepoints didn't get converted. Do the turret names have to follow the format "turret01-base" "turret01-arms" "turret01-fp0x"? Anyhow, thanks a lot.
-
wowie. Thanks a lot. I can get the turrets to appear properly after much flipflopping in the base blender model now, but the firepoints didn't get converted. Do the turret names have to follow the format "turret01-base" "turret01-arms" "turret01-fp0x"? Anyhow, thanks a lot.
For multi-part turrets - yes
For the simple turrets, just "turret01" and the firepoint "turret01-fp00"
Just noticed that PCS2, when it saves a cob, starts the fire point numbering from -fp00
-
okay, i've got everything working right except for the textures. when i use the POF constructor suite to make the final POF, only five of the twelve textures used are interpreted and saved into the pof by PCS. Any idea as to what's up with that? all of the textures used are game texures, so i can't be missing any specialized maps.
Another thing I would like to know is how to find/edit the names of all my turrets, so I can write the .tbl file correctly.
Is it a bad thing when i tell ModelView to "rotate parts" and nothing moves?
Again, all help is greatly appreciated.
-
okay, i've got everything working right except for the textures. when i use the POF constructor suite to make the final POF, only five of the twelve textures used are interpreted and saved into the pof by PCS. Any idea as to what's up with that? all of the textures used are game texures, so i can't be missing any specialized maps.
Each Blender object can have only one texture using the export script. If that's not your problem either post or pm a link and I'll have a look.
Another thing I would like to know is how to find/edit the names of all my turrets, so I can write the .tbl file correctly.
In Blender the Outliner shows all the turret names, and use *pad to copy one table entry and repaste multiple times, then edit :nervous:
Is it a bad thing when i tell ModelView to "rotate parts" and nothing moves?
I don't trust Modelview to rotate anything. Others find it very useful. If it rotates in game then the pof and table are ok.
-
Then that means that the main body can't have snazzy multiple-textures like the typhon and colossus, right?
-
Then that means that the main body can't have snazzy ugly and inefficient multiple-textures like the typhon and colossus, right?
Fixed. ;)
Seriously, you should definitely be using a single texture for most models. Texture tiling (ie, multiple textures) is far less efficient in terms of rendertime, and unless it's done brilliantly usually looks rather crappy. Painting your own texture is definitely harder and takes a lot longer, but once you're practiced it produces far superior results to tiling.
-
Then that means that the main body can't have snazzy multiple-textures like the typhon and colossus, right?
Nope.
You can use multiple textures. You just can't export them.
In Blender split the mesh up so that each texture has its own part. Then export. In Truespace (sorry :nervous:) put all the mesh pieces under the same group. PCS2 will combine the pieces back into one mesh object.
-
I have absolutely no skill at truespace, so i might need some guiding on that.
And i still can't get the table file to agree with the model. Anyone know what the parts to the "$subsystem: ___________,__,__" entry are and how to use them in the game?
-
I have absolutely no skill at truespace, so i might need some guiding on that.
And i still can't get the table file to agree with the model. Anyone know what the parts to the "$subsystem: ___________,__,__" entry are and how to use them in the game?
It is subsystem name (must be the same as in the model file), percent of ship's total hitpoints that the subsystem has (can be zero, like fighterbays), and seconds per 360 degree turn (can also be 0, really only used for turrets and rotating subsystems).
-
I have absolutely no skill at truespace, so i might need some guiding on that.
Heh, I use Truespace to get to an extension called Trueview. Effectively it's a heirarchy editor. The Truespace skills required are the ability to load and then at the end save the cob file. :P
-
Okay, i must be doing something really wrong somewhere, and i have no clue where that somewhere is. So, I ask anyone out there to take a look at these files, review them and tell me what I'm doing wrong. A summation of the problem is that this model does appear in freespace, but it is lacking any and all subsystems. :confused: It also flies backwards (I can solve that one, no worries there, just some strangeness between Blender and trueCrap that can be compensated for by a negative scaling along the Y axis (across X)).
the .tbl file can be found here:
http://files.filefront.com/Ioatbl/;9775407;/fileinfo.html (http://files.filefront.com/Ioatbl/;9775407;/fileinfo.html)
the .blend file used to model this thing is here:
http://files.filefront.com/GTDIoa+MasterExporterblend/;9775437;/fileinfo.html (http://files.filefront.com/GTDIoa+MasterExporterblend/;9775437;/fileinfo.html)
the final pof file spat out of PCS is here:
http://files.filefront.com/GTDIoapof/;9775450;/fileinfo.html (http://files.filefront.com/GTDIoapof/;9775450;/fileinfo.html)
any advice/help is again appreciated.
-
When you hit 3 (sideview) the nose should be on the left.
Before export you need to apply rotation and scaling - select all and hit CTRL-a (trying to figure why this turns your stuff into a mess)
Turrets on top face forward - Turrets on bottom need to face backwards.
Multipart turrets on sides are only for people who like a challange. :P
I haven't checked if the export script handles stuff not being on layer 0
Detail 0 (high) Detail 1 (lower) Detail 3 or 4 (lowest detail levels, 4 =pyramid 4 faces)
EDIT:
For heirarchy in Blender you will need to be more structured. The reason you have the turrets facing one way in Blender vs Truespace is Scaling and Rotation. The rotation for each part for export should be 0 and the scale 1.
If you scale an object its children are scaled as well, but the children's scale factor still stays at 1. So when you "apply" scale to the parent it keeps its size but the children loose the scaling. The only way around it is to not parent everything till the final stage. Rotation of children has the same problem.
If you do rotate a turret with heirarchy, then remove all turret parenting, apply scale and rotation (CTRL-a) to all its parts and re-setup the heirarchy. After that you can copy it multiple times without any problems. Lamps don't care about rotation.
Use PCS2 to setup subsystems.
navigation, communication, weapons, sensors, engine01-5
5 engines are different from 5 engine glows. You can have 1 or 2 engines with 5 engine glows (thrusters).
-
Water has pretty much covered all the issues there, yeah.
About the turret hierarchy stuff and applying scale and rotation, select everything and clear the parenting (alt-p as opposed to ctrl-p) and apply scale and rotation (ctrl-a). You might have to do it for each object. As Water said - if you press n a little properties window pops up. If scale and rotation has been applied to an object then the Scale x, y and z fields are all 1.0, while the Rotation x, y and z fields are all 0.0.
After this you will need to re-build the hierarchy again, parenting arms to bases, and then selecting all bases and parenting them to the main hull. If you want to be lazy and the positions of the turrets haven't changed, you can just parent all lights to the main hull rather than the individual correct turret - PCS2 doesn't care what the data lights (such as firepoints) are parented to, as long as the name of the light itself is right. It's only interested in name and location. It's just easier for making modifications to the turret layout if the light is parented to the turret base or arms. :)
Also, side multipart turrets are a bit trickier than regular turrets, but all they require is a forward vector (identical to a firepoint) and an upward vector. So if you had a turret on the starboard side of the ship, you would give it a forward vector of 0,0,1 and an upward vector of 1,0,0 (I think. Might be a -1. Depends on whether FS sees starboard as positive or negative X.)
So, your Subobject Properties for the base of that turret would look like this:
$special=subsystem
$fov=180
$name=gun turret
$uvec:1,0,0
$fvec:0,0,1
-
Thanks all! I haven't had a chance to get around to this, but it seems like it will help. I'll post again if that doesn't work it out.
I encountered another problem with the LOD's. I get the fact that level 0 is the highest, level 4 the lowest, but for some odd reason during export, the levels got flipped. Level 4 held the second highest detail, level three the medium, and level two the lowest, and level one the full detail model.
-
I encountered another problem with the LOD's. I get the fact that level 0 is the highest, level 4 the lowest, but for some odd reason during export, the levels got flipped. Level 4 held the second highest detail, level three the medium, and level two the lowest, and level one the full detail model.
The LOD's are mixed up in blender, but they are ok in the pof
In the Blend file:
detail 0 2052 tri (1026 quads)
detail1 248 faces (rename to detail3)
detail2 512
detail 3 1026 (rename to detail1)
-
The scrambling in blender was done purposefully to make the pof file work properly.
When the blender LOD's weren't scrambled, the pof LODs were.
-
Alrighty, this is starting to piss me off. I just did everything you guys told me to do to the letter, and for some reason, FS2 will not, absolutely will not see the turret systems, the subsystems, or any weapons. The model's subobjects all have scale 1, rot 1 for all axes, the heirarchy checks out, and all editors/pof readers I have do not encounter any errors when processing this model. Is it still something with the table file?
Any help is greatly appreciated, as always.
-
The pof and table contain most of the turret data, but the mission file also contains a list of each cap ships subsystems, including turrets.
Otherwise repost your re-edited blend + pof + table and test mission file (if you have one)
-
The turret stuff stored in the mission files shouldn't affect anything.
To have a working multipart turret, as a general guide you need to:
1) Have the barrels (arms) as child objects of the rotating base object, and have the base object a child of the main hull.
2) Also make sure that the centres of rotation of each object are in the appropriate places or the bits will rotate all over the place)
3) Make sure the arms on all turrets are pointing directly away from the hull beneath. This usually means straight up or down for regular top/bottom turrets.
4) In PCS2, the subobject properties for the base subobject are set as follows:
Movement Type: Rotate
Axis: Y Axis (This is the up-down axis and is used for turrets on the top or bottom of your ship. You need to use fvec and uvec for anything else)
Properties:
$special=subsystem
$fov=180 (Imagine a targetting cone with the point attached to the turret base, and the rest of the cone straight above or below it. The FOV is the angle of the pointy end of that cone.)
$name=main turret (This doesn't actually have an effect, but is probably still nessecary. Never could be bothered to test. ;) )
5) In the Turrets section of PCS2, add (if it's not there already) a turret with:
'Parent' set to your turrets rotating base subobject
'Physical' set to your turrets barrels subobject
'Normal' set to point in the same direction the arms are pointing, ie. straight away from the hull below.
Then add as many firepoints as you have barrels with the limit being 3 max and stick them where you want the shots to emerge.
6) In the table entry for the ship, make reference to the turret somewhere in the subsystem section at the bottom. The format is:
$Subsystem: <name>, <percent of main hull strength subsystem has>, <time taken for turret to do full 360° rotation>
$Default PBanks: ( "<weapon1>" "<weapon2>" )
So for example:
$Subsystem: turret01,0.833,1.0
$Default PBanks: ( "Terran Huge Turret" )
There are a few other specialised options you can find in the wiki. :)
-
Then add as many firepoints as you have barrels with the limit being 3 max and stick them where you want the shots to emerge.
. . .
I think we have the culprit. Every turret carries four firing points.
Just to verify, the name in the $subsystem entry needs to be the same as in the .pof, right?
-
Yeah - the name of the turret's base subobject. :)
-
Okay, everything is as it should be, but its still throwing fits. Is it possible it's being cranky because my file is lacking turret debris models? (Although that doesn't explain why the subsystems don't appear...)
Files currently in use:
GTDIoaT3.pof
http://files.filefront.com/GTDIoaT3pof/;9812763;/fileinfo.html (http://files.filefront.com/GTDIoaT3pof/;9812763;/fileinfo.html)
GTDIoa_MasterExporterNoLayers3Firepoints.blend (FEAR THE USELESS LONG NAME!)
http://files.filefront.com/GTDIoa+MasterExporterNoLablend/;9812784;/fileinfo.html (http://files.filefront.com/GTDIoa+MasterExporterNoLablend/;9812784;/fileinfo.html)
And the Ioa Table Entry:
http://files.filefront.com/GTDIoatxt/;9812803;/fileinfo.html (http://files.filefront.com/GTDIoatxt/;9812803;/fileinfo.html)
-
It looks like you converted that file in PCS1 - I strongly recommend you open the pof in PCS2, go to data>purge BSP cache and resave.
Anyway, the problem appears to be in your table. Where you have "$Subsystem: turret01, 3, 3.0" etc for each turret in the table, in the POF your turret subobjects are named "turret01-base" etc.
So, all I needed to do to get the weapons working according to Fred was add "-base" to the end of each subsystem name in the table so the names match that of the subobjects. :)
-
YAY! IT BLOWS STUFF UP NOW! :D
But 4 of the six guns try to shoot backwards... and a corvette can seriously own it because of this :mad:
So, since all the side guns are throwing fits, I'm gonna get rid of them. In their place will be protrusions on which guns are mounted on the top and bottom.
Thanks for all your help and patience.
-
Ah, it looks like you need to specify the fvec and uvec of the turret arms as well. If that still produces weird results, try doing the exact opposite of what fvec and uvec imply. That is, pretend up vector is actually down vector and front vector is back vector.
I'm suggesting this because I'm looking at one of Bobs old demo models that appears to do this - everythings the exact opposite to what you'd expect. :\
-
Ahhh.... so that's the problem.
I'll think about that when i'm done recovering from that last model. I already gave the ship more guns, just only in the up and down position. The new version doesn't look as cool, so I might edit it some more. Plus I think its too powerful. And the textures need serious work.
I also noticed that the FS2 negative fields are all flipped in PCS. Meaning, in FS2, -X is on the left. in PCS, -X is on the right.
-
So, since all the side guns are throwing fits, I'm gonna get rid of them.
Most side turrets on FS ships are still just plain blob turrets. Once the turret support becomes rock solid that will change fast for new ships.