Jump to content
Sign in to follow this  

Promote Specific Parameter with Python

Recommended Posts

I've got a script the creates a small node network and links them together. There was one thing I was stuck at though, how to I promote certain parameters on some of the nodes?  


Here's the script:

#Written by anim (odforce.net)
#Allows you to create nodes in currently active node view
tabs = hou.ui.currentPaneTabs() # get all active tabs
tabs = [tab for tab in tabs if tab.type() == hou.paneTabType.NetworkEditor] # keep only network editors
tabs = [tab for tab in tabs if tab.pwd().childTypeCategory().name() == "Vop"] # keep only Vopnets

#Creates nodes in active frame
if tabs:
    node = tabs[0].pwd()
    #Creates global variable, sets name, and sets output settings to single variable mode
    globe = node.createNode('global', 'global_wetmap').parm('usemenu').set(1)
    #Creates a transfrom node, sets name and changes space to world
    trans = node.createNode('transform', 'transform_wetmap').parm('tospace').set('space:world')
    #Creates a defult point cloud open node and names it
    pcopen = node.createNode('pcopen', 'pcopen_wetmap').parm
    #Creates a defult point cloud filter node and names it
    pcfilter = node.createNode('pcfilter', 'pcfilter_wetmap')

    #Sets up all node connections, ready to be attached to layer mix
    hou.node('/mat/ttop/transform_wetmap').setInput(0, hou.node('/mat/ttop/global_wetmap'))
    hou.node('/mat/ttop/pcopen_wetmap').setInput(2, hou.node('/mat/ttop/transform_wetmap'))
    hou.node('/mat/ttop/pcfilter_wetmap').setInput(0, hou.node('/mat/ttop/pcopen_wetmap'))



Share this post

Link to post
Share on other sites

In case it's not clear what I'm looking to do:




I want this file parm promoted automatically. Any insight? Still struggling here :(

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