Problem importing models

Hi guys,



I have a problems importing models in JM3 sdk.



Im importing my model from blender. The converter works fine. When I import my model to project wow…pretty good.

I add my model in the “scenecomposer”. I go to AnimControl - Properties and see all anim (stanging, running, walking…).



My problem is my code…



player = (Node)assetManager.loadModel(“Models/test/test.j3o”);



control = player.getControl(AnimControl.class);



player.getControl(AnimControl.class) return null, why?



Some hint?



Thanx people

Oliveira

You get returned is the root node of the model, if the AnimControl is attached to a child you won’t get it this way but have to use play.getChild(“childName”).getControl(AnimControl.class);

Hi, normen thx the reply



…but still dosent work.



I changed the code to:

control = player.getChild(“char”).getControl(AnimControl.class), and stil is returned null.



In the sceneExplorer, the hierarchy seems like this:



| Models/test/test-scene_node

  • lamp

    | - char

    | - BaseMesh-Entity

    | - BaseMesh-ogremesh

    | + BaseMesh-geom-1

    | AnimControl

    | com.jme3.animation.SkeletonControl



    Sorry my question, Im noob in animation…



    Thanx, guy

    Oliveira

I can’t really work out the hierarchy on that but have you tried finding the AnimControl on “lamp” instead of “char” ?

Thanx marl



It dosent works, the AnimControl is inside the char Node…not inside the lamp.



Thx a lot

Hi, guys



I solved the problem.



I didnt pay atention in sceneExplorer…



I had to get all children of hierarchy…like normen wrote.



n1 = getChild(“char”)

n2 = (Node)n1.getChild(“BaseMesh-Entity”)

control = n2.getChild(“BaseMesh-ogremesh”).getControl(AnimControl.class)



thx guys!

See you

Oliveira

Just do player.getChild(“BaseMesh-ogremesh”) then, it will also grab spatials further down the hierarchy, just the name has to be unique ofc.

Wow, thank you normen and marl



I will do that



Thx people

Oliveira