1、Unity3DAnimation外文文献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 animations, and more.Read t
2、his 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:Easy workflow and setu
3、p 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 for aligning animation
4、 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 plex interactions between animations with a visual programm
5、ing 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 properties over time. Ea
6、ch 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 e from motion capture studios or other sources.Animation Clips are then organised into a structured flowchart-like system cal
7、led 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 example to control a powerup s
8、pinning 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 fluid motion as the player mov
9、es 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 own character model, as w
10、ell as adjustingmuscle definitions. These special features are enabled by UnitysAvatarsystem, where humanoid characters are mapped to a mon internal format.Each of these pieces - theAnimation Clips, theAnimator Controller, and theAvatar, are brought together on a GameObject via theAnimator ponent. T
11、his ponent 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 external source or created within Unity
12、. 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 sub-state machines) appear as nodes
13、 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 monAvatarformat. This mapping is stored as an Avatar asset as part of the import
14、ed character model, and also appears in the Project window as shown.When animating the character model, it has an Animator ponent attached. In the Inspector view shown above, you can see theAnimator ponentwhich has both theAnimator Controllerand theAvatarassigned. The animator uses these together to
15、 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”) es with a lot of concepts and terminology. If at any point, you need to find out what som
16、ething means, go to ourAnimation Glossary.Legacy animation systemWhile Mecanim is remended 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 created before Unity 4. For information on the Legac
17、y 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 supports importing animation from external sources, an
18、d 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 studioAnimations created from scratch by an artist in
19、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 also allows you to create and edit animation clips.
20、These clips can animate:The position, rotation and scale of GameObjectsponent 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 variablesThe timing of calling functions within your own script
21、sAnimation 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, Cinema 4D, 3D Studio Max, can contain animation dat
22、a 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 exist in a separate file to the model to be animated.It
23、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 situations, it may be that you have a library of animations
24、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 mon to have a simple placeholder model in your animation files for the purposes of previewing them. Alternat
25、ively, 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 multiple animation clips from a single FBX file if exported as
26、 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 might contain the animation for a few different jump motio
27、ns, 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 range for each clip.Importing Animation FilesBefore any
28、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 packages (seethis pagefor further details on exporting). To im
29、port 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 well suited for working with animations for humanoid ske
30、letons. 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 humanoid skeleton to another, allowingretargetingandinverse k
31、inematics. 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 a
32、nimation 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 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 matc
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1