Morrorz Posted April 26, 2021 Share Posted April 26, 2021 (edited) I have Subnet node name is "subnet1". In "subnet1" i have ROP node.The same name as subnet is "subnet1". When i change my subnet name change the my ROP name too. How to write in "On Name Change" python ? Thank you. Edited April 26, 2021 by Morrorz Quote Link to comment Share on other sites More sharing options...
DonRomano Posted April 26, 2021 Share Posted April 26, 2021 You might want to have a look at this : https://www.sidefx.com/docs/houdini/hom/hou/Node.html#addEventCallback Cheers, 1 Quote Link to comment Share on other sites More sharing options...
Morrorz Posted April 26, 2021 Author Share Posted April 26, 2021 Have exemple for me please !! hou.node("/subnet1").addEventCallback((hou.nodeEventType.NameChanged, ), name_changed) it's error sir Quote Link to comment Share on other sites More sharing options...
DonRomano Posted April 26, 2021 Share Posted April 26, 2021 I typed this (the example provided in the link I sent) in the Python Shell and it works fine : def name_changed(node, event_type, **kwargs): print("Geo node is now named %s" % node.name()) hou.node("/obj/geo1").addEventCallback((hou.nodeEventType.NameChanged, ), name_changed) You have to define a function to link to the event callback, and no just copy one line... Note this will work only for the current session, it won't be saved in the file if you close Houdini (as written in the doc link). Cheers, Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.