#include <AlPlayFrame.h>
class AlPlayFrame
AlPlayFrame (boolean bAllChannels = FALSE);
~AlPlayFrame ();
statusCode viewFrame (const double frame, const boolean doRedraw = TRUE);
void setShowSameFrame (const boolean showSameFrame = FALSE)
Be VERY VERY CAREFUL about how you use this class. As part of its optimisation technique, a lot of animation information is cached outside of the normal messaging system. This means that if you delete some animation objects while an AlPlayFrame object is active, then at some stage PowerAnimator will become very confused (as in core dump confused). In addition, the constructor for this class REQUIRES that modelling windows be opened. Core dumps or strange behaviour within the application can occur if this condition is not met.
Ordinarily the AlPlayFrame class will not recompute a requested frame if it is already the current frame. However for certain uses (for example, if you are changing a keyframe position) it may be necessary to recompute the current frame. Passing TRUE to the setShowSameFrame method will allow you to override the default behavior.
To use AlPlayFrame, create an instance of AlPlayFrame at the point in your code where the viewFrames are to begin. Call the viewFrame member of that AlPlayframe object for as many frames as are necessary. When that AlPlayFrame object goes out of scope, the destructor undoes the optimization and it becomes safe to modify Alias structures. For example:
make list_of_frames;
{
AlPlayFrame playframe;
for frm in list_of_frames do
{
playframe.viewFrame( frm );
}
}
< doRedraw - TRUE if this method should perform the redraw, FALSE if the calling function well do it (perhaps by calling AlUniverse::redrawScreen)
sFailure - an error occurred (i.e. the universe may not have been initialized)