Subnet rename inputs / labels using python

   1046   1   0
User Avatar
Member
2 posts
Joined: Dec. 2014
Offline
Hello,
can't find how to change input names and labels using python. (see image for reference)

thanks
Jonathan

Attachments:
name_label.JPG (71.1 KB)

User Avatar
Member
236 posts
Joined: March 2023
Offline
Hello, I know this is a bit of an old thread, but I wanted to update it with the solution for any futures reference :

The subnet plug name are actually houdini's parameter and can be simply renamed with node.parm("").set()

each plug have 2 parameter respectively named "name1" "name2" "name3" "label1" "label2" "label3" up to 64

exemple :

import hou
subnet = hou.node("/mat").createNode("subnet")
subnetoutput = subnet.node("suboutput1")
textureNode = subnet.createNode("texture")

subnetoutput.setInput(0, textureNode, 0)

subnetoutput.parm("name1").set("myfirstinput")
subnetoutput.parm("label1").set("Fancy Label")

Hope it help !
Edited by ASquirrel - Sept. 17, 2023 06:23:16

Attachments:
007181_hindie_feZdkhEqin_2023-09-17_12-18-00.png (28.9 KB)

Head of Pipeline @ LightVFX
  • Quick Links