add callback event /hou.nodeEventType error

   5459   2   0
User Avatar
Member
58 posts
Joined: Sept. 2009
Offline
I wanna make a python callback in a Houdini OTL.
here is the code embed in the Python Module Section:

import hou
node = hou.node(“/obj/mySOP”)
def setUpCallback(node):
node.addEventCallback(hou.nodeEventType.ChildCreated, onNodeChange)

def onNodeChange(**kwargs):
if kwargs == hou.nodeEventType.ChildCreated:
print kwargs


however, every time I run the setUpCallback(node) the error message pop out:


File “/home/prisms/builder-new/Nightly11.0/dev/hfs/houdini/python2.6libs/hou.py”, line 6084, in addEventCallback
return _hou.Node_addEventCallback(*args)
TypeError: in method ‘Node_addEventCallback’, argument 2 of type ‘std::vector<HOM_EnumValue *,std::allocator<HOM_EnumValue * > > const &’


anyone has an idea about this ?
User Avatar
Member
1906 posts
Joined: Nov. 2006
Online
The method requires a tuple of node event types.
node.addEventCallback( (hou.nodeEventType.ChildCreated, ), onNodeChange)
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
58 posts
Joined: Sept. 2009
Offline
fast and correct! thank you Graham
  • Quick Links