Koroldev Posted February 7, 2018 Share Posted February 7, 2018 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 :) Quote Link to comment Share on other sites More sharing options...
Guest Posted February 7, 2018 Share Posted February 7, 2018 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 Koroldev 1 Quote Link to comment Share on other sites More sharing options...
Koroldev Posted February 11, 2018 Author Share Posted February 11, 2018 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! Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted February 11, 2018 Share Posted February 11, 2018 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. :/ Koroldev 1 Quote Link to comment Share on other sites More sharing options...
Koroldev Posted February 12, 2018 Author Share Posted February 12, 2018 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 Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted February 12, 2018 Share Posted February 12, 2018 *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. Koroldev 1 Quote Link to comment Share on other sites More sharing options...
Guest Posted February 12, 2018 Share Posted February 12, 2018 Let's try something else Can you go through your bones and call bone.updateMatrix(yourNewBaseMatrix) ? Koroldev 1 Quote Link to comment Share on other sites More sharing options...
Koroldev Posted February 13, 2018 Author Share Posted February 13, 2018 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); } Quote Link to comment Share on other sites More sharing options...
Guest Posted February 13, 2018 Share Posted February 13, 2018 try with skeleton.bones.updateMatrix(keys[350].value, false) ? Quote Link to comment Share on other sites More sharing options...
Guest Posted February 13, 2018 Share Posted February 13, 2018 if it does not work, please provide a repro in the playground, so I can try to help you further Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.