Jump to content

new rest pos for Skeleton


Koroldev
 Share

Recommended Posts

Hi all, who know the babylon have the fucnctionality for setting a new rest pose for skleton?

I mean, if we have a skeleton for the example with 20 frames and by default the rest pose it the first frame, but if I need to apply a frame of the animation as new rest pose, how I can do this from code?

Thanks  :)

Link to comment
Share on other sites

On 07.02.2018 at 7:35 PM, Deltakosh said:

Hello this is not directly supported but you should be able to update bone._restPose to a new Matrix

 

If this works for you I'll add an accessor to avoid using a private property

I tried, but it is not exactly what I need.

I need something like setFrame for a bone, but setFrame working only if an animaiton for a bone already played.

If I clone new skeletone and use setFrame for each one bone for the skeleton and skeleton do not have playing animation, then setFrame does not works.

How I can clone skeleton and at once in this frame before a render apply any frame for this skeleton, that the animation started from frame that I need, because the first animation

alway started from rest pose and then rest pose blends with animation which we started.

In short - need to start animation for new skeleton from needed frame without rest pose.

 

Thanks!

Link to comment
Share on other sites

Hi guys.  Sorry to interrupt.  Yeah, this is animation "sewing", in a way.

"Rest".  It would be nice to have auto-animate... from rest position... to ANY-frame.

AND... auto-animate... from ANY-frame... to rest position.

Animations are not as plug'n'play as they COULD be, eh?  *nod*

I dunno why I replied.  I have nothing useful to say.  :/

Link to comment
Share on other sites

*nod*.  It might not be technically possible, though.  Animations could be "accumulated" (additive?), so perhaps they need to be played-to-a-frame, and cannot jump to a frame.

I think each frame is "movement since previous frame" and not "movement since beginning frame".  Maybe, no jump-to-frame is possible... because of that. 

But, I am no expert about interpolations.  I should read some docs and/or study some code... before I yap.  :)

Link to comment
Share on other sites

Okay, there I tried to get keys from the animation, that to get matrix from the key, but after this code nothing happens, the skeloton still have the rest pose 

 

var animation = scene.beginAnimation(skeleton, 0, 1);
animation.stop();
        
for (var i = 0; i < skeleton.bones.length; i++) {
            var keys = animation.getAnimations()[i].getKeys();
            skeleton.bones[i].updateMatrix(keys[350].value);
}
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...