Jump to content
Sign in to follow this  
Morrorz

How to move parameter to root Python !!

Recommended Posts

Posted (edited)

import hou
#CreateNode
root = "/obj"
node = hou.node(root).createNode("geo" , "test")
#ParmGRP
parm_group = node.parmTemplateGroup()
parm = hou.IntParmTemplate("testParm", "TestParameter"  , 1)
#ParmAppend
parm_group.append(parm)
node.setParmTemplateGroup(parm_group)

#Move To Tranform Folder()
parm_group.remove("testParm")
parm_group.appendToFolder(parm_group.findIndicesForFolder("Transform"),node.parm("testParm").parmTemplate())
node.setParmTemplateGroup(parm_group)

#################### MOVE TO ROOT #######################

#################### ERROR #######################

parm_group = parm_group
parm_group.remove("testParm")
#parm_group.appendToFolder(parm_group.findIndicesForFolder("Misc"),node.parm("testParm").parmTemplate())
parm_group.appendToFolder(parm_group.findIndicesForFolder("root"),node.parm("testParm").parmTemplate())
node.setParmTemplateGroup(parm_group)

01.png

Edited by Morrorz

Share this post


Link to post
Share on other sites

After you run "node.setParmTemplateGroup(parm_group)" command the parameter is already by default added to the "root" parameter folder of the node.
Is there a specific reason why you are moving it to the transform folder?

Share this post


Link to post
Share on other sites
Posted (edited)

thanks very much #Martin Brattensborg

I want try move Translate,Rotate,Scale etc in Tranform Folder to Root sir.

Now i still can't do it.

Edited by Morrorz

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×