13. Animation action overview While animating the excavator character I showed the use of four different animation actions. In this chapter I will list and explain the remaining animation action types. The only exception will be the script animation action. This one gets its own chapter due to its 'advancedness'. I will not be demonstrating all animation actions, I leave that to the collection of sample projects you'll find in the LD4DStudio's installation folder. To keep the list of animation actions complete, actions discussed elsewhere will be present by reference. Mutate action Move to action Inc action Acceleration action The acceleration action is basically a non linear inc action. It takes a start and end speed and increases the linked analog animation element in such a way it rate of increment goes from the start to the end speed. If the end speed is lower then the start speed it will act as a deceleration action. This action is primary used in combination with normal inc actions. It can then be used to simulate the acceleration or deceleration before / after the continued linear changes made with the inc action. See the 'helicopter' sample for example usage. It's properties are:
Calculated action The calculated action is one of the most powerful animation actions. With it you can mutate one analog animation element based upon one or two others. To this end you can assign two sources (A and B) and choose an operation to apply to them. Possible operations are:
If you omit sourceA or sourceB it uses the value property instead. So if you assign only sourceB and use value 15 with the multiply operation you get: target = 15 x sourceB This action is extremely helpful while animating mechanical dependencies like gears. It's properties are:
Calculated inc action The calculated inc action is much like the normal inc action. It lets you increase an analog animation element value over time by a certain amount, but with this action the 'amount' isn't constant. It depends on a source analog animation element and operation with a constant. This basically gives you a gas pedal you can use to influence e.g. the wheel rotation speed of a car. This can be extra fun while playing around with joysticks in simulated playback mode. Possible operations are
Its properties are:
Frequency generator action The frequency generator action gives you wave driven value control over an analog animation element. Most animation actions are linear and because of that movement of character may feel 'unnatural'. By using e.g. the sine wave to move the legs of a minifig it will look much more realistic. You have full control over the wave form and amplitude. You can choose from several kinds of waves, namely:
It's properties are:
Waves can be hard to grasp, if you're not used to them. To assist you with this, the frequency generator action has a window for its object. This window lets you play with the wave parameters while giving you visual feedback on the implementations. The window is fairly simple. There are edit boxes for the wave properties, an example rendering of the wave and two buttons. The 'apply' button must be clicked if you want to save the current wave settings to the action' properties. The 'restore' button resets the window to the current object properties. The 'Render wave duration' checkbox can be used to choose between previewing a single period (the default) or the wave behavior during the whole length of the action. It can only be checked if the action isn't non stop. Freehand action Like the frequence generator action this action is used to control a analog animation element using a wave. But with the freehand action you can draw that wave yourself, this can be handy for 'random' spastic movements like to use for a minifig arm's. It's properties are:
Most of the above properties don't make much sense on their own, this is because you will be doing the most work for a freehand animation action in it's editing window. It can be opened by double clicking the action you want to edit. Doing so will open a window like the one below (do note this is an configured action in order to give you a better visual example.). This window is basically a big piece of blocked paper, you can use to manipulate the samples in the set time duration. To aid you in this work there are a number of tools accessible via the buttons at the top. Above buttons have the following functions:
Zooming is quit strait forward, you use it to get a view of your liking to work with (part) of the wave. Button #6 is best understood by clicking just trying. So click on the grid with your left mouse button and hold it down. If you now move it around you will see a green region being controlled. This is the current selection. If you now let go of the mouse and click the #6 button and do this again you'll see the red line will be redrawn following your mouse movement. In selection mode you can also resize the selection by clicking and dragging the outer edges of the selection around or move the whole selection (including the values it represents) around by clicking middle of it and moving your mouse to the left or tight. In both selection and drawing mode you can manipulate a single sample by clicking and moving it's bit red dot around, but do mind these 'dots' are only visible if the current horizontal zoom isn't to far out. So if you don't see the dots use the #2 button to zoom in until they appear. To get the red line to a pattern that suits your needs you can use buttons #8 through #12. First there us #8, it will remove the current selection causing everything behind it to move to the left. The leftover at the right as a result of the lost space will be filled with the rest value. Button #9, can be used to insert a silence at the current position. To get a current position you'll need to click the mouse once at the desired position in selection mode. Clicking the button will open the following dialog. This dialog lets you set the length of the silence you want to insert in two ways. You can ether give the number of samples you want, or the duration in milliseconds. But do mind in case of milliseconds thing will be round based upon the segment length (action duration divided by segment count). Finally you choose the value to use for the inserted samples. This defaults to the rest value. When all is to your liking clicking 'ok' will insert silence causing to move everything right from the selection position to move in order to make room for the new silence. Button #10 is much the same as #9 but instead of inserting silence you will be replacing the current selection (or the whole thing if no selection is active) with a value of choice. Clicking the button will open a tiny dialog only asking for the value to use, it defaults to the rest value. Button #11 is used to generate a wave in a way we used to from the frequency generator action. This is handy of e.g. setting a basic shape. Clicking it will open the below dialog. The options you can set here are identical to the similar named ones in the frequency generator action, so I'm not going to reexplain them here. Only additional thing worth mentioning is the 'fit wave' button at the bottom right. You can use that to set the wave's frequency in such a way it will fit a single period in the given time frame (ether the selection or action duration). Samples and segments You might be wondering what the difference is between samples and segments, because I have been a bit vague about that. Segment count is used to indicate in how many pieces you want to divide the given duration (aka resolution). A sample is the value you set for the begin of each of those pieces and at the end of the last one. So you will always have (segment count + 1) samples. That last one is needed so the animation engine knows what to assign if the duration has been passed. This is pretty much it for the freehand aniaction, the best way to get the hang of it is to just 'play' with it awhile. For some examples you could look at the pneumaticDemo sample. It uses freehand action to create non linear movement of an extending pneumatic cylinder. Sequence reference action The sequence reference animation action is a very important organizing and reuse ability tool. With it you can apply other actions from another sequence during the length of the reference action. It's properties are:
Often you want to do an animation which includes e.g. a walking minifig. The walking sequence is stored in a sequence which you can reuse from other sequences. But what if you want a different minifig character to walk? You would think you have to create the same sequence using different animation elements. Luckily this is not necessary, it is possible to apply another sequence's actions while using different animation elements in those actions. This is done by 'fooling' the sequence using mappings. For example: You've got a whole bunch of actions manipulating character "minifig1" in the target sequence. But you want to animate minifig2 the same way in the current sequence. For this to work you have to map all minifig2 animation elements to minfig1. This way when the referenced sequence manipulates e.g. minifig1.leftLeg.angles.y it will actually be changing minigig2.leftLeg.angles.y Mappings are done on object level (lights, cameras, characters, etc) to spare you the work of creating a mapping for each and every animation element separately. You can manage the mappings for a sequence reference with a special dialog. This dialog is opened from the "Reference mappings" object below the sequence reference action object. The mapping dialog gives you an overview of all local animation objects at the left. At the right you'll find all objects used in the target sequence. You now can use the two lists to create unions. This is done by clicking an item in the left and right lists and if they are compatible you will be allowed to click the 'add' button. After having been added, the mapping will appear in the center list. To edit an existing mapping click it in the center list, then adjust its left and right list item at will. Click 'modify' to keep the changes for the mapping. To delete a mapping select it and press 'delete'. Binary mutate action The binary mutate action is used to instantly change a binary animation element's value. It's of course the binary version of the normal mutate action. You can use it to initialize or transform the value. Transforming is done by choosing an operation and optionally setting a second value. Available operations are:
It's properties are:
Binary calculated action The binary calculated action is used to mutate one binary animation element based upon one or two others. To this end you can assign two sources (A and B) and choose an operation to let go on them. Possible operations are:
It's properties are:
Binary frequence generator action The binary frequency generator action is used to continually flip a binary animation element's value using according to a pattern over time. Its properties are:
Like the 'start mode' and 'pattern' properties suggest, there are a number of different start modes available resulting in different kinds of behavior. Lets go over all of them.
These patterns and the current set start mode can be tricky to completely understand, but I don't think it's something a little bit of experimenting can't solve. Compare action The compare action is used to set a binary animation elements value by comparing two analog animation elements values. The possible compare operations are:
It's properties are:
Region compare action The region compare action sets a binary animation element by doing a regional compare on an analog animation element. This means the target will be true while the source value is in a certain region. It's properties are:
Object init action The object init action . Most animation actions manipulate only one animation element. But in some cases you'll find you need to manipulate just about every element in e.g. an character at once in much the same way. Initialization is such a case, so to help keep the number of animation actions down there is the object init action. It let's you initialize all animation elements associated with an high level object (character, camera etc) at once. It's properties are:
The only interesting property is the target one, use use it to assign a character, camera or other high level object to the action. After setting it, you are ready to edit the actual animation element values you want to initialize to, using the objects in the object's 'values' subbranch. Please not only enabled elements will be present in the list of elements. Each object in that list has only two properties, namely: 'apply' and 'value'. 'Apply' determines if you actually will be using the element for initialization in the action and 'value' of course contains the value you want the linked element to change to whenever this action is processed. Configuring all the elements can be done in an easier way by using the 'object init' actions edit dialog. You open this by clicking the '[ ]' button visible when the object is selected in the tree. Done so will open a dialog like below, please note I assigned a camera to the action for this example. The dialog is fairly straight forward, you can edit the 'apply' and 'value' setting for all associated animation elements at once by using the grid. There are three special buttons whom let you set all selected elements value at once. 'Clear' will set them to '0' or 'false', 'Rest' will assign the rest values and 'Current' will assign the linked animation elements current values. Opening the right mouse button popup menu will give you two more mass property changing tools, whom apply to the 'apply' property. Object follow action The object follow action, just like the object init action, influences all animation elements of a higher level object at once. But this action can be used to let e.g. one character mimic another character's movement. this is handy for things like a parade of minifigs (see the parade sample). You only animate one minifig and all others will follow that one's movements. It's properties are:
Just as the other object action the real settings are done in the 'value' subbranch or with a special edit dialog. Lets take a look to the dialog, you open it by clicking the '[ ]' button in the action's property editor toolbar. It should look something like the picture below. Please note I did assign a camera object to the 'target' and 'source' properties first. The dialog is very similar to the one of the 'object init' action. But here you can only control the 'apply' state of assigned animation elements. The 'apply' property can be very important, cause you rarely want two objects to fully mimic each other. Take for example the parade fully mimicking each minifig from a single master will result in 'seeing' only one minifig because they will all be rendered on the same location. This will be prevented by disabling the 'apply' property for some of the position animation elements. In conclusion there are two buttons you can use for mass changing of the selected elements their 'apply' property. Script action Camera action | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Best viewed with Firefox 2, Seamonkey or IE 7 at 1024x768 or higher resolution. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Copyright Roland Melkert 2008-2017, all rights reserved. LEGO is a registered trademark of the LEGO Group, which does not sponsor, endorse, or authorize this website. |