I want to use Animation.Sample function in sage controller.

Re: I want to use Animation.Sample function in sage controll

PostPosted by shivajs » Thu Oct 17, 2013 7:25 pm

Animation.Sample doesn't change anything because the Sage update generally only changes the AnimationState speed.
shivajs
 
Posts: 4
Joined: Wed Oct 09, 2013 12:34 am

Re: I want to use Animation.Sample function in sage controll

PostPosted by AlteredReality » Mon Oct 21, 2013 8:48 pm

Hmmm....based on my research, it seems like it should force all animations states for the animation component to be applied...

http://docs.unity3d.com/Documentation/S ... ample.html
http://answers.unity3d.com/questions/46 ... usage.html

This is not the case in your experience then?
Andy - Altered Reality
AlteredReality
Site Admin
 
Posts: 118
Joined: Fri Jan 06, 2012 8:31 pm

Re: I want to use Animation.Sample function in sage controll

PostPosted by shivajs » Mon Oct 21, 2013 9:04 pm

I'm not saying Animation.Sample doesn't work. I'm saying that (for the most part) sage relies on AnimationState.speed to progress animations (sage doesn't normally change AnimationState.time or AnimationState.normalizedTime), and as such Animation.Sample doesn't do anything useful if called at the end of a SageController.Update.

Consider:
Code: Select all
animation.Sample(); // consider this pose

var animState = animation["testAnim"];
animState.speed = 2f;

animation.Sample(); // versus this pose
shivajs
 
Posts: 4
Joined: Wed Oct 09, 2013 12:34 am

Re: I want to use Animation.Sample function in sage controll

PostPosted by AlteredReality » Tue Oct 22, 2013 7:55 pm

shivajs wrote:I'm not saying Animation.Sample doesn't work. I'm saying that (for the most part) sage relies on AnimationState.speed to progress animations (sage doesn't normally change AnimationState.time or AnimationState.normalizedTime), and as such Animation.Sample doesn't do anything useful if called at the end of a SageController.Update.

Consider:
Code: Select all
animation.Sample(); // consider this pose

var animState = animation["testAnim"];
animState.speed = 2f;

animation.Sample(); // versus this pose


Doh, I'm sorry, you are absolutely correct. I only update the time directly I'm preview mode while in the editor. (At which point it also calls Animation.Sample) In order to do this with what is there, you'd need to manually change the time based on speed and frame time, and then call Animation.Sample. You would then need to reset the animation time back to what it was, as it would still update it based on speed when the animation component updates.
Andy - Altered Reality
AlteredReality
Site Admin
 
Posts: 118
Joined: Fri Jan 06, 2012 8:31 pm

Previous

Return to Questions and Discussion

Who is online

Users browsing this forum: No registered users and 0 guests


Style by Gokinstudio | Free forum hosting by ProphpBB | Software by phpBB | Report Abuse | Privacy
cron