Modifing Parm with Python

   367   0   1
User Avatar
Member
146 posts
Joined: June 2016
Offline
Hi all, Ive read multiple forums regarding this but still not able to make it work.

Im trying to modify a custom `multiline string parm`
I want to change the language of it through python, say i have a dropdown to choose formatting whether python or vex.

here is what i did so far, I found the way to do this is using the .setTag() function to set {"editorlang : "python"}
i can see the tags are modified by printing my parmTemplateGroup but i couldnt see the change in the node.

Im not sure what im doing wrong, can someone help please?


import hou

n = hou.node('/obj/htip2')
g = n.parmTemplateGroup()

old_lang = g.find("code")
new_lang = old_lang
new_lang.setTags({"editorlang":"python"})

g.replace("code", new_lang)
n.setParmTemplateGroup(g)

print(new_lang.tags())
Edited by Mohanpugaz - May 2, 2024 08:09:37
Mohan Pugaz
movfx
https://www.instagram.com/movfx/ [www.instagram.com]
https://www.youtube.com/channel/@_movfx
  • Quick Links