superLag Copyright ©2002,©2003 Michael B. Comet All Rights Reserved
Help last updated on 05/28/2003
Super Lag is a MAX Script to help automate rigging and animation of secondary action and follow through. It provides easy to use animation controls, that are stable, and won't go flying off like typical dynamics or spring systems.
The object world space positon and rotation will drive the rotation of the lag object. That is, the object will rotate based on how it is moving and rotating already in the hierarchy.
superLag consists of 2 parts, a Rigging step and then an Animation step.
Rigging occurs once for each selected object, and auto creates an animation control and internal helper for lag processing.
Animation occurs by "calculating" or "baking" the required data for the superLag. At this point the lag will work in realtime, and adjustments to parameters can be made. This includes adjusting the amount, speed and timing. All of that can be adjusted after baking in realtime. The exception to this is the "Simple" Lag version that once baked, needs to be rebaked to adjust.
Note there are two different styles of Lag provided here. One is a version that lags as mentioned with easy to use animation controls, and is typically used to provide nice back and forth style motion.
The second version called "Simple Lag" simply rotates an object the amount the parent rotates some specified frame count earlier. This version DOES however take into account world space rotation. So it works, even if the parent itself is not rotating, but the entire chain is. It also can be baked for faster playback.
Select each object in the hierarchy that you want rigged. Select them in the order from parent to child.
Expand the "Setup" rollout in the superLag script.
As you can see, there are several options. There are two main types of "Lag's" provided with the superLag script. The "Super" setup is the normal full blown setup that provides basic animation controls and does nice secondary action.
The "Simple" version will cause the rigged object to rotate also, but based on a specified frame delay from how it would normally be. This means under normal circumstances the object won't lag back and forth, whereas the "Super" version allows this. However, if the object is a child of something with "Super" Lag, then it will be rotating some amount after that node, and therefore appear to bounce as well.
For speed and quality motion, it is usually best to rig the initial object with "Super" lag and then the child objects directly under it with "Simple" lag. You could also break up a long chain with super lag interspersed through out. Like a "Super" version followed by 2 "Simple" childs, then the same thing repeated again down the hierarchy.
The buttons in the above rollout specify what will happen for the selected objects. The "Rig As Chain" button will rig the first selected node for SuperLAG. All following selected objects will be rigged as Simple.
In addition each selected object could be rigged as desired, by pressing the "Rig for SUPER" or "Rig for SIMPLE" buttons.
The checkbox Rig SIMPLE Lag for Baking, Not Realtime will set the simple lag up, but nothing will happen until that control gets calculated. Alternatively it can use a realtime Max Expression, but this can be quite slow. For stability and speed, it is usually best to leave this on, and then bake it later when needed.
1. A Lag control object. This will be named with the object name and "LagCTRL" appended to the end. Any animation parameters are added via custom attributes. If the Empty Modifier aka "Attribute Holder" modifier is installed on your machine, then that will be added to the control curve to make it look nicer. This control gets "inserted" into the hierarchy.
Objects rigged with a "Super" setup will have a Blue control object. Those done for "Simple" lag will have a green setup. In both cases, these objects can be animated normally including position, rotation, etc...
2. A Lag "AUTO" slave helper. This node is a child of the Lag control. For both types of setup this node has an expression on it for lagging. The exception is that if the rig is for a "Simple" setup and baking only was active, there is no expression. In addition, there are custom attributes on these nodes that are process and animated automatically by the calculation portion of the script. Do NOT animate the values on these nodes.
3. A helper to "Zero" the values for the control. This helper is a parent of the Lag control, and is called the object name with "LagCTRLZEROINT".
In addition it is also assumed that the Z-Axis is "up". What this means is that if the object moves forward on it's X axis, then Z is up so the object will rotate on it's Y axis. If you wish instead to have it rotate on the Z axis when it moves forward, you can select the "AUTO" slave object and check "Y Axis is up". This option is only available for "Super" versions of the rig. In otherwords, when translating forward, the rig will by default rotate up and down assuming Z is up.
The overall process with superLag rigs is that typically objects that have this applied are secondary, or their motion is based on motion of another object. Because of this you would want to first animate your character or object like normal. You can animate the actual "LagCTRL" objects normally with rotation and translation, etc....
Once your basic animation is done, you then have to "Calculate" or "Bake" this information to allow superLag to work. How this works is dependent upon whether or not the object was rigged with a "Super" or "Simple" setup.
IMPORTANT: Any MOVEMENT changes that are made to the original controls or hierarchy, ie: changes in rotation, position etc, will require a re-bake or re-calculation of the selected lag controls in order to get proper motion.
In order to calculate or bake the required data, Select the LagCTRL or the LagAUTO slave and press the "Calculate" button. If you have a "CTRL" selected, you can switch to the Slave, and vice-versa pressing the "Select" type buttons.
You can also erase lag data for the current time range, or for the entire max scene for all selected Lag controls. Simple select the control and press the desired Erase button.
The image on the right shows how these look. The frameDelay is the number of frames before or after that the object should rotate behind. The default is -2 which means it will rotate based on how how it would have actually looked 2 frames earlier.
Good values are generally in the range of -2 to -8 or so.
If the Simple setup was rigged for realtime, then this will occur (slowly) as you play and scrub animation.
In order to speed it up, you can specify that the "SIMPLE" rigs will get Baked when the calculate button is pressed. If this is done, actual rotation key frames are process and the set onto the related LagAUTO Slave node. You can then see and adjust these keys on the AUTO slave if desired. At that point, any changes to the animation of the control or related hierarchy, will require a re-calculation.
This setup will cause the object to rotate back and forth based on position and rotation motion. For rotation the object will appear to lag and bounce based on the world rotation of the node. For position, the object will rotate Up and Down when it moves forward and back. (Based on the Z axis being up by default, see the rigging section above). It will rotate on the Z axis when it is moved along it's Y axis, and rotate on the Y axis when moved along the Z. The object will never spin unless the actual rotation in world spins along it's X-axis. But it will not spin on X by translation effects.
IMPORTANT: While the Lag data must be calculated first to cause the superLag to work, the actual parameters shown, such as Percent, Bounce Frame, Falloff etc all work in REALTIME after this is done. So you can bake the data, and then play back and actually adjust and animate these values in realtime afterwards. You only need to re-bake if the actual source movement has changed!
The parameters work as follows:
Active: When on, the script controller on the LagAUTO slave tries to work and cause lagging motion. This requires that data has been baked. Any changes to the control motion via positon, rotation on it or the hierarchy above it, will require a re-bake to get new proper motion.
For speed purposes, you can set this to off/not active if you don't want to see or deal with the lag.
Strength X,Y,Z: This controls the amount of rotation that will occur on the lag object. The default is 100% on all axis. You can raise or lower (or even set to negative) to adjust how this works. If you want more/bigger motion raise these values. If you want to limit the amount or set it to only rotate on certain axis, you can set these down to zero.
Bounce Frames: This is the number of frames that it will take for the lag object to rotate back and forth. ie: the lag will rotate from once side to another and then back to that original side in this many frames.
Lowering this value causes the motion to look faster, and lighter. Raising it will make it look heavier and slower.
Falloff Frames: This value sets how long it takes for the motion to die down. Generally once the object comes to rest, it will take this long for the rotation to stop.
Lower values cause the motion to end quicker, possibly without any extra bounce and make things look lighter. Higher values make the bounce take longer to come to rest and look heavier.
Translation %, and Rotation %: These values are master amounts that control how much the object will rotate/lag. The Translation % specifies how much the object rotates based on how it is moving through space. The Rotation % specifies how much the object rotates based on how it is rotating through space.
For example if you want an object to lag only based on rotations that are occuring, but not its movement positionally, set the Translation % to 0.
I recommend taking a simple bone, rigging it with this lag, and then doing tests to learn how it works. For example, rotate the bones LagCTRL on X, then bake the data, and play it back. Then erase that and try it on other axis. Try moving the bone only on one axis, and see how the lag occurs to learn how this all works.
Base animation with no lag. Only animation is position and rotation on the blue control object.
Default Animation created by superLag with 24/48 bounce and falloff.
Default Animation created by superLag with 12/18 bounce and falloff for faster lighter feel.
Default Animation created by superLag with 48/56 bounce and falloff and -4 simple lag delay, for heavier slower feel.