3d Model/Animation Pipeline

zexzex Join Date: 2009-10-07 Member: 68978Members
edited January 2011 in Modding
Has anyone imported custom models/animations into NS2/Spark and what is the export pipeline like?

- What 3rd-party content creation software is supported
- What kind of animated skin/rig is expected
- How are materials created, is there a proprietary UW shader type and are standard 3rd party material formats and/or pixel shaders exported
- How is collision handled, i.e. for animated meshes vs static meshes
- when can modders expect documentation on the above, if it isn't currently available

Comments

  • zexzex Join Date: 2009-10-07 Member: 68978Members
    there's no documentation on this?
  • MagnetoMagneto Join Date: 2010-12-22 Member: 75856Members
    I think some of your questions can be answered if you search the wiki and forums, i think collada is the format used so anything that works with it should be ok.
  • zexzex Join Date: 2009-10-07 Member: 68978Members
    edited January 2011
  • HarimauHarimau Join Date: 2007-12-24 Member: 63250Members
    This may be relevant?: <a href="http://www.m4x0r.com/blog/2010/05/eliminating-exporting-in-an-asset-pipeline/" target="_blank">http://www.m4x0r.com/blog/2010/05/eliminat...asset-pipeline/</a>
  • MOOtantMOOtant Join Date: 2010-06-25 Member: 72158Members
    Not at all it just explains trick - they save game specific data at the end of 3ds ".max" file. Unless the plugin that does this allows configuring exporting that is done later and then you just run .DAE -> .model.
  • HarimauHarimau Join Date: 2007-12-24 Member: 63250Members
    Send off an email, imo.
  • McGlaspieMcGlaspie www.team156.com Join Date: 2010-07-26 Member: 73044Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Reinforced - Onos, WC 2013 - Gold, Subnautica Playtester
    edited January 2011
    oookaay, here goes....


    <!--quoteo(post=1821066:date=Jan 3 2011, 12:25 AM:name=zex)--><div class='quotetop'>QUOTE (zex @ Jan 3 2011, 12:25 AM) <a href="index.php?act=findpost&pid=1821066"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->- What 3rd-party content creation software is supported<!--QuoteEnd--></div><!--QuoteEEnd-->Any program that exports to the <a href="http://www.khronos.org/collada/faq/" target="_blank">COLLADA</a> format, which is basically all the major ones out there.
    Blender, Maya, 3DS, even Wings 3D (with a plugin). I have been able to import a custom model into the game, but never quite sorted out the texture alignment for its surfaces. I'm pretty sure I unintentionally flipped the Y axis when exporting to Collada format. I was just curious and never tried to go back to it. I do know if you follow the correct conventions of the Collada format the Builder app will convert and copy your materials from your custom model to the appropriate directories.

    <!--quoteo(post=1821066:date=Jan 3 2011, 12:25 AM:name=zex)--><div class='quotetop'>QUOTE (zex @ Jan 3 2011, 12:25 AM) <a href="index.php?act=findpost&pid=1821066"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->- How are materials created, is there a proprietary UW shader type and are standard 3rd party material formats and/or pixel shaders exported<!--QuoteEnd--></div><!--QuoteEEnd-->Spark uses a material system and DirectX style shaders (*.fx files). I believe it supports Pixel Shader model 2 & 3 and Vertex shaders v2 & v3 as well. I could be mistaken of the Pixel/Vertex shader models it follows. All of the current shaders used can be found in the '..\Natural Selection 2\ns2\shaders" folder; however, these are basically compiled and Max has done some seriously gnarly stuff with them, so I don't recommend messing with these.
    For information on importing textures take a look here: <a href="http://www.unknownworlds.com/ns2/wiki/index.php/Importing_Custom_Textures" target="_blank">Importing Custom Textures</a>. The <a href="http://www.unknownworlds.com/ns2/wiki/index.php/Builder" target="_blank">Builder app</a> will compile/convert your psd files to dds files for you.
    And look <a href="http://www.unknownworlds.com/ns2/wiki/index.php/Builder#Building_Models" target="_blank">at this page for the basics on importing a model</a> into the Spark format.
    It's worth noting, there are some missing Material <map> type not in that article called 'Gloss'. I'm not sure if the Albedo map is supported yet or not.

    Here is an example .material file:
    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><material>
        <maps>
            <map type="texture" value="models/marine/male/male_black_face.dds" />
            <map type="bump" value="models/marine/male/male_black_face_normal.dds" />
            <map type="emissive" value="models/marine/male/male_black_face_illum.dds" />
            <map type="specular" value="models/marine/male/male_black_face_spec.dds" />
        </maps>

        <properties>
            <property type="surface" value="organic" />
        </properties>

    </material><!--c2--></div><!--ec2-->


    <!--quoteo(post=1821066:date=Jan 3 2011, 12:25 AM:name=zex)--><div class='quotetop'>QUOTE (zex @ Jan 3 2011, 12:25 AM) <a href="index.php?act=findpost&pid=1821066"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->- What kind of animated skin/rig is expected<!--QuoteEnd--></div><!--QuoteEEnd-->Changing the skin/materials on model is not currently support. I do know it is on the Technical Task list, but it's way way down on the list. As far as texture mapping goes, you just need to follow the COLLADA format. It supports your standard UV mapping, so you shouldn't run into any problems there. The animations are driven by a skeletal or bones that work within a linear keyframe. In your modeling program you'd setup a skeleton for your model and associate specific polygons/surfaces with specific bones. Then do keyframe style animations. One thing I do not understand about models/animations is the attachment points and how the Pivot points (Marine's torso pitch up down as he looks around, etc.) work.

    <!--quoteo(post=1821066:date=Jan 3 2011, 12:25 AM:name=zex)--><div class='quotetop'>QUOTE (zex @ Jan 3 2011, 12:25 AM) <a href="index.php?act=findpost&pid=1821066"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->- How is collision handled, i.e. for animated meshes vs static meshes<!--QuoteEnd--></div><!--QuoteEEnd-->Each ScriptActor type entity (think players, structures, etc. not static props placed in the level editor) have a skeleton that is used for animations. All of the models (entities, not static props) have your everyday Bound Box and then smaller Hit Boxes that define the more granular "collision areas" of a model. To see an example of what I'm talking about, load up the Viewer app and then open any of the in-game entity based models (player models, sentries, etc.). Under the 'View' menu in the Viewer you can see all of the various components that comprise a completed model. There is very little information on how they define a rag-doll skeleton or physics aspects of the collision data in a model right now, so anyone's guess is as good as mine in this area. The biggest difference between Static and Animated meshes is the amount of "schtuff" in the model. Static meshes only require a Bound Box to be defined (afaik). The Bound Boxes are part of the Collada format and should be defined in your modeling program.

    <!--quoteo(post=1821066:date=Jan 3 2011, 12:25 AM:name=zex)--><div class='quotetop'>QUOTE (zex @ Jan 3 2011, 12:25 AM) <a href="index.php?act=findpost&pid=1821066"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->- when can modders expect documentation on the above, if it isn't currently available<!--QuoteEnd--></div><!--QuoteEEnd-->I have no idea, but I wouldn't expect it for a very long time. This will most likely not come until after v1.0 release or just before it.


    I by no means have any insider information or have a true understanding of Spark, but hopefully this will at least be enough to get you or anyone else started.
  • zexzex Join Date: 2009-10-07 Member: 68978Members
    edited January 2011
    Dude, thanks for taking the time to type that out. It's not enough to get me started but it is certainly helpful to know that kind of general top-down information.

    <!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->Any program that exports to the <a href="http://www.khronos.org/collada/faq/" target="_blank">COLLADA</a> format<!--QuoteEnd--></div><!--QuoteEEnd-->

    Cool.

    <!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->for information on importing textures take a look here: <a href="http://www.unknownworlds.com/ns2/wiki/index.php/Importing_Custom_Textures" target="_blank">Importing Custom Textures</a>.<!--QuoteEnd--></div><!--QuoteEEnd-->

    What I need to know is which textures are exported. For example if I export a collada model with a diffuse + specular map, will both of those maps be imported? If I export a model with a normalmap bmp in the "bump" texture slot, will that be imported? Or does every model need it's own custom shader to be written by hand which defines all it's maps?

    <!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->Changing the skin/materials on model is not currently support.<!--QuoteEnd--></div><!--QuoteEEnd-->
    I don't know what you mean here, I was asking about animated characters. "Skin" refers to bone-mesh weighting in 3d graphics terminology.

    <!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->There is very little information on how they define a rag-doll skeleton or physics aspects of the collision data in a model right now, so anyone's guess is as good as mine in this area.<!--QuoteEnd--></div><!--QuoteEEnd-->

    This is not trivial, it's critical for custom characters.

    <!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->The Bound Boxes are part of the Collada format and should be defined in your modeling program.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Again, not trivial. How is it defined in the modeling program?

    <!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->Docs will most likely not come until after v1.0 release or just before it.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Well, if that is the case I just hope they didn't plan on many people to pre-ordering the game for sake of modding with the engine.
  • McGlaspieMcGlaspie www.team156.com Join Date: 2010-07-26 Member: 73044Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Reinforced - Onos, WC 2013 - Gold, Subnautica Playtester
    Np, yw. I hope it helps someone else too.

    If you read up on the Collada format a lot of your questions will be answered. Basically, if you are using a material in your model, it's going to get exported and referenced in the converted model.

    <!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->I don't know what you mean here, I was asking about animated characters. "Skin" refers to bone-mesh weighting in 3d graphics terminology.<!--QuoteEnd--></div><!--QuoteEEnd--> We're talking about the same thing, different terminology. Although, the "skin" part I was referring to is the actual texture on a model.

    <!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->Again, not trivial. How is it defined in the modeling program?<!--QuoteEnd--></div><!--QuoteEEnd-->This is part of the Collada format, or I should say, how Spark converts that format. I don't remember exactly where but there is a means to control it.


    Ok, long story short, if you want to get started on this you will need to dig through these forums and the Wiki to glean some of the information you need. Most of what my big-ass post was from, was the various posts I've read and bits of the Wiki.
  • zexzex Join Date: 2009-10-07 Member: 68978Members
    On the contrary, Collada's documentation will not answer my questions about Spark's art pipeline. As one example, bounding boxes are most definitely not part of the Collada format. I imagine they are flagged somehow, i.e. with a specific naming convention that Spark looks for on import.

    I understand that some information is on the wiki and forum, but not only am I not inspired to buy a game for modding purposes when I have to be Sherlock Holmes to figure out the art pipeline, I also doubt that all the necessary information is even available, period.

    Anyway thanks (sincerely) for your help McGlaspie. I'm confident these docs will appear eventually so I'll just keep an eye out.
  • marksmarks Join Date: 2008-07-28 Member: 64720Members
    If you're considering buying NS2 just to mod it .... there are better alternatives.
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    <!--quoteo(post=1822461:date=Jan 7 2011, 11:34 PM:name=zex)--><div class='quotetop'>QUOTE (zex @ Jan 7 2011, 11:34 PM) <a href="index.php?act=findpost&pid=1822461"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I understand that some information is on the wiki and forum, but not only am I not inspired to buy a game for modding purposes when I have to be Sherlock Holmes to figure out the art pipeline, I also doubt that all the necessary information is even available, period.

    Anyway thanks (sincerely) for your help McGlaspie. I'm confident these docs will appear eventually so I'll just keep an eye out.<!--QuoteEnd--></div><!--QuoteEEnd-->
    I'm not sure why you're under the impression that modding at this point should be easily possible, let alone be documented, when the game itself is in a barely functioning shape (excuse the hyperbole). I imagine the UWE-team is currently mostly focused on producing the game, as in the end it IS their core-business and what they need in order to survive. In any case, you have answered your own question.
  • zexzex Join Date: 2009-10-07 Member: 68978Members
    edited January 2011
    <!--quoteo(post=1822592:date=Jan 8 2011, 08:03 AM:name=player)--><div class='quotetop'>QUOTE (player @ Jan 8 2011, 08:03 AM) <a href="index.php?act=findpost&pid=1822592"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I'm not sure why you're under the impression that modding at this point should be easily possible, let alone be documented<!--QuoteEnd--></div><!--QuoteEEnd-->

    I'm not sure why you're under the impression that I'm under that impression. That being said, UW more than likely already has tools docs because they work with contractors, and I wasn't sure if those were included with pre-orders. It's abundantly clear that they are not, therefore I am hoping UW could weigh in on whether they would consider making them public or at least including them with the game.
  • ChopsChops UW Technical Artist (and Store Guy) Join Date: 2009-08-06 Member: 68373Super Administrators, NS2 Developer, Pistachionauts
    <!--quoteo(post=1821066:date=Jan 2 2011, 08:25 PM:name=zex)--><div class='quotetop'>QUOTE (zex @ Jan 2 2011, 08:25 PM) <a href="index.php?act=findpost&pid=1821066"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Has anyone imported custom models/animations into NS2/Spark and what is the export pipeline like?

    - What 3rd-party content creation software is supported
    - What kind of animated skin/rig is expected
    - How are materials created, is there a proprietary UW shader type and are standard 3rd party material formats and/or pixel shaders exported
    - How is collision handled, i.e. for animated meshes vs static meshes
    - when can modders expect documentation on the above, if it isn't currently available<!--QuoteEnd--></div><!--QuoteEEnd-->


    Trying to take my job? ;) I handle most of the exporting and compiling for the official assets in NS2, so if anyone can help you it's me!

    -For 3rd-party tools we mostly use 3ds Max 2009. There is "ColladaMax.dle" in Natural Selection 2's game folder which is Max's custom Collada export plug-in for 3ds Max. That's what I use to export models to the proper .dae format. Obviously we also use Photoshop to generate the .psd's which builder makes into .dds's.

    -For animated objects you can create a simple skeleton using the bone tool, and to rig we use the Skin modifier in 3ds Max. Static objects don't require a skin or bones.

    -To create a material you need a .material file which looks like the what McGlispie posted. That combines the different textures into one material.
    But to make sure it works with your model you need to have a Material applied to the model in 3ds Max. The diffuse map of this Material should be linked to a .psd that shares the same name as the .material file you are using. To make it simple it is best to have the .psd, .material, .model, and .dae all in the same folder when building.

    -For most static objects we just reference the original model as the physics object and it will generate a convex shell automatically. If any part of the model has a large concave area then it will need a custom physics object. For custom physics objects we use Rigid Body Collections in Reactor for 3ds Max. Animated models all use custom physics objects and if the model needs a ragdoll then we use the Ragdoll Constraint and Constraint Solver in Reactor for 3ds Max.

    -There will soon be an update to mod support from the other Brian and when that is ready I want to create a series of videos to guide modders through this process of exporting models that can be used for your mods or use with the Spark Cinematic Editor.

    Hope that helps for now.
  • zexzex Join Date: 2009-10-07 Member: 68978Members
    <!--quoteo(post=1855592:date=Jun 23 2011, 02:14 AM:name=Chops)--><div class='quotetop'>QUOTE (Chops @ Jun 23 2011, 02:14 AM) <a href="index.php?act=findpost&pid=1855592"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Hope that helps for now.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Thanks for your reply, and I look forward to the mod support/video series.
  • MagnetoMagneto Join Date: 2010-12-22 Member: 75856Members
    edited June 2011
    <!--quoteo(post=1855592:date=Jun 23 2011, 03:14 AM:name=Chops)--><div class='quotetop'>QUOTE (Chops @ Jun 23 2011, 03:14 AM) <a href="index.php?act=findpost&pid=1855592"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->-There will soon be an update to mod support from the other Brian and when that is ready I want to create a series of videos to guide modders through this process of exporting models that can be used for your mods or use with the Spark Cinematic Editor.<!--QuoteEnd--></div><!--QuoteEEnd-->

    That's good to hear, it's just what we need, i've tried all sorts to get models and textures working using freely available tools, so is there any chance it will be possible to use stuff like blender, sketchup and paint.net etc? It doesn't seem to work right now, though perhaps its just me...

    <a href="http://www.unknownworlds.com/ns2/forums/index.php?showtopic=112634" target="_blank">http://www.unknownworlds.com/ns2/forums/in...howtopic=112634</a>
Sign In or Register to comment.