Jump to content

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'))



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...