Help with AnimationMode changes.

For awhile now we’ve had issues ever since unity dropped the original AnimationUtility.StartAnimationMode function support which took objects and reverted changes to them after.

AnimationUtility.StartAnimationMode is deprecated. Use AnimationMode.StartAnimationMode with the new APIs. The objects passed to this function will no longer be reverted automatically. See AnimationMode.AddPropertyModification

So its pretty obnoxious for unity to warn me to use a undocumented function.

Has anyone worked around this yet, or know how to have it act as before where it would revert things when animation mode stopped? Thanks

I figured it out. If you had code like this…

AnimationUtility.StartAnimationMode( new Object[]{go} );

go.SampleAnimation(clip, time);

.. 

AnimationUtility.StopAnimationMode();

you have to now…

AnimationMode.StartAnimationMode();

AnimationMode.StartSampling();

AnimationMode.SampleAnimationClip( go, clip, time );

..

AnimationMode.StopSampling();

AnimationMode.StopAnimationMode();

I tried this, and its stopped mechanim from playing the states?! Does anyone know how to fix this?