[SOLVED] Animate in Blender or in jme3?

I’m just starting out with jme3 and while reading some tutorials and articles I came up to the following:

Game-compatible models are models that basically only consist of a mesh and UV-mapped textures, in some cases animations

Coming from here: https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:external:blender

I was wondering… I am about to create a very simple model in Blender that should represent a car.
When moving forwards, backwards and so on I want the wheels to rotate so should I animate them in Blender or should I do this in jme3?

I am also wondering, can I access the individual wheels from within jme3 so I can let them rotate individually (if one is stuck for example)?

Just wondering what the best practice is for this

If you want to access individual parts of your model, I think you have to develop them as different objects in Blender. Then they will appear as a tree of subnodes, representing your various parts.

1 Like

Thanks. I was planning on doing this anyway.
In blender I will have something ike this:

  • Car
    ----- frontAxis
    ----------leftWheel
    ----------rightWheel
    ----- rearAxis
    ----------leftWheel
    ---------- rightWheel

this will be translated into a tree as well in jme3? And I Will be able to rotate individual objects?

Should work.

Also, note that the Blender importer creates a separate geometry (capable of rotation) for each material region of a Blender object. So for instance if your trim, windshield, and tires have their own materials, they will wind up as separate geometries too, even if they were not separate objects in Blender.

1 Like

Cool thx.
Looking really good. I just did a test and I seem to be able to traverse the object tree which is great!

Just one last question… Is that tree read only or can I append Node’s to those imported models during runtime?

The reason why I’m asking is that I want to build a modular car where the user can attach modules. So for example I create a chassis in blender and a wheel which are separate models.
In the game the user can select the wheels which I want to attach to the chassis.

if I do something like this:

leftFront.attachChild(selectedWheel);

Where leftFront is the Node from the imported blender model.

Ok, nevermind. I figured it out myself.

I surrounded the model by a custom node:

[java]
Node car = new Node();
car.attachChild(chassisModel); //imported model from blender
car.attachChild(frontLefWheel);
car.attachChild(frontRightWheel);

[/java]

seems to work just fine.

1 Like