Skeletal Issues

Well time for the next problem of the day, you can probably guess by now that I am no artist. In any case, I made a simple 3ds max scene, two objects, two GEOMETRIC BONES, not max bones. One bone is attached to the other (root bone), and each respective box in the scene is attached to one bone, there are only 2 boxes. I UV Unwrapped the boxes and it shows it nice and fine ingame , and the export from 3ds max has numerous files including .mesh,.scene,.material,.mesh.xml,.skeleton,.skeleton.xml files. In any case, it seems that after I import the files, it is compressed into one .j3o file which also shows fine on the SceneComposer window. The submeshes all show both mesh and animcontrol components. On the Hello Animation page, I wanted to debug the skeleton to see if its there, and I decided to use the code on the page, however, I am running into a slight problem:

[java]

AnimControl control = model.getControl(AnimControl.class);

Skeleton skel = control.getSkeleton();[/java]



The control.getSkeleton() throws a NullPointerException. I just dont understand why, because AnimControl is showing on the SceneComposer window under both Box1 and Box2 submeshes. Please help

You cannot expect every function of your 3d editor to translate to a 3d rendering engine, especially not when you go via an intermediate format. Read up on the supported features, only bone animations are supported. Also if you dont see the AnimControl in the SceneComposer the you will not find it in the application too.

I know, I am sorry its just that I barely know 3ds max, art is just not my cup of tea I am just testing things out, in any case, what exactly is bone animation, and why does the control.getSkeleton() return a NullPointerException. It seems the AnimControl class’s contructor takes in a Skeleton and sets the class’s skeleton member to equal that parameter, and the output of getSkeleton is the same member. control is not initialized as a new AnimControl though, is that the cause?

Without animation (the animation is not exported to the ogre file) you get no AnimControl, no.

Lol that makes absolute sense, I guess then my confusion is why this shows up:





EDIT btw on a reread, I said that I did see the AnimControl (hence the picture above), yet the code seems to not work. Thank you in advance.

Well as you see its not on the root node of the loaded model. So you will have to do something like

[java]Node model=(Node)assetManager.loadModel(blah);

AnimControl animControl=model.getChild("Box02-ogremesh").getControl(AnimControl.class);[/java]

It seems that it compiles and at least it doesnt crash, it doesnt return an exception now, I will see what I can get done now, thank you, the issue now is that on the SkeletalMesh debug attach, it just freezes lol, at least its not an art issue :).