Koroldev Posted November 13, 2016 Share Posted November 13, 2016 Hello guys! I have, maybe, a little bit strange question. But how can I set the main position of skeleton or the started position of skeleton I dont know how its named. When I export model from blender and current animation frame in blender let's say 35, in babylon, if I do not begin skeleton animation, skeleton current frame it is 35. If I export model from blender and current frame 12, than in babylon main pos of skeleton it is frame 12. How can I set main pos for skeleton programmatically in babylon. I need set main pos first frame regardless of current frame in blender. Becouse I often export from blender and I can foget set skeleton in first frame and it will not be immediately noticeable in the game. I hope you will understand about what I told Quote Link to comment Share on other sites More sharing options...
dbawel Posted November 14, 2016 Share Posted November 14, 2016 Please explain further ... Move trees? Quote Link to comment Share on other sites More sharing options...
adam Posted November 14, 2016 Share Posted November 14, 2016 If I understand you correctly, you should use Bone.setPosition on the root bone whenever the animation is playing. scene.registerBeforeRender(function(){ rootBone.setPosition(x, y, z); }; Quote Link to comment Share on other sites More sharing options...
adam Posted November 14, 2016 Share Posted November 14, 2016 Another possible answer: animation.goToFrame(frameNum) Quote Link to comment Share on other sites More sharing options...
Koroldev Posted November 14, 2016 Author Share Posted November 14, 2016 4 hours ago, adam said: If I understand you correctly, you should use Bone.setPosition on the root bone whenever the animation is playing. scene.registerBeforeRender(function(){ rootBone.setPosition(x, y, z); }; Not exatly. Okay guys, I will try to explain differently. I have in blender a model with a skeleton and this skeleton has animation walk. In first frame of animation my skeleton has pose without transformations: From second frame and to frame 71 my skeleton has animation walk: When I export my model in babylon and do not use beginAnimation function, just run babylon project and I see that my model in pose that is equal frame number 36! Like on screenshot: I need that when my project start, than first pose equals first frame, like on screenshot: I need this because In this model further in my game I will use shift of the center of the model, but shift of the center of the model uses a frame, which was when my project starts (in my case it frame 36). If I use for all bones bone.returnToRest, my model is still in frame 36. I want to rest pose of my model, this was first frame like on first screenshoot. Thanks to everyone who is trying to understand my problem, becouse English is slightly difficult for me 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.