mecanim_Mecanim和默认值

mecanim_Mecanim和默认值

mecanim

Hi there,

嗨,您好,

we are looking into how Mecanim handles its default values and  wondering if we should change it in the future.

我们正在研究Mecanim如何处理其默认值,并想知道将来是否应该更改它。

Let’s get a bit technical!

让我们来一点技术!

The way that Mecanim currently works is that if a “property”– position, rotation, scale, float, animator parameter etc. – is animated by an AnimationClip in an AnimatorState, it will always be controlled by the Animator. This means that when transitioning into some AnimatorState that does not have an AnimationCurve for that “property”, it will be forced to its default value.

Mecanim当前的工作方式是,如果“属性”(位置,旋转,比例,浮动,动画师参数等)由AnimatorState中的AnimationClip动画化,则它将始终由Animator控制。 这意味着,当过渡到没有针对该“属性”的AnimationCurve的某些AnimatorState时,它将被强制为其默认值。

About this approach:

关于这种方法:

Pros:

优点

  • States don’t have to handle default values themselves. So no need to clean up values at the end of the AnimatorState.

    州不必自己处理默认值。 因此,无需在AnimatorState的末尾清理值。
  • The current value of a property does not depend of which AnimatorStates were previously visited.

    属性的当前值不取决于先前访问过哪个AnimatorState。

Cons:

缺点

  • Counter intuitive to have values forced to their defaults when not animated in an AnimatorState.

    不直观时将值设置为默认值(如果未在AnimatorState中设置动画时)。
  • No way to have an empty AnimatorState that remembers the last pose/animation/sprite.

    没有办法让一个空的AnimatorState记住上一个姿势/动画/精灵。

Do you see others pros and cons?

您看到别人的利与弊吗?

Our idea is to change the default behavior so that properties are not forced back to their default values when not animated.   How does that sound?

我们的想法是更改默认行为,以便在不设置动画时不强制将属性恢复为默认值。 听起来怎么样?

We could then offer the option to force write back of default values (like the current behavior).  We think of putting the option in the Animator itself.  Do you have uses where you would like to have a finer level of control over this?

然后,我们可以提供强制回写默认值(如当前行为)的选项。 我们考虑将选项放在Animator中。 您是否希望在其中使用一些更好的控制方法?

Thanks for your time!

谢谢你的时间!

翻译自: https://blogs.unity3d.com/2014/05/30/mecanim-and-default-values/

mecanim