We are finally there, the animation nerve center aka sequence editor. A new animation has by default one sequence created for it. Basically a sequence is little more than a collection of animation element manipulations. These manipulators are called animation actions. There are a whole bunch of different types of animation actions, that you will soon learn to use.
Before we open the sequence object window, let's first prepare our work environment. Like I said in the previous chapter, you will be needing the control panel and monitor a lot, so it's best to keep them open. However, the two of them pretty much fill a desktop, so we will be needing a additional desktop. Add a new desktop to your workspace. If you don't know how to do this go back and read the interface chapter.
After adding the new desktop locate the 'sequence 1' object in the object tree and open its window by double clicking it. You should end up with a screen like below.
Basics
A sequence is like a big schedule. It enables you to place numerous actions after each other at certain time offsets. To allow multiple actions at the same time there is a channel facility. You can have as many channels you like but a new sequence starts with four by default.
Each channel can have as many animation actions you like (sequence length is the only limit). You can place multiple animation actions at the same offset in the same channel providing these are zero length actions (instant).
All these actions will be processed by the animation engine in a particular order. It is very important to be aware of this order, especially when you're working with dependencies (eg. increasing a angle).
The best way to visualize the animation action processing is by looking at domino's. They all fall down after each other. The same goes with animation actions. For example, lets take the following scenario:
time
channel 1
channel 2
0
set A to 0 set B to 0
inc B by 10
250
inc A by 10
inc A by 20
For simplicity I used A and B instead of full blown animation element names. While processing the animation engine will manipulate A and B as follows:
set A to 0
set B to 0
inc B by 10
inc A by 10
inc A by 20
So the order of processing is: time offset first then channel order.
One very important aspect you should know about the animation engine is: It will always begin with the current animation element values. No automatic reseting will be done,so you must never forget to set all the animation elements you want to manipulate to a starting value at offset 0.
If you don't do this, end results may end up different with each playback. This is because if e.g. only use inc actions the current the value will be inc-ed again. So by using a 'set action' at zero offset you will ensure the start situation is as expected.
The reason behind not doing this automatically as a default is simple: I can not 'guess' what you want to start with. Also, the no resetting can even be a very neat real time animating tool while using for example script-based animation actions in 'simulate mode', but more about that later.
You might think "What about those 'auto init to rest values' properties.", and you are right those can be used to auto initialize animation elements for certain objects like a character of light. But they all are 'false' (off) by default because the above reason. But they will give you the option to force a nice starting position for large amounts of animation elements without having to create a 'set action' for each and every one of them in your sequence(s). When enabled the animation engine will apply it's rest value for every affected animation element before processing the animation actions. This way you wont have to worry about 'weird' behavior for that particular object.
Toolbars
The sequence window has two toolbars.
The first or main toolbar is used to control the sequence window display, interface and layout (See below picture). Let's walk through the buttons.
1
Zoom in. Decreases the time steps of the grid.
2
Zoom selection.
3
Zoom out. Increases the time steps of the grid.
4
Enable/disable display of information bubble while mouse is over an animation action.
5
Add one or more channels.
6
Delete the current channel (and all its actions).
7
Toggle between wide and small channel display mode.
8
Delete the current animation action.
9
Enable/disable batch action adding mode. Normally you add one action at a time (by clicking it's button and placing it somewhere). While in batch mode the selected action type stays selected and you can place several actions by clicking on multiple places.
The second tool bar is all about animation actions. Buttons in the #11 area represent the different types of animation actions. You add one of them to the sequence by clicking the wanted action's button followed by clicking the location you want it placed. Each of the action kinds will be handled later on.
10
Selects 'no action'. Useful to stop batch adding the current animation action.
11
Animation action to be inserted next. Click the animation action type you want to insert followed by clicking on the location you want it inserted. If Button #9 is down you can click multiple times to insert the same type of action on multiple locations.
12
Animation action wizards. Dialog driven tools to help you insert batches of animation actions in one go.
Let's animate
The best way to learn the secrets of animation actions is by simply using them, so lets use some of the more 'simple' ones while animating our excavator. I'll give detailed information on each used type of animation action we use in the example animation. The more complicated/special animation actions I will handle in the next chapter.
We talked about how important initialization is so lets start with that. To initialize an analog animation element you need the 'mutate' animation action. Click the animation action button (First one in the #11 area). While the button is down moving the mouse in the scheduler area reveals a rectangle representing the action. It will have a green border while it hovers on a location you can insert it. Because it's the first action you can place it anywhere, but initialization should start at the beginning. So place it at the 0ms offset in the first channel. See the picture below for pointers.
After you placed the action the timescale at the left of the screen will slightly change. There are now two 0ms lines. This is because the action is 'instant', it requires no execution time. So you're free to add another action at 0ms in this channel.
The placed action is also represented by a new object in the object tree. It will be selected by default. Until now you did not need to work that much with the object tree, but working with actions will change this fast, because most actions can only be configured by using their properties in the object inspector. But before we go into configuring the action, let's first talk 'mutate action details'.
Mutate action
The mutate action is one of the very basic action kinds. It's used to change the value of a single analog animation element. It can do this in five different ways:
Assign it a constant value.
Add a constant value to it's current value.
Subtract a constant value from it's current value.
Multiply it's current value with a constant.
Divide the current value by a constant.
It's properties are:
Name
The well known object name, it should be unique within the sequence. There is no shame in keeping the generated name. You probably only want to rename certain 'key' actions.
Enabled
Determines if the action will be processed during animation playback. By default it's true, but you can disable it at anytime, keep in mind disabled actions might radically change your animation especially if they're used for initialization.
Offset
The time offset in the sequence. This off course determines 'when' the action is executed.
Target
The animation element you wish to mutate with this action. You can select an element by using the '..' button. it opens the familiar element selection dialog discussed in the control panels chapter.
Operation
This property lets you choose which of the five different mutation types you want to use.
Value
This is the 'constant' to be used in combination with the mutation kind (operation).
Let's animate (resumed)
Let's begin animating the excavator by rotating the cabin. To do this, we first need to initialize the 'Cabin.angle.y' value. So that's precisely what we are going to do with our first animation action. Select the action's object if not yet selected and go to its properties. First we need to link the action to the animation element we want to manipulate. Use the element selection dialog to assign 'Excavator 1.joint.Cabin.angle.y' to the action. Next we must decide to which value we want to initialize. 0 is default, but I think it nicer to let the excavator start in a rotated state, so let's set it to -45.
After the angle is initialized we can instruct the animation engine to rotate the cabin by using the 'Move to' animation action. Place a 'move to' action in channel one at offset 0 (directly below the mutate action).
After you placed the action you see it is slightly different from the mutate action. That's because move to actions have a 'length'. By default they have a duration of 500ms, this is illustrated by coloring the occupied area in the channel by a light blue rectangle.
Let me explain this 'move to' action type in detail, before we configure it.
Move to action
The move to action is used to change the value of a single analog animation element to a target value over time. It's kinda like morphing, it 'knows' the value of the element at offset time and it also 'knows' the wanted target value. So the action will calculate the current value of the element at any given time in between by interpolation
It has the following properties:
Name
Same as other actions.
Enabled
Same as other actions.
Offset
Same as other actions.
Target
Same as other actions.
Value
The target value for the chosen animation element at the end of this action.
Duration
The amount of time in which the value will move to its target.
A simple example to illustrate the power of this action:
There's a Move to action at offset 100ms with an target value of 180 and a duration of 400ms.
The current value of the animation element at 100ms is 0.
The current frame time is 300ms.
The animation engine will do the following:
At 300ms, the Move to action is at 200ms, which is half of its total duration (300-100).
Therefore the current value for the assigned element should also be at half its difference.
As a result the engine will assign 90 to the element (0+0.5*(180-0)).
Beware the result may differ if it exceeds the joint's range settings.
Let's animate (resumed)
Let's rotate the cabin 45 degrees clockwise as our very first motion. You do this by changing the placed Move to animation value property to 0. It might be confusing in why you have to set it to 0 while you want to rotate 45 degrees. This is because we just initialized the element to -45 in the previous action. So to move it 45 degrees we need to move it to 0 over the given time. If you wanted to rotate lets say 60 degrees you would need to set the move to action's value to 15.
Next is the duration, by default the duration property is at 500ms. This is half a second and might be a little fast for a 45 degree rotation (An excavator is heavy machinery), so let's change it to 1000ms.
You might be anxious to 'see' your animation in action, so lets 'watch' our movie. Change the current desktop to desktop 'desktop'. This will bring back the desktop we organized in the previous chapter. There's only one thing missing on it, the animation playback window. Locate the 'animation 1' object and double click it. Move the window to a convenient place, so you can press buttons and at the same time see the monitor and (part of) the control panel. You might end up with something like:
Now the moment you waited for, press the play button in the animation window. Finally something moves on its own! And after only 11 chapters of documentation I might add :)
Exiting as it is, the animation is only 1 second long. So you might want to enable looping to see it multiple times. You probably also noticed it does 'nothing' for 3 seconds. This is because the sequence is 4 seconds long and therefore the animation is 4 seconds long. It just doesn't move for the last 3 seconds due to lack of animation actions after the 1000ms offset.
If you change the control group of the control panel to the group with the joint angles, you will notice the slides tied to animated elements will move too. But the really neat thing is you can still manually move all other sliders while playing the animation. This is why auto reseting is somewhat unwanted, because now you can change the camera and/or other joint angles while the movie plays. This is very helpful in trying movements and especially camera views out before coding them with animation actions.
Let's animate more stuff
Let's extend the animation by doing something with the excavator arm. The fist step is initialization of the three arm joints. So put three mutate actions on the scheduler at offset 0. Put one in channel 2, one in channel 3 and one in channel 4. Select the correct targets for each of them, the needed targets are: 'Excavator 1.joint.LowerArm.angle.z', 'Excavator 1.joint.UpperArm.angle.z' and 'Excavator 1.joint.Bucket.angle.z'.
Initializing these elements to zero gives a somewhat unnatural pose - it's more realistic to start the excavator with a nice collapsed arm. Go back to the control panel window and see if you can position the sliders for the arm joints in such a way you get a nice 'starting' pose. I ended up with with 144 degrees for the lower arm, 90 degrees for the upper arm and -90 degrees for the bucket.
After posing the actor go back to the sequence editor and select the first of the new mutate actions. among the object inspector's buttons there is a button with downwards pointing yellow arrow on it. You can use this button to copy the current value of the assigned element to the action's value property. This makes configuring mutate actions for initializations a snap. Click the copy button for all three actions.
There are two more 'helper' buttons for actions with a value property. 'A yellow upwards arrow' and 'a big R with a small black arrow pointing at a stick figure'. The first one is used to apply the action's value to the linked animation element's value (the reverse of the other yellow arrow button). The last one can be used to copy the linked animation element's rest value to the action's value property.
Now that the arm is initialized, let's think about how we want to animate it during the last 3 seconds of the animation. I thought it would be nice to make a digging motion. First the arm extends and then it contracts to 'lift' the dirt it dug. You could do this with move to actions, but in the interest of learning a new animation action lets do this with 'Inc actions'.
Inc action
The Inc action is used to steadily raise an analog animation element's value over time. It does this by linearly adding a constant amount to the value at a chosen interval. It's useful for rotating wheels or gears, for example, and relative joint changes. Relativity is often more useful than absolutes like the Move to action uses.
It has the following properties:
Name
Same as other actions.
Enabled
Same as other actions.
Offset
Same as other actions.
Target
Same as other actions.
Value
The amount the element value will be increased with in one interval.
Interval
The timespan in which the value will be added to the elements value.
Duration
The total length of this action, if you set it to -1 it will run forever (or at least to the sequence end).
Speed
This is a read only human friendly representation of the set speed resulting from 'value' and 'interval' translated to units per second.
A simple example:
There's an Inc action at offset 100ms.
It has an interval of 200ms, a value of 30 and a duration of 400ms.
The value of the animation element at 100ms is 40.
The current frame time is 400ms.
The animation engine will do the following:
At 400ms, the inc action is at 300ms of it's total duration (400-100).
The interval is 200ms so it looped 1.5 times.
Therefore the current value for the assigned element should be 1.5 times the chosen value plus the starting value.
As a result the engine will assign 85 to the element (1.5*30+40).
Beware the result may differ if it validates the joints range settings.
Let's animate more stuff (resumed)
"make a digging motion", sounds easy? But animation takes time and lots of patience. It could take quite a while to 'find' the action values, intervals and duration configuration you like the best. The key thing to keep in mind is 'just try it' and keep adjusting till it's to you're liking.
Let's start by placing an Inc action at offset 1000 in channel 2. Assign it the upperarm joint (the same the mutate action in this channel has, one animation element per channel is a good organizing habit). The action will by default have a duration of forever '-1'. But we need two limited motions in this joint to create the digging animation (expand/contract). Change the duration of the action to 1500ms. Try to place and configure a similar inc action in channels three and four for the lower arm and bucket animation elements yourself.
Now lets try to find the desired pose at the end of the arm's expansion by adjusting the three arm joints using the control panel. I thought -84, 40 and -10 were nice. This means we have to change the lower arm value from -144 to -84. To this with the inc action you must use a value of 60 and a interval of 1500 (the same interval as duration).
For the upper arm we need to go from 90 to 40. The action may be called 'inc' but you can just as easily use it to decrease an element's value. This is done by using negative values, -50 in this case. Don't forget to set the interval to 1500ms. Using an equal interval and duration prevents having a headache, because an interval of 1000 and duration of 1500 will give you an result difference of -75 (1.5 times -50). A different interval is only useful if you are working with things like "rotations per second".
For the bucket it's a change from -90 to -10, so set the action's value to 80. I found it more 'natural' to have the bucket reach it's target value before the upper and lower arms. So let's set the bucket inc action to a duration and interval of 1250ms.
All these numbers may be confusing so lets overview our three inc action configurations:
Channel 2
Channel 3
Channel 4
Offset
1000
1000
1000
Target
lowerArm.angle.z
upperArm.angle.z
bucket.angle.z
Interval
1500
1500
1250
Value
60
-50
80
Duration
1500
1500
1250
We now have an 'expanding' motion of the arm. To complete our award winning movie, we need to animate the 'contracting' part. To this end we use another set of three inc actions. It's much the same as before, but mostly in reverse. Here are the 'numbers' - you should be able to configure the actions without help by now.
Channel 2
Channel 3
Channel 4
Offset
2500
3500
2500
Target
lowerArm.angle.z
upperArm.angle.z
bucket.angle.z
Interval
1500
500
1000
Value
-60
50
-80
Duration
1500
500
1000
While configuring you will need to scroll around a bit due to the length of the sequence. Alternatively you could change the zoom level (button #1, #2 and #3) but keep in mind the placing of actions snaps to the current time grid. When done you should have something like below:
You must have noticed the difference in offsets and lengths I used, this is done to get a 'nicer' end result. You are of course free to change anything if you think the result looks better that way. Speaking of results check the animation out by playing it.
Animating cameras
While playing the movie you might have noticed the framing of it all is quite poor. You can fix this by adjusting the lookat point in the monitor (or control panel after adding controls for it).
You can also animate the camera in the sequence editor to get a fixed camera flow in you're animation (just add some channels first). There are two cameras to play with so you can even do some editing by switching cameras at certain offsets. This is done by using the 'camera action' (details follow). Cameras can be animated just like character joints. It's all only a case of selecting the correct animation elements in your actions.
I could do some example animating the cameras, but I think it's time to let you do the work yourself. If you do have troubles you can always open the "Excavator" project located in the samples directory of your LD4DStudio installation location. It's basically the project we have been working on during this manual.
Camera action
The camera action is used to set the current 'output' camera. You can place it anywhere but usually it's best to reserve an 'editing' channel for all camera actions. This way you can move them around later to improve the flow of your animation.
It has the following properties:
Name
Same as other actions.
Enabled
Same as other actions.
Offset
Same as other actions.
Camera
Lets you select the camera to switch to at this offset.
The sequence object
You might thought I forgot the sequence object itself, but better late than never. Although the object has only three properties, I delayed explainging them to tell you about animation actions first.
First we have the name property. In a simple animation with only one sequence you don't need to rename it, but try to use meaningful names in bigger animations otherwise you will lose your grasp on the flow of things.
Secondly we have duration. In case of the main sequence (chosen in the animation object) it will determine the length of your animation. In all other usages it will 'constrain' the sequence actions within the given time frame.
Last property is "nonstop", by default on true. In this state animation actions within the sequence will not be constrained to the duration. This means that actions with an ending above the duration will continue to influence the animation on higher sequences.
This property is especially useful when you use a sequence with actions using a duration of 'forever'. Setting the nonstop to true will spare you work in the way of adjusting sequence lengths every time you extend the duration of something else using that sequence.
The channel object
Channels also have an object representation. These objects aren't very exciting but let's go over the properties for the completeness of it all. Name should be clear by now.
Enabled is just like it suggests, it gives you the option to disable all actions in the channel at once. The action's individual enabled states will not change. Disabling an entire channel is useful for e.g. disabling camera animation, given you have organized your animation actions smartly by placing all camera stuff in one or more dedicated channel(s).
Default analog target. This is a very handy property if you plan to use a channel for mutating a single analog animation element. By setting the property to the animation element you want to mutate in this channel, all actions added to it will default their target to it. This way you don't have to select it for every action you insert in the channel, it's a real time/annoyance saver.
Default binary target. This one is much the same but for a binary target instead.
Default object target. Most animation actions manipulate a single animation element. But there are a few you can use on all elements of a high level object (character, camera, light, etc) at once. With this property you can set a default to use with the target property of those kinds of actions.
The new sequence wizard
In the above I told you it's a good idea to 'reserve' a channel for a single animation element to manipulate. And you also read about the channels default target properties. This is all fine but when doing big and complicated animations using multiple sequences it can become an annoying thing to set up those channels every time. To prevent this there is a 'new sequence wizard' dialog. It lets you create a new sequence in a handy starting situation with only a couple of mouse clicks.
To access the wizard select the 'sequences' object it will have two buttons in it's property editor. The big '*' and one for the wizard. Click it to open the below dialog.
First you optionally set a different name, non stop state and duration for the new sequence in the top edit boxes. Next you need to select what animation elements you want to edit in this sequence. This is done by clicking the 'add' button on the right. This will open the animation selection dialog which lets you select multiple elements to add to the sequence.
After adding one or more animation elements they will appear in the 'channels' grid. The animation elements in the list can still be mutated by using the remaining buttons on the right. You can change their order (using the 'up' and 'down' buttons while a row is selected). You can remove one or more actions again with the 'delete' button. And you can edit the current selected row's linked animation element by clicking 'edit'.
The grid also gives you the opportunity to edit channel names. By default the animation element names will be used with their '.' and ' ' characters removed. You can edit any of the channel names by clicking it's current value.
If you want to create a sequence using a channel setup very similar to an existing sequence you wont have to select all the elements again, instead you could use the 'Copy from' button. This button lets you select a sequence, and will fill the grid with all channels using a default target from that sequence. Do note the existing items in the grid will not be cleared first.
When all is to your liking click 'ok' and a new sequence will be created with a dedicated channel for every animation element in the wizard's grid. Of those channels a default property will also be set to given animation elements. If 'default binary target' or 'default analog target' is used depends on the type of animation element used.
Working with multiple sequences
Now you more familiar with sequences in general it is time to take a closer look to the 'sequences' object. Just like with a single sequence you can open a edit window for this object by double clicking it. It will open a window like the one below.
This may not look to exciting for the excavator animation. But when working with complicated animations, containing tens or even hundreds of sequences, this window might be the difference between a nice animation and the loony bin. For a more useful example see the below overview for the 'escape' sample project.
As you see the window is used to get an overview of the interconnections of used sequences in a tree like manner. The tree form is a result of using the seqRef animation action (discussed in the next chapter). The big horizontal red line is used to show you which sequences are actually used. If any are below this line it indicates those are 'orphan' sequences.
In closing lets go over the toolbar buttons.
1
This lets you toggle the enabled state of the currently selected seqRef action on the overview.
2
This will create a new sequence and link it to the selected seqRef action.
3
This will select the linked sequence for the select seqRef action in the overview.
4
This will open or refocus the sequence editor window for the selected object in the overview.
5
Clicking this will make the current selected sequence the main sequence of the animation.
6
This lets you enable/disable the rendering of object notes for the sequence objects in the overview.
To get the most of the sequences overview window I suggest you just play with it in one of the bigger sample projects.