Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import hou
- items = hou.selectedItems()
- editor = hou.ui.paneTabOfType(hou.paneTabType.NetworkEditor)
- images = list(editor.backgroundImages())
- for item in items:
- if isinstance(item, hou.NetworkBox):
- nodes = item.nodes()
- nodes = hou.sortedNodes(nodes)
- for i in range(len(nodes)):
- node = nodes[i]
- pos = node.position()
- image = hou.NetworkImage()
- image.setPath('$HIP/images/'+str(i+1)+'.png')
- x1 = - 0.4
- y1 = 0
- x2 = x1 + 0.4
- y2 = y1 + 0.4
- image.setRelativeToPath(node.path())
- image.setRect(hou.BoundingRect(x1,y1,x2,y2))
- images.append(image)
- editor.setBackgroundImages(images)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement