Jump to content

How to remove animation?

Ingo Chou

Recommended Posts



How to remove animation created by BABYLON.Scene.beginAnimation(target, from, to, true) ?


BABYLON.Animatable object returned by  BABYLON.Scene.beginAnimation()  can only stop at a


key frame.



        if (bAnim) {                var anim = new BABYLON.Animation("myAnimation", "scaling.x", 30,                 BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);                var keys = [];                keys.push({ frame: 0, value: 1 });                keys.push({ frame: 20, value: 0.2 });                keys.push({ frame: 60, value: 1 });                anim.setKeys(keys);                mymesh.animations.push(anim);                scene.beginAnimation(mymesh, 0, 60, true);        }        else {               scene.stopAnimation(mymesh);               mymesh.animations = new Array();        }
Link to comment
Share on other sites

I am getting into AnimationRange instances for skeletons coming from external sources, .babylon file.  Was planning on adding a modest # of methods for AnimationRange management today (hopefully).


At Animation Class:

  1. getHighestFrame() : number, for adding more animation ranges along with the frames themselves without frame # collision
  2. removeAnimationRange(rangeName: string) : boolean

At Bone Class:

  1. copyAnimationRange(donor : Bone, rescaleAsRequired = false) : boolean // rescaleAsRequired not implemented first PR

At Skeleton Class:

  1. copyAnimationRange(donor : Skeleton, rescaleAsRequired = false) : boolean // rescaleAsRequired not implemented first PR
  2. removeAnimationRange(rangeName : string): boolean

This is in addition to methods to load ranges.  These will not be coming out of the Blender exporter yet, but tested by hand modifying a .babylon.  If you start assigning ranges to stuff as you add it, then you should be able to rely on these to clean up.

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.

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.


  • Recently Browsing   0 members

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