IC Python API:RLPy REventCallback

From Reallusion Wiki!
Jump to: navigation, search
Main article: Modules.

Inheritance

This class inherits public member functions from:

Detailed Description

This class is used to register callbacks for system events.

class REventCallbackSampleCode(RLPy.REventCallback):
 def __init__(self):
   RLPy.REventCallback.__init__(self)

 def OnTimerUpdated (self, fTime):
   print('Updated time:' + str(fTime))

 def OnCurrentTimeChanged (self, fTime):
   print('Current time:' + str(fTime))
  
 def OnBeforeLoadFile(self, nFileType):
   print('File type:' + str(nFileType))

 def OnFileLoaded(self, nFileType):
   print('File type:' + str(nFileType))

 def OnAfterFileLoaded(self, nFileType):
   print('File type:' + str(nFileType))

 def OnProjectDataChanged(self, nProjectDataType):
   print('Project Data type:' + str(nProjectDataType))

 def OnBeforeSaveFile(self, nFileType, pProjectName):
   print('File type:' + str(nFileType) + ', Project Data type:' + str(nProjectDataType))

 def OnFileSaved(self, nFileType, pProjectName):
   print('File type:' + str(nFileType) + ', Project Data type:' + str(nProjectDataType))

 def OnObjectSelectionChanged(self):
   print('Object Selection Changed')

 def OnObjectDataChanged(self):
   print('Object Data Changed')

 def OnObjectAdded(self):
   print('Object Added')

 def OnObjectDeleted(self):
   print('Object Deleted')

 def OnDialogModeChanged(self, nDialogMode):
   print('Dialog Mode Changed ~ ' + 'Dialog Mode:' + str(nDialogMode))

 def OnPickedModeChanged(self, nPickMode, nPreviousPickMode):
   print('Picked Mode Changed ~ ' + ' Pick Mode:' + str(nPickMode) + ', Previous Pick Mode:' + str(nPreviousPickMode) )

 def OnUndoRedoDone(self):
   print('Undo Redo Done')

 def OnPlayed(self):
   print('Play')

 def OnStopped(self):
   print('Stop')

# register event
event_callback = REventCallbackSampleCode()
id = RLPy.REventHandler.RegisterCallback(event_callback)

Member Functions

OnAfterFileLoaded

RLPy.REventCallback.OnAfterFileLoaded ( self, nFileType )

Callback for after file loaded.

Parameters

nFileType [IN] file type - int


OnBeforeLoadFile

RLPy.REventCallback.OnBeforeLoadFile ( self, nFileType )

Callback for before load file.

Parameters

nFileType [IN] file type - int


OnBeforeSaveFile

RLPy.REventCallback.OnBeforeSaveFile ( self, nFileType, pProjectName )

Callback for before save file.

Parameters

nFileType [IN] file type - int

pProjectName [IN] project name - string


OnCurrentTimeChanged

RLPy.REventCallback.OnCurrentTimeChanged ( self, fTime )

Callback for current time changed.

Parameters

fTime [IN] current time - float


OnDialogModeChanged

RLPy.REventCallback.OnDialogModeChanged ( self, nDialogMode )

Callback for dialog mode changed.

Parameters

nDialogMode [IN] dialog mode - int


OnFileLoaded

RLPy.REventCallback.OnFileLoaded ( self, nFileType )

Callback for file loaded.

Parameters

nFileType [IN] file type - int


OnFileSaved

RLPy.REventCallback.OnFileSaved ( self, nFileType, pProjectName )

Callback for file saved.

Parameters

nFileType [IN] file type - int

pProjectName [IN] project name - string


OnProjectDataChanged

RLPy.REventCallback.OnProjectDataChanged ( self, nProjectDataType )

Callback for project data changed.

Parameters

nProjectDataType [IN] project data type - int


OnTimerUpdated

RLPy.REventCallback.OnTimerUpdated ( self, fTime )

Callback for timer updated.

Parameters

fTime [IN] current time - float