Jump to content
gemini

Adding a Parameter (button) after an Exiting One in Python

Recommended Posts

Posted (edited)

Hi,

In a Filecache node I would like to add an other Rendering button after the factory default button.

Can it be somehow ?

G

Edited by gemini

Share this post


Link to post
Share on other sites

Hi there!

You can add spare parameters using the Edit Parameter Interface option in the FileCache node settings (the little gear icon). Please note that it will only be available in your current scene file. If you want it available across all scenes, then you need to save it as a permanent default.

Hope it helps :)

 

Cheers

-J

 

 

Share this post


Link to post
Share on other sites

Hi,

Thanks, but you see we are in the scripting section. I meant in Python. ;)

Sz

Share this post


Link to post
Share on other sites

It can be done but you're probably better making an HDA

The code it something like

node = hou.node('/obj/geo1/FILE')
new_button = hou.ButtonParmTemplate("new_button", "New Button")
node.addSpareParmTuple(new_button)

You need to set the proper scripts in the button for it to replicate the actual button logic

Share this post


Link to post
Share on other sites

Ofcourse you meant Python. How did I miss that ? Here you go :)

# Get the file cache node 
cacheNode = hou.node("/obj/geo1/filecache1")

# Get the param template group for the file cache node
parmTempGrp = cacheNode.parmTemplateGroup()

# create a button param template 
myButton = hou.ButtonParmTemplate('myrender', 'Render')

# Insert my button param template after the Save to Disk -(execute) parameter
parmTempGrp.insertAfter('execute', myButton)

# Set the updated param template group to the cache node 
cacheNode.setParmTemplateGroup(parmTempGrp) 

 

Cheers

-J

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

×