How can I set a default animation and start frame in script?
oPage.animation.clip = oPage.animation["blahblah"].clip;
oPage.animation["blahblah"].normalizedTime = 0.5;
doesn’t do anything.
oPage.animation.clip = oPage.animation["blahblah"].clip;
oPage.animation.Play();
Will play the animation however.
Set the time of the animation state after playing a specific clip.
animation.Play(“run”);
animation[“run”].time = 1.0;
Thanks for the answer - but this continues to play the animation, how do I get it to pause at a frame until I tell it to play?
Also, how can I advance animation frames manually. I’m looking to create something similar to the Animation view where you manually slide back and forth through an animation.
Unfortunately there is no way to advance an animation by frame. You have to select a time scaling for the animation and play back part of it by time.
Not so.
You can set the speed property to zero. This gives you explicit control over the animation state and you can just set the animation state to whatever value you like. If you want to work frame based just divide the frame number by the frame rate when assigning the time value.
Also instead of calling play you can:
state.enabled = true;
state.weight = 1;
state.speed = 0;
state.time = .5;