-
When you have a model highlighted
-
in the project panel you can define how
-
Unity interprets the mesh, animation,
-
and other properties using the Inspector.
-
These properties come in 3 parts
-
Model, Rig and Animations.
-
In this lesson we'll be looking at the
-
Animations section.
-
The first option under Animations
-
is whether or not to import animations.
-
This must be check to use any of the animations
-
stored within the model file.
-
Bake Animations is used when an animation
-
has been created in a separate modelling
-
or animation program using inverse kinematics,
-
or IK for short.
-
And it has no yet been converted to forward kinematics
-
You can also choose what sort of
-
compression you'd like for your animations.
-
By default there is no compression
-
but you can choose Keyframe Reduction,
-
or Optimal.
-
If you choose to compress the animations
-
you need to decide what error you wish to
-
allow for position, rotation and scale.
-
The smaller the values, the higher the
-
precision, the less compression you get.
-
Below the compression options
-
there's a list of clips that are available
-
from the model.
-
These can be added to or deleted
-
using the + and - icon.
-
Next to each of the names are the
-
start and end frames for the clip.
-
This is what makes each clip in the take different.
-
When one of these clips is selected
-
all of the options are available for that
-
specific animation clip.
-
The first option is the name of the clip.
-
Also, if the file has multiple takes
-
you will see what take that clip is from.
-
Next is the timeline of the animation.
-
Using the handles in the timeline
-
or the Start and End fields
-
you can edit on which frame
-
the clip begins and ends.
-
Below the start and end controls
-
is the loop controls.
-
Loop Time, when checked,
-
means that when the animation is finished
-
playing it will start again.
-
If Loop Pose is checked Unity will
-
try and match up the start and end pose
-
so that the looping clip looks smooth.
-
The Cycle Offset is for adjusting
-
when the clip starts and ends.
-
Use this for mirroring animations.
-
For example, if you want a run clip
-
to be mirrored then you might set the offset
-
to 0.5 so that the other foot is on the floor.
-
The Root Transform Rotation
-
affects how the rotation of an animation
-
affects the avatar.
-
If the root transform rotation is baked
-
in to the pose then the avatar will not
-
rotate with any turning in the animation.
-
Use this option for animations
-
such as running in a straight line
-
so that any slight deviation from a straight
-
line will not affect it.
-
The root transform rotation can either be
-
based on body orientation at the start
-
of the animation or the original source file
-
of the animation.
-
If Body Orientation is chosen
-
then the upper body will point forward.
-
You can use the offset to fine tune
-
the direction of the animation.
-
The next options refer to the root
-
transform position in the Y axis.
-
As with root transform rotation if you check
-
Bake Into Pose the avatar will not
-
move up or down during the animation.
-
There are a few options of what the
-
position can be based on.
-
Original takes the Y position
-
from the source fail.
-
Otherwise it can be based on the avatar's
-
centre of mass or the position of it's feet.
-
Again the offset can be used to
-
fine tune the movement in the Y axis.
-
Root transform position XZ
-
works similarly to the Y axis option
-
except that it affects the horizontal
-
movement of the avatar.
-
Baking in to the pose will restrict movement
-
on the XZ plane.
-
This can be based on either the original file
-
or the centre of mass.
-
When you use the handles on the timeline
-
to adjust the animation you will see a graph
-
for each of the properties below it
-
representing how well it will match
-
when the clip is looped.
-
Based on this matching each option
-
has a traffic light indicating how well
-
it matches.
-
Green for a good loop match,
-
yellow for an okay match
-
and red for a not good match.
-
Depending on what sort of animation clip
-
you are trimming you may or may not
-
want these to loop nicely.
-
For example, with a walking animation
-
you would want the pose to loop nicely
-
but you probably wouldn't want the transform
-
position XZ to loop.
-
If the Mirror box is checked
-
then the animation will be flipped left to right.
-
For information on the avatar mask
-
and animation curves and events options
-
see the lessons linked below.