Unity3D类人动画humanoid animations







动画和Mecanim术语表 A Glossary of Animation and Mecanim terms

Date:2013-05-24 11:01
Icon
图标
Term
术语
Description
描述
Type of Concept
概念类型
Usage/Comments
用途/注释
Animation Clip related terms 动画剪辑相关术语
Animation Clip
动画剪辑
Animation data that can be used for animated characters or simple animations. It is a simple "unit" piece of motion, such as (one specific instance of) "Idle", "Walk" or "Run"
可以用于角色或者简单动画的动画数据。它是动作的简单“单元”,诸如(特别的实例)“空闲”,“走路”或者“跑步”
sub-Asset
子资源
 
Body Mask
身体蒙版
A specification for which body parts to include or exclude for a skeleton
一个用于包括或排除身体部位骨骼的规格
Asset (.mask)Used in Animation Layers and in the importer
在动画分层和导入器中使用
 Animation Curves
动画曲线
Curves can be attached to animation clips and controlled by various parameters from the game
曲线可以附加到各种动画剪辑并且被游戏中的各种参数来控制
  
Avatar related terms 阿凡达相关术语
Avatar
阿凡达
An interface for retargeting one skeleton to another
从一个骨架重定向到另外一个骨架的界面
sub-Asset
子资源
 
 Retargeting
重定向
Applying animations created for one model to another
把为一个模型创建的动画应用到另外一个模型
Process
过程
 
 Rigging
绑定
The prcoess of building a skeleton hierarchy of bone joints for your mesh
为你的网格建立一个骨架的层次结构和关节的过程
Process
过程
done in an external tool, such as Max or Maya
在外部工具中完成,比如Max或者Maya
 Skinning
蒙皮
The process of binding bone joints to the character's mesh or 'skin'
把骨骼关节绑定到角色网格或者“皮肤”的过程
Process
过程
done in an external tool, such as Max or Maya
在外部工具中完成,比如Max或者Maya
 Muscle Definition
肌肉定义
A Mecanim concept, which allows you to have a more intuitive control over the character's skeleton. When an Avatar is in place, Mecanim works in muscle space, which is more intuitive than bone space
一个Mecanim概念,它允许你更直觉化地控制Avatar。当一个Avatar准备好了之后,Mecanim工作在肌肉空间,这比骨骼空间更直觉化。
  
 T-pose
T字姿势
The pose in which the character has his arms straight out to the sides, forming a "T". The required pose for the character to be in, in order to make an Avatar
角色双臂平身形成一个“T”字的姿势。角色必须保持这个姿势来制作Avatar。
  
 Bind-pose
绑定姿势
The pose at which the character was modelled
角色在建模过程中的姿势
  
Human template
人形模板
A pre-defined bone-mapping
一个预先定义的骨骼映射
Asset (.ht)Used for matching bones from FBX files to the Avatar.
用于从FBX文件中匹配骨骼到Avatar。
Animator and Animator Controller related terms
动画和动画控制器相关术语
 Animator Component
动画组件
Component on a model that animates that model using the Mecanim animation system. The component has a reference to an Animator Controller asset that controls the animation.
在模型上使用Mecanim动画系统的组件。这个组件引用一个控制动画的Animator Controller资源。
Component
组件
 
 Root Motion
根动作
Motion of character's root, whether it's controlled by the animation itself or externally.
角色根级的动作,它可以被动画本身或者外部控制。
  
Animator Controller (Asset)
动画控制器(资源)
The Animator Controller controls animation through Animation Layers with Animation State Machines and Animation Blend Trees, controlled by Animation Parameters. The same Animator Controller can be referenced by multiple models with Animator components.
动画控制器通过动画层中的动画状态机,还有被参数控制的混合树来控制动画。同一个Animator Controller可以被多个模型使用Animator 组件引用。
Asset (.controller) 
 Animator Controller (Window)
动画控制器(窗口)
The window where the Animator Controller Asset is visualized and edited.
动画控制器在其中被可视化并编辑的窗口。
Window
窗口
 
 Animation Layer
动画层
An Animation Layer contains an Animation State Machine that controls animations of a model or part of it. An example of this is if you have a full-body layer for walking / jumping and a higher layer for upper-body motions such as throwing object / shooting. The higher layers take precedence for the body parts they control.
每个动画层包含一个控制整个模型或者部分模型的动画状态机。例如全身层可控制走路、跳跃并且更高的层面控制上半身动作比如投掷、跳跃。更高层对于身体部位有更高的控制权。
  
 Animation State Machine
动画状态机
A graph controlling the interaction of Animation States. Each state references an Animation Blend Tree or a single Animation Clip.
一个控制动画状态之间交互的图。每个状态引用一个混合树或者单一动画剪辑。
  
 Animation Blend Tree
动画混合树
Used for continuous blending between similar Animation Clips based on float Animation Parameters.
基于浮点动画参数,用于连续在多个近似的动画剪辑之间进行混合。
  
 Animation Parameters
动画参数
Used to communicate between scripting and the Animator Controller. Some parameters can be set in scripting and used by the controller, while other parameters are based on Custom Curves in Animation Clips and can be sampled using the scripting API.
用于在脚本和Animator Controller之间通信。一些参数可以在脚本中设定并且在控制器中被引用,另外一些参数是基于在动画剪辑中的自定义曲线并且可以使用脚本API来采样。
  
 Inverse Kinematics (IK)
反向动力学
The ability to control the character's body parts based on various objects in the world.
基于世界中各种对象来控制角色身体部分的能力。
  
Non-Mecanim animation terms 非Mecanim动画术语
 Animation Component
动画组件
The component needed for non-Mecanim animations
使用非Mecanim动画时需要的组件
Component
组件
 

页面最后更新:2012-11-07







使用类人动画 Working with humanoid animations

Date:2013-05-25 10:51

The Mecanim Animation System is particularly well suited for working with animations for humanoid skeletons. Since humanoid skeletons are a very common special case and are used extensively in games, Unity provides a specialized workflow, and an extended tool set for humanoid animations.

Mecanim动画系统是特别适合为类人骨架使用的。类人骨架是非常常用的特例并且在游戏中广泛使用。Unity为类人动画提供了一个特别的工作流,还有一个扩展工具集。

Because of the similarity in bone structure, it is possible to map animations from one humanoid skeleton to another, allowing retargeting and inverse kinematics. With rare exceptions, humanoid models can be expected to have the same basic structure, representing the major articulate parts of the body, head and limbs. The Mecanim system makes good use of this idea to simplify the rigging and control of animations. A fundamental step in creating a animation is to set up a mapping between the simplified humanoid bone structure understood by Mecanim and the actual bones present in the skeleton; in Mecanim terminology, this mapping is called an Avatar. The pages in this section explain how to create an Avatar for your model.

因为骨骼结构的类似性,使得把动画从一个类人骨架映射到另外一个类人骨架成为可能,也使得重定向和反向动力学成为可能。极少例外地,类人模型可以被认为是有相同的结构,有清晰的身体,头,四肢。Mecanim系统很好地利用这个主意来简化搭骨架和控制动画。创建动画的一个基本步骤是设置一个unity3d可理解的简化后的类人骨骼到骨架中实际骨骼的映射;在Mecanim的术语中,这个映射称为Avatar。这段的页面中解释了如何为你的模型创建Avatar。





创建Avatar Creating the Avatar

Date:2013-05-25 10:59

After a model file (FBX, COLLADA, etc.) is imported, you can specify what kind of rig it is in the Rig tab of the ModelImporter options.

在FBX导入之后,你可以在FBX导入器选项中的rig标签页指定是哪种类型的骨架。

Humanoid animations

For a Humanoid rig, select Humanoid and click Apply. Mecanim will attempt to match up your existing bone structure to the Avatar bone structure. In many cases, it can do this automatically by analysing the connections between bones in the rig.

对于类人骨架,选择Humanoid然后单击Apply.Mecanim将会尝试匹配你的骨骼结构到Avatar骨骼结构。在大多情况下,它可以自动地分析骨骼之间的链接来完成这一过程。

If the match has succeeded, you will see a check mark next to the Configure... menu

如果匹配成功,你将会在Configure...按钮旁边看到一个对号

Also, in the case of a successful match, an Avatar sub-asset is added to the model asset, which you will be able to see in the project view hierarchy.

并且,在成功匹配的情况下,一个Avatar子资源会被增添到FBX资源,你可以再项目视图中看到它。

 
Models with and without an Avatar sub-asset
含有和不含Avatar的子资源


The inspector for an Avatar asset
Avatar资源的检视器

If Mecanim was unable to create the Avatar, you will see a cross next to the Configure ... button, and no Avatar sub-asset will be added. When this happens, you need to configure the avatar manually.

如果Mecanim不能床架Avatar,你将会看到一个叉号出现在Configure...按钮旁边,并且没有Avatar子资源被添加。当这种情况发生的时候,你需要手动配置avatar。

Non-humanoid animations 非类人动画

Two options for non-humanoid animation are provided: Generic and Legacy. Generic animations are imported using the Mecanim system but don't take advantage of the extra features available for humanoid animations. Legacy animations use the the animation system that was provided by Unity before Mecanim. There are some cases where it is still useful to work with legacy animations (most notably with legacy projects that you don't want to update fully) but they are seldom needed for new projects. See this section of the manual for further details on legacy animations.

提供了2种非类人动画:通用和旧版。通用动画是使用Mecanim系统导入但是不会获得类人动画的额外好处。旧版动画是使用Unity在Mecanim之前提供的动画系统。还有一些情况下旧版动画系统是有用的(大多是你不想完全更新项目的情况)但是他们很少在新的项目中使用。参看手册的这一段来了解旧版动画的更多细节。

(back to Avatar Creation and Setup)

(back to Mecanim introduction)

页面最后更新:2013-01-07






配置Avatar Configuring the Avatar

Date:2013-06-02 14:30

Since the Avatar is such an important aspect of the Mecanim system, it is important that it is configured properly for your model. So, whether theautomatic Avatar creation fails or succeeds, you need to go into the Configure Avatar mode to ensure your Avatar is valid and properly set up. It is important that your character's bone structure matches Mecanim's predefined bone structure and that the model is in T-pose.

Avatar是Mecanim的一个如此重要方面,它需要被配置地符合你的模型。因此不论自动Avatar创建失败或者成功,你都需要进入Avatar配置模式来确保你的Avatar是有效并且合适地配置了。你的角色骨骼匹配Mecanim的预定义骨骼结构并且模型是T字形姿势是非常重要的。

If the automatic Avatar creation fails, you will see a cross next to the Configure button.

如果自动Avatar创建失败,你将会看到一个叉号出现在Configure按钮旁边。

If it succeeds, you will see a check/tick mark: 
腐乳它成功了,你将会看到一个对号出现在Configure...按钮旁边:

Here, success simply means all of the required bones have been matched but for better results, you might want to match the optional bones as well and get the model into a proper T-pose.

在这里,成功简仅仅意味着需要的骨骼被匹配上了,但是为了获得更好的结果,你可能会想也匹配上可选的骨骼以及让模型进入一种合适的T字姿势。

When you go to the Configure ... menu, the editor will ask you to save your scene. The reason for this is that in Configure mode, the Scene View is used to display bone, muscle and animation information for the selected model alone, without displaying the rest of the scene.

当你进入Configure...按钮,编辑器将会问你是否保存场景。之后进入Configure模式,场景视图用来单独显示指定模型的骨骼,肌肉和动画信息,不显示场景的其他部分。

Once you have saved the scene, you will see a new Avatar Configuration inspector, with a bone mapping.

一旦你保存了场景,你就会看到一个带有骨骼映射的新Avatar配置检视器。

The inspector shows which of the bones are required and which are optional - the optional ones can have their movements interpolated automatically. For Mecanim to produce a valid match, your skeleton needs to have at least the required bones in place. In order to improve your chances for finding a match to the Avatar, name your bones in a way that reflects the body parts they represent (names like "LeftArm", "RightForearm" are suitable here).

检视器显示哪些骨骼是需要的还有哪些骨骼是可选的-可选的骨骼的运动可以自动用插值计算出来。为了让Mecanim产生有效的匹配,你的骨架需要至少含有必须的骨骼在适当的位置。为了提高查找匹配Avatar的机会,可以使用反映身体部位的名称命名你的骨骼(像“LeftArm”“RightForearm”这样的名称都是合适的)。

If the model does NOT yield a valid match, you can manually follow a similar process to the one used internally by Mecanim:-

如果模型没有产生一个有效的匹配,你可以手动按照类似Mecanim内部的处理方式做一下:

  1. Sample Bind-pose (try to get the model closer to the pose with which it was modelled, a sensible initial pose) 
    采样绑定姿势(尝试让模型更接近它建模时候的姿势,一个合理的最初姿势)
  2. Automap (create a bone-mapping from an initial pose) 
    自动映射(从最初的姿势创建一个骨骼映射)
  3. Enforce T-pose (force the model closer to T-pose, which is the default pose used by Mecanim animations) 
    强制T字姿态(强制让模型更接近T字姿态,这是Mecanim使用的默认姿势)。

If the auto-mapping (Mapping->Automap) fails completely or partially, you can assign bones by either draging them from the Scene or from the Hierarchy. If Mecanim thinks a bone fits, it will show up as green in the Avatar Inspector, otherwise it shows up in red.

如果自动映射(Mapping->Automap)完全或者部分失败,你可以通过从场景或者体系结构视图拖拽它们来赋值到骨骼。如果Mecanim认为骨骼合适,它会用绿色在Avatar检视器中显示,否则会以红色显示。

Finally, if the bone assignment is correct, but the character is not in the correct pose, you will see the message "Character not in T-Pose". You can try to fix that with Enforce T-Pose or rotate the remaining bones into T-pose.

最后如果骨骼被正确赋予了,但是角色不是在正确的姿势,你将会看到消息“Character not in T-Pose(角色不是在T字姿态)”。你可以尝试Enforce T-pose(强制T字姿态)或者旋转余下的骨骼到T字姿态。

Human Template files 人体模板文件

You can save the mapping of bones in your skeleton to the Avatar on disk as a "human template file" (extention *.ht), which can be reused by any characters that use this mapping. This is useful, for example, if your animators use a consistent layout and naming convention for all skeleton but Mecanim doesn't know how to interpret it. You can then Load the .ht file for each model, so that manual remapping only needs to be done once.

你可以用“人体模板文件”(扩展名*.ht)的形式保存骨骼到你Avatar骨架的映射到到磁盘上,你可以在任意角色上重用这个映射。这非常有用,比如,如果你的动画使用一致布局和命名约定到所有的骨架上但是Mecanim不知道如何解释它。你可以为模型载入.ht文件,这样手动重映射只需要做一次。

(back to Avatar Creation and Setup)

(back to Mecanim introduction)

页面最后更新:2012-11-05





肌肉设定 Muscle setup

Date:2013-06-02 14:35

Mecanim allows you to control the range of motion of different bones using Muscles.

Mecanim允许你使用肌肉(Muscles)控制不同骨骼上的各种动作尺度。

Once the Avatar has been properly configured, Mecanim will "understand" the bone structure and allow you to start working in the Muscles tab of the Avatar Inspector. Here, it is very easy to tweak the character's range of motion and ensure the character deforms in a convincing way, free from visual artifacts or self-overlaps.

一旦Avatar正确配置了,Mecanim将会“理解”骨骼的结构并且允许你开始在Avatar检视器中的Muscle是标签栏中开始工作。这里,很容易调整角色的动作尺度并且确保角色使用逼真的方式扭曲,避免过度造作和自我重叠。

You can either adjust individual bones in the body (lower part of the view) or manipulate the character using predefined deformations which operate on several bones at once (upper part of the view).

你可既可以在body(视图下部)来调整单独的动画或者使用预先定义的一次操作若干骨骼的扭曲(视图上部)来操作角色。

Muscle Clips 肌肉剪辑

In the Animation tab, you can set up Muscle Clips, which are animations for specific muscles and muscle groups.

在Animation标签栏,你可以建立肌肉剪辑(Muscle Clips),它是针对特定肌肉或者肌肉组的动画。

You can also define which body parts these muscle clips apply to.

你也可以定义肌肉动画应用到身体的哪个部分。

(back to Avatar Creation and Setup)

(back to Mecanim introduction)

页面最后更新:2012-11-01













资源准备和导入 Asset Preparation and Import

Date:2013-05-25 02:28

Humanoid meshes 类人网格

In order to take full advantage of Mecanim's humanoid animation system and retargeting, you need to have a rigged and skinned humanoid type mesh.

为了应用Mecanim的类人动画系统和重定向的所有好处,你需要有一个绑骨并蒙皮的类人网格。

  1. A character model is generally made up of polygons in a 3D package or converted to polygon or triangulated mesh, from a more complex mesh type before export. 
    一个角色模型通常是由3D包组成或者从一个导出前更加复杂的网格类型转换为多边形或者三角网格。
  2. joint hierarchy or skeleton which defines the bones inside the mesh and their movement in relation to one another, must be created to control the movement of the character. The process for creating the joint hierarchy is known as rigging
    一个定义了一组网格内的骨骼和他们的之间的运动关系的关节体系或者骨架,必须是为了控制角色的运动而创建的。众所周知创建这样关节体系的过程称作搭骨架(rigging).
  3. The mesh or skin must then be connected to the joint hierarchy in order to define which parts of the character mesh move when a given joint is animated. The process of connecting the skeleton to the mesh is known as skinning. 
    一个网格或者皮肤必须被链接到关节体系来定义给定关节被动画化时角色的某一部分网格如随之运动。这个链接骨架和网格的过程就是蒙皮。

Stages for preparing a character (modeling, rigging, and skinning) 
预备角色的步骤(建模,搭骨架,蒙皮)

How to obtain humanoid models 
如何获取类人模型

There are three main ways to obtain humanoid models for with the Mecanim Animation system:

这里有三种重要的途径来获取用于Mecanim动画系统的类人模型:

  1. Use a procedural character system or character generator such as PoserMakehuman or Mixamo. Some of these systems will rig and skin your mesh (eg, Mixamo) while others will not. Furthermore, these methods may require that you reduce the number of polygons in your original mesh to make it suitable for use in Unity. 
    使用一个程序化角色系统程者角色生成器诸如Poser,Makehuman或者Mixamo。其中一些系统会为你的网格搭骨架和蒙皮(比如,Mixamo)但是另外一些不会。此外,这些方法可能需要你减少原有网格上的面数来适应Unity。
  2. Purchase demo examples and character content from the Unity Asset Store
    从Unity Asset Store购买演示示例和角色内容
  3. Also, you can of course prepare your own character from scratch. 
    还有,你当然可以从草图开始准备自己的角色

Export & Verify 导出和验证

Unity imports a number of different generic and native 3D file formats. The format we recommend for exporting and verifying your model is FBX 2012 since it will allow you to:

Unity导入可以导入大量不同通用和本地3D文件格式。我们推荐的导出和验证你模型的格式是FBX2012因为它会让你可以:

  • Export the mesh with the skeleton hierarchy, normals, textures and animation 
    导出带骨架层级的网格,法线,纹理和动画
  • Re-import into your 3D package to verify your animated model has exported as you expected 
    重新导入进你的3D包来更验证你的动画模型
  • Export animations without meshes 
    导出不带网格的动画

Further details 更多细节

The following pages cover the stages of preparing and importing animation assets in greater depth

下面的页面涵盖了更深入的准备和导入动画资源的步骤:

(back to Mecanim introduction)

页面最后更新:2012-11-01





准备你自己的角色 Preparing your own character

Date:2013-05-25 02:39

There are three main steps in creating an animated humanoid character from scratch: modellingrigging and skinning.

从草图开始创建动画化的类人角色有三个主要步骤:建模,搭骨架,蒙皮

Modelling 建模

This is the process of creating your own humanoid mesh in a 3D modelling package - 3DSMax, Maya, Blender, etc. Although this is a whole subject in its own right, there are a few guidelines you can follow to ensure a model works well with animation in a Unity project.

这是在3D建模工具包-3DSMax,Maya,Blender,诸如此类来建立你自己的类人网格的过程。尽管这是一个属于它们(建模工具)自己的主题,这里有一些你可以遵循的指导原则来保证一个模型可以很好的在Unity的动画系统中使用。

  • Observe a sensible topology. The exact nature of a "sensible" structure for your mesh is rather subtle but generally, you should bear in mind how the vertices and triangles of the model will be distorted as it is animated. A poor topology will not allow the model to move without unsightly distortion of the mesh. A lot can be learned by studying existing 3D character meshes to see how the topology is arranged and why. 
    遵循合理的拓扑结构。一个“合理” 的网格结构的精确意义是非常微妙的,不过通常情况下,你应该牢记模型的顶点和三角面在动画化之后会怎样变形。一个不好的拓扑结构会让网格变形地非常难看。你可以从已有的3D角色网格学习很多拓扑结构是如何安排的以及这样安排的原因。
  • Be mindful of the scale of your mesh. Do a test import and compare the size of your imported model with a "meter cube" (the standard Unity cube primitive has a side length of one unit, so it can be taken as a 1m cube for most purposes). Check the units your 3D package is using and adjust the export settings so that the size of the model is in correct proportion to the cube. Unless you are careful, it is easy to create models without any notion of their scale and consequently end up with a set of objects that are disproportionate in size when they are imported into Unity. 
    注意网格的缩放比例。做一次导入测试,比较导入的模型和一个“米立方”(大多情况下是一个边长1米的Unity标准立方体元素)。检测你的3D建模工具包使用的单位并且调整导出设定使得模型的尺寸处在相对这个立方体合适的比例。你必须小心,很容易创建出没有任何标注的缩放比例的模型并且最终会造成一些导入进unity之后不成比例的物体。
  • Arrange the mesh so that the character's feet are standing on the local origin or "anchor point" of the model. Since a character typically walks upright on a floor, it is much easier to handle if its anchor point (ie, its transform position) is directly on that floor. 
    安放角色使得角色的脚站在坐标原点或者模型的“锚点”。角色通常是竖直地走在地面上,如果角色的锚点(也就是他的变换中心)在地面上会更容易控制。
  • Model in a T-pose if you can. This will help allow space to refine polygon detail where you need it (e.g. underarms). This will also make it easier to position your rig inside the mesh. 
    如果你会的话,使用T字姿态建模。这会对在三维空间中细化化多边形细节(比如,腋下)有帮助。这也会使得放置骨架到网格中更容易。
  • Clean up your model. Where possible, cap holes, weld verts and remove hidden faces, this will help with skinning, especially automated skinning processes. 
    清理你的模型。只要可能的话,覆盖孔洞,焊接顶点并且移除隐藏的面,这会对蒙皮有帮助,特别是自动蒙皮过程。

Skin Mesh - Modelled, textured and triangulated 
蒙皮网格-建模后,有纹理并且已三角化的模型

Rigging 搭骨架

This is the process of creating a skeleton of joints to control the movements of your model.

这是创建骨架上的关节来控制你的模型进行运动的过程。

3D packages provide a number of ways to create joints for your humanoid rig. These range from ready-made biped skeletons that you can scale to fit your mesh, right through to tools for individual bone creation and parenting to create your own bone structure. Although the details are outside the scope of Unity, here are some general guidelines:

3D建模工具包提供了各种方法为类人骨架创建关节。从从已经构建好的可以缩放后放入网格的两足动物骨架,到创建特别骨骼的工具还有父子化骨骼结构。尽管这方面的细节超出了unity的范围,这里还是有一些通用的准则:

  • Study existing humanoid skeletons hierarchies (eg, bipeds) and where possible use or mimic the bone structure. 
    学习已有的类人骨架体系(比如,两足动物)并且在可能的地方尽量模仿这样的骨骼架构
  • Make sure the hips are the parent bone for your skeleton hierarchy. 
    确保臀部是整个骨架的根节点
  • A minimum of fifteen bones are required in the skeleton. 
    在骨架中至少要有15个骨骼
  • The joint/bone hierachy should follow a natural structure for the character you are creating. Given that arms and legs come in pairs, you should use a consistent convention for naming them (eg, "arm_L" for the left arm, "arm_R" for the right arm, etc). Possible hierarchies include:
    角色的关节点/骨骼结构应该按照自然的结构建立。手臂和腿成对出现,你应该对骨骼使用一致的命名(比如“arm_L”命名左臂”“arm_R”命名右臂,诸如此类)。一个体系结构可能包含:
    • HIPS - spine - chest - shoulders - arm - forearm - hand 
      臀部-脊椎-胸部-肩膀-手臂-前臂-手
    • HIPS - spine - chest - neck - head 
      臀部-脊椎-胸部-脖子-头
    • HIPS - UpLeg - Leg - foot - toe - toe_end 
      臀部-大腿-小腿-脚-脚趾-脚趾尖

Biped Skeleton, positioned in T-pose 
两足动物骨架,放置成T字姿势

Skinning 蒙皮

This is the process of attaching the mesh to the skeleton

这是给骨架附加网格的过程

Skinning involves binding vertices in your mesh to bones, either directly (rigid bind) or with blended influence to a number of bones (soft bind). Different software packages use different methods, eg, assigning individual vertices and painting the weighting of influence per bone onto the mesh. The initial setup is typically automated, say by finding the nearest influence or using "heatmaps". Skinning usually requires a fair amount of work and testing with animations in order to ensure satisfactory results for the skin deformation. Some general guidelines for this process include:

蒙皮过程包括在你的网格中绑定顶点到骨骼,还有直接指定(硬绑定)或者混合多块骨骼的影响(软绑定)。不同的软件包使用不同的办法,比如,赋值给特别的顶点权重并且在网格上逐骨骼绘制影响到的顶点。最初的设定通常是自动化的,通过找最近的影响顶点或者使用“热度图”。蒙皮通常需要大量的工作并且使用动画测试来确保获得满意的皮肤变形效果。这个过程的一些指导准则如下:

  • Using an automated process initially to set up some of the skinning (see relevant tutorials on 3DMax, Maya, etc.) 
    最开始使用自动蒙皮过程来设定皮肤(查看3DS Maya之类的相关教程)
  • Creating a simple animation for your rig or importing some animation data to act as a test for the skinning. This should give you a quick way to evaluate whether or not the skinning looks good in motion. 
    为你的骨骼创建一个简单的动画或者导入一些动画数据作为一个蒙皮结果的测试。这给你一个快捷的办法来评估你的蒙皮是否在运动中看起来很好。
  • Incrementally editing and refining your skinning solution. 
    增量地编辑和细化你的蒙皮方案。
  • Sticking to a maximum of four influences when using a soft bind, since this is the maximum number that Unity will handle. If more than four influences affect part of the mesh then at least some information will be lost when playing the animation in Unity. 
    坚持在软绑定的时候每个顶点最多使用4个骨骼,这是Unity支持的数目上限。如果超过4个骨骼,那么在Unity播放骨骼动画时至少会有一些信息被丢失。

Interactive Skin Bind, one of many skinning methods 
众多蒙皮方法之一,交互式皮肤绑定。

(back to AssetPreparationandImport)

(back to Mecanim introduction)

页面最后更新:2012-11-01






导入动画 Importing Animations

Date:2013-05-25 02:43

Before a character model can be used, it must first be imported into your project. Unity can import native Maya (.mb or .ma) and Cinema 4D (.c4d) files, and also generic FBX files which can be exported from most animation packages (see this page for further details on exporting). To import an animation, simply drag the model file to the Assets folder of your project. When you select the file in the Project View you can edit the Import Settings in the inspector:-

在角色模型可用之前,它必须先被导入进你的项目。Unity可以导入原生Maya(.mb或者.ma)和Cinema4D(.c4d)文件,并且也广泛地支持大多建模工具包都可以导出的FBX文件(查看此页了解更多导出的细节)。要导入动画,只需简单地拖放模型文件到你项目中的Assets文件夹。当你在项目视图中选择文件的时候你可以在inspector中编辑它的导入设定。


The Import Settings Dialog for a mesh
网格的导入设定对话框

See the FBX importer page for a full description of the available import options.

查看FBX导入器页面了解全部的可用导入选项描述。

Splitting animations 分割动画

(back to Mecanim introduction)

页面最后更新:2012-11-01




分割动画 Splitting Animations

Date:2013-05-25 03:43

An animated character typically has a number of different movements that are activated in the game in different circumstances. These movements are called Animation Clips. For example, we might have separate animation clips for walking, running, jumping, throwing, dying, etc. Depending on the way the model was animated, these separate movements might be imported as distinct animation clips or as one single clip where each movement simply follows on from the previous one. In cases where there is only a single clip, the clip must be split into its component animation clips within Unity, which will involve some extra steps in your workflow.

一个动画化的角色典型地会在游戏中不同的情况有多个不同的动作。这些动作称为动画剪辑。比如,我们可能针对走路,跑步,跳跃,投掷,死亡之类有不同的动画剪辑。依赖于模型被动画化的方法,这些分离的动作可能作为不同的动画剪辑导入,或者当每个动作是简单的之前动作的延续时作为单个动画剪辑导入。在只有一个动画剪辑的情况下,这个剪辑必须用Unity分割成它的子组件剪辑,这会在你的工作流中引入一些其他步骤。

Working with models that have pre-split animations
使用含有预先分割的动画的模型工作

The simplest types of models to work with are those that contain pre-split animations. If you have an animation like that, the Animations tab in the Animation Importer Inspector will look like this:

使用起来最简单的模型类型是那些包含了预分割动画的。如果你有一个像那样的动画,动画导入器的Inspector中动画标签页会看起来像这样:

You will see a list available clips which you can preview by pressing Play in the Preview Window (lower down in the inspector). The frame ranges of the clips can be edited, if needed.

你将会看到一列可以在播放窗口中(inspector右下角)点击播放来预览的的动画剪辑。如果需要,帧范围可以被修改。

Working with models that have unsplit animations
使用含有未分割动画的模型工作

For models where the clips are supplied as one continuous animation, the Animation tab in the Animation Importer Inspector will look like this:

对于那些剪辑作为一个连续动画提供的模型,动画导入器Inspector中的动画标签页会看起来像这样:

In cases like this, you can define the frame ranges that correspond to each of the separate animation sequences (walking, jumping, etc). You can create a new animation clip by pressing (+) and selecting the range of frames that are included in it.

像这样4合1的情况,你可以定义符合分离动画序列(走,跳之类)的帧范围。你可以通过按下+创建一个新的动画剪辑并且选择包含动画的帧范围。

For example:

例如:

  • walk animation during frames 1 - 33 
    走路动画在帧1-33
  • run animation during frames 41 - 57 
    跑动画在帧41-57
  • kick animation during frames 81 - 97 
    踢动画在帧81-97


The Import Settings Options for Animation 动画的导入设定

In the Import Settings, the Split Animations table is where you tell Unity which frames in your asset file make up which Animation Clip. The names you specify here are used to activate them in your game.

在导入设定中,分割动画表是你告诉unity哪些在你资源文件中的帧构成一个动画剪辑的地方。你在这里指定的名字将会在你的游戏中用来激活它们。

For further information about the animation inspector, see the Animation Clip component reference page.

更多关于动画inspector的内容,参看动画组件参考页

Adding animations to models that do not contain them
增加模型不包含的动画

You can add animation clips to an Animation component even for models without muscle definitions (ie, non-Mecanim). You need to specify the default animation clip in the Animation property, and the available animation clips in the Animations property. The animation clips you add to such a non-Mecanim model should also be setup in a non-Mecanim way (ie, the Muscle Definition property should be set to None)

即使对那些没有肌肉定义的模型(也就是非Mecanim),你也可以增加动画剪辑到动画组件中。你需要在动画属性中指定默认的动画剪辑,并且在Animation属性中指定可用的动画剪辑。你在这个非Mecanim模型中指定的动画也需要使用非Mecanim的方式(也就是说,肌肉定义属性应该被设置为None)。

For models that have muscle definitions (Mecanim), the process is different:-

对于含有肌肉定义的模型(Mecanim),流程是不一样的:

  • Create a New Animator Controller 
    创建一个新的动画控制器
  • Open the Animator Controller Window 
    打开动画控制器窗口窗口
  • Drag the desired animation clip into the Animator Controller Window 
    拖放想要的动画剪辑到动画控制器窗口
  • Drag the model asset into the Hierarchy. 
    拖放模型资源到层级视图
  • Add the animator controller to the Animator component of the asset. 
    增加动画控制器资源到资源的动画组件

Importing Animations using multiple model files
使用多个模型文件导入动画

Another way to import animations is to follow a naming scheme that Unity allows for the animation files. You create separate model files and name them with the convention 'modelName@animationName.fbx'. For example, for a model called "goober", you could import separate idle, walk, jump and walljump animations using files named "goober@idle.fbx", "goober@walk.fbx", "goober@jump.fbx" and "goober@walljump.fbx". Only the animation data from these files will be used, even if the original files are exported with mesh data.

另外一种导入动画的方法是使用一个Unity允许的针对动画文件的命名方式。你创建不同的模型文件并且使用“模型名@动画名.fbx”的命名约定。比如,对一个叫“goober”的模型,你可以分别导入空闲,走路,跳跃和踢墙跳跃动画使用命名为“goober@idle.fbx”,“goober@walk.fbx”,“goober@jump.fbx”和“goober@walljump.fbx”的文件。这些文件中只有动画数据会被使用,即使原有文件是同网格数据一起导出的。

An example of four animation files for an animated character (note that the .fbx suffix is not shown within Unity)
一个用4个动画文件的单个角色的例子(注意.fbx后缀在Unity中没有显示。

Unity automatically imports all four files and collects all animations to the file without the @ sign in. In the example above, the goober.mb file will be set up to reference idle, jump, walk and wallJump automatically.

Unity自动导入所有4个文件并且收集所有的动画到没有@标记的文件中。在上面的例子中,goober.mb文件将会自动建立到空闲,跳跃,走路和踢墙跳的引用。

For FBX files, simply export a model file with no animation ticked (eg, goober.fbx) and the 4 clips as goober@animname.fbx by exporting the desired keyframes for each (enable animation in the FBX dialog).

对于FBX文件,简单的导入一个没有动画的模型文件(也就是,goober.fbx)和4个命名为goober@动画名.fbx的剪辑,为每个文件导出想要的帧(在FBX对话框中选择)。

(back to Mecanim introduction)

页面最后更新:2013-01-15








  • 1
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Unity3D中,骨骼重定向(Bone Retargeting)是一种技术,用于将一个角色的骨骼动画应用到另一个角色的不同骨骼结构上。这在游戏开发中非常有用,因为它可以使开发人员重复使用现有的动画资源,并将其应用到不同的角色模型上。 Unity3D提供了一些工具和方法来实现骨骼重定向: 1. Avatar Mask:Avatar Mask是一个定义了动画应用范围的蒙版。可以在Animator组件上创建Avatar Mask,并使用它来控制哪些骨骼需要应用动画,以及每个骨骼的权重。通过编辑Avatar Mask,可以精确地控制动画在目标角色上的应用程度。 2. Humanoid Retargeting:Unity3D中的Humanoid角色类型具有统一的骨骼结构和命名约定。当目标角色采用Humanoid角色类型时,可以使用Humanoid Retargeting功能将源角色的动画应用到目标角色上。这个功能会自动匹配和映射对应的骨骼。 3. 动画曲线编辑器:Unity3D提供了一个强大的动画曲线编辑器,可以对动画曲线进行编辑和调整。这个工具可以用来调整和修正动画在不同骨骼结构上的表现,以使其看起来更加自然和准确。 需要注意的是,骨骼重定向并不是一个完全自动化的过程。它可能需要一些手动调整和微调,以确保动画在目标角色上的效果符合预期。此外,骨骼结构和比例的差异也可能导致一些挑战,可能需要进行额外的处理。 总的来说,骨骼重定向是一个有用的技术,可以帮助开发人员在Unity3D中将现有的动画资源应用到不同的角色模型上。通过合理使用Avatar Mask、Humanoid Retargeting和动画曲线编辑器等工具,可以实现高质量和高效率的骨骼重定向。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值