Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. import hou
  2. items = hou.selectedItems()
  3. editor = hou.ui.paneTabOfType(hou.paneTabType.NetworkEditor)
  4. images = list(editor.backgroundImages())
  5. for item in items:
  6. if isinstance(item, hou.NetworkBox):
  7. nodes = item.nodes()
  8. nodes = hou.sortedNodes(nodes)
  9. for i in range(len(nodes)):
  10. node = nodes[i]
  11. pos = node.position()
  12. image = hou.NetworkImage()
  13. image.setPath('$HIP/images/'+str(i+1)+'.png')
  14. x1 = - 0.4
  15. y1 = 0
  16. x2 = x1 + 0.4
  17. y2 = y1 + 0.4
  18. image.setRelativeToPath(node.path())
  19. image.setRect(hou.BoundingRect(x1,y1,x2,y2))
  20. images.append(image)
  21. editor.setBackgroundImages(images)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement