Unity3DAnimation外文文献知识讲解_第1页
Unity3DAnimation外文文献知识讲解_第2页
已阅读5页,还剩19页未读 继续免费阅读

下载本文档

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

文档简介

1、Un i t y 3DAn i mat i on外文文献Untiy3D AnimationUnitys Animation features include Retargetable animations, Full control ofanimation weights at runtime, Event calling from within the animation playback,Sophisticated State Machine hierarchies and transitions, Blend shapes for facialanimations, and more.R

2、ead this section to find out how to import and work with imported animationand how to animate objects, colours, and any other parameters within Unity itself.Animation System OverviewUnity has a rich and sophisticated animation system (sometimes referred toasMecanim). It provides:Easy workflow and se

3、tup of animations for all elements of Unity includingobjects, characters, and properties.Support for imported animation clips and animation created within UnityHumanoid animation retargeting - the ability to apply animations from onecharacter model onto another.Simplified workflow for aligning anima

4、tion clips.Convenient preview of animation clips, transitions and interactions betweenthem. 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 visualprog

5、ramming tool.Animating different body parts with different logic.Layering and masking featuresAnimation workflowUnitys animation system is based on the conceptAonfimation Clips, whichcontain information about how certain objects should change their position,rotation, or other properties over time. E

6、ach clip can be thought of as a single linearrecording. Animation clips from external sources are created by artists oranimators with 3rd party tools such as Max or Maya, or come from motion capturestudios or other sources.Animation Clips are then organised into a structured flowchartlike systemcall

7、ed an Animator Controller. The Animator Controller acts as a Sta“te Machine”which keeps track of which clip should currently be playing, and when theanimations should change or blend together.A very simple Animator Controller might only contain one or two clips, forexample to control a powerup spinn

8、ing and bouncing, or to animate a door openingand closing at the correct time. A more advanced Animator Controller mightcontain dozens of humanoid animations for all the main characters actions, andmight blendbetween multiple clips at the same time to provide a fluid motion as the playermoves around

9、 the scene.Unitys Animation system also has numerous special features for handlinghumanoid characters which give you the ability to retargethumanoid animationfrom any source (Eg. motion capture, the asset store, or some other third-partyanimation library) to your own character model, as well as adju

10、sting muscledefinitions. These special features are enabled by Unity Avatar systesm, wherehumanoid characters are mapped to a common internal format.Each of these pieces - the Animation Clips, the Animator Controller, and theAvatar, are brought together on a GameObject via theAnimator Component. Thi

11、scomponent has a reference to an Animator Controller, and (if required) the Avatarfor this model. TheAni mator Con troller, i n turn, contains the referen ces to the Animation Clips ituses.The above diagram shows the follow ing:Ani matio n clips are imported from an exter nal source or created withi

12、n Unity .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 Ani mator win dow. The States(which may represe nt ani matio ns or n ested sub-state mach i

13、n es) appear as nodes conn ected by lin es. This Animator Controller exists as an asset in the Projectwindow.The rigged character model (i n this case, the astro naut“Astrella”) has a specific configuration of bones which are mapped to UnityscomnAvatar format. This mapping is stored as an Avatar ass

14、et as part of theimported character model, and also appears in the Project wi ndow as show n.Whe n ani mati ng the character model, it has an An imator comp onentattached. In the In spector view show n above, you can see the Ani mator Component which has both the An imator Con troller and the Avatar

15、 assig ned. The animator uses these together to an imate the model. The Avatar reference is only necessary whe n animating a humanoid character. For other types of animation,only an Animator Controller is required.Cnbr4lkraP (Mrt Hi如is!hAfMrnfbcrT fSAinniflFisrUnitys animation system (Known as“Mecan

16、im”h)acomes witlot of concepts and terminology. If at any point, you need to find out whatsomething means, go to our Animation Glossary.Legacy animation systemWhile Mecanim is recommended for use in most situations, Unity has retainedits legacy animation system which existed before Unity 4. You may

17、need to usewhen working with older content created before Unity 4. For information on theLegacy animation system, see this sectionUnity intends to phase out the Legacy animation system over time for allcases by merging the workflows into Mecanim.Animation ClipsAnimation Clips are one of the core ele

18、ments to Unitysanimation system. Unity supports importing animation from external sources, andoffers the ability to create animation clips from scratch within the editor using theAnimation window.Animation from External SourcesAnimation clips imported from external sources could include:Humanoid ani

19、mations captured at a motion capture studioAnimations 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 assetstore)Multiple clips cut and sliced from a single imported timeline.Animation Created and Edite

20、d Within UnityUnitys Animation Window also 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, thevolume of a soundProperties within your own scripts including flo

21、at, int, Vector and booleanvariablesThe timing of calling functions within your own scripts Animation from ExternalSourcesOverview of Imported AnimationAnimation from external sources is imported into Unity in the sameway as regular 3D files. These files, whether they FBX files or native formats fro

22、m3D software such as Maya, Cinema 4D, 3D Studio Max, can contain animationdata 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 theanimations to go with it can be present in the same file. In other cases,

23、 theanimations 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 bere-used on other models. For example, a giant octopus end-boss in your gamemight have a unique arrangement of limbs and bones, and its own set ofanimatio

24、ns.In other situations, it may be that you have a library of animations which are tobe used on various different models in your scene. For example, a number ofdifferent humanoid characters might all use the same walk and run animations. Inthese situations, its common to have a simple placeholder mod

25、el in youranimation files for the purposes of previewing them. Alternatively, it is possible touse animation files even if they have no geometry at all, just the animation data.When importing multiple animations, the animations can each exist asre generseparate files within your project folder, or y

26、ou can extract multiple animation clipsfrom 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 filecontains multiple separate animations arranged on a single timeline. For example,a long motion cap

27、tured timeline might contain the animation for a few different jumpmotions, and you may want to cut out certain sections of this to use as individualclips and discard the rest. Unity provides animation cutting tools to achieve thiswhen you import all animations in one timeline by allowing you to sel

28、ect the framerange for each clip.Importing Animation FilesBefore any animation can be used in Unity, it must first be imported into yourproject. Unity can import native Maya (.mb or .ma), 3D Studio Max (.max) andCinema 4D (.c4d) files, and also generic FBX files which can be exported frommost animat

29、ion packages (see this page for further details on exporting). To importan animation, simply drag the file to the Assets folder of your project. When youselect the file in the Project View you can edit the Import Settings in the inspector.Working with humanoid animationsThe Mecanim Animation System

30、is particularly well suited for working withanimations for humanoid skeletons. Since humanoid skeletons are usedextensively in games, Unity provides a specialized workflow, and an extended toolset for humanoid animations.Because of the similarity in bone structure, it is possible to map animationsfr

31、om one humanoid skeleton to another, allowingretargeting and inversekinematics. With rare exceptions, humanoid models can be expected to have thesame basic structure, representing the major articulate parts of the body, head andlimbs. The Mecanim system makes good use of this idea to simplify the ri

32、gging andcontrol of animations. A fundamental step in creating a animation is to set up amapping between the simplified humanoid bone structure understood by Mecanimand the actual bones present in the skeleton; in Mecanim terminology, thismapping is called an Avatar. The pages in this section explai

33、n how to create anAvatar for your model.Creating the AvatarAfter a model file (FBX, COLLADA, etc.) is imported, you can specify whatkind of rig it is in the Rig tab of the Model Importer options.Humanoid animationsFor a Humanoid rig, select Humanoid and click Apply. Mecanim will attempt tomatch up y

34、our 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.If the match has succeeded, you will see a check mark next to the ConfiguremenuAlso, i n the case of a successful match, an Avatar sub-asset is a

35、dded to themodel asset, which you will be able to see in the project view hierarchy.iE( (han& c hsr.ethari.bodY pi char.ethan.glasses f c h ar_ethan_ s kcltto n liii chr_e Lhan-body固chr_ethin_glasses Q Take OOI石EThdnAvdtdrAvatar added as a sub-assetSelect ing the avatar sub-asset will bring up t

36、he in spector. You can the n configure the avatar.The in spector for an Avatar assetIf Meca nim was un able to create the Avatar, you will see a cross n ext to theCon figure butt on, and no Avatar sub-asset will be added. When this happe ns,you n eed to con figure the avatar manu ally.Non-huma noid

37、ani mati onsTwo optio ns for non-huma noid ani mati on areprovided: Gen eric and Legacy. Gen eric ani mati ons are imported using theMecanim system but don t take advantage of the extrafeatures available for huma noid ani mati ons. Legacy ani mati onsuse the ani mati on system that was provided by U

38、n ity before Mecanim. There are some cases where it is still useful to work with legacyani mati ons (most no tably with legacy projects that you don updatefully) but they are seldom n eeded for new projects. See this sectionof the manual for further details on legacy animations.t waCon figuri ng the

39、 AvatarSince the Avatar is such an importa nt aspect of the Meca nimsystem, it is importa nt that it is con figured properly for your model.So, whether the automatic Avatar creati on fails or succeeds, you need to go into the Con figure Avatar mode to en sure your Avatar isvalid and properly set up.

40、 It is importa nt that your character structurematches Mecanims predefined bone standtuiret themodel is in T-pose.If the automatic Avatar creation fails, you will see a cross nextto the Con figure butt on.ModelRigAnimahan TypeAvatar I已finitionDpthntzf匸aneHuman口id匚realje Frunn岂If it succeeds, you wil

41、l see a check/tick mark:ModelRigAnimationiAnimatiDPTypMumancsidtAvatar DefinitionCreate fron Th注Muriel $V I CAnfigLH亡,Optimize Came Objects.Revert 11 ApplyHere, success simply means all of the required bones have bee n matchedbut for better results, you might want to match the opti onal bones as wel

42、l and getthe model into a proper T-pose.Whe n you go to the Con figure -me nu, the editor will ask youto save your sce ne. The reas on for this is that in Con figure mode, the Scene Viewis used to display bone, muscle and ani mati on in formati on for the selected modelalone, without displayi ng the

43、 rest of the sce ne.Do you want to save the chans you made in the scene Untitled?Your changes will be lost if yau don*t save themDont Save匚ancelSavev_ /X_z K_ XOnce you have saved the sce ne, you will see a new Avatar Configurationinspector, with a bone mapping.The in spector shows which of the bone

44、s are required and which are opti onal- the opti onal ones can have their moveme nts in terpolated automatically. ForMeca nim to produce a valid match, your skelet on n eeds to have at least therequired bones in place. In order to improve your chances for finding a match to theAvatar, n ame your bon

45、es in a way that reflects the body parts they represe nt(names like“LeftArm”,“RightForearm”are suitable here).If the model does NOT yield a valid match, you can manu ally follow a similarprocess to the one used internally by Mecanim:-Sample Bin d-pose (try to get the model closer to the pose with wh

46、ich it wasmodelled, a sensible initial pose)Automap (create a bon e-mapp ing from an in itial pose)En force T-pose (force the model closer to T-pose, which is the default poseused by Meca nim ani mati ons)Mapfjjng PtiM屯匚Apply noneSample Bifid-PosIf the auto-mapp ing (Mapp in g-Automap) fails complet

47、ely or partially, youcan 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 thecorrect pose

48、, you will see the message“Character not in TPose”. You can try to fix that withEnforce T-Pose or rotate the rema ining bonesinto T-pose.Avatar Body MasksSometimes it is useful to restrict an animation to specific body parts. Forexample, an walking animation might involve the character sway ing his

49、arms butif he picks up a gun, he should hold it in front of him. You can use an Avatar BodyMask to specify which parts of a character an ani mati on should be restricted to- see this page page for further details.Untiy3D动画系统统一的动画功能包括 Retargetable 动画 , 在运行时动画完全控 制重量 , 从内部事件调用动画播放 , 复杂的状态机结构和转换 , 混合形

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

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

52、。统一的动画系统也有许多特色处理人形角色给你的能力 gdp8 % 从任何来源(如人形动画。 动作捕捉, 资产存储或其他第三方动画库 )自己的角色模型,以及调整肌肉的定义。 这些特点使统一的 Avatar系统,人形角色被映射到一个通用的内部格式。这些产品 动画短片,动画控制器,Avatar GameObject 通过, 都聚集在一起动画组件。此组件有一个引用一个动画控制器,如果需要 Avatar 这个模型。 反过来,动画控制器包含引用动画短片它使 用。上面的图显示如下:动画短片中从外部源进口或创建团结。在这个例子中,他们是进口运动捕获的人形动画。动画剪辑放置和安排在一个动画师控制器。这显示了一个

53、动画师的视图控制器在动画窗口中。(这可能代表动画或嵌套的子状态 机),由线连接节点。 这个动画控制器存在作为一种资产在项目窗 口。操纵角色模型(在这种情况下,宇航员“ Astrella ”)有一个特定 的配置映射到统一的共同的骨头 Avatar 格式。 这种映射是存储为 一个 Avatar资产作为导入的角色模型的一部分,也出现在项目窗口 如图所示。当动画角色模型,它有一个动画师组件连接。在 Inspector 视图所示,您可以看到动画组件这既有动画控制器和Avatar 分配。动画师使用这些动画模型。 Avatar 的引用只在动画时需要一个人形的性格。对于其他类型的动画,只需要一个动画控制器。统

54、一的动画系统(称为“ Mecanim”)提供了大量的概念和术语。如xpp-ll P Harboraiii果在任何时候 , 你需要去我们的动画术语表找出一些手段。传统动画系统虽然 Mecanim 在大多数情况下,推荐使用统一保留其传统动画系 统之前统一。 您可能需要使用在处理之前创建的旧内容统一。 传 统动画系统的信息 , 请参阅本节统一打算淘汰遗留动画系统随着时间的推移 , 在所有情况下通过 合并Mecanim 工作流。动画短片动画短片是一个统一的动画系统的核心元素。 从外部来源的统 一支持导入动画 , 并提供从头创建动画剪辑的能力在编辑器中使用动 画窗口。动画从外部来源动画剪辑从外部进口来源

55、可能包括 : 仿人动作捕捉工作室动画了动画艺术家从头开始创建的外部 3 d 应用程序 ( 如 3 ds Max 或 玛雅)动画组从第三方库 (如从统一的资产存储 ) 多个片段剪切和切片从单一进口时间表。动画中创建和编辑统一统一的动画窗口还允许您创建和编辑动画剪辑。 这些片段可以 动画:GameObjects 的位置,旋转和尺度组件属性 , 如材料颜色、光线的强度 , 体积的声音 在自己的脚本包括浮动属性 ,int, 向量和布尔变量 的时间在自己的脚本调用函数动画从外部来源进口动画的概述动画从外部来源导入相同的方式定期统一的 3 d 文件。 这些文 件,他们是否通用的FBX 文件或本地格式从玛雅

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

温馨提示

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

评论

0/150

提交评论