Compiling Models with Spark SDK

AnthoniAnthoni Join Date: 2009-04-10 Member: 67129Members
edited January 2010 in NS2 General Discussion
<div class="IPBDescription">Using Blender or Maya</div><b><div align='center'><!--sizeo:4--><span style="font-size:14pt;line-height:100%"><!--/sizeo-->Compiling Models with Spark SDK<!--sizec--></span><!--/sizec--></div></b>
In this post I will show you how to compile custom models for Natural Selection 2 using the Spark SDK. For this I am assuming you have the builder properly configured pointing to your source directories. For this we will be only operating in the <b>../modelsrc/</b> directory though.

First, what you need to do is of course model your object in Blender or Maya, make sure the name of your object is the same as the name of the psd file you are using for your texture. When exporting from Maya you will use the <b>fbxmaya.mll</b> plug-in as it has a .dae exporter. For blender you should use the Collada 1.4 exporter, but when exporting from blender set these settings:
<img src="http://img705.imageshack.us/img705/2126/daefixblimg.jpg" border="0" class="linked-image" />

After you export you file from your respective modeling packages, you'll need to write a .model_compile file. To do that just create a new text document in Notepad, Notepad++, or ConTEXT. Set the name of the file to the name of your model. Here is how the file should look:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->geometry "model_name_here.dae"<!--c2--></div><!--ec2-->

Then just save that file in the <b>../modelsrc/</b> directory. Also, don't forget to write a .material file for the .psd either, make sure the texture path is set to <b>models/imagename.dds</b>. Now it's time to fix the .dae file to make it work for the builder. If you are using Maya you want to open up your dae file in Notepad, ConTEXT, etc. In my case I was using a file called box_text.psd, in your file it will be the name of your texture. You want to change from:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><library_images>
        <image id="box_test_psd-img" name="box_test_psd-img">
            <init_from>file://C:/Users/Anthoni/Desktop/NS2Projects/src/modelsrc/box_test.psd</init_from>
        </image>
</library_images><!--c2--></div><!--ec2-->
To:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><library_images>
        <image id="box_test_psd-img" name="box_test_psd-img">
            <init_from>box_test.psd</init_from>
        </image>
</library_images><!--c2--></div><!--ec2-->

Once all the files are in the <b>../modelsrc/</b> directory, and fixed you want to open up the LaunchPad, and then open up the Builder App.
Then just click Build>Build and it should build the model and materials for you.

I hope this has provided you with some help, and good luck in your model compiling endeavors! :)

Comments

Sign In or Register to comment.