IC Python API:RLPy REventHandler

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

Detailed Description

This class is used to register callbacks for system events.

class MyEventCallback(RLPy.REventCallback):
 def __init__(self):
   RLPy.REventCallback.__init__(self)
 def OnObjectSelectionChanged(self):
   print("OnObjectSelectionChanged")
 def OnFileLoaded(self, file_type):
   print("OnFileLoaded")
 def OnObjectDeleted(self):
   print("OnObjectDeleted")

# register event
event_callback = MyEventCallback()
id = RLPy.REventHandler.RegisterCallback(event_callback)
...
status = RLPy.REventHandler.UnregisterCallback(id) #return RStatus

Member Functions

RegisterCallback

RLPy.REventHandler.RegisterCallback ( pCallback )

Register event listener callback.

Parameters

pCallback [IN] REventCallback - RLPy.REventCallback

Returns

Callback id - int

UnregisterCallback

RLPy.REventHandler.UnregisterCallback ( uId )

Remove callback with id.

Parameters

uId [IN] callback id - int

Return Values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Fail


UnregisterCallbacks

RLPy.REventHandler.UnregisterCallbacks ( kIds )

Remove callbacks with ids.

Parameters

kIds [IN] callback ids - int

Return Values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Fail


SetListener

RLPy.REventHandler.SetListener ( pListener )

Set RIEventListener instance [internal].