Promote Specific Parameter with Python

   2379   2   1
User Avatar
Member
19 posts
Joined: 6月 2016
Offline
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:

#Active node view written by anim (odforce.net)
#Allows you to create nodes in currently active node view
tabs = hou.ui.currentPaneTabs() # get all active tabs
tabs = # keep only network editors
tabs = # keep only Vopnets

#Creates nodes in active frame
if tabs:
node = tabs.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'))
Edited by HappehLemons - 2019年2月2日 16:30:09
User Avatar
Member
899 posts
Joined: 2月 2016
Offline
You mean you want to create channel references?
I guess you should just feed the one paramater value with one parm object

example when both parms are in the same node:

node = hou.pwd()
first = node.parm("first")
second = node.parm("second")

first.set(second)  # this will link the first parm to the values of the second parm
User Avatar
Member
19 posts
Joined: 6月 2016
Offline
Andr
You mean you want to create channel references?
I guess you should just feed the one paramater value with one parm object

example when both parms are in the same node:

node = hou.pwd()
first = node.parm("first")
second = node.parm("second")

first.set(second)  # this will link the first parm to the values of the second parm


I think there's confusion here, let me try to simplify.

I use python to create a node. I want a parameter of that node to be automatically promoted. Here's the way to manually do this:


What do I need to do in order to do this automatically in python?
  • Quick Links