When a modifier is finished deforming the object, it needs to include its validity interval in the validity interval of the object.
This way if an object was static, but had an animated modifier applied to it, the system would know that the modifier would need to be re-evaluated if the user moves to a new time. To do this, the modifier calls the BaseObject::UpdateValidity()
function on the object, specifying the channel altered and the modifier's interval. Modifiers that only affect the geometry channel would specify GEOM_CHAN_NUM
. Modifiers that affect other channels would have to call this method once for each channel modified. The interval that is passed in to this method is then intersected with the interval that the object keeps for each channel. So as the object travels through the pipeline, its validity intervals are potentially getting smaller as (possibly) animated modifiers are applied to it.
The base class SimpleMod
and SimpleWSMMod
calls BaseObject::UpdateValidity()
with GEOM_CHAN_NUM
. The developer must supply the modifier's validity interval to SimpleWSMMod
by implementing the virtual method RefTarget::GetValidity()
.
The Bend modifier sample implements the RefTarget::GetValidity()
method by starting with an interval of FOREVER
, then intersecting it with the intervals of its animated parameters. This computes the overall validity interval for the modifier.