Sign in to follow this  
negrant

new rest pos for Skeleton

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  :)

Share this post


Link to post
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!

Share this post


Link to post
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.  :/

Share this post


Link to post
Share on other sites
12 hours ago, Wingnut said:

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

You are already the second, we collect signatures for signing the petition about set bones to any frame wihtout a blending :)

Share this post


Link to post
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.  :)

Share this post


Link to post
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);
}

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.