Class 1 - Week 8 - Copying and Pasting Keys

As with everything else in Maya, there are many ways to go
about copying keys, each one with it's own difficulties and
rules to keep in mind. This gets even trickier when you are
trying to copy the keys from all the different controls
and attributes of a rig at once, all the while trying to
figure out which keys need to be offset and which need reversed.

But if copying can be such a headache, why do it in the first place?
Copying keys in a situation such as the vanilla walk, or any
cycle, allows you to work on a small section of your animation
and perfect it, instead of working on the entire thing and
having to redo the same actions over and over again. Copying
can also give you an easy way to get overlap in certain areas.

Before copying, the first thing I like to do is look at the
attributes I'm planning to duplicate and figure out which can
be copied easily, which need to be reversed and which need to
be offset. In the case of the Ballie Rig, this is how I would
organize it. (Assuming Ballie is walking forward along the Z
axis)

Easy - Attributes that can be copied without any
modifications or tweaks.
Ty
Rx
Footroll
Ballroll
Toebreak
Knee Follow
Knee PV


Reversed - These attributes are ones that go in a
different direction from the original copy. For example, if
I'm copying a step with the right foot and pasting it to
create a step with the left foot, I would need to make sure
the body shifts it's weight in the opposite direction and the
Tx of the feet would need to be reversed so they don't pop
from one side to the other.
Tx
Ry
Rz
Leg Twist
Ball Twist
Ball Rock


Offset - This usually consists only of the Tz
(or whichever axis is moving forward). If we were to copy and
paste this regularly, the body would snap backwards and simply
cover the same ground. What we want it for is to continue
moving forward, so the pasted keys must be offset from the
originals.
Tz

Once we've got all that figured out, let's check our Copy and
Paste options to make sure they are all set correctly. You can
find both under Edit in the Graph Editor or Dope Sheet.

Copy Keys options
This is fairly straight forward. Just makes sure "Time range"
is set to "All" and you're good to go.


Paste Keys options
Once you open up the Paste options, the first thing to do is
go to Edit > Reset Settings, this way we're sure most of the
settings are set correctly. The only ones left to check are:

Help images: Make sure it's checked. If you are unsure
of how a paste action will affect your curves, this will show
you a demonstration image of how it will work.

Connect: This setting will need to be switched
depending on if we need to reverse or offset the attributes.

When Connect is checked, this will make sure the first key of
the pasted curves lines up with the last key of the original
curve, offsetting the curves.

Unchecked will cause the pasted curves to keep the exact same
values as the originals they were copied from. Very useful
when you need to reverse values.

A useful thing to do when pasting lots of curves is to hit the
"Apply" button instead of "Paste Keys". This will paste the
keys, but without closing the Paste options, allowing you to
paste multiple times without having to go back to the menu.

Now that we've gone over the different copying methods, let's
apply them to Ballie's walk cycle! Since this is the vanilla
walk, we only need the first 12 keys to get the entire walk
cycle complete.

Creating a Cycle

We'll begin with the body, as it's a bit simpler than the
feet. So let's get going by selecting the body and opening up
the graph editor.

In the graph editor, select all the curves and copy them. It
is extremely important that you make sure the curves you want
to copy from or paste to are selected before you copy or
paste. If they aren't, it can cause things to paste improperly.
(An important thing to note is that Ctrl+C and Ctrl+V do not
copy and paste the same way in Maya and should not be used for
copying curves.)

Set the current time to one frame after the last key,
(for example, if the last key is on frame 12, set the time to
frame 13), make sure Connect is turned off in the paste
options and hit apply. Pasting the keys one frame ahead
of the last keys will preserve the original keys and give
you a buffer if something goes wrong.

If you play it now, what you'll have is an exact duplicate of
the original, meaning the body weight will be shifting over the
wrong leg and also snapping back to the beginning. Let's fix
this, starting with the Tz.

This part may sound a bit confusing, but try to stick with it.
  • First, select the newly copied Tz keys and copy them again.
  • Now delete those keys and paste them in again, this time
    making sure Connect is checked in the paste options. This will
    offset the Tz curve, making it so that the body continues to
    move forward.

Now on to the reversals!
  • Select all the newly pasted keys on the curves that
    are marked in the Reversal list above. You can make it easier
    to select them by highlighting their names in the Graph Editor
    Outliner (the list of attributes on the left).
  • With them all selected, go up to the value box in the
    graph editor and type in "*=-1", without the quotations. This
    will multiply all the values of the selected keys by -1,
    inverting the animation.
  • Once you're sure everything is working properly, delete the
    keys on frame 12 and move all the keys afterwards back one
    frame.

With the body all copied over, it's time to move to the feet.
It's almost exactly the same method, except that you will need
to copy keys from one foot onto the other to create a cycle.

Select both feet and open up the graph editor. In the Graph's
Outliner, you can switch between both feet making it easier
than having to go back to the viewport to select each foot.

  • Pick the L_foot, select all it's curves and copy them.
  • Pick the R_foot, select it's curves and move the timeline to
    frame 13 or one frame ahead of the last key.
  • Paste the keys, making sure that Connect is unchecked in the
    paste options and hit Apply.
  • Now the rest is all the same as the pasting on the body.
  • Offset the Tz curve just as before.
  • Reverse any curve in the Reversal list up above.
  • Delete the keys on frame 12 and scoot everything past that back one frame.
Repeat the process but this time copying the keys from the R_foot to the L_foot,
and making sure you only copy the first 12 frames. You should now have a full
walk cycle of 24 frames! Copying frames is a bit tricky to get used to so don't
worry if it doesn't work out the first time around. Just keep practicing and
you'll get the hang of it in no time. And once you get the hang of it, you can
try speeding up the process by copying the keys from foot to foot, copying the
body, and then reversing and offsetting all the curves at the same time.

Looping the cycle
 
What's this? We only have 24 frames but the assignment asks
for 48! With you're new-found copying skills, this should be no
problem. And the great thing is that since you have a full
cycle now, you don't have to worry about reversing any curves,
just offsetting the Tz!

But what if I told you there is an even easier way to loop a
cycle? A way that would not only be easy, but also update any
of the changes you make to the cycle automatically.

To do this, select the body and feet and select all of their
curves in the graph editor.
Now select Curves > Post Infinity > Cycle with Offset and voilĂ !

You should now have an infinite loop that auto-updates any
changes you make!

Hopefully all this was useful and if you have any more
questions, feel free to contact either Cameron or me.

No comments:

Post a Comment