Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: pecenipicek on August 26, 2008, 07:09:34 am

Title: Retaining hierarchy on export from any program to tS 7.6 + VRML
Post by: pecenipicek on August 26, 2008, 07:09:34 am
Hokay, basically, the method i've found out that works the best for transferring 3D models with hierarchy intact through different programs is using the VRML 1.0 format.
http://en.wikipedia.org/wiki/VRML
Quote
VRML is a text file format where, e.g., vertices and edges for a 3D polygon can be specified along with the surface color, UV mapped textures, shininess, transparency, and so on.
Quote
The first version of VRML was specified in November 1994.

That is the version you will of course need. Most programs can both import and export VRML 1.0. some can do VRML 2.0 but i find it that trueSpace 7.6 doesnt really like VRML 2.0

Now, down to the important part.
(http://img174.imageshack.us/img174/1091/tut01ql9.th.jpg) (http://img174.imageshack.us/my.php?image=tut01ql9.jpg)
We have our model here, along with the hierarchy formatted the way PCS2 should like it. Basically, autogen verified stuff. (this model is already ingame)
First of, be certain that your model has something resembling a UV map and just a basic texture of sorts applied to it (may be just a plain color for all the converter cares, just make sure you have one)

The hierarchy should contain only the model itself, its subobjects and associated lights. Okay, so lets export it. Save your file as VRML 1.0 or VRML 1. Take note that you should really be carefull what you name your objects, since if the name of a say null object and your object containing the geometry are the same, your geometry will get a ,1 attached to the end of its name.
Example: You have your hierarchy set up like this

HG_AF (null)
     -HG_AF (geometry)
          -center_HG_AF (light that defines the central axis of the model)
          -whatever else you want goes afterwards... just remember the general pof structure. This might help, but it needs updating (http://freespace.volitionwatch.com/blackwater/fstut/PCS_auto-gen.htm)

It might work that way in your program, but if you export to VRML, it will come out like this.

HG_AF (null)
     -HG_AF,1 (geometry)
          -center_HG_AF (light that defines the central axis of the model)
          -whatever else you want goes afterwards...

This is very bad for getting it into PCS2, since it will probably report an unglued light problem, so make sure that you do not export your file with a null for the root object. Your geometry object should be the root. ALWAYS.

You exported it fine? K. Lets get it into trueSpace 7.6. If you just installed it, you'll see the Workspace side of TS. Click on model, TS6 files, load scene.

(http://img170.imageshack.us/img170/1762/tut03bw3.th.jpg) (http://img170.imageshack.us/my.php?image=tut03bw3.jpg)

Load up the VRML file you just saved. It should be named like this "InsertNameHere.wrl". The .wrl extension is important. Anyways, load the scene and check it with the trueview hierarchy editor.
 
(http://img170.imageshack.us/img170/4050/tut05wk2.th.jpg) (http://img170.imageshack.us/my.php?image=tut05wk2.jpg)

If you dont have trueview already, download it here (http://tap.irialeona.com/dl/TrueView.7z) put it in the folder tsx in your truespace7.6/ts/ folder where ts7.6 is installed. Then click on the install new truespace extension button and navigate to where you put the trueview.tsx.

After you have covered that speedbump (if you had it), click on the topmost object in the hierarchy of your model.

(http://img520.imageshack.us/img520/6267/tut06ok1.th.jpg) (http://img520.imageshack.us/my.php?image=tut06ok1.jpg)

Click on the TS6 Files -> Save As... -> Object

(http://img144.imageshack.us/img144/1926/tut07ba2.th.jpg) (http://img144.imageshack.us/my.php?image=tut07ba2.jpg)

From the pull-down menu select truespace 6.0 model. (this is because PCS doesnt read the UV data properly from 7.x cobs, at least in my experience)

(http://img511.imageshack.us/img511/830/tut08fn4.th.jpg) (http://img511.imageshack.us/my.php?image=tut08fn4.jpg)

Time to open PCS2... (i'm using PCS 2.0.3, didnt test with newer dae supporting versions...)

Open your cob file and check if it imported properly. (basically, no import errors should be present. the "Use geometry filter" option has given me a lot of unglued object problems, so i turned it off. That option is basically a safeguard against non-planar polygons.)

If it turns out okay, you can use it without any problems, now you just need to add table data and you're set.


Hiigaran Flak Frigate (http://egzodus.com/dir/HG_AF.7z)
I have attached in this .7z archive the model along with the tables and an example mission. Use it as a mod folder, since it only uses modular tables to add the things needed. Also, you might want to make a new pilot just for testing. Otherwise, some errors might occur. Ye've been advised :p

Also the weapon has the shield factor at 25 because it doesnt get through shields otherwise. (homeworld universe doesnt have shields on fighters)

This method basically only needs you to be able to set up the hierarchy in your program of choice, then export it via VRML 1.0 and import it to truespace. You also do not neccesarily need 7.6 since even 3.2 can import VRML 1.0 without any problems.

This method might seem a bit... idiotic, considering the whole collada endeavour, but note, not all programs can export to .dae, so this will be usefull to people who dont have the ability to export to COLLADA.


Time taken to write this : 2 hours
Resources consumed : 5 cigarettes, one Burn energy drink, 24 shivans while testing the mission and the model so that it works properly and one very unhappy gnome has been punted off to parts unknown when he thought it would be a good idea to sit on the barrel of a flak gun.
Model used: Hiigaran Flak Frigate, modelled by me, courtesy of The Apocalypse Project (http://tap.hard-light.net)


Also note, this is my way of giving back to the community that started me on 3D. I have joined here in November 2004, finding it via Spacebattles.com, finding out that the FS2 community is stronger than i tought, grabbed truespace 3.2 and went on from there, trying to do mods, but i didnt succeed anywhere. But i have to thank mostly to Karajorma since he was the person who helped me the most to do stuff in truespace, sooo, shout out to you kara. Pece out.

Also a big critique on the whole community... Why didnt anyone think of this sooner?
Title: Re: Retaining hierarchy on export from any program to tS 7.6 + VRML
Post by: pecenipicek on August 26, 2008, 07:35:05 am
to anyone who downloaded the test 7z, download again, i accidentally uploaded the wrong file, its the right one now.
Title: Re: Retaining hierarchy on export from any program to tS 7.6 + VRML
Post by: shiv on August 26, 2008, 07:55:15 am
Stick this thread please :) Really good tutorial :D
Title: Re: Retaining hierarchy on export from any program to tS 7.6 + VRML
Post by: Snail on August 26, 2008, 08:00:50 am
Well, done for now.
Title: Re: Retaining hierarchy on export from any program to tS 7.6 + VRML
Post by: KewlToyZ on August 26, 2008, 10:08:09 am
Quote
Then click on the install new truespace extension button and navigate to where you put the trueview.tsx.

After you have covered that speedbump (if you had it), click on the topmost object in the hierarchy of your model.

Where is this thing. The one thing I hate most about TS? I want menus I can read through quickly and a command line I hate this baffling gui!
Title: Re: Retaining hierarchy on export from any program to tS 7.6 + VRML
Post by: pecenipicek on August 26, 2008, 10:28:19 am
the icons on the lower set of the screen. more specifically, this button.
(http://img.photobucket.com/albums/v82/pecenipicek/tut-09.jpg)
Title: Re: Retaining hierarchy on export from any program to tS 7.6 + VRML
Post by: KewlToyZ on August 26, 2008, 11:18:34 am
Thank you sir!
Nothing more frustrating than TS forums and not being able to post after registering let alone the fact their search engine only returns generic terms like file or install, but nada for things like tsx.

I read that I can switch the environment to menus instead of buttons but they never say how?
edit: Ahh I found it, 1D, doh!
Insane that I have to bother you guys here with these questions when their forums dont allow posting after registration...

pecenipicek , I humbly thank you for your time sir!
I have a crick in my neck from testing formats and different programs over the past week with my model.
This should get me much farther along now!
Title: Re: Retaining hierarchy on export from any program to tS 7.6 + VRML
Post by: bob_v5 on September 11, 2008, 10:29:04 am
How do I get trueview to work? When I click on the plug button it only gives me the option to install .rsx files. If I choose "all files", I can pick the .tsx file, and nothing seems to happen. Did it install? IF it did, where do I find the button to run it? ts is really annoying. Hope someone can help, I been stuck for hours because of this.
Title: Re: Retaining hierarchy on export from any program to tS 7.6 + VRML
Post by: pecenipicek on September 11, 2008, 11:07:14 am
i have already explained this in detail. READ THE THREAD!
Title: Re: Retaining hierarchy on export from any program to tS 7.6 + VRML
Post by: bob_v5 on September 11, 2008, 11:48:15 am
I did read the thread. But just to be sure I read it again. And then again. This confused me as I had allready done exactly what you said.
With one exception.
On my truespace at least, there is another button almost identicle to the one in your pic. I pressed the wrong one. Doh.