Unity3DAnimation外文文献_第1页
Unity3DAnimation外文文献_第2页
Unity3DAnimation外文文献_第3页
Unity3DAnimation外文文献_第4页
Unity3DAnimation外文文献_第5页
已阅读5页,还剩16页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Untiy3D Animation Unity s Animation features include Retargetable animations, Full control of animation weights at runtime, Event calling from within the animation playback, Sophisticated State Machine hierarchies and transitions, Blend shapes for facial animations, and more. Read this section to fi

2、nd out how to import and work with imported animation and how to animate objects, colours, and any other parameters within Unity itself. Animation System Overview Unity has a rich and sophisticated animation system (sometimes referred to as Mecanim ). It provides: Easy workflow and setup of animatio

3、ns for all elements of Unity including objects, characters, and properties. Support for imported animation clips and animation created within Unity Humanoid animation retargeting - the ability to apply animations from one character model onto another. Simplified workflow for aligning animation clips

4、. 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 programmi

5、ng tool. Animating different body parts with different logic. Layering and masking features Animation workflow Unity s animation system is based on the conceptAonfimation Clips, which contain information about how certain objects should change their position, rotation, or other properties over time.

6、 Each clip can be thought of as a single linear recording. Animation clips from external sources are created by artists or animators with 3rd party tools such as Max or Maya, or come from motion capture studios or other sources. Animation Clips are then organised into a structured flowchart-like sys

7、tem called an Animator Controller. The Animator Controller acts as a State M“achine” which keeps track of which clip should currently be playing, and when the animations should change or blend together. A very simple Animator Controller might only contain one or two clips, for example to control a p

8、owerup spinning and bouncing, or to animate a door opening and closing at the correct time. A more advanced Animator Controller might contain dozens of humanoid animations for all the main character s actions, and might blend between multiple clips at the same time to provide a fluid motion as the p

9、layer moves around the scene. Unity s Animation system also has numerous special features for handling humanoid characters which give you the ability to retargethumanoid animation from any source (Eg. motion capture, the asset store, or some other third-party animation library) to your own character

10、 model, as well as adjusting muscle definitions. These special features are enabled by Unity Avatar systesm, where humanoid characters are mapped to a common internal format. Each of these pieces - the Animation Clips, the Animator Controller, and the Avatar, are brought together on a GameObject via

11、 theAnimator Component. This component has a reference to an Animator Controller, and (if required) the Avatar for this model. The Animator Controller, in turn, contains the references to the Animation Clips it uses. 1 .VAr* E) t JivXihii 1 A rtni4faJvi4iir 0 AppJ gTIWbg 1 The above diagram shows th

12、e follow ing: Ani matio n clips are imported from an exter nal source or created within Un ity .In this example, they are imported moti on captured huma noid ani mati ons. The ani mati on clips are placed and arran ged in an Ani mator Controller. This shows a view of an Animator Controller in the An

13、i mator win dow. The States (which may represe nt ani matio ns or n ested sub-state mach in es) appear as no des conn ected by lin es. This Animator Controller exists as an asset in the Project window. The rigged character model (in this case, thestronaut“ Astrella ” ) has a specific configuration o

14、f bones which are mapped to Unity com mon Avatar format. This mapp ing is stored as an Avatar asset as part of the imported character model, and also appears in the Project win dow as show n. Whe n ani mati ng the character model, it has an An imator comp onent attached. In the In spector view show

15、n above, you can see the Ani mator Comp onent which has both the An imator Con troller and the Avatar assig ned. The ani mator uses these together to an imate the model. The Avatar reference is only n ecessary whe n ani mati ng a huma noid character. For other types of ani mati on, only an Ani mator

16、 Con troller is required. Unity s animation system (Known as“ Mecanim” ) comes with a lot of concepts and terminology. If at any point, you need to find out what something means, go to our Animation Glossary. Legacy animation system While Mecanim is recommended for use in most situations, Unity has

17、retained its legacy animation system which existed before Unity 4. You may need to use when working with older content created before Unity 4. For information on the Legacy animation system, see this section Unity intends to phase out the Legacy animation system over time for all cases by merging th

18、e workflows into Mecanim. Animation Clips Animation Clips are one of the core elements to Unity s animation system. Unity supports importing animation from external sources, and offers the ability to create animation clips from scratch within the editor using the Animation window. Animation from Ext

19、ernal Sources Animation clips imported from external sources could include: Humanoid animations captured at a motion capture studio Animations created from scratch by an artist in an external 3D application (such as 3DS Max or Maya) Animation sets from 3rd- party libraries (eg, from Unity s asset st

20、ore) Multiple clips cut and sliced from a single imported timeline. Animation Created and Edited Within Unity Unity s Animation Window also allows you to create and edit animation clips. These clips can animate: The position, rotation and scale of GameObjects Component properties such as material co

21、lour, the intensity of a light, the volume of a sound Properties within your own scripts including float, int, Vector and boolean variables The timing of calling functions within your own scripts Animation from External Sources Overview of Imported Animation re gener Animation from external sources

22、is imported into Unity in the same way as regular 3D files. These files, whether they FBX files or native formats from 3D software such as Maya, Cinema 4D, 3D Studio Max, can contain animation data in the form of a linear recording of the movements of objects within the file. In some situations the

23、object to be animated (eg, a character) and the animations to go with it can be present in the same file. In other cases, the animations may exist in a separate file to the model to be animated. It may be that animations are specific to a particular model, and cannot be re-used on other models. For

24、example, a giant octopus end-boss in your game might have a unique arrangement of limbs and bones, and its own set of animations. In other situations, it may be that you have a library of animations which are to be used on various different models in your scene. For example, a number of different hu

25、manoid characters might all use the same walk and run animations. In these situations, it common to have a simple placeholder model in your animation files for the purposes of previewing them. Alternatively, it is possible to use animation files even if they have no geometry at all, just the animati

26、on data. When importing multiple animations, the animations can each exist as separate files within your project folder, or you can extract multiple animation clips from a single FBX file if exported as takes from Motion builder or with a plugin / script for Maya, Max or other 3D packages. You might

27、 want to do this if your file contains multiple separate animations arranged on a single timeline. For example, a long motion captured timeline might contain the animation for a few different jump motions, and you may want to cut out certain sections of this to use as individual clips and discard th

28、e rest. Unity provides animation cutting tools to achieve this when you import all animations in one timeline by allowing you to select the frame range for each clip. Importing Animation Files Before any animation can be used in Unity, it must first be imported into your project. Unity can import na

29、tive Maya (.mb or .ma), 3D Studio Max (.max) 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 file to the Assets folder of your project. When you select

30、the file in the Project View you can edit the Import Settings in the inspector. Working with humanoid animations The Mecanim Animation System is particularly well suited for working with animations for humanoid skeletons. Since humanoid skeletons are used extensively in games, Unity provides a speci

31、alized workflow, and an extended tool set for humanoid animations. Because of the similarity in bone structure, it is possible to map animations from one humanoid skeleton to another, allowingretargeting and inverse kinematics. With rare exceptions, humanoid models can be expected to have the same b

32、asic structure, represe nting the major articulate parts of the body, head and limbs. The Mecanim system makes good use of this idea to simplify the rigg ing and con trol of ani mati ons. A fun dame ntal step in creati ng a animation is to set up a mapping between the simplified humanoid bone struct

33、ure un derstood by Meca nim and the actual bones prese nt in the skeleton; in Mecanim terminology, this mapping is called an Avatar. The pages in this secti on expla in how to create an Avatar for your model. Creat ing the Avatar After a model file (FBX, COLLADA, etc.) is imported, you can specify w

34、hat kind of rig it is in the Rig tab of the Model Importer optio ns. Huma noid ani matio ns For a Huma noid rig, select Huma noid and click Apply. Meca nim will attempt to match up your exist ing bone structure to the Avatar bone structure .In many cases, it can do this automatically by an alys ing

35、the conn ecti ons betwee n bones in the rig. If the match has succeeded, you will see a check mark n ext to the Con figure menu Also, i n 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. Ethan 強 Automap) fai

36、ls completely or partially, you can assig n bones by either drag ing them from the Scene or from the Hierarchy. If Meca nim thi nks a bone fits, it will show up as green in the Avatar Inspector, otherwise it shows up in red. Fin ally, if the bone assig nment is correct, but the character is not in t

37、he correct pose, you will see the message“ Character not in T-Pose” . You can try to fix that withEnforce T-Pose or rotate the rema ining bones into T-pose. Avatar Body Masks Sometimes it is useful to restrict an animation to specific body parts. For example, an walking animation might involve the c

38、haracter swaying his arms but if he picks up a gun, he should hold it in front of him. You can use an Avatar Body Mask to specify which parts of a character an animation should be restricted to - see this page page for further details. Untiy3D 动画系统 统一的动画功能包括 Retargetable 动画 , 在运行时动画完全控 制重量 , 从内部事件调用

39、动画播放 , 复杂的状态机结构和转换 , 混合形 状的面部动画等等。 阅读本节来找出如何导入和使用进口动画和动画对象 , 如何团结 内部颜色和任何其他参数。 动画系统概述 统一一个丰富而复杂的动画系统 (有时称为“ Mecanim”) 。 它提 供了: 简单工作流和设置所有元素的统一 ,包括对象的动画人物 , 和属 性。 支持导入动画短片 人形动画重定向从一个角色模型能够应用到另一个角色模 型。 简化工作流程调整动画剪辑。 方便预览动画剪辑 , 转换和它们之间的相互作用。 这让动画师工 作更独立于程序员 , 原型和预览动画游戏代码连接在前。 管理间复杂的交互动画可视化编程工具。 动画不同的身体

40、部位和不同的逻辑。 分层和掩蔽特性 动画工作流程 动画系统是基于统一的概念动画短片包含关于特定对象信息应 该改变他们的位置 ,旋转, 或其他属性。 每个片段可以被认为是一个 线性记录。 动画剪辑从外部来源是由艺术家和动画师等第三方工具 Max或玛雅,或来自动作捕捉工作室或其他来源完成。 动画剪辑然后组织成一个结构化流程图一样的动画叫系统控制 器。动画控制器作为一个“状态机”跟踪剪辑现在应该改变或混合 在一起。 一个非常简单的动画控制器可能只包含一个或两个片段,例如控 制powerup旋转和跳跃,或有生命的一扇门打开和关闭在正确的时 间。更先进的动画控制器可能包含几十个人形动画的主要人物的行 动

41、,和可能之间的混合多个剪辑同时提供流体运动的球员围绕现场。 统一的动画系统也有许多特色处理人形角色给你的能力 gdp8 % 从任何来源(如人形动画。动作捕捉,资产存储或其他第三方动画库) 自己的角色模型,以及调整肌肉的定义。 这些特点使统一的Avatar 系统,人形角色被映射到一个通用的内部格式。 这些产品 动画短片,动画控制器,Avatar GameObject通过, 都聚集在一起动画组件。 此组件有一个引用一个动画控制器,如果需 要Avatar这个模型。反过来,动画控制器包含引用动画短片它使用。 I* 0虫阿 3-v fia u* trilsrcilBer a :A rtrwMi-Jv 0

42、 u fl 11 CvH打*#!闾I*!* i| 0 HljucTir 上面的图显示如下 动画短片中从外部源进口或创建团结。 在这个例子中,他们是进 口运动捕获的人形动画 动画剪辑放置和安排在一个动画师控制器。这显示了一个动画 师的视图控制器在动画窗口中。(这可能代表动画或嵌套的子状态 机),由线连接节点。这个动画控制器存在作为一种资产在项目窗口。 操纵角色模型 (在这种情况下 , 宇航员“ Astrella ”)有一个特定 的配置映射到统一的共同的骨头 Avatar 格式。 这种映射是存储为一 个 Avatar 资产作为导入的角色模型的一部分 , 也出现在项目窗口如 图所示。 当动画角色模型

43、 ,它有一个动画师组件连接。 在 Inspector 视图 所示, 您可以看到动画组件这既有动画控制器和 Avatar 分配。 动画 师使用这些动画模型。 Avatar 的引用只在动画时需要一个人形的性 格。 对于其他类型的动画 , 只需要一个动画控制器。 统一的动画系统(称为“ Mecanim”)提供了大量的概念和术语。 如果在任何时候 , 你需要去我们的动画术语表找出一些手段。 传统动画系统 虽然Mecanim在大多数情况下,推荐使用统一保留其传统动画系 统之前统一。 您可能需要使用在处理之前创建的旧内容统一。 传统 动画系统的信息 , 请参阅本节 统一打算淘汰遗留动画系统随着时间的推移

44、, 在所有情况下通过 合并Mecanim工作流。 动画短片 动画短片是一个统一的动画系统的核心元素。 从外部来源的统 一支持导入动画 , 并提供从头创建动画剪辑的能力在编辑器中使用动 画窗口。 动画从外部来源 动画剪辑从外部进口来源可能包括 : 仿人动作捕捉工作室动画了 动画艺术家从头开始创建的外部 3 d 应用程序 ( 如 3 ds Max 或玛 雅) 动画组从第三方库 (如从统一的资产存储 ) 多个片段剪切和切片从单一进口时间表。 动画中创建和编辑统一 统一的动画窗口还允许您创建和编辑动画剪辑。 这些片段可以 动画: GameObjects 的位置 , 旋转和尺度 组件属性 ,如材料颜色、

45、光线的强度 , 体积的声音 在自己的脚本包括浮动属性 ,int, 向量和布尔变量 的时间在自己的脚本调用函数 动画从外部来源 进口动画的概述 动画从外部来源导入相同的方式定期统一的 3 d 文件。 这些文 件,他们是否通用的FBX文件或本地格式从玛雅等三维软件,电影4 d,3 d Studio Max, 可以包含动画数据的形式线性记录文件内的对象 的运动。 在某些情况下动画的对象 (例如, 一个角色)和动画, 它可以出现 在同一文件中。 在其他情况下 , 动画可能存在于一个单独的文件到模 型动画。 可能是动画是特定于一个特定的模型 , 而不能被重用在其他模 型。 举个例子 , 一个巨大的章鱼

46、end-boss 游戏中可能有一个独特的 四肢和骨头 , 安排自己的动画。 在其他情况下 , 在你的场景也许你有一个动画被用在各种不同的 模型。例如, 许多不同的人形角色可能都使用相同的走和跑动画。在 这些情况下 , 通常有一个简单的占位符模型动画文件预览的目的。或 者, 可以使用动画文件 , 即使他们没有几何 , 就动画数据。 当导入多个动画 , 动画可以项目文件夹中的每个作为单独的文件 存在,或者你可以从单个FBX文件中提取多个动画剪辑从运动如果导 出为建筑商或插件 / 脚本玛雅 , 马克斯或其他 3 d 包。 你可能会想这 样做如果你的文件包含多个单独的动画安排在一个时间轴。 例如, 长

47、时间运动捕获的时间表可能包含几个不同的动画动作 , 跳, 你可能 想要使用的某些部分作为单独的片段和丢弃。 统一提供动画切割工 具来实现这一当你导入所有在一个时间轴动画通过允许您选择框架 为每个剪辑范围。 进口动画文件 在团结可以使用任何动画之前 , 它必须首先导入到您的项目。 团 结可以导入本地玛雅(。mb或.ma),3 d Studio Max(.max) 和电影4 d(.c4d)文件,以及通用的FBX文件,可以从大多数出口(见动画包这 个页面在出口详情 )。 导入一个动画 , 简单地将文件拖动到资产您的 项目的文件夹。 当您选择的文件项目视图您可以编辑导入设置检查 员 使用人形动画 Meca nim动画系统尤其适合使用动画人形骷

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论