Animated model from 3ds max to jme need help!

please help me import an animated model from 3ds max to jme … i am very new to jme as well as 3d modeling a step by step would be really appreciated …



i am using 3ds max 2012

and javamonkeyplatform alpha 4

Hello!

The way I do exporting from 3Ds Max and Maya is with the plugin OgreMax Scene Exporter.

When installed you’ll see a new scroll-down menu at the top called OgreMax.

There you’ll have to setup a few things… that I can’t remember at the moment, and since I am not home at my computer I can’t look them up.

I’ll post the steps necessary when I get home in less than an hour. Until then, you can download and install the non-commersial version of OgreMax Scene Exporter (if you haven’t already).

1 Like

i installed the non commercial version of OgreMaxScene Exporter thanks for the advice but i cant seem to get it working right for all my models … can you please mention me the necessary steps or run me through the required settings … i know i might be asking really stupid questions but i am really new with all this . Thanks

Hey, sorry for the late answer.

Ok, now to OgreMax, I haven’t actually tested it inside JMP, but I believe it should work!



In every 3D-project you create, you have to go into the OgreMax → Scene Settings… and then in the tab called “Meshes”, unmark “Export Binary Files”, and mark the “Export XML Files” instead. The is because you have to have Ogres XML files to convert them in JMP.

I would also recommend marking the “Copy Bitmaps to Export Directory” in the “Materials” tab, if you don’t want to copy all the texture files manually.



When you have created an animation you select the objects that are animated and go to OgreMax → Object Settings…

In the “Node Animations” tab you click the Add…-button, name the animation (like walk or such).

Select what frames the animation is between.

Select if the animation is looped or not (walk is looped while attack may be not).

And then lastly, in some cases you may want to select the “Copy First Animation Key to Last” which should do exactly what is says, copy all values of the animation from the first frame to the last, this is only used if the animation feels choppy and if this is the way to solve the choppiness.



The last step is most often useless if you create a good enough animation, but you never know :slight_smile:



Then of course there is the export, if you want to export everything inside the project you go to “OgreMax” → “Export” → “Export Scene…”, if you just want to export a small portion of the project or want the project to be divided for some reason, you “Export Selected Objects…” instead (of course you need to select the objects to export then, but that’s obvious).



Hope this helps!

1 Like

i did all that … i was able to load the model thanks 4 that … :slight_smile:



i exported one animation with it and i named it flip. to test it . i copied the example code (HelloAnimation) from the tutorial replaced oto with my model and replaced all the animations in it(“walk” , “stand”) with my animation (“flip”) the code now builds but when i try to run it , it crashes … i cant figure out what am i doing wrong …? :frowning:



this it what it crashes with :





INFO: Child (null) attached to this node (Statistics View)

4 Aug, 2011 12:50:44 PM com.jme3.scene.Node attachChild

INFO: Child (Statistics View) attached to this node (Gui Node)

4 Aug, 2011 12:50:44 PM com.jme3.material.MaterialDef

INFO: Loaded material definition: Phong Lighting

4 Aug, 2011 12:50:45 PM com.jme3.scene.Node attachChild

INFO: Child (submesh0) attached to this node (banim3-ogremesh)

4 Aug, 2011 12:50:45 PM com.jme3.scene.Node attachChild

INFO: Child (submesh1) attached to this node (banim3-ogremesh)

4 Aug, 2011 12:50:45 PM com.jme3.scene.Node attachChild

INFO: Child (submesh2) attached to this node (banim3-ogremesh)

4 Aug, 2011 12:50:45 PM com.jme3.scene.Node attachChild

INFO: Child (banim3-ogremesh) attached to this node (Root Node)

4 Aug, 2011 12:50:45 PM com.jme3.app.Application handleError

SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

java.lang.NullPointerException

at jme3test.helloworld.HelloAnimation.simpleInitApp(HelloAnimation.java:36)

at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:230)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:124)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:200)

at java.lang.Thread.run(Thread.java:662)

BUILD SUCCESSFUL (total time: 5 seconds)



please help me out …!!! i am clueless :frowning:

Hmm… most probably it is a silly mistake. Maybe you forgot a semi-colon somewhere or didn’t respect case-sensitiviness. Run through your program and check if you did any of these mistakes. If I were you, I’d start in the main. If the problem persists please copy/paste the whole program here.



@Iohnn, very good explanation. Cheers!

i double checked all the semicolons and case sensitive stuff they are all fine.



I did some addition to the code :



control1 = player1.getControl(AnimControl.class);

System.out.println(control1);



this code gives me output as null. does this means the animations are not being exported ? :frowning:

no the animations arent exported because lohnn was mistaken.

You have to press the “Mesh Animations” tab. not the “Node Animations” tab.



Same thread here : http://hub.jmonkeyengine.org/groups/graphics/forum/topic/animated-models-3/?topic_page=2&num=15

1 Like

Yeah, @tralala is right, I overlooked that :confused: That is the same problem which happened to me.

@raj0489:

My first advice is :

you should test your model and animation in SceneViewer before using it in your code (They are pretty much the same loading method so you can see what is going wrong immediately )

  • You said you new to JME and maybe the SDK so try to find how to use SDK in the tutorial right here *

    https://wiki.jmonkeyengine.org/legacy/doku.php/jme3#jmonkeyengine_sdk_documentation



    2nd if everything WORK fine in SceneViewer (It can be exported Fine but not working fine, duel to a lot of unnessesary things exist in ogre .scene format.



    I really think you should take a very carefully look in you Animation tab in OgreMax <= I 've messed up with it a mil of times then get the correct way to export things …

Oh, so it’s Mesh Animations?

Since, as I said, I haven’t tested it in JME, and all that I wrote is self-learned. And when tested inside the Ogre Scene Viewer (or whatever it’s called), I believe it works.

But then of course, that is not the JMP Scene Viewer.



How do I look at animations inside the JMP Scene Viewer? I’ve always wanted to know that!

@Iohnn, right-click on the model and click show in scene viewer or something like that. If nothing comes up, you have to open the Scene Viewer Window from the Windows (?) Menu. If the model is not visible in Scene Viewer click the light bulb icon for light.

so does this mean i can not animate without using bones…?

Yeah, that’s no new information for me :), but the animations, are they gonna show up in the properties panel or something like that?

raj0489 said:
so does this mean i can not animate without using bones..?

Yeah, it would be annoying to not be able to animate without bones...

thanks a lot guies it worked finally… :slight_smile:

now that i can import the animated models …any detailed tutorial available on working with animations in jme. A detailed documentation with examples at least …? can i speed it up slow it down … stop it mid way or things like that …?

@raj0489:



I separate you question in 2 answer :



One :

There is a lot of animation tutorial out there and working of course !!!

My advice is you should learn about how JME is designed and basic things first or you get a lot of “what,how,when and why?” in you way to make a JME game!



Two:

JME animations class are:

  • Bone Animation can be controlled by AnimControl which have a lot of AnimChannel for each of your mesh’s Animation you describe in 3dsMax.

    TestCase: look and run at the package: JME3Test/model/anim <= run the all test.


  • Node Animation can be controlled by Cinematic include Path Animation and Simple (Translate/Rot/Scale) things … Moreover Sound and NiftyGUI and be included too.

    Cinematic got Track and Event, which can be found here:



    TestCase: look and run at the package: JME3Test/animation



    All the things I mention above is stay here:

    Documentation : https://wiki.jmonkeyengine.org/legacy/doku.php/jme3#tutorials_for_beginners

    and JavaDoc : http://hub.jmonkeyengine.org/javadoc/
1 Like

i was able to load the model last time … but when i am trying to export and load a new model from 3ds max . The model is loading but is not visible. I have added the lighting in the scene. I am sure i am doing something wrong with the model export as if i try to load any other model in the same code it works perfect

my models name is armf1 i guess acording to the log(below) my model is loading but it is not visible. Is there any setting in ogremax exporter that could cause or solve this problem please help its urgent … !!!



9 Aug, 2011 5:33:45 PM com.jme3.scene.Node attachChild

INFO: Child (submesh0) attached to this node (armf1-ogremesh)

9 Aug, 2011 5:33:45 PM com.jme3.scene.Node attachChild

INFO: Child (submesh1) attached to this node (armf1-ogremesh)

9 Aug, 2011 5:33:45 PM com.jme3.scene.Node attachChild

INFO: Child (submesh2) attached to this node (armf1-ogremesh)

9 Aug, 2011 5:33:45 PM com.jme3.scene.Node attachChild

INFO: Child (submesh3) attached to this node (armf1-ogremesh)

9 Aug, 2011 5:33:45 PM com.jme3.scene.Node attachChild

INFO: Child (submesh4) attached to this node (armf1-ogremesh)

9 Aug, 2011 5:33:45 PM com.jme3.scene.Node attachChild

INFO: Child (submesh5) attached to this node (armf1-ogremesh)

9 Aug, 2011 5:33:45 PM com.jme3.scene.Node attachChild

INFO: Child (submesh6) attached to this node (armf1-ogremesh)

9 Aug, 2011 5:33:45 PM com.jme3.scene.Node attachChild

INFO: Child (armf1-ogremesh) attached to this node (Root Node)

9 Aug, 2011 5:33:45 PM com.jme3.renderer.lwjgl.LwjglRenderer updateUniformLocation

@raj0489:

Did you notice I mention in my previous post that you should test the model in SceneViewer first before you try to bring it into the real world… By this test you can make sure your model and animations work good, the Scale is fine and don’t have to be afraid of “meshes normal flip” problem…



In the sceneviewer (and in your code too) you can see statInfo and know how many triangle is rendered. If is kind of match your triangle you have in the scene( a little bigger)…


raj0489 said:
i was able to load the model last time .. but when i am trying to export and load a new model from 3ds max . The model is loading but is not visible. I have added the lighting in the scene. I am sure i am doing something wrong with the model export as if i try to load any other model in the same code it works perfect
my models name is armf1 i guess acording to the log(below) my model is loading but it is not visible. Is there any setting in ogremax exporter that could cause or solve this problem please help its urgent .. !!!!


Two problem can cause nothing visible :
1 The scale is too big ... or too tiny. You should make your scale in 3dsmax to 100% to represent everything correctly, so if your model height is 2 meter, it is tall 2 unit. Try ResetXForm to remove the scale...
2 You should carefully check you bone animation (a must do if you just buy it or download it somewhere), If there is a 0 weight vertex, it is dangerous.

If the bone scale (bip) is not 100%, issue happen,
I must say that : Scale of the bone is usually messed up when been through few convert times from one to another format. You should definitely check it!!!