Class ChangeForegroundCallback

3DS Max Plug-In SDK

Class ChangeForegroundCallback

See Also: Class CommandMode, Class IScene.

class ChangeForegroundCallback

Description:

The purpose of this callback is to call INode::FlagForeground() for any nodes in the scene that are supposed to be in the foreground.

Methods:

Prototype:

virtual BOOL IsValid()=0;

Remarks:

Implemented by the Plug-In.

Returns TRUE if this foreground callback is valid ; otherwise FALSE. When the system needs to redraw the viewports the system checks to see if the current foreground callback is the same one that was in place the last time. If it is the same the system will call this method to see if the state is valid. If the state is not valid (this method returns FALSE) then the foreground and background are re-built and then the Validate() method is called so this foreground callback may note that it is invalid.

Prototype:

virtual void Invalidate()=0;

Remarks:

Implemented by the Plug-In.

The system calls this method of the plug-in when the foreground state is no longer valid. The plug-in should set a flag internally to indicate it is invalid. For example if the current node selection set changes the system calls this method to mark it as invalid so that the next time the system goes to redraw the viewports it can determine that it would need to rebuild the foreground and the background.

Prototype:

virtual void Validate()=0;

Remarks:

Implemented by the Plug-In.

The system calls this method when the foreground state is valid. For example after the foreground and background buffers have been re-built this method is called. The plug-in should set a flag internally to indicate it is valid.

Prototype:

virtual void callback(TimeValue t,IScene *scene)=0;

Remarks:

Implemented by the Plug-In.

This method is used to enumerate the scene and flag nodes in the scene that need to go in the foreground.

Parameters:

TimeValue t

The time to flag the nodes.

IScene *scene

This interface pointer provides methods to enumerate all nodes in the scene, or to flag nodes that are selected, animated or dependent on a given node.