amorgan Posted February 18, 2016 Share Posted February 18, 2016 I have a Blender exported mesh with animation that has different animations in the same animation sequence, but at different frames. For example, animation_1 is at 0 - 40 frames and animation_2 is at 100 - 105 frames. I am calling them and getting the animatable object back from the scene.beginAnimation function. For example: scene.mesh.playAnimation1 = function () { if (scene.mesh.animatable) { scene.mesh.animatable.stop(); } scene.mesh.animatable = {}; scene.mesh.animatable = scene.beginAnimation(scene.bowMesh.skeletons, 0, 40, false, 1, function () { // do something }); } I do this also for my other animation. Then I call scene.mesh.playAnimation1 to play it. The problem I am having is that the callback function from both are playing, no matter which one I call, though the correct animation is playing? Is this a bug or am I using it in an unintended way. It seems as if I should take the beginAnimation out of this function, but I don't want it to play on load. Thanks in advance for the help. PS: Was about to post this without a playground example: http://www.babylonjs-playground.com/#24CTKX Click the FPS Label in the scene to start/toggle animation -amorgan Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted February 18, 2016 Share Posted February 18, 2016 Blender exporter now supports actions. If you make it into multiple actions you may still have issues when you call your named animation ranges, but felt it would help you. Calling using this actions may avoid it. var skeleton = scene.getSkeletonByName("my_skeleton"); skeleton.beginAnimation("actionName"); Quote Link to comment Share on other sites More sharing options...
amorgan Posted February 20, 2016 Author Share Posted February 20, 2016 Thanks for that update. This is good to know, I think the last time I was trying to get multiple animations on one mesh, BJS did not support this. Though, I guess what I really want/need would be able to get an animatable object before calling beginAnimation and still be able to set up the specific animation (frames). Am I missing something? There still seems to be either a bug, or I'm doing this the wrong way. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 21, 2016 Share Posted February 21, 2016 It is definitely a bug..I'll fix it for next commit Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 21, 2016 Share Posted February 21, 2016 Here is it: https://github.com/BabylonJS/Babylon.js/commit/605f28e402902f1d072704b1cbff97d6832a04ae amorgan 1 Quote Link to comment Share on other sites More sharing options...
amorgan Posted February 21, 2016 Author Share Posted February 21, 2016 Awesome. Thanks Deltakosh! I will also confirm that it is now working as I expect it to. GameMonetize 1 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.