Jump to content

bone animation from Blender - Problems with rest pose?


Fabian Schempp
 Share

Recommended Posts

Hi,
I'm very new to babylon.js.
But I have a lot of experience with Blender and worked with other 3D Engines like Unity3D.

I try to get a bone driven animation from Blender working in babylon.js.

It works but it seems that the last keyframe of the animation used as the restpose for the animation,
which gives totaly wrong results.

Has this happen to anyone else?
What can cause this behavior?

Best,
Fabian

Link to comment
Share on other sites

Gryff is probably the best to look at your scene.  I was wonder the version you are using?  If not 4.2, which was put out Friday, maybe test with 4.1. This was changed to support actions.

DK, bringing up the rest position.  Was wondering if maybe the matrix passed in bone constructor might be cloned off as a _rest member, with getter & returnToRest method?  I am not really sure why, but think it might be important for re-targeting.  DBawel has not been back lately to weight in.

Link to comment
Share on other sites

Possibly another 1 post wonder as not back since post.  Either way,  when I went to bone.ts I found a _baseMatrix member.  It is reference copied in constructor, not cloned.  It has a getter, but not a returnTo method.

Is this supposed to be for resting?  Perhaps, just change the name to be more recognizable.

Link to comment
Share on other sites

Ok, I have a new version of the exporter ready to go, v 4.2.1.  I made a typo fix for Blender Nodes, & expanded the set of inverse kinematic bones to ignore to having '.ik', '.IK', 'ik.', & 'IK.' in the name.

Also, the matrix being passed for a bone is not the 'rest' position, but the current pose.  The rest position looks sometimes like a crucification pose.  That is the one useful for skeleton re-targeting, I think.  Added a separate "field" on a .babylon for a bone:

{"name":"LeftUpLeg","index":2,
"matrix":[-0.1241,0.9922,0.0117,0,0.3019,0.0265,0.953,0,0.9452,0.1218,-0.3028,0,0,4.0173,0,1],
"rest":[-0.1146,0.9926,0.0412,0,0.2379,-0.0129,0.9712,0,0.9645,0.1212,-0.2347,0,0,4.0173,0,1],

Will PR after I have modified Parse & constructor.  _rest will be defined as a constructor arg with a default of null.  If null, _rest will be cloned from matrix.

Will add a returnToRest() for a bone.  Also will add a skeleton version which does all bones, as that is how it is likely to be called.

As far as why this topic was started, I am guessing at what he meant, but think this was a reference to what happens when having translation in the animation of the root bone.  I am trying to address this in my QI extension.  I have the advantage of being beforeRender based, which by definition makes me mesh based.  The BJS animation of skeletons is skeleton based, and can have multiple meshes & multiple root bones, so not so easy to handle internally.  I just tell them to drop dead if there are multiple root bones.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...