[tutorial]how to import custom models into spark
borgking
Join Date: 2009-11-24 Member: 69504Members
Hi, today I'm going to write about the model compiling process with the spark builder.
I wasn't able to import it with textures working yet, so if you find any way to do it, please help.
At first you need a modeling programm which is able to export into the Collada format (.dae).
<b>For XSI, 3Dsmax and Blender users:</b>
I noticed there is a problem with the export from XSI which makes spark tools crash, so I ported into blender, which is open source, via obj export.
There I simply imported the file, after deleting any other objects. Select in this tool is right click.
So finaly I select my model and export with export->collada 1.4 There I used Triangles/Only export selection/use UV image mat.
If you have entered your directory, filename and the .dae extention press export. Notice: to compile the file has to lay in a subdirectory of your mods modelsrc directory.
<a href="http://borgkinghome.bo.funpic.de/tutorials/spark_modelcompile/spark_export_dae.jpg" target="_blank">http://borgkinghome.bo.funpic.de/tutorials..._export_dae.jpg</a>
So when you have exported into the collada format, you have to write a small text data, similar to .qc files of the source engine.
Simply create a new textdocument in the dae's directory and rename it to <your model's name>.model_compile.
You can easily edit it with notepad or any other text editor.
Now you have to type following into this model_compile file:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><model>
<geometry (your .dea's file name).dae />
</model><!--c2--></div><!--ec2-->
Save and build with the builder, and you have a game ready compiled version of your model in your spark ;)
I assume to get the textures working you have to add anything into this, since the viewer shows textures if you let it show the .dae.
So, Max, can you please enlighten us?
/e: Pipi: simply try to export to blender, the same way as with XSI...
I wasn't able to import it with textures working yet, so if you find any way to do it, please help.
At first you need a modeling programm which is able to export into the Collada format (.dae).
<b>For XSI, 3Dsmax and Blender users:</b>
I noticed there is a problem with the export from XSI which makes spark tools crash, so I ported into blender, which is open source, via obj export.
There I simply imported the file, after deleting any other objects. Select in this tool is right click.
So finaly I select my model and export with export->collada 1.4 There I used Triangles/Only export selection/use UV image mat.
If you have entered your directory, filename and the .dae extention press export. Notice: to compile the file has to lay in a subdirectory of your mods modelsrc directory.
<a href="http://borgkinghome.bo.funpic.de/tutorials/spark_modelcompile/spark_export_dae.jpg" target="_blank">http://borgkinghome.bo.funpic.de/tutorials..._export_dae.jpg</a>
So when you have exported into the collada format, you have to write a small text data, similar to .qc files of the source engine.
Simply create a new textdocument in the dae's directory and rename it to <your model's name>.model_compile.
You can easily edit it with notepad or any other text editor.
Now you have to type following into this model_compile file:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><model>
<geometry (your .dea's file name).dae />
</model><!--c2--></div><!--ec2-->
Save and build with the builder, and you have a game ready compiled version of your model in your spark ;)
I assume to get the textures working you have to add anything into this, since the viewer shows textures if you let it show the .dae.
So, Max, can you please enlighten us?
/e: Pipi: simply try to export to blender, the same way as with XSI...
Comments
I tried opening the .model file with notepad and changing the material line to match a .material file, but i think it corupts the file has it won't load in the viewer after being edited.
<!--quoteo(post=1744356:date=Dec 19 2009, 11:19 PM:name=Ark)--><div class='quotetop'>QUOTE (Ark @ Dec 19 2009, 11:19 PM) <a href="index.php?act=findpost&pid=1744356"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Thx for this, too bad we have to keep doing stuff by trail and error to figure this stuff out.<!--QuoteEnd--></div><!--QuoteEEnd-->
Too bad? We're rushing ahead of developers with this: they said they'll release documentation in a while.
Too bad? We're rushing ahead of developers with this: they said they'll release documentation in a while.<!--QuoteEnd--></div><!--QuoteEEnd-->
Then whats the point of releasing stuff without proper documentation? A simple .pdf would have sufficed until they have time to proper document it.
They are an independant company whose producing their own tools.. and they're releasing their "work-in-progress" stuff along the way to people who have pre-bought the game.
It's not like they're going to publish an update fully clean of things that doesn't yet work properly or completed artworks every week.
I think everyone saw the tram repair arm model, yet not textured. Another example of their WIP is the builder, that is not yet fully functionnal but I can see how it will become a solid tool to work with.
I think some of us here are a bit too demanding.. about their pre-order.
;)
Because then we'd have to wait a lot longer. Most of Spark is self-explanatory anyway.
The editor and viewer are easy to get into and understand, just wish the <i>other</i> tools add a little more documentation.
Im not trying to be a ###### here, just think they should properly test stuff and have documentation ready, if not then hold the tools back til time permits.
If that's how you feel don't use them until the build is up to your standards.
Then there would be no Alpha.
No one's forcing anyone to figure out the tools on their own, one could indeed wait until there's some documentation to go with them.
I see it as a case of people pushing UW to get tools out without them being able to test them properly and UW are doing it to keep there customers happy.
I see it as a case of people pushing UW to get tools out without them being able to test them properly and UW are doing it to keep there customers happy.<!--QuoteEnd--></div><!--QuoteEEnd-->
You don't release either Alphas or Betas at all.
<a href="http://en.wikipedia.org/wiki/Software_release_life_cycle" target="_blank">http://en.wikipedia.org/wiki/Software_release_life_cycle</a>
We're currently in pre-alpha. No one badgered UW to do this, they did the same sort of thing with NS1 to get the community up to speed so they could ship some user-made maps with the game. Plus feedback, of course.
I would like to offer my services as a modeler if anyone needs custom props, I can't guarantee deadlines, but I can do fairly complex models for anyone requiring them, as long as I enjoy making them ;) (so not a hundred different lightsources, but advanced machinery or stuff like that should be cool, just draw some concepts and I'll see if I can offer my assistance)
my question for UWE, will we be able to have animated models as props? would be cool to have those arms moving around instead of just having static maps. (plus it would be a cool gameplay element)
Absolutely. It's already in the Alpha.
<a href="http://img693.imageshack.us/i/ak47s.jpg/" target="_blank"><img src="http://img693.imageshack.us/img693/5055/ak47s.th.jpg" border="0" class="linked-image" /></a>
I dunno what I'm doing wrong but each time I load my model in the viewer, it says:
Couldn't open file "models/.material"
Couldn't open file "notfound.material"
And so my model is displayed without any textures...
All my files are in:
C:\Program Files\Natural Selection 2\ns2\models\mystuff
pillar.dds
pillar_spe.dds
pillar.model
pillar.material
pillar.material content:
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec--><material>
<maps>
<map type="texture" value="models/mystuff/pillar.dds" />
<map type="specular" value="models/mystuff/pillar_spe.dds" />
</maps>
</material><!--QuoteEnd--></div><!--QuoteEEnd-->
And the model_compiler content:
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec--><model>
<geometry pillar.dae />
</model><!--QuoteEnd--></div><!--QuoteEEnd-->
i'm using plugin colladamax 3.04c for 3DS...I think it works quite well since my model is displayed in the viewer...only the textures are missing and I really wonder why.
Can you help ?
Thank you
<!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto--><model>
<geometry "pillar.dae" />
<b> <materials_path "models/mystuff" /></b>
</model><!--fontc--></span><!--/fontc-->
You can also scale model size:
<!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto--><model>
<geometry "pillar.dae" />
<materials_path "models/mystuff" />
<b> <scale 1.0 /></b>
</model><!--fontc--></span><!--/fontc-->
<b>scale</b> being any float value above 0.
So you have finaly solved this :)
Thank you for this!
/e: doesnt't work somehow:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><model>
<geometry "fish01.dae" />
<materials_path "models/darkwater/nature" />
<scale 10.0 />
</model><!--c2--></div><!--ec2-->
and
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->Couldn't open file "models/.material"
Couldn't open file "notfound.material"<!--c2--></div><!--ec2-->
When i open any UWE models with wordpad, i can find a line/path like:
models/props/refinery/mining_computer_01.material
however mine keep being stuck with this line:
models/.material
even when I add the material path to the model_compiler...it still remains the same (and if I edit it manually, the model doesnt work at all).
Also loaded the dae into the viewer and it shows the texture. Only when it's compiled the texture is missing :(
or
Remove the path so its just my_texture.dds and place a copy of the textures .material file in along side the model.
*Blender wont export Colloda if "Use Relitive Paths" is selected.
Does anyone know how to get the physics mesh to work in blender cause i can run through my models :/ ?