Blender animation no working

Hey guys,



I’ve made some fixes to animations.

Hope they will work better now.



Just donot use constraints on bones yet.

Some of them are not working good yet and not all owner/target spaces are implemented.



But the object animation and object constraints should work.

Or at least I think so :wink:

@Kaelthas said:
Just donot use constraints on bones yet.
Some of them are not working good yet and not all owner/target spaces are implemented.

You mean you import constraints from blender? or you can't export bones that have constraints on them?

I import constraints.



Not all of them are yet implemented (and not all of them will be, for example and Action constraint or Python constraint).

But I hope to import most of them.

But some (like Loc/rot/size limit or Loc/rot/size like) should import correctly for objects.



As I said - bones have little trouble with calculation spaces, but I hope to solve it soon :wink:

Hi @Kaelthas,



I’m getting the following error when I do right clic on blend file and select view model on SDK:

java.lang.NullPointerException

at com.jme3.animation.SkeletonControl.cloneForSpatial(SkeletonControl.java:201)

at com.jme3.scene.Spatial.clone(Spatial.java:1155)

at com.jme3.scene.Node.clone(Node.java:565)

at com.jme3.scene.Node.clone(Node.java:61)

at com.jme3.scene.Spatial.clone(Spatial.java:1142)

at com.jme3.scene.Node.clone(Node.java:565)

at com.jme3.scene.Node.clone(Node.java:61)

at com.jme3.scene.Spatial.clone(Spatial.java:1142)

at com.jme3.scene.Node.clone(Node.java:565)

at com.jme3.scene.Node.clone(Node.java:61)

at com.jme3.scene.Spatial.clone(Spatial.java:1182)

at com.jme3.asset.ModelKey.createClonedInstance(ModelKey.java:58)

at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:300)

at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:408)

[catch] at com.jme3.gde.core.assets.SpatialAssetDataObject.loadAsset(SpatialAssetDataObject.java:90)

at com.jme3.gde.core.assets.actions.OpenModel$1.run(OpenModel.java:72)

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



Output console shows:

Loading obejct: Armature

Armature: (0.0, 0.0, -0.0)–> null

Child (Armature) attached to this node (Models/canim/Canim 0 01.blend)

Loading obejct: Canim

Importing mesh.

Loading material.

Materials name: {0}

Loaded material definition: Phong Lighting

Child (MeshCanim1) attached to this node (Canim)

Child (Canim) attached to this node (Armature)

Canim: (0.0, 0.0, -0.0)–> Armature



Blend file has a model with Armature (root bone and 5 bones more for spinal column (from hips to head)). No constrains. No animation. Only mesh and bones.



Also, I got “MeshCanim1 has more than 4 weight on bone index xx” error messages on a previous test. I think this is related with a vertex that is assigned to more than 4 vertex group, right?



Update:

.blend file



Thanks in advance,



H

@Kaelthas this is happening when a model has an armature but no animation.

Probably its not cloning but simply referencing its own skeleton control.

It happens when cloning SkeletonControl.



We can solve it in two ways:

  1. Add anim control with no animations to themodel that has a skeleton (changes in blender loading code).
  2. check for null in cloneForSpatial method of SkeletonControl



    Which way shall I go ?? :slight_smile:

A control with no animation is the best way to go IMO.

And you should always load the skeleton if there is an armature modifier on a model.



Also…not completely related but, it would be cool to have an option (maybe in the blenderKey) to load only bones that are deforming the mesh.

Some bones may be controls bones in blender to ease the animation process, or IK targets for limbs etc…

Most of the time we don’t need them in the engine, because animations are already computed. It would save some iteration when updating the skeleton.