Event Callbacks

An event handler is implemented by an OnEvent callback. All OnEvent callbacks have the same signature: they get a Context object as an argument, and return true or false.

C++ Example: OnEvent Callback

XSIPLUGINCALLBACK CStatus <event_handler_name>_OnEvent( CRef& in_ctxt )
{
   Context ctxt( in_ctxt );

//  Your code goes here .

//  Return false to perform the operation, true to abort
   return false;
}

JScript Example: OnEvent Callback

function OnBeginNewScene_OnEvent( in_ctxt )
{

//  Your code goes here .

//  Return false to perform the operation, true to abort
   return false;
}

Python Example: OnEvent Callback

def MyOnBeginNewScene_OnEvent( in_ctxt ):

#  Your code goes here .

#  Return False to perform the operation, True to abort
   return False

For operations such as save, import, and export, the OnEvent return value specifies whether to abort the operation. Return True to abort the operation, and otherwise return False to allow the operation to continue.

You can abort the following:

• OnBeginNewScene

• OnBeginSceneOpen

• OnBeginSceneSave

• OnBeginSceneSaveAs

• OnBeginFrame

• OnBeginSequence

• OnBeginFileImport

• OnBeginFileExport



SOFTIMAGE|XSI v6.01     

Return to Softimage XSI Index