Easy Ogre Exporter for 3DSMAX

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Easy Ogre Exporter for 3DSMAX

Post by arkeon »

Hello !

new version : 2.3 on April 25 2015

Added Optional textures conversion to DDS format.
Added automatic shaders generator for normal / specular map and simple pixel lighting with multi light

As usual for our users, we were looking for an easy and free Ogre exporter for 3ds Max, and cannot found any with a good standard material converter nor a simple interface.
Last time that I need to export a simple scene it took me several hours to convert and set materials (and several crash).
So I decided to make my own exporter ^^

The objective for the Easy Ogre Exporter is to be the most simple as possible but with a lots of direct conversions from max scenes, and sure to be free and LGPL
3ds Max users are not developers !!

I started from the code of the FxOgreFxExporter (to get some clues), but since this exporter only manage a single mesh, I rewrote almost every thing
Here the current working state :
- one click export from the Max export menu > Ogre scene
- mesh binary export for each objects in the scene
- standard material conversions with colors, multi textures / uvs, refmap channel, transparency and material options like "double sided" or "wire"
- Architecture material conversion, with colors, diffuse texture, multi uv and transparency
- Mentalray Arch / Design material conversion, with colors, diffuse texture, multi uv and transparency
- export the textures files
- skeleton with animations from the main track or from the biped mixer if available
- nodes animations from the main track for each node in the dot scene
- lights and cameras ^^
- automatic unit conversion to meter
- morph animations
- mesh poses
- vertex animations
- small dialog interface for a minimum of setting like the Ogre version for meshs, prefixs, directories ...
- manage animations from the motion mixer
- generated shaders for normal maps or pixel lighting options
- textures conversion / optimization to DDS format
- a setup for quick installation

Actual exporter is compiled for max 9 to max 2015 in 32 and 64bits, can export in all Ogre versions

you can get the plugins files here
https://arkeon.dyndns.org/svn-scol/trun ... er/output/
chose your max version and copy the dle file in your max plugins directory

Please give me some feed back if you found some mistakes on the materials or animations conversions

If some developers with an experience on the Max SDK want to participate please do :)
the lack of max SDK documentation give me some headache ^^

sources : https://arkeon.dyndns.org/svn-scol/trun ... xExporter/

Enjoy !
Last edited by arkeon on Sat Apr 25, 2015 11:30 am, edited 20 times in total.
OpenSpace 3D Project manager
http://www.openspace3d.com
User avatar
madmarx
OGRE Expert User
OGRE Expert User
Posts: 1671
Joined: Mon Jan 21, 2008 10:26 pm
x 50

Re: Easy Ogre Exporter for 3DSMAX

Post by madmarx »

That's great!
I wrote mine in maxscript (not opened source), because if this lack of sdk knowledge.
Best regards,
Pierre
Tutorials + Ogre searchable API + more for Ogre1.7 : http://sourceforge.net/projects/so3dtools/
Corresponding thread : http://www.ogre3d.org/forums/viewtopic. ... 93&start=0
User avatar
EricB
Bronze Sponsor
Bronze Sponsor
Posts: 358
Joined: Fri Apr 09, 2010 5:28 am
Location: Florida
x 212
Contact:

Re: Easy Ogre Exporter for 3DSMAX

Post by EricB »

Keep up the good work, really looking forward to this! (specially the morph animations)
Image
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Re: Easy Ogre Exporter for 3DSMAX

Post by arkeon »

Hi I'm actually working on poses but the max morpher plugin return corrupted data and crash :/
I read some cases about this but I really don't understand why I can't access the morpher object correctly !

If anyone find a clue about this, it could help me a lot !
OpenSpace 3D Project manager
http://www.openspace3d.com
User avatar
madmarx
OGRE Expert User
OGRE Expert User
Posts: 1671
Joined: Mon Jan 21, 2008 10:26 pm
x 50

Re: Easy Ogre Exporter for 3DSMAX

Post by madmarx »

Hi, when I did this with maxscript, I had to export the poses first and do the "rebinding" of the targets.
If the target has 'blue' color it is hidden and you have to do that, otherwise it is green and you don't need.
So for each pose :
- go to 100% for this pose, set all the other poses at 0%
- snapshot mesh, and put it in scene
- bind the morph target to the just produced mesh.
- then you can access data for this pose.

Hope this helps.
Tutorials + Ogre searchable API + more for Ogre1.7 : http://sourceforge.net/projects/so3dtools/
Corresponding thread : http://www.ogre3d.org/forums/viewtopic. ... 93&start=0
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Re: Easy Ogre Exporter for 3DSMAX

Post by arkeon »

with the max SDK there is a MorphR3 class to access data from the morpher plugin (the class is from the morpher sample)
I've tried to get the object just like in the faceFx exporter but with no success or as described on this post : http://dl3d.free.fr/phpBB2/viewtopic.ph ... 90037c671a
but i run into the same problem ^^ the MorphR3* is corrupted :/
OpenSpace 3D Project manager
http://www.openspace3d.com
User avatar
madmarx
OGRE Expert User
OGRE Expert User
Posts: 1671
Joined: Mon Jan 21, 2008 10:26 pm
x 50

Re: Easy Ogre Exporter for 3DSMAX

Post by madmarx »

Maybe you can ask derek nedelman how he did?
or you may try to encapsulate maxscript calls just for this function?
Tutorials + Ogre searchable API + more for Ogre1.7 : http://sourceforge.net/projects/so3dtools/
Corresponding thread : http://www.ogre3d.org/forums/viewtopic. ... 93&start=0
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Re: Easy Ogre Exporter for 3DSMAX

Post by arkeon »

finally I get the morpher data !

Just for those who could lost their mind with this :
- rebuild all Ogre dependencies with _SECURE_SCL=0 in preprocessor
- rebuild ogre _SECURE_SCL=0 in preprocessor
- rebuild exporter with _SECURE_SCL=0 in preprocessor

and then it works ... weird and dirty ... but it works ...
OpenSpace 3D Project manager
http://www.openspace3d.com
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Re: Easy Ogre Exporter for 3DSMAX

Post by arkeon »

Exporter update ^^
it now export Mesh poses with the poses names from the morpher modifier.

I've only tested on Max 2011 if some of you get export errors with mesh pose please tell me :)
I'm not sure if the _SECURE_SCL flag is needed for all max versions :/
OpenSpace 3D Project manager
http://www.openspace3d.com
Zargman
Gnoblar
Posts: 2
Joined: Thu Oct 27, 2011 1:20 pm

Re: Easy Ogre Exporter for 3DSMAX

Post by Zargman »

Hi there!

Thanks for this great plugin!

One question - any chance of supporting one very important feature - storage of parity in tangent w component? For mirrored meshes.
That's the only thing that keeps me from using your plugin instead of OgreMax...

Anyway, great work!
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Re: Easy Ogre Exporter for 3DSMAX

Post by arkeon »

Hi !

why not ^^ but I don't have any idea of where to get this information from max meshs :/ nor how to set that on ogre mesh ...
Any clue or help is welcome :)
OpenSpace 3D Project manager
http://www.openspace3d.com
Zargman
Gnoblar
Posts: 2
Joined: Thu Oct 27, 2011 1:20 pm

Re: Easy Ogre Exporter for 3DSMAX

Post by Zargman »

I guess this thread covers this problem pretty well:

http://www.gamedev.net/topic/347799-mir ... ce-solved/

As for where to save it - in tangent vector, as 4th component, "w".
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Re: Easy Ogre Exporter for 3DSMAX

Post by arkeon »

Exporter updated to 0.4 !

- it now manage poses and poses animations.
- the node animations have been optimized to only get the track line keys positions.
- a progress bar on bottom of the max interface show the current export state.
- use the max offset instead of the false node position for non reset Xform objects
- correction on root bone translation
- lights and camera are now exported with the correct orientation

@Zargman
I use Ogre::Mesh::buildTangentVectors and Ogre::Mesh::suggestTangentVectorBuildParams to generate tangents for ogre mesh,
doest this manage the parity ?

looking in ogre documentation i saw buildTangentVectors (VertexElementSemantic targetSemantic=VES_TANGENT, unsigned short sourceTexCoordSet=0, unsigned short index=0, bool splitMirrored=false, bool splitRotated=false, bool storeParityInW=false)

Do I only have to set storeParityInW to true ?
OpenSpace 3D Project manager
http://www.openspace3d.com
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Re: Easy Ogre Exporter for 3DSMAX

Post by arkeon »

Export updated to 0.5

it is now possible to export for all Ogre versions

- added morph vertex animatons
- manage animations defined in the max motion mixer (graph editor menu > motion mixer)
- added a configuration interface to select the Ogre target version and other advanced settings like tangent build options (parity)

see the wiki page for more details http://www.ogre3d.org/tikiwiki/Easy+Ogre+Exporter

It need tests :) please gives your feedback
OpenSpace 3D Project manager
http://www.openspace3d.com
shanefarris
Greenskin
Posts: 107
Joined: Sun Mar 01, 2009 8:36 pm
x 7

Re: Easy Ogre Exporter for 3DSMAX

Post by shanefarris »

Great tool, but I'm running into some problems. When I export an animation, the location of the bones are not in the correct location.

Image

I also tried to use OgreMax, the bones are located differently, but still wrong. The only thing I can think of is the animations were used using Pen Attribute Holder, its a script that allows you to store custom attributes, but I'm not an artist, and I don't even know what that means.

http://www.creativecrash.com/3dsmax/dow ... ute-holder

Any ideas on what I can do?

Thanks.
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Re: Easy Ogre Exporter for 3DSMAX

Post by arkeon »

what modifier and bone type do you use ?
Is the bind position and animation are bad or only the animation ?

biped with skin modifier seems to works fine.
OpenSpace 3D Project manager
http://www.openspace3d.com
shanefarris
Greenskin
Posts: 107
Joined: Sun Mar 01, 2009 8:36 pm
x 7

Re: Easy Ogre Exporter for 3DSMAX

Post by shanefarris »

arkeon wrote:what modifier and bone type do you use ?
Is the bind position and animation are bad or only the animation ?

biped with skin modifier seems to works fine.
How do I find out? I only know enough 3DS to export stuff, and move around in the viewports :)

The mesh is only bad once I start the animations, if there are no animations the mesh looks fine.

Would you like for me to send you the model?
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Re: Easy Ogre Exporter for 3DSMAX

Post by arkeon »

Yes the model could help to understand :)
OpenSpace 3D Project manager
http://www.openspace3d.com
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Re: Easy Ogre Exporter for 3DSMAX

Post by arkeon »

Corrections done for bone structures (not based on biped)
So it was not due to the script.
Just a hint for your model, you should use bones for the models too, it should be easier to only have an animation for all nodes (in your case)

there is also an option to generate automatic LOD levels in this version, but in some cases the edge list construction fail if the vertices are not welded correctly (don't know why)
if someone already had a problem with Ogre::ProgressiveMesh::generateLodLevels and buildEdgeList, please let me know.
OpenSpace 3D Project manager
http://www.openspace3d.com
shanefarris
Greenskin
Posts: 107
Joined: Sun Mar 01, 2009 8:36 pm
x 7

Re: Easy Ogre Exporter for 3DSMAX

Post by shanefarris »

arkeon wrote:Corrections done for bone structures (not based on biped)
So it was not due to the script.
Just a hint for your model, you should use bones for the models too, it should be easier to only have an animation for all nodes (in your case)

there is also an option to generate automatic LOD levels in this version, but in some cases the edge list construction fail if the vertices are not welded correctly (don't know why)
if someone already had a problem with Ogre::ProgressiveMesh::generateLodLevels and buildEdgeList, please let me know.
Awesome it works!

One more question, the animations are all on one track, how do I split them up into there own animations?
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Re: Easy Ogre Exporter for 3DSMAX

Post by arkeon »

To split the track you have to use the motion mixer :
- first select your animated object
- Animation menu -> save animation and choose the animation interval (from 0 to 20 for example)
- graph menu -> motion mixer
- add a track for each animated object
- add a clip from each file

so the motion mixer clips will be exported as single animations with the clip name
OpenSpace 3D Project manager
http://www.openspace3d.com
shanefarris
Greenskin
Posts: 107
Joined: Sun Mar 01, 2009 8:36 pm
x 7

Re: Easy Ogre Exporter for 3DSMAX

Post by shanefarris »

arkeon wrote:To split the track you have to use the motion mixer
I tried doing that and had problems, so now I am seeing if an artist friend of mine can do it. It is pain when Max has so many different ways of doing something, and having to support all those different technologies just to do the same thing.
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Re: Easy Ogre Exporter for 3DSMAX

Post by arkeon »

Yes you're right :/
and this is the only way I found to separate animations in 3ds max.
OpenSpace 3D Project manager
http://www.openspace3d.com
elegilor
Gnoblar
Posts: 1
Joined: Wed Feb 29, 2012 5:24 pm

Re: Easy Ogre Exporter for 3DSMAX

Post by elegilor »

Hello. I am the friend in question :-) Do you know if it's possible to save animation data from multiple objects (i.e. multiple meshes and their respective bones) into one animation file then create one track for those objects in Motion Mixer, or do I have to export separate files for each individual object and create tracks for every object with animation data (i.e. individual bones)? The animated character in question is a soldier with a gun, so there's separate geometry/bones for gun, body, clothing etc. Any help would be greatly appreciated.
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Re: Easy Ogre Exporter for 3DSMAX

Post by arkeon »

Hi :)

it is not possible to export nodes animations into a skeleton animation (I think), if you want to have only one animation the simple way is to attach all your "objects" and animate them with bones.

Edit :
Sorry didn't understand all your question ^^
animations in ogre are by :
- bones (skin modifier)
- nodes animation
- morph (morpher modifier with mesh poses)
- mesh animation (vertex translations)

animations in max are by object.
an animated mesh with bones should have his animation stored by the skin modifier.

so in Max for the motion mixer, you have to save an animation file per object (I'm not sure of that I'm not a max expert)
- select your object
- in the animation menu > save animation
- in graph menu -> motion mixer
- add a track from the selected object
- import a clip from your animation file

and this for each animated objects

I really hop that you don't need to do this for each bone, but the exporter just get the animation interval and the clip name from the motion mixer and don't care of the animations keys in that case, so I think it 'll work

Tell me if I'm right :)
OpenSpace 3D Project manager
http://www.openspace3d.com
Post Reply