Jump to content

How to python rename node in subnet


Morrorz

Recommended Posts

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 by Morrorz
Link to comment
Share on other sites

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,

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...