Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import hou
- import math
- def main():
- ###**** First we will select the number of nodes we wan to connect and then basically use this as a list to connect all of them ****###
- limit = len(hou.selectedNodes())
- ####**** Then we create a list if the nodes w.r.t direction and then later sort them based on direction and connect them ****####
- yPos = []
- for aNode in hou.selectedNodes():
- yPos.append([aNode.position()[1], aNode])
- yPos = sorted(yPos)
- for i in xrange(len(yPos) - 1):
- yPos[i][1].setInput(0,yPos[i+1][1])
- for yNode in hou.selectedNodes():
- yFit = math.floor(yNode.position()[0])
- mean = (yNode.position()[1]) - (yFit) / (limit)
- xPos = []
- for xNode in hou.selectedNodes():
- xPos.append([xNode.position()[1], xNode])
- xPos = sorted(xPos)
- for i in xrange(len(xPos) - 1):
- meanPos = math.floor(((xPos[i+1][0]) + (xPos[i][0])) / (2))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement