Unity3D之Mecanim动画系统

Mecanim动画系统 Mecanim Animation System

Date:2013-05-16 07:48

Unity has a rich and sophisticated animation system called Mecanim. Mecanim provides:

Unity有一个丰富并且精密的动画系统叫做Mecanim。Mecanim提供了:

  • Easy workflow and setup of animations on humanoid characters.

    为类人角色设计的简单的工作流

  • Animation retargeting - the ability to apply animations from one character model onto another. 

    动画重定向-能够把一个动画应用到多个不同模型的能力

  • Simplified workflow for aligning animation clips. 

    用于对齐影片剪辑的简化的工作流

  • Convenient preview of animation clips, transitions and interactions between them. This allows animators to work more independently of programmers, prototype and preview their animations before gameplay code is hooked in. 

    方便的影片剪辑预览,变换和交互。这使得动画师的工作可以更多地独立于程序员的,方便在游戏逻辑代码挂接之前建立原型和预览。

  • Management of complex interactions between animations with a visual programming tool. 

    使用一个可视化编程工具来管理动画之间复杂的交互。

  • Animating different body parts with different logic. 

    对身体不同的地方使用不同的逻辑进行动画控制。

Typical setup in the Visual Programming Tool and the Animation Preview window

可视化编程工具和动画窗口典型的设置。

Mecanim workflow (Mecanim工作流程)

Workflow in Mecanim can be split into three major stages.

Mecanim的工作流可以被分割为如下3个主要的阶段:

  1. Asset preparation and import. This is done by artists or animators, with 3rd party tools, such as Max or Maya. This step is independent of Mecanim features.

    资源预备和导入。这是由美工或者动画师完成的工作,使用第三方的工具,比如Max或者Maya。这一步是独立于Mecanim的特性的。

  2. Character setup for Mecanim, which can be done in 2 ways:

    为Mecanim设定角色,有以下2种途径:

    • Humanoid character setup. Mecanim has a special workflow for humanoid models, with extended GUI support and retargeting.
      The setup involves creating and setting up an Avatar and tweaking Muscle
      definitions
      .

      类人角色配置。Mecanim对于类人角色有一个特别的工作流,使用扩展后的GUI和重定向。配置包含创建和设定一个Avatar并且调整肌肉定义。

    • Generic character setup. This is for anything like creatures, animated props, four-legged animals, etc. Retargeting is not possible here, but you can still take advantage of the rich feature set of Mecanim, including
      everything described below.

        通用角色配置。这是为任何东西像是人,有动画的柱子,四足动物之类设计的。重定向在这里是不支持的,但是你仍然可以得到后文中描述的Mecanim的好处。

  3. Bringing characters to life. This involves setting up animation
    clips
    , as well as interactions between them, and involves setup of State Machines and Blend
    Trees
    , exposing Animation Parameters, and controlling animations from code.

    让角色动起来。这包括设定动画剪辑和它们之间的交互,还包括状态机和混合树,列出动画参数,还有从代码中控制动画。

Mecanim comes with a lot of new concepts and terminology. If at any point, you need to find out what something means, go to our Animation
Glossary
.

Mecanim带来很多概念和术语。如果在某些时候你需要查找它们的意思,来我们的动画术语页面。

Legacy animation system 旧版动画系统

While Mecanim is recommended for use in most situations, especially for working humanoid animations, the Legacy animation system is still used in a variety of contexts. One of them is working legacy animations and code (content created before Unity 4.0).
Another is controlling animation clips with parameters other than time (for example for controlling the aiming angle). For information on the Legacy animation system, see this
section

虽然在大多情况Mecanim是推荐使用的,特别是针对类人动画进行工作的时候,但是旧版的动画系统仍然会在很多的情况下被使用。其中之一是在之前的代码和动画中使用(在Unity4.0之前创建的内容)。另外一个例子是使用参数而不是时间控制的动画(比如控制瞄准角)。更多有关旧版动画系统的内容,参看这里

Unity intends to phase out the Legacy animation system over time for all cases by merging the workflows into Mecanim.

Unity计划逐步淘汰旧版动画系统把工作流都并入Mecanim。

页面最后更新:2013-02-14

标签: Mecanim Animation 动画系统 unity3d

分类:Manual| 翻译: FancyBit

时间: 2024-08-07 08:38:18

Unity3D之Mecanim动画系统的相关文章

Unity3D之Mecanim动画系统学习笔记(一):认识Mecanim动画系统

Mecanim简介 Mecanim动画系统是Unity3D4.0开始引入的一套全新的动画系统,主要提供了下面4个方面的功能: 针对人形角色提供一套特殊的工作流. 动画重定向的能力,可以非常方便的把动画从一个角色模型应用到其他角色模型之上. 提供可视化的Animation编辑器,可以方便的创建和预览动画片段. 提供可视化的Animator编辑器,可以方便的管理多个动画切换的状态. 工作流 模型的准备 Unity不能制作3D模型和进行骨骼绑定,这些需要在专业的建模软件中由美术进行制作,一般常用的建模

Unity3D之Mecanim动画系统学习笔记(九):Blend Tree(混合树)

认识Blend Tree 我们在Animator Controller中除了可以创建一个State外还可以创建一个Blend Tree,如下: 那么我们看下新创建的Blend Tree和State有什么区别: 唯一的区别就是Montion指向的类型变成了Blend Tree类型,那么一个Blend Tree其实也就是一个状态,和状态不同的地方就是一个状态只能设定一个动画,而一个Blend Tree则可以设定为多个动画的混合. 混合树是Mecanim动画系统中比较复杂的一个内容,且其分为多个维度,

Unity3D之Mecanim动画系统学习笔记(二):模型导入

我们要在Unity3D中使用上模型和动画,需要经过下面几个阶段的制作,下面以一个人形的模型开发为准来介绍. 模型制作 模型建模(Modelling) 我们的美术在建模时一般会制作一个称为T-Pose(及双臂张开)的模型. 骨骼绑定(Rigging) 在之前制作的模型上进行骨骼的绑定,我们需要注意的是骨骼数量不能少于15根,同时要遵循Unity3D的骨骼制作标准,如下: http://docs.unity3d.com/Manual/Preparingacharacterfromscratch.ht

Unity3D之Mecanim动画系统学习笔记(十):Mecanim动画的资源加载相关

资源加载是必备的知识点,这里就说说Mecanim动画的资源如何打包及加载. 注意,Unity4.x和Unity5.x的AssetBundle打包策略不一样,本笔记是基于Unity4.x的AssetBundle进行打包的. 我们一般使用FBX类型的模型及动画文件,而动画文件的储存一般有两种情况,一是所有的动画和模型都一起存放到一个文件中,还有一种情况是模型单独一个文件而动画单独一个文件.这里我们就两种情况都看一下. 使用的资源是Unity3D自带的以及从一本教材中取出的两种类型的动画资源,同时需要

Unity3D之Mecanim动画系统学习笔记(七):IK(反向动力学)动画

什么是IK? IK(Inverse Kinematics)即反向动力学,即可以使用场景中的各种物体来控制和影响角色身体部位的运动,一般来说骨骼动画都是传统的从父节点到子节点的带动方式(即正向动力学),而IK则倒过来,由骨骼子节点带动骨骼父节点,具体情况比如人物走路踩到了石头就需要由脚的子节点来带动全身骨骼做出踩到石头的响应. IK可以使人物和场景更加贴合,从而达到更加真实的游戏效果,如果大家玩过<波斯王子>或<刺客信条>系列,应该对主角的攀爬和飞檐走壁的能力印象深刻,这些都是应用了

Unity3D之Mecanim动画系统学习笔记(五):Animator Controller

简介 Animator Controller在Unity中是作为一种单独的配置文件存在的文件类型,其后缀为controller,Animator Controller包含了以下几种功能: 可以对多个动画进行整合: 使用状态机来实现动画的播放和切换: 可以实现动画融合和分层播放: 可以通过脚本来对动画播放进行深度控制: 下面我们通过一个图来直观的看看动画的组成结构: Animator组件用来控制人物动画的播放,其中需要的两个最核心的内容就是控制动画播放逻辑的Animator Controller以

Unity3D之Mecanim动画系统学习笔记(三):Animation View

动画组件之间的关系 我们先看一张图: 这里我们可以看到,我们在GameObject之上绑定的Animator组件是控制模型进行动画播放的. 而其属性Controller则对应一个Animator Controller文件,该文件可以在Animator窗口中打开,其是被设计为状态机形式的系统,多个状态之间的切换关系可以在该界面进行设置. Animator Controller中的每个状态则对应一个Animation Clip,每个Animation Clip是一个简单的动画单元,可以在Animat

Unity3D之Mecanim动画系统学习笔记(四):Animation State

动画的设置 我们先看看Animation Clip的一些设置: Loop time:动画是否循环播放. 下面出现了3个大致一样的选项: Root Transform Rotation:表示为播放动画的对象的旋转方面的信息. Root Transform Position(Y):表示为播放动画的对象的位置 y 轴方面的信息. Root Transform Position(XZ):表示为播放动画的对象的位置 XZ 平面方面的信息. 他们都有一致的选项,我们逐个的来看: Bake Into Pose

Unity3D之Mecanim动画系统学习笔记(八):Animator Layers(动画分层)

解决什么问题? 动画分层可以用来解决什么样的问题呢?试想一下如果你要开发一款第三人称的射击游戏,那么肯定是希望身体的动画分为上下两部分,上方根据瞄准的位置和是否射击进行动画播放,下方根据移动播放动画.最好的例子就是Unity4.x自带的示例AngryBots了. Avatar Mask 下面我们就使用Avatar Mask来实现人物在奔跑中招手的效果. 我们先添加一个人物到场景,同时为其添加一个Animator Controller并设定好跳转条件,如下: 接下来我们添加下面的脚本来控制动画的播