[SOLVED] Animation issue

Hey again. I finally finished my model and animation format but when I attach the animation to the model node AnimControl and setAnim the bones move but the mesh does not.

Any ideas?

(Also unrelated the bones rotations are flipped. I’m working on fixing it)

Did you forget to add SkeletonControl or to call setSpatial somewhere by any chance?

Show the code

I added a SkeletonControl. I wasn’t aware about setSpatial. Looking into it now.

Just to note: actually setSpatial is for internal use only and in general case should not be called directly. Sorry for misleading.

setSpatial did nothing unfortunately ]:

Here’s the important part. Am I missing anything?

    Mesh mesh = builder.build(!foundNormal, !foundTangent);
    Node model = new Node(name);
    Geometry geo = new Geometry(name + "-geom", mesh);

    Skeleton skeleton = new Skeleton(boneList);
    model.addControl(new AnimControl(skeleton));
    model.addControl(new SkeletonControl(skeleton));

Originally I didn’t use a node, but I noticed that the Ogre loader did. So I tried it out. Same issue.

Should not you add SkeletonControl before AnimControl? Not sure about it though, I yet have to dig it deeper for my own needs and better understanding.

Swapped it around to test. Still the same.

And Yeah I’ve been digging around the animation code for awhile now. But I can’t figure this one out.

I’m digging around skeleton animation classes due to plans to use animation retargeting a lot in future and another fun things like having bones that act as attachment points but are not real bones as they should not be sent to GPU (still investigating if this is possible at all).

Just random thought - maybe you did not load or did corrupt information about vertices linked to bones?

You’re loading a name.mesh.xml and a name.skeleton.xml right?

Derp. I was building the mesh before adding in the blendindices and weights…

But now I’m getting NPE at:

    positionsBP.copyElements(0, positions, 0, positionsBP.getNumElements());

@JESTERRRRRR No I’m loading my own formats.

“TestCustomAnim” has the same issue.

Okay I’ve found something. I had to upload the index/weight buffer to type “BoneIndex” and “BoneWeight”
Then setBuffers for HW skinning empty.

Okay, now I can’t find out how my animation poses are flipped about:

Why create your own format ?
If you’re interesting, xbuf format welcome any help.

Else, for your own format, I guess you could find interesting info into the blender exporter and the jme import on the repositories: xbuf · GitHub

fixing all the rotation, parenting,… could take lot of time.

1 Like

xbuf looks interesting. I’ll keep looking into it.

I had made this format for my own engine. But I just want to start to work on my actual game. So I changed over to jME, and brought over my format. This format works perfectly. I just think I’m missing a step in jME.

If you “just want to start work on your actual game”. Why spend time to create your format and not reuse j3o or xbuf ?

Trust create and fix issue in a format can consumme lot of time. Model/geomety is the easiest part, fixing skeleton, animation and issue like you have could be very time consumming.
I made xbuf open and CC0 so anyone can take it and use it without constrainte. But I accept any contribution, suggestion …

Haha good point.
But I feel attached to this xP

Idem with xbuf :stuck_out_tongue_winking_eye:

For your bug, I guess you have issue in exporting or importing parenting between bones (eg applying rotation).

Yeah I’m tweaking it around. I’ll find it soon enough.

I’m just worried that its a step for JME that I’m Missing.


After looking at FbxtoJmeTrack I realized that I wasn’t applying the inverse bindpose…

It’s all binary and super light weight. And the best part is rigify friendly xP