If you want the transformations that you are driving with ICE kinematics to be based on the previous frame's values instead of being propagated upward through the operator stack, you can use a simulation. For example, this allows you to drive spring-like deformers to add secondary dynamics to a rig for jiggling or other effects.
When you select a null and choose Create Simulated ICE Tree in the ICE tree view, the Pre-Simulation, Simulation, and Post-Simulation regions are created in the operator stack.
These regions work in a similar fashion to the regions on geometric objects.
Operators in the Pre-Simulation region are evaluated when the simulation environment is not active, and on the first frame of the simulation. They are not re-evaluated during a simulation. They can be used to define the initial state of a simulation as well as to initialize any data that is needed.
Operators in the Simulation region are evaluated on the second and subsequent frames of a simulation. They are updated based on the previous frame instead of the result of the Pre-Simulation region. For example, you can use Verlet integration to update spring velocities based on the previous values.
Operators in the Post-Simulation region are applied to the result of the regions below. They are always evaluated.
If necessary, you can move operators between regions as described in Changing the Order of Operators [Data Exchange].
For more info about environments in general, see The ICE Simulation Environment [ICE Guide].
When using simulations with ICE kinematics, you need to be especially careful about which ICE trees get and set data on which objects. For best results:
Use a separate null or other object to hold the initialization and evaluation trees. This should be the only object with a Simulation region.
Calculate initial values in a tree in the Pre-Simulation region, and store them as custom attributes on the null itself. Do not set data on the driven objects.
Evaluate the simulated values in a tree in the Simulation region, and store them as custom attributes on the null as well. Again, do not set data on the driven objects.
On the driven objects, use a tree to get values from the null and set self.kine.global. It is also possible to use a tree on a different null to get the custom attributes and set kine.global on multiple objects.
If you modify an ICE tree in the Simulation region, the changes take effect immediately but the previous frames are not automatically re-simulated in Live and Interactive simulation modes.
If you modify an ICE tree in the Pre-Simulation region, the changes do not take effect until you return to the first frame of the simulation.
You cannot cache the results of ICE-driven transformations. Instead, you must plot the results. For more information about plotting, see Plotting (Baking) Animation [Animation].
Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License