Jump to content

Scene.Animatables


JohnM
 Share

Recommended Posts

Hi, 

I was wondering, is it possible / could it be possible to create multiple animations for a single mesh but have them as separate animatables so you can pause and play etc each individual animation applied to that mesh?

ive tried to create a new BABYLON.Animatable each time i create an animation but then the _runtimeAnimation is empty and .pause() .play() doesnt work.

any help is much appreciate and if anything else needs explaining just let me know! 

many thanks,

John

Link to comment
Share on other sites

Hi,

 

thanks for your answer! 

I just wanted to clarify that all my animated objects are only meshes with no bones / rigging  / skeletons. would this still work for my meshes? 

I would check it myself but I wont be able to work on it till tomorrow.

Many thanks! 

Link to comment
Share on other sites

So i tried this - 

Quote

You can use scene.beginAnimation() function with target is mesh.skeleton

and it didnt work, im guessing because obviously I have no skeletons attached to my meshes, and unless they're characters, i prob never will. 

has anyone got any other suggestions? being able to control each individual animation would be a great help to me

 

many thanks

Link to comment
Share on other sites

I have also tried this - https://doc.babylonjs.com/how_to/group#how-to-group-animations

 

but it doesnt seem to give the desired effect either. however i feel like it should, I feel like i should be able to apply a single animation to a group, how ever at the moment when i do this it says -

SCRIPT445: Object doesn't support this action

 

and points to this - 

var startAnim = new BABYLON.AnimationGroup("spherePosY");
                
startAnim.addTargetedAnimation(newAnimation, myObject);

startAnim.pause();

 

Link to comment
Share on other sites

Hi,

Perhaps i am not explaining myself clearly, I am bad for doing that haha.

I have animations that I have created using this method. however when i then create a SECOND animation using this method. it obviously gets applied to that mesh also which is good. 

but what is bad (for me) is that the second animation ALSO gets applied to the SAME scene.Animatable.

so when i do - 

anim.pause();

it would then pause BOTH animations, where as i want to be able to control each animation individually. 

i hope this makes more sense? 

many thanks. 

Link to comment
Share on other sites

Hi guys, sorry for the late reply.

regards to the repro, its difficult for me to make the time for a repro as this is a professional project and if bugs pop up for me whilst making the repro thats time taken away from something else, but yea i definitely understand it would help.

 

JohnK - Yes thats exactly what I want!! how come your two animations have two separate animatables? mine always gets combined into one when two animations are applied to the same mesh.

EDIT - I suppose a better question would be, can anyone explain or link me to the docs for beginDirectAnimation as i am assuming this is what is sorting my issue, but thisthis and this is all i can find about it online. 

Many thanks.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...