coccarolla
Jan. 7, 2026 05:34:11
Can someone please help me understand conceptually the difference between these two? Why or when should you make use of one or the other?
mabelzile
Jan. 15, 2026 16:00:12
__init__() is the Python handle constructor and is called when the state is entered and the handle is created.
onActivate() is called by Houdini to initialize an existing handle, either when the state is first entered or when it is resumed.
When the state exits, onDeactivate() is called and the handle is deleted. The next time the state is entered, a new handle is created and onActivate() is called again.
Interrupting a state does not delete the handle, but still triggers onDeactivate().
coccarolla
Jan. 16, 2026 07:30:24
mabelzile
__init__() is the Python handle constructor and is called when the state is entered and the handle is created.
onActivate() is called by Houdini to initialize an existing handle, either when the state is first entered or when it is resumed.
When the state exits, onDeactivate() is called and the handle is deleted. The next time the state is entered, a new handle is created and onActivate() is called again.
Interrupting a state does not delete the handle, but still triggers onDeactivate().
Great, things are starting to make sense.
Can you share a bit of insight on how to use onDeactivate specifically? Do you need to call something to delete the handle or is that handled by Houdini on exiting the viewer state? I know about registering, is that the same?