Hi,
Can anyone show me an example of how I can join nodes together for example a set of sop nodes in a for loop ie box > facet > null . I just dont quite get the syntax of how to have a list of nodes and wire one nodes output to another nodes input .
Kind regards
Rob
Q: - General Python help !
4044 11 1- circusmonkey
- Member
- 2624 posts
- Joined: 8月 2006
- Offline
- pelos
- Member
- 621 posts
- Joined: 8月 2008
- Offline
- circusmonkey
- Member
- 2624 posts
- Joined: 8月 2006
- Offline
- Ferry Taswin
- Member
- 4 posts
- Joined: 9月 2014
- Offline
- circusmonkey
- Member
- 2624 posts
- Joined: 8月 2006
- Offline
- pezetko
- Member
- 392 posts
- Joined: 11月 2008
- Offline
- circusmonkey
- Member
- 2624 posts
- Joined: 8月 2006
- Offline
- circusmonkey
- Member
- 2624 posts
- Joined: 8月 2006
- Offline
Hi all,
I can create a list of nodes children() how can I delete a specific node from a list . for example I want to delete the file1 node but there may be 25 nodes in there. I was thinking along the lines of a if statement to look at a list ie
variable = somenode.something(“file1”)
if var = true
blah.destroy()
Rob
I can create a list of nodes children() how can I delete a specific node from a list . for example I want to delete the file1 node but there may be 25 nodes in there. I was thinking along the lines of a if statement to look at a list ie
variable = somenode.something(“file1”)
if var = true
blah.destroy()
master = hou.node('/obj')
node = master.createNode('geo', ‘obj_box’)
node.moveToGoodPosition()
for child in node.children():
print child
Rob
Gone fishing
- Anonymous
- Member
- 678 posts
- Joined: 7月 2005
- Offline
- circusmonkey
- Member
- 2624 posts
- Joined: 8月 2006
- Offline
- circusmonkey
- Member
- 2624 posts
- Joined: 8月 2006
- Offline
python ……..
# create empty geo node
obj = hou.node(“/obj”)
n = obj.createNode(“geo”, “box_obj”)
n.moveToGoodPosition()
p = n.parmTuple(“t”).set((2,0.5,0))
### create box node inside
b = n.createNode(“box”)
b.parmTuple('size').set((1, 1, 1))
sel = n.setSelected(True)
Taking the previous post I figured how I could automatically select an object on creation then delete the file1 sop. I am going to stick my neck out and assume its not best practice to select then delete. I had a crack at deleting the file1 sop with an approach where I did not select the node. All I got was hou.object didn't support inline . Any other workflows I could explore ?
Rob
# create empty geo node
obj = hou.node(“/obj”)
n = obj.createNode(“geo”, “box_obj”)
n.moveToGoodPosition()
p = n.parmTuple(“t”).set((2,0.5,0))
### create box node inside
b = n.createNode(“box”)
b.parmTuple('size').set((1, 1, 1))
sel = n.setSelected(True)
Taking the previous post I figured how I could automatically select an object on creation then delete the file1 sop. I am going to stick my neck out and assume its not best practice to select then delete. I had a crack at deleting the file1 sop with an approach where I did not select the node. All I got was hou.object didn't support inline . Any other workflows I could explore ?
Rob
Gone fishing
- Anonymous
- Member
- 678 posts
- Joined: 7月 2005
- Offline
A little late, so you probably figured this out till now, but take a look at what arguments can be passed into this method:
http://www.sidefx.com/docs/houdini14.0/hom/hou/Node#createNode [sidefx.com]
If you set run_init_scripts = False, than it will create only container without file1.
http://www.sidefx.com/docs/houdini14.0/hom/hou/Node#createNode [sidefx.com]
If you set run_init_scripts = False, than it will create only container without file1.
-
- Quick Links