Animated Model in 3ds Max -> jmonkey

Hi, i have an animated model in 3ds max 11 and now i want to past it into my project.

At first i created .obj and imported them. This works but i dont have any animations cause its an obj file.

Now i tried some hours to convert my model to mesh.xml. I installed Blender and added OgreXML via the SDK but now i can only export .mesh files and they are not supported.

Now i have serveral questions:

  1. Do i need Blender or is there another way? i tried to export mesh files from 3ds and use the OgreTool OgreXMLConverter but i get an error
  2. Blender only creates very small .txml and .scene files insead of mesh files altough it is displayed that it is possible to export mesh files. WTF?



    Its horrible trying to import models and install so many tools and addons and at the end it doesnt work. Pls add more supported file formats.

    And add more tutorials.

.obj doesn’t support keyframed animations.



1-There are some people using 3ds max and exporting ogre file formats as well. @atomix is one of them.

2-What do u mean about instead of mesh files? .mesh.xml is a mesh file lol.

There’s an OgreXML plugin for 3dsmax.

http://www.ogremax.com



Before you export the model, make sure that Export XML files is selected:

http://www.ogremax.com/Documents/OgreMaxSceneExporter-3DSMax/scene-settings-dialog-page-meshes.html



The mesh.xml files can be loaded directly by jME3

Thanx, the OgreMax Plugin works fine, but I have still some problems with the animations.

When I add the Mesh Animation to the Object and export the file the animation is added to the mesh.xml file.

The code added looks like this:

[xml] </submeshes>

<skeletonlink name=“ogre.skeleton” />

<submeshnames>

<submeshname name=“submesh3” index=“3” />

<submeshname name=“submesh2” index=“2” />

<submeshname name=“submesh1” index=“1” />

<submeshname name=“submesh0” index=“0” />

</submeshnames>

<animations>

<animation name=“stand” length=“1.28542”>

<tracks>

<track target=“submesh” index=“2” type=“morph”>

<keyframes>

<keyframe time=“0”>

<position x="-20.3815" y=“16.7028” z=“146.875” />

<normal x="-0.0851934" y=“0.988629” z="-0.123917" />

<position x="-21.0725" y=“7.28045” z=“132.927” />

<normal x="-0.0974337" y=“0.826935” z="-0.553792" />

<position x="-28.055" y=“4.57927” z=“139.394” />

…[/xml]

And even if i check “Export Animations to Seperate Skeleton File” the animation is added to the mesh and does not work in jmonkey.

and does not work in jmonkey.


It means nothing.

The animation cannot be found:

java.lang.IllegalArgumentException: Cannot find animation named: ‘stand’

Accordling to the exception above, is this thrown when you set the anim via source code? If you use the SDK you could check if that anim exists in animcontrol via SceneExplorer when you load your model in SceneComposer.

The animation controller does not display any animations, but when i remove the animation from the mesh text editor and add

[xml] <animations>

<animation name="stand" length="0.160000">

<tracks>

<track bone="Object19">

<keyframes>

<keyframe time="0.000000">

<translate x="0.000000" y="-0.161123" z="0.000001"/>

<rotate angle="0.000000">

<axis x="0.000001" y="0.000005" z="1.000000"/>

</rotate>

<scale x="1.000000" y="1.000000" z="1.000000"/>

</keyframe>

</keyframes>

</track>

</tracks>

</animation>

</animations>[/xml]

to the skeletton Jmonkey does not get an error when i play the stand animation. (Code copied from Oto)

But when i add

[xml] <animations>

<animation name="stand" length="0.160000">

<tracks>

<track bone="Object19">

<keyframes>

<keyframe time="0.000000">

<position x="-20.3815" y="16.7028" z="146.875" />

<normal x="-0.0851934" y="0.988629" z="-0.123917" />

</keyframe>

</keyframes>

</track>

</tracks>

</animation>

</animations>[/xml]

i get an array out of bounds exception:

java.lang.ArrayIndexOutOfBoundsException: -4

at com.jme3.animation.CompactQuaternionArray.deserialize(CompactQuaternionArray.java:97)

at com.jme3.animation.CompactQuaternionArray.deserialize(CompactQuaternionArray.java:43)

at com.jme3.animation.CompactArray.get(CompactArray.java:132)

at com.jme3.animation.BoneTrack.setTime(BoneTrack.java:207)

at com.jme3.animation.Animation.setTime(Animation.java:108)

at com.jme3.animation.AnimChannel.update(AnimChannel.java:343)

at com.jme3.animation.AnimControl.controlUpdate(AnimControl.java:330)

jME3 only supports skeletal animation, mesh/morph/pose animations are not supported (yet)

Thank you very much!

I selected some wrong options in OgreMax.

One last question about 3ds Max: During the walk animation of the model the Z-Axis is replaced with the Y-Axis. Can i change the Axis for a range of keyframes?



Btw are you interested in a long tutorial converting mdx (Warcraft 3 format with many free low poly models) to .mesh.xml?

@ogerlord said:
Thank you very much!
I selected some wrong options in OgreMax.
One last question about 3ds Max: During the walk animation of the model the Z-Axis is replaced with the Y-Axis. Can i change the Axis for a range of keyframes?

Isn't Y-axis what you want? That is what used in jME3 by default. Either way you'll have to look into the export options. Ogre, like jME3, also uses Y-axis as up.

@ogerlord said:
Btw are you interested in a long tutorial converting mdx (Warcraft 3 format with many free low poly models) to .mesh.xml?

I don't think its such a good idea since people making these models only intended them to be used in Warcraft 3. Probably for non-commercial use its okay though.