通过身体遮罩可以对动画里面特定的身体部位进行激活或禁止。在网格导入观察器和动画层的动画标签里面可以设置身体遮罩。身体遮罩让您能根据角色需求精确的裁剪动画。例如,您有一个常见的行走动画,包括手臂和腿的动作,但是如果现在一个角色的双手举着巨大的物体,您当然不会希望她在行走的时候手臂来回摆动。 unity3d脚本 http://www.unitymanual.com当然,您可以通过身体遮罩的切换,继续使用常规的行走动画。
The body parts included are: Head, Left Arm, Right Arm, Left Hand, Right Hand, Left Leg, Right Leg and Root (which is denoted by the "shadow" under the feet). In the body mask, you can also toggle inverse kinematics (IK) for hands and feet, which will determine whether or not IK curves will be included in animation blending.
身体部位包括:头、左手臂、右手臂、左手、右手、左腿、右腿、Root (以脚的背面作为标志)。在身体遮罩界面,您可以给手或脚指定是否需要IK(反向运动学),由此可决定在动画混合里面是否包括IK曲线。
Click the avatar section to toggle inclusion or exclusion (green/red)
点击Avatar部位,以触发包括或不包括(绿色/红色)
Double click in empty space surrounding the avatar to toggle all
在avatar周围空白处双击可以翻转所有部位的状态
Body mask in the Body Mask inspector (arms excluded)
在身体遮罩观察器里面的身体遮罩(不包括手臂)
In the Animation tab of the mesh import inspector, you will see a list entitled Clips that contains all the object's animation clips. When you select an item from this list, options for the clip will be shown, including the body mask editor.
在网格导入观察器的动画标签里,您会看到一个叫做Clips的列表,里面有当前对象的所有动画剪辑。当您从列表中选择一个条目,会显示这个剪辑的选项,其中包括身体遮罩编辑器。
You can also create Body Mask Assets (Assets->Create->Avatar Body Mask), which show up as .mask files on disk.
您也可以通过Assets->Create->Avatar Body Mask菜单创建身体遮罩资源,在磁盘上的后缀名是.mask。
The BodyMask assets can be reused in Animator Controllers, when specifying Animation Layers
身体遮罩资源可以在动画控制器中重用,在指定动画层的时候。
A benefit of using body masks is that they tend to reduce memory overheads since body parts that are not active do not need their associated animation curves. Also, the unused curves need not be calculated during playback which will tend to reduce the CPU overhead of the animation.
使用动画遮罩的益处是可以减少内存消耗,因为不活跃的身体部位就不需要和它关联的动画曲线。同时,没使用的动画曲线也不会在播放动画的时候来计算,这样就减少了动画的CPU消耗。