Developers working with animation need to specify points in time and time intervals. The basic unit of time in 3ds Max and the SDK is 1/4800th of a second. This length of time is a data type named TimeValue
. TimeValue
s are used throughout the class methods in the SDK when a particular instant in time needs to be specified. For example, if your plug-in needs to know the current system time (the position of the 3ds Max frame slider) it calls Interface::GetTime()
, which returns a TimeValue
that indicates the current time.
In 3ds Max, intervals are commonly used to define the time period in which an object remains unchanged. For processing efficiency, 3ds Max avoids re-computing objects whenever it can. If an animated plug-in can specify how long it will remain unchanged, 3ds Max does not need to re-evaluate the object during that time interval. For example, 3ds Max needs to know for how long a modification made by a modifier can be assumed to be valid. Consider a Bend modifier where the user has animated the bend angle over time: un-bent from frame 0 to frame 50, and then bent 45 degrees at frame 100. So that 3ds Max does not need to re-evaluate the modifier every frame (it is not bending from frame 0 to 50) the modifier provides 3ds Max with a Validity Interval that indicates how long the object remains unmodified. This Validity Interval is expressed as a Time Interval that starts at given time. So, if 3ds Max asks the modifier, at Frame 0, for the Time Interval that the object remains unmodified, the response is 50. If 3ds Max asks the modifier, at Frame 75, for example, the Time Interval that the object remains unmodified, the response is 1, because the modifier continuously bends, at each frame, from frame 51 to frame 100.
Intervals of time are specified in the SDK using an Interval object. This object has a start and end time and various methods to work with the interval. There are numerous methods that a plug-in implements to specify Validity Intervals. The modifier example above would do so using the method Modifier::LocalValidity
().