Как открыть аниматор в юнити

The Animator Window

The Animator Window allows you to create, view and modify Animator Controller assets.

Как открыть аниматор в юнитиThe Animator Window showing a new empty Animator Controller asset

The Animator window has two main sections: the main gridded layout area, and the left-hand Layers & Parameters pane.

Как открыть аниматор в юнитиThe layout area of the Animator window

The main section with the dark grey grid is the layout area. You can use this area to create, arrange and connect states in your Animator Controller.

You can right-click on the grid to create a new state nodes. Use the middle mouse button or Alt/Option drag to pan the view around. Click to select state nodes to edit them, and click & drag state nodes to rearrange the layout of your state machine.

Как открыть аниматор в юнитиThe Parameters view, with two example parameters created.

The left-hand pane can be switched betwen Parameters view and Layers view. The parameters view allows you to create, view and edit the Animator Controller Parameters. These are variables you define that act as inputs into the state machine. To add a parameter, click the Plus icon and select the parameter type from the pop up menu. To delete a parameter, select the parameter in the lists and press the delete key.

Как открыть аниматор в юнитиThe Layers view

When the left-hand pane is switched to Layers view, you can create, view and edit layers within your Animator Controller. This allows you to have multiple layers of animation within a single animation controller working at the same time, each controlled by a separate state machine. A common use of this is to have a separate layer playing upper-body animations over a base layer that controls the general movement animations for a character.

To add a layer, click the plus icon. To delete a layer, select the layer and press the delete key.

Clicking the “eye” icon on or off will show or hide the Parameters & Layers side-pane, allowing you more room to see and edit your state machine.

Как открыть аниматор в юнитиThe hierarchical breadcrumb location

The “breadcrumb” hierarchical location within the current state machine. States can contain sub-states and trees and these structures can be nested repeatedly. When drilling down into sub states, the hierarchy of parent states and the current state being viewed is listed here. Clicking on the parent states allows you to jump back up to parent states or go straight back to the base layer of the state machine.

Enabling the lock icon will keep the Animator Window focused on the current state machine. When the lock icon is off, clicking a new animator asset or a Game Object with an animator component will switch the Animator Window to show that item’s state machine. Locking the window allows you to keep the Animator window showing the same state machine, regardless of which other assets or Game Objects are selected.

Источник

Animator component

If the GameObject is a humanoid character with an Avatar definition, the Avatar should also be assigned in this component, as seen here:

Как открыть аниматор в юнитиThe Animator component with a controller and avatar assigned.

This diagram shows how the various assets (Animation Clips, an Animator Controller, and an Avatar) are all brought together in an Animator Component on a GameObject:

Как открыть аниматор в юнитиDiagram showing how the various parts of the animation system connect together

Properties

Property:Function:
ControllerThe animator controller attached to this character.
Avatar An interface for retargeting animation from one rig to another. More info
See in Glossary
The Avatar for this character. (If the Animator is being used to animate a humanoid character)
Apply Root MotionSelect whether to control the character’s position and rotation from the animation itself or from script.
Update ModeThis allows you to select when the Animator updates, and which timescale it should use.
Normal The direction perpendicular to the surface of a mesh, represented by a Vector. Unity uses normals to determine object orientation and apply shading. More info
See in Glossary
The Animator is updated in-sync with the Update call, and the animator’s speed matches the current timescale. If the timescale is slowed, animations will slow down to match.
Animate PhysicsThe animator is updated in-sync with the FixedUpdate call (i.e. in lock-step with the physics system). You should use this mode if you are animating the motion of objects with physics interactions, such as characters which can push rigidbody A component that allows a GameObject to be affected by simulated gravity and other forces. More info
See in Glossary objects around.
Unscaled TimeThe animator is updated in-sync with the Update call, but the animator’s speed ignores the current timescale and animates at 100% speed regardless. This is useful for animating a GUI system at normal speed while using modified timescales for special effects or to pause gameplay.
Culling ModeCulling mode you can choose for animations.
Always AnimateAlways animate, don’t do culling even when offscreen.
Cull Update TransformsRetarget, IK and write of Transforms are disabled when renderers are not visible.
Cull CompletelyAnimation is completely disabled when renderers are not visible.

Animation curve information

The information box at the bottom of the Animator component provides you with a breakdown of the data being used in all the clips used by the Animator Controller.

An animation clip contains data in the form of “curves”, which represent how a value changes over time. These curves may describe the position or rotation of an object, the flex of a muscle in the humanoid animation An animation using humanoid skeletons. Humanoid models generally have the same basic structure, representing the major articulate parts of the body, head and limbs. This makes it easy to map animations from one humanoid skeleton to another, allowing retargeting and inverse kinematics. More info
See in Glossary system, or other animated values within the clip such as a changing material colour.

This table explains what each item of data represents:

If your animation clips are imported with “Anim Compression A method of storing data that reduces the amount of storage space it requires. See Texture Compression, Animation Compression, Audio Compression, Build Compression.
See in Glossary ” set to “Optimal” in the Animation import reference, Unity will use a heuristic algorithm to determine whether it is best to use the dense or stream method to store the data for each curve.

Источник

Аниматор и контроллер аниматора

Аватар определяет структуру скелета объекта, но контроллер аниматора ( Animator Controller ) также требуется для применения анимаций к скелету. Контроллер аниматора создается Unity и позволяет вам руководить набором анимаций для персонажа и переключаться между ними когда выполняется некоторое условие. Например вы можете переключиться от анимации походки к прыжку при нажатии клавиши пробела. Контроллер управляет переходами между анимациями используя так называемую машину состояний ( State Machine ),- род некоторой программы написанной языком визуального программирования в Unity. Больше информации можно найти здесь.

Как открыть аниматор в юнитиПростой контроллер аниматора

Animator Controller assets are created from the Assets menu, or from the Create menu in the Project window.

Аватар определяет структуру скелета объекта, но контроллер аниматора ( Animator Controller ) также требуется для применения анимаций к скелету. Контроллер аниматора создается Unity и позволяет вам руководить набором анимаций для персонажа и переключаться между ними когда выполняется некоторое условие. Например вы можете переключиться от анимации походки к прыжку при нажатии клавиши пробела. Контроллер управляет переходами между анимациями используя так называемую машину состояний ( State Machine ),- род некоторой программы написанной языком визуального программирования в Unity. Больше информации можно найти здесь.

The controller manages the various animation states and the transitions between them using a so-called State Machine, which could be thought of as a kind of flow-chart, or a simple program written in a visual programming language within Unity. More information about state machines can be found here. The structure of the Animator Controller can be created, viewed and modified in the Animator Window.

Как открыть аниматор в юнитиПростой контроллер аниматора

Источник

Animator component

Use the Animator component to assign animation to a GameObject in your Scene. The Animator component requires a reference to an Animator Controller which defines which animation clips to use, and controls when and how to blend and transition between them.

If the GameObject is a humanoid character with an Avatar definition, the Avatar should also be assigned in this component, as seen here:

Как открыть аниматор в юнитиThe Animator component with a controller and avatar assigned.

This diagram shows how the various assets (Animation Clips, an Animator Controller, and an Avatar) are all brought together in an Animator Component on a GameObject:

Как открыть аниматор в юнитиDiagram showing how the various parts of the animation system connect together

Свойство:Функция:
ControllerAnimator Controller данного персонажа.
AvatarThe Avatar for this character. (If the Animator is being used to animate a humanoid character)
Apply Root MotionSelect whether to control the character’s position and rotation from the animation itself or from script.
Update ModeThis allows you to select when the Animator updates, and which timescale it should use.
NormalThe Animator is updated in-sync with the Update call, and the animator’s speed matches the current timescale. If the timescale is slowed, animations will slow down to match.
Animate PhysicsThe animator is updated in-sync with the FixedUpdate call (i.e. in lock-step with the physics system). You should use this mode if you are animating the motion of objects with physics interactions, such as characters which can push rigidbody objects around.
Unscaled TimeThe animator is updated in-sync with the Update call, but the animator’s speed ignores the current timescale and animates at 100% speed regardless. This is useful for animating a GUI system at normal speed while using modified timescales for special effects or to pause gameplay.
Culling ModeРежим куллинга для анимаций (в каких случаях анимация не должна проигрываться).
Always AnimateВсегда анимировать, не производить куллинг.
Cull Update TransformsRetarget, IK and write of Transforms are disabled when renderers are not visible.
Cull CompletelyAnimation is completely disabled when renderers are not visible.

Animation curve information

The information box at the bottom of the Animator component provides you with a breakdown of the data being used in all the clips used by the Animator Controller.

An animation clip contains data in the form of “curves”, which represent how a value changes over time. These curves may describe the position or rotation of an object, the flex of a muscle in the humanoid animation system, or other animated values within the clip such as a changing material colour.

This table explains what each item of data represents:

LabelФункция:
Clip CountThe total number of animation clips used by the animator controller assigned to this Animator.
Curves (Pos, Rot & Scale)The total number of curves Unity uses to animate the position, rotation or scale of GameObjects. These are for animated GameObjects that are not part of a standard humanoid rig. When animating a humanoid avatar, these curves would show up a count for extra non-muscle bones such as a tail, flowing cloth or a dangling pendant. If you have a humanoid animation and you notice unexpected non-muscle animation curves, you might have unnecessary animation curves in your animation files.
MusclesThe number of muscle animation curves used for humanoid animation by this Animator. These are the curves used to animate the standard humanoid avatar muscles. As well as the standard muscle movements for all the humanoid bones in Unity’s standard avatar, this also includes two “muscle curves” which store the root motion position and rotation animation.
GenericThe number of numeric (float) curves used by the animator to animate other properties such as material colour.
PPtrThe total count of sprite animation curves (used by Unity’s 2d system)
Curves CountThe total combined number of animation curves
ConstantThe number of animation curves that are optimised as constant (unchanging) values. Unity selects this automatically if your animation files contain curves with unchanging values.
DenseThe number of animation curves that are optimised using the “dense” method of storing data (discrete values which are interpolated between linearly). This method uses less significantly less memory than the “stream” method.
StreamThe number of animation curves using the “stream” method of storing data (values with time and tangent data for curved interpolation). This data occupies significantly more memory than the “dense” method.

If your animation clips are imported with “Anim Compression” set to “Optimal” in the Animation import reference, Unity will use a heuristic algorithm to determine whether it is best to use the dense or stream method to store the data for each curve.

Источник

Animation System Overview

Unity has a rich and sophisticated animation system (sometimes referred to as ‘Mecanim’). It provides:

Обзор анимации

Unity’s animation system is based on the concept of Animation Clips, which contain information about how certain objects should change their position, rotation, or other properties 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 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 example 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 character’s actions, and might blend between multiple clips at the same time to provide a fluid motion as the player moves around the scene.

Unity’s Animation system also has numerous special features for handling humanoid characters which give you the ability to retarget humanoid animation from any source (Eg. motion capture, the asset store, or some other third-party animation library) to your own character model, as well as adjusting muscle definitions. These special features are enabled by Unity’s Avatar system, where humanoid characters are mapped to a common internal format.

Как открыть аниматор в юнитиDiagram showing how the various parts of the animation system connect together

The above diagram shows the following:

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.

Унаследованная анимационная система

While 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 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 the workflows into Mecanim.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *