Gugis Posted February 4, 2014 Share Posted February 4, 2014 Does babylon support playing multiple animations for one mesh? For example torso bones is playing attack animation and legs walk animation Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 4, 2014 Share Posted February 4, 2014 In this case the animation will be for the bones Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 4, 2014 Share Posted February 4, 2014 But sorry about my non-response: yes you can Quote Link to comment Share on other sites More sharing options...
Gugis Posted February 4, 2014 Author Share Posted February 4, 2014 But sorry about my non-response: yes you can Maybe my question is not correct I dont know how this term is called, but i guess I am looking for animations blending. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 4, 2014 Share Posted February 4, 2014 If you are using bones the blending is automatic Quote Link to comment Share on other sites More sharing options...
Gugis Posted February 4, 2014 Author Share Posted February 4, 2014 If you are using bones the blending is automatic scene.beginAnimation(skeleton, 0, 29, true, 1.0);scene.beginAnimation(skeleton, 30, 59, true, 1.0); So this should play both animations? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 5, 2014 Share Posted February 5, 2014 yes but you cannot specify in this case which part of the skeleton is animated I suggest doing the same but at bones level JackFalcon 1 Quote Link to comment Share on other sites More sharing options...
Gugis Posted February 5, 2014 Author Share Posted February 5, 2014 yes but you cannot specify in this case which part of the skeleton is animated I suggest doing the same but at bones levelSorry, I don't get it Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 5, 2014 Share Posted February 5, 2014 Skeletons contains a collection of bones:skeleton.bones you can launch animation on each bone if you want Quote Link to comment Share on other sites More sharing options...
kolar Posted May 18, 2014 Share Posted May 18, 2014 If you are using bones the blending is automatic I have tried to play multiple animations at the same time, but blending doesn't work: http://jsfiddle.net/kolar/gPt7U/3/Is it possible to set each animation a different weight? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 18, 2014 Share Posted May 18, 2014 The value start and end are some %. When your end has 11 means 11% of all of the animations available in models. var totalFrame = skeletons[0]._scene._activeSkeletons.data.length; scene.beginAnimation(skeletons[0], 100 * 0/totalFrame, 100 * 11 /totalFrame, true, vitesse);More information here:http://www.html5gamedevs.com/topic/2947-scenebeginanimation-fromto/ Quote Link to comment Share on other sites More sharing options...
gryff Posted May 18, 2014 Share Posted May 18, 2014 Wonderful what you can learn quite by accident from some of these threads. 1. you can launch animation on each bone if you want Works like a charm - and just seems to have solved a problem I was having myScene.beginAnimation(mySkeleton.bones[4], 90, 110, false, 1, function(){...});2. From the jsfiddle posted by kolar above, I may have found out two things:BABYLON.SceneLoader.ImportMesh(null, "https://dl.dropboxusercontent.com/u/12395133/", "bieber.babylon", scene, function (newMeshes, particleSystems, skeletons) { var chlop = newMeshes[0]; scene.beginAnimation(skeletons[0], 1, 11, true, 1.0); chlop.position.x = -1;});a. I can use my dropbox to demo files -though not tried it yet. b. the ImportMesh can return "skeletons" - all the code I have seen just had "function(newMeshes, particleSystems)". cheers, gryff Quote Link to comment Share on other sites More sharing options...
kolar Posted May 18, 2014 Share Posted May 18, 2014 The value start and end are some %. When your end has 11 means 11% of all of the animations available in models. var totalFrame = skeletons[0]._scene._activeSkeletons.data.length; scene.beginAnimation(skeletons[0], 100 * 0/totalFrame, 100 * 11 /totalFrame, true, vitesse);More information here:http://www.html5gamedevs.com/topic/2947-scenebeginanimation-fromto/ It's not true in my example. I used animation that has 30 frames (you can check it in .babylon file) so scene.beginAnimation(skeletons[0], 0, 30, true, 1);should play only ~10 frames, but it plays whole animation. See: http://jsfiddle.net/kolar/gPt7U/4/ Quote Link to comment Share on other sites More sharing options...
gryff Posted May 18, 2014 Share Posted May 18, 2014 Well if I was trying to play only 10 frames of a 30 frame animation then: I used animation that has 30 frames (you can check it in .babylon file) so scene.beginAnimation(skeletons[0], 0, 30, true, 1); should play only ~10 frames, but it plays whole animation. I would change the "30" to "10" - as you are telling it to play 30 frames with that code. cheers.gryff Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 18, 2014 Share Posted May 18, 2014 scene.beginAnimation(skeletons[0], 0, 100, true, 1); Will play the animation of 30 frames (100 = 100%) scene.beginAnimation(skeletons[0], 0, 11, true, 1); play 11% available in skeletal animation see:http://www.html5game...imation-fromto/ Quote Link to comment Share on other sites More sharing options...
kolar Posted May 18, 2014 Share Posted May 18, 2014 Dad72 see: http://jsfiddle.net/kolar/gPt7U/4/ , I set (from=0, to=100), (from=0, to=50) and (from=0, to=30) and in all cases it shows all keyframes, not 30%, 50% and 100% of them. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 18, 2014 Share Posted May 18, 2014 So there is a bug. I just wanted reported that they are %, because everyone does not know that 30 is not 30 frame, but 30%. unless this change is Deltakosh Edit: I also think that if there is less than 100 frame, it is not % but the frames is calculated. (This is the impression I) Quote Link to comment Share on other sites More sharing options...
amorgan Posted February 17, 2016 Share Posted February 17, 2016 I know this is a pretty old thread, but I was trying to look up some information on scene.beginAnimation and came across this via a search, so wanted to make sure this was not left hanging (almost two years, but hey why not). As far as a I can tell, from and to are the specific frames (at least when exporting with Blender), not percentages (BabylonJS v2.2) Also seems to be confirmed here: http://doc.babylonjs.com/tutorials/07._Animations#parameters-for-scenebeginanimation Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 17, 2016 Share Posted February 17, 2016 Yes, there is a time when it was 'percentages' but now it is by 'keyframes'. but this has not always been the case. amorgan 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 17, 2016 Share Posted February 17, 2016 They were not really percentage (As far as I can remember) but frames. Obviously if last frame == 100 (which was was the previous version of exporters produced), then it looks like percentage 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.