IC Python API:RLPy REventHandler

From Reallusion Wiki!
Revision as of 19:05, 31 March 2019 by Chuck (RL) (Talk | contribs) (Created page with "{{TOC}} {{Parent|IC_Python_API:RL_Python_Modules|Modules}} ==Detailed Description== This class is used to register callbacks for system events. <syntaxhighlight lang="Python">...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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].