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

下载本文档

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

文档简介

1、-作者xxxx-日期xxxxUnity3DAnimation外文文献【精品文档】Untiy3D AnimationUnitys 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 animati

2、ons, and more.Read this section to find out how to import and work with imported animation and how to animate objects, colours, and any other parameters within Unity itself.Animation System OverviewUnity has a rich and sophisticated animation system (sometimes referred to as Mecanim). It provides:Ea

3、sy workflow and setup of animations for all elements of Unity including objects, characters, and properties.Support for importedanimation clipsand animation created within UnityHumanoid animationretargeting- the ability to apply animations from one character model onto another.Simplified workflow fo

4、r 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

5、 with a visual programming tool.Animating different body parts with different logic.Layering and masking featuresAnimation workflowUnitys animation system is based on the concept ofAnimation Clips, which contain information about how certain objects should change their position, rotation, or other p

6、roperties over time. 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

7、 flowchart-like system called an Animator Controller. The Animator Controller acts as a “State Machine” 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 exam

8、ple to control a powerup 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 characters actions, and might blend between multiple clips at the same time to provide a flui

9、d motion as the player moves around the scene.Unitys Animation system also has numerous special features for handling humanoid characters which give you the ability toretargethumanoid animation from any source (Eg. motion capture, the asset store, or some other third-party animation library) to your

10、 own character model, as well as adjustingmuscle definitions. These special features are enabled by UnitysAvatarsystem, where humanoid characters are mapped to a common internal format.Each of these pieces - theAnimation Clips, theAnimator Controller, and theAvatar, are brought together on a GameObj

11、ect via 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 theAnimation Clipsit uses.The above diagram shows the following:Animation clips are imported from an exte

12、rnal source or created within Unity. In this example, they are imported motion captured humanoid animations.The animation clips are placed and arranged in an Animator Controller. This shows a view of an Animator Controller in the Animator window. The States (which may represent animations or nested

13、sub-state machines) appear as nodes connected by lines. This Animator Controller exists as an asset in the Project window.The rigged character model (in this case, the astronaut “Astrella”) has a specific configuration of bones which are mapped to Unitys commonAvatarformat. This mapping is stored as

14、 an Avatar asset as part of the imported character model, and also appears in the Project window as shown.When animating the character model, it has an Animator component attached. In the Inspector view shown above, you can see theAnimator Componentwhich has both theAnimator Controllerand theAvatara

15、ssigned. The animator uses these together to animate the model. The Avatar reference is only necessary when animating a humanoid character. For other types of animation, only an Animator Controller is required.Unitys animation system (Known as “Mecanim”) comes with a lot of concepts and terminology.

16、 If at any point, you need to find out what something means, go to ourAnimation Glossary.Legacy animation systemWhile Mecanim is recommended for use in most situations, Unity has retained its legacy animation system which existed before Unity 4. You may need to use when working with older content cr

17、eated before Unity 4. For information on the Legacy animation system, seethis sectionUnity intends to phase out the Legacy animation system over time for all cases by merging the workflows into Mecanim.Animation ClipsAnimation Clips are one of the core elements to Unitys animation system. Unity supp

18、orts importing animation from external sources, and offers the ability to create animation clips from scratch within the editor using the Animation window.Animation from External SourcesAnimation clips imported from external sources could include:Humanoid animations captured at a motion capture stud

19、ioAnimations 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 Unitys asset store)Multiple clips cut and sliced from a single imported timeline.Animation Created and Edited Within UnityUnitys Animation Window al

20、so allows you to create and edit animation clips. These clips can animate:The position, rotation and scale of GameObjectsComponent properties such as material colour, the intensity of a light, the volume of a soundProperties within your own scripts including float, int, Vector and boolean variablesT

21、he timing of calling functions within your own scriptsAnimation from External SourcesOverview of Imported AnimationAnimation from external sources is imported into Unity in the same way as regular 3D files. These files, whether theyre generic FBX files or native formats from 3D software such as Maya

22、, 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 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 exi

23、st 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 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 situati

24、ons, 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 humanoid characters might all use the same walk and run animations. In these situations, its common to have a simple placeholder model in your anima

25、tion 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 animation data.When importing multiple animations, the animations can each exist as separate files within your project folder, or you can extract multip

26、le 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 want to do this if your file contains multiple separate animations arranged on a single timeline. For example, a long motion captured timeline mi

27、ght 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 the rest. Unity provides animation cutting tools to achieve this when you import all animations in one timeline by allowing you to select the frame

28、range for each clip.Importing Animation FilesBefore any animation can be used in Unity, it must first be imported into your project. Unity can import native 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 packag

29、es (seethis pagefor further details on exporting). To import an animation, simply drag the file to theAssetsfolder of your project. When you select the file in theProject Viewyou can edit theImport Settingsin the inspector.Working with humanoid animationsThe Mecanim Animation System is particularly

30、well suited for working with animations for humanoid skeletons. Since humanoid skeletons are used extensively in games, Unity provides a specialized workflow, and an extended tool set for humanoid animations.Because of the similarity in bone structure, it is possible to map animations from one human

31、oid skeleton to another, allowingretargetingandinverse 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 c

32、ontrol 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 anAvatar. The pages in this section explain how to

33、 create an Avatar for your model.Creating the AvatarAfter a model file (FBX, COLLADA, etc.) is imported, you can specify what kind of rig it is in theRigtab of theModel Importer options.Humanoid animationsFor a Humanoid rig, selectHumanoidand clickApply. Mecanim will attempt to match up your existin

34、g bone structure to the Avatar bone structure. In many cases, it can do this automatically by analysing the connections between bones in the rig.If the match has succeeded, you will see a check mark next to theConfiguremenuAlso, in the case of a successful match, an Avatar sub-asset is added to the

35、model asset, which you will be able to see in the project view hierarchy.Avatar added as a sub-assetSelecting the avatar sub-asset will bring up the inspector. You can then configure the avatar.The inspector for an Avatar assetIf Mecanim was unable to create the Avatar, you will see a cross next to

36、theConfigurebutton, and no Avatar sub-asset will be added. When this happens, you need toconfigure the avatar manually.Non-humanoid animationsTwo options for non-humanoid animation are provided:GenericandLegacy. Generic animations are imported using the Mecanim system but dont take advantage of the

37、extra features available for humanoid animations. Legacy animations use 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 dont want to update fully) but they are sel

38、dom needed for new projects. Seethis sectionof the manual for further details on legacy animations.Configuring the AvatarSince theAvataris such an important aspect of the Mecanim system, it is important that it is configured properly for your model. So, whether theautomatic Avatar creationfails or s

39、ucceeds, you need to go into theConfigure Avatarmode to ensure your Avatar is valid and properly set up. It is important that your characters bone structure matches Mecanims predefined bone structureandthat the model is in T-pose.If the automatic Avatar creation fails, you will see a cross next to t

40、heConfigurebutton.If it succeeds, you will see a check/tick mark: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.When you go to theConfigure menu, the editor will

41、ask you to save your scene. The reason for this is that inConfiguremode, the Scene View is used to display bone, muscle and animation information for the selected model alone, without displaying the rest of the scene.Once you have saved the scene, you will see a newAvatar Configurationinspector, wit

42、h a bone mapping.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 chance

43、s 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).If the model does NOT yield a valid match, you can manually follow a similar process to the one used internally by Mecanim:-Sample Bind-p

44、ose(try to get the model closer to the pose with which it was modelled, a sensible initial pose)Automap(create a bone-mapping from an initial pose)Enforce T-pose(force the model closer to T-pose, which is the default pose used by Mecanim animations)If the auto-mapping (Mapping-Automap) fails complet

45、ely or partially, you can assign bones by either draging them from theSceneor from theHierarchy. If Mecanim thinks a bone fits, it will show up as green in theAvatar Inspector, otherwise it shows up in red.Finally, if the bone assignment is correct, but the character is not in the correctpose, you w

46、ill see the message “Character not in T-Pose”. You can try to fix that withEnforce T-Poseor rotate the remaining bones into T-pose.Avatar Body MasksSometimes it is useful to restrict an animation to specific body parts. For example, an walking animation might involve the character swaying his arms b

47、ut if he picks up a gun, he should hold it in front of him. You can use anAvatar Body Maskto specify which parts of a character an animation should be restricted to - seethis pagepage for further details.Untiy3D 动画系统统一的动画功能包括Retargetable动画,在运行时动画完全控制重量,从内部事件调用动画播放,复杂的状态机结构和转换,混合形状的面部动画等等。阅读本节来找出如何导入

48、和使用进口动画和动画对象,如何团结内部颜色和任何其他参数。动画系统概述统一一个丰富而复杂的动画系统(有时称为“Mecanim”)。 它提供了:简单工作流和设置所有元素的统一,包括对象的动画人物,和属性。支持导入动画短片人形动画重定向从一个角色模型能够应用到另一个角色模型。简化工作流程调整动画剪辑。方便预览动画剪辑,转换和它们之间的相互作用。 这让动画师工作更独立于程序员,原型和预览动画游戏代码连接在前。管理间复杂的交互动画可视化编程工具。动画不同的身体部位和不同的逻辑。分层和掩蔽特性动画工作流程动画系统是基于统一的概念动画短片包含关于特定对象信息应该改变他们的位置,旋转,或其他属性。 每个片段

49、可以被认为是一个线性记录。 动画剪辑从外部来源是由艺术家和动画师等第三方工具Max或玛雅,或来自动作捕捉工作室或其他来源完成。动画剪辑然后组织成一个结构化流程图一样的动画叫系统控制器。 动画控制器作为一个“状态机”跟踪剪辑现在应该改变或混合在一起。一个非常简单的动画控制器可能只包含一个或两个片段,例如控制powerup旋转和跳跃,或有生命的一扇门打开和关闭在正确的时间。 更先进的动画控制器可能包含几十个人形动画的主要人物的行动,和可能之间的混合多个剪辑同时提供流体运动的球员围绕现场。统一的动画系统也有许多特色处理人形角色给你的能力gdp8 %从任何来源(如人形动画。 动作捕捉,资产存储或其他第

50、三方动画库)自己的角色模型,以及调整肌肉的定义。 这些特点使统一的Avatar系统,人形角色被映射到一个通用的内部格式。这些产品- - -动画短片,动画控制器,Avatar GameObject通过,都聚集在一起动画组件。 此组件有一个引用一个动画控制器,如果需要Avatar这个模型。 反过来,动画控制器包含引用动画短片它使用。上面的图显示如下:动画短片中从外部源进口或创建团结。 在这个例子中,他们是进口运动捕获的人形动画。动画剪辑放置和安排在一个动画师控制器。 这显示了一个动画师的视图控制器在动画窗口中。 (这可能代表动画或嵌套的子状态机),由线连接节点。 这个动画控制器存在作为一种资产在项

51、目窗口。操纵角色模型(在这种情况下,宇航员“Astrella”)有一个特定的配置映射到统一的共同的骨头Avatar格式。 这种映射是存储为一个Avatar资产作为导入的角色模型的一部分,也出现在项目窗口如图所示。当动画角色模型,它有一个动画师组件连接。 在Inspector视图所示,您可以看到动画组件这既有动画控制器和Avatar分配。 动画师使用这些动画模型。 Avatar的引用只在动画时需要一个人形的性格。 对于其他类型的动画,只需要一个动画控制器。统一的动画系统(称为“Mecanim”)提供了大量的概念和术语。 如果在任何时候,你需要去我们的动画术语表找出一些手段。传统动画系统虽然Mec

52、anim在大多数情况下,推荐使用统一保留其传统动画系统之前统一。 您可能需要使用在处理之前创建的旧内容统一。 传统动画系统的信息,请参阅本节统一打算淘汰遗留动画系统随着时间的推移,在所有情况下通过合并Mecanim工作流。动画短片动画短片是一个统一的动画系统的核心元素。 从外部来源的统一支持导入动画,并提供从头创建动画剪辑的能力在编辑器中使用动画窗口。动画从外部来源动画剪辑从外部进口来源可能包括:仿人动作捕捉工作室动画了动画艺术家从头开始创建的外部3 d应用程序(如3 ds Max或玛雅)动画组从第三方库(如从统一的资产存储)多个片段剪切和切片从单一进口时间表。动画中创建和编辑统一统一的动画窗

53、口还允许您创建和编辑动画剪辑。 这些片段可以动画:GameObjects的位置,旋转和尺度组件属性,如材料颜色、光线的强度,体积的声音在自己的脚本包括浮动属性,int,向量和布尔变量的时间在自己的脚本调用函数动画从外部来源进口动画的概述动画从外部来源导入相同的方式定期统一的3 d文件。 这些文件,他们是否通用的FBX文件或本地格式从玛雅等三维软件,电影4 d,3 d Studio Max,可以包含动画数据的形式线性记录文件内的对象的运动。在某些情况下动画的对象(例如,一个角色)和动画,它可以出现在同一文件中。 在其他情况下,动画可能存在于一个单独的文件到模型动画。可能是动画是特定于一个特定的模

54、型,而不能被重用在其他模型。 举个例子,一个巨大的章鱼end-boss游戏中可能有一个独特的四肢和骨头,安排自己的动画。在其他情况下,在你的场景也许你有一个动画被用在各种不同的模型。 例如,许多不同的人形角色可能都使用相同的走和跑动画。 在这些情况下,通常有一个简单的占位符模型动画文件预览的目的。 或者,可以使用动画文件,即使他们没有几何,就动画数据。当导入多个动画,动画可以项目文件夹中的每个作为单独的文件存在,或者你可以从单个FBX文件中提取多个动画剪辑从运动如果导出为建筑商或插件/脚本玛雅,马克斯或其他3 d包。 你可能会想这样做如果你的文件包含多个单独的动画安排在一个时间轴。 例如,长时间运动捕获的时间表可能包含几个不同的动画动作,跳,你可能想要使用的某些部分作为单独的片段和丢弃。 统一提供动画切割工具来实现这一当你导入所有在一个时间轴动画通过允许您选择框架为每个剪辑范围。进口动画文件在团结可以使用任何动画之前,它必须首先导入到您的项目。 团结可以导入本地玛雅(。 mb或.ma),3 d Studio Max(.max)和电影4 d(.c4d)文件,以及通用的FBX

温馨提示

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

评论

0/150

提交评论