Forum > modo > SDK, Scripting & Macros > Collada 1.4 exporter for Modo 202, R3

Topic - Collada 1.4 exporter for Modo 202, R3

 

Mountain View, California
406 posts
To celebrate the release of Modo 202, I am releasing Revision 3 of my Collada 1.4 exporter for Modo.

Revision 3 is exponentially faster than Revision 2! (The speed-up was implemented by pre-sorting the UVs.)

Additional material support will be available in Revision 4.

Please excuse the hand-crafted XML. Luxology doesn't offer a C++ SDK, so it's not easy to use TinyXML with Lua script.

Enjoy!

ExportCollada14R3.zip

Twitter: modoCOLLADA
SourceForge: http://colladamodo.sourceforge.net

8/4/2006 - 2:11 AM
[ Quote ]
Son Kim
rating: signal 0  

California
3687 posts
thanks man, this well be handle in the near future :)

The human race is going through a shift in consciousness, from 3D to 5D. Reattach to your higher self and wake up! 10/10/10-11/11/11-12/21/12

8/4/2006 - 2:21 AM
[ Quote ]

Mountain View, California
406 posts
Here's some screenshots to show the Modo 202 -> Collada 1.4 exporter in action.

A test model in Modo 202:



The same model exported to C4 Engine via Collada 1.4:



An important limitation in the current version of this exporter, Revision 3, is that the exporter only handles a scene with a single texture map.

For the next version, Revision 4, I'm working to improve the material support. I plan to look up a texture for each layer, using the texture map referred to by the material of the first polygon.

Cheers.

Twitter: modoCOLLADA
SourceForge: http://colladamodo.sourceforge.net

8/4/2006 - 8:19 AM
[ Quote ]
Steve McRae
rating: signal 0  

Calgary, Canada
1088 posts
very cool Huidafa - can I put this on vertexmonkey.com?

cheers,
8/4/2006 - 9:10 AM
[ Quote ]

Mountain View, California
406 posts
Quote from Steve McRae :
very cool Huidafa - can I put this on vertexmonkey.com?


Sure. Thanks for offering to host it.

Twitter: modoCOLLADA
SourceForge: http://colladamodo.sourceforge.net

8/4/2006 - 10:06 PM
[ Quote ]
Michael.
rating: signal 0  

Plymouth, UK
667 posts
Are you also working on import functionality ? I'm guessing it shouldn't be too hard to go the other way, right ?

Michael.
8/5/2006 - 8:44 AM
[ Quote ]

Mountain View, California
406 posts
Quote from Michael Kearns :
Are you also working on import functionality ? I'm guessing it shouldn't be too hard to go the other way, right ?


Yes, Collada 1.4 importing is equally important, so I can roundtrip between Modo and the world editor in the game engine I am working with.

However, importing Collada 1.4 is a bit more difficult than exporting, because of the need to parse the incoming XML. (The exporter is just writing out hand-crafted XML.) It would be a lot easier if Luxology would release even a rudimentary C++ SDK, so I could use an XML parser such as TinyXML to abstract away the XML tree, which would let me concentrate on the code that is specific to Modo.

I'll post an announcement here on the forum, once I have the first implementation of a Collada 1.4 importer ready to share.

Cheers.

Twitter: modoCOLLADA
SourceForge: http://colladamodo.sourceforge.net

8/5/2006 - 4:18 PM
[ Quote ]

Mountain View, California
406 posts
Quote from Steve McRae :
very cool Huidafa - can I put this on vertexmonkey.com?


Hi Steve,

Thanks for hosting the Collada 1.4 exporter. I appreciate the nice touch of adding the Collada logo for its entry on your site.

I noticed that you labeled the exporter as a Perl script (the sideways graphic along the left edge of the entry.)

The exporter script is actually written in the Lua scripting language.

Please, could you change the category to "Lua" instead of "Perl"?

Thanks again for hosting the script.

Cheers.

Twitter: modoCOLLADA
SourceForge: http://colladamodo.sourceforge.net

8/5/2006 - 4:28 PM
[ Quote ]
Steve McRae
rating: signal 0  

Calgary, Canada
1088 posts
done! :)
8/5/2006 - 5:04 PM
[ Quote ]
interpreter
rating: signal 0  


461 posts
thanks for this very useful script!

will you also correctly handle material smoothing angles in the future? or does that get handled already?

why would you need c++ to use a xml library? aren't there xml libraries for lua? (i don't have any lua experience but for python there are plenty of modules you can use for xml handling.)
8/9/2006 - 4:49 PM
[ Quote ]
Wizardkiss
rating: signal 0  


100 posts
Looks great. I haven't tested it with Multiverse engine yet but I suspect it will probably work. Thanks for doing it. :)
8/9/2006 - 7:16 PM
[ Quote ]

Mountain View, California
406 posts
Quote from interpreter :
thanks for this very useful script!

will you also correctly handle material smoothing angles in the future? or does that get handled already?

why would you need c++ to use a xml library? aren't there xml libraries for lua? (i don't have any lua experience but for python there are plenty of modules you can use for xml handling.)


Hi interpreter,

By "smoothing angles", are you referring to per-vertex normals? If you can point out how where in the Lua scripting APIs I could get at per-vertex normals (as opposed to the per-pixel values in a normal map), I would certainly be interested in adding support for it, as Collada allows you to interleave normals with the vertex and UV table indices. (The C4 Engine I'm using will support per-vertex normals fairly soon, as well.)

Also, I'm aware of add-on XML packages that can be added to Lua hosting programs, but I'm pretty sure Luxology would have to add new libraries to Lua from the host side, to bind in the new library functions. On the other hand, if you know of an XML library that is actually implemented as Lua script (language version 5) please let me know. I'm not sure how that would be possible, but it sounds good.

I don't know Python. I've only learned Lua so far.

By the way, the normal object-to-object baking feature in modo 202 works great. I was able to bake a normal map and export it to TGA, and then use it with a model in C4 Engine.

Specifically, I baked a normal map from a high-resolution version of a sports car model down onto a low-poly version of the same model, and it was amazing to see the simulated details after it was done rendering. modo 202 rendered a 1024x1024 normal map in about 15 minutes.

I'll post screenshots after I clean it up a bit more (I have to move some geometry I have sitting on adjacent UV spans for ease of painting, that overlaps in normal-space.)

Twitter: modoCOLLADA
SourceForge: http://colladamodo.sourceforge.net

8/10/2006 - 12:25 AM
[ Quote ]
interpreter
rating: signal 0  


461 posts
i am looking forward to your screenshot!

i don't really know lua. i have only found luaexpat with google. it's callback driven and a bit different to tinyxml which i think is a dom implementation. maybe you find another library which is more tinyxml like.

what i meant with the smoothing angle is if your exporter correctly supports soft and hard edges. i think there are two kinds of normals in modo. averaged vertex normals and face normals. if the angle between two faces is bigger than the material's smoothing angle threshold then the edge appears hard (the vertices use the face normal) otherwise it will be soft (the vertices use the averaged vertex normal).

but you are right! if you use a normal map for everything you don't really need this anyway since you have per pixel normals. i didn't think about that.
8/10/2006 - 2:39 AM
[ Quote ]
 
Search
Topic Subscriptions
Forum Preferences
Forum Help
Search the Forums
Advanced Search
modo Training Materials

New for modo 401
Backpack Modeling

New for modo 401
Human Eye

HDRE Urban Kit

HDRE Landscape Kit

Studio Lighting & Illumination Kit

Product Auto Presets

Splash Kit

Subdivision Modeling

modo 401 Spotlight

Real World modo

Shader Tree Essentials

modo 401 Courseware

Rotary Aircraft Engine

Architectural Interior Rendering Series (Intermediate)

Architectural Modeling Series (Intermediate)

Rapid Prototyping Training Series (Intermediate)

Concept Car Training Series (Intermediate)

Cartoon Kid Training Series (Intermediate)

The Alley - Real-Time Asset and Level Creation (Intermediate)

modo is a registered trademark of Luxology LLC., in the USA and/or other countries.
All products or brand names mentioned are trademarks or registered trademarks of their respective holders.