Skip to content

Instantly share code, notes, and snippets.

@iCyP
Last active January 11, 2019 13:56
Show Gist options
  • Save iCyP/698029242f72ae8de6d6f847eece9ac7 to your computer and use it in GitHub Desktop.
Save iCyP/698029242f72ae8de6d6f847eece9ac7 to your computer and use it in GitHub Desktop.
blender_node_placer
import bpy
def node_placer(parent_node):
bottom_pos = [parent_node.location[0]-100-parent_node.width, parent_node.location[1]]
for child_node in [link.from_node for socket in parent_node.inputs for link in socket.links]:
child_node.location = bottom_pos
bottom_pos[1] -= (parent_node.height +100)
for ch_node in [link.from_node for socket in child_node.inputs for link in socket.links]:
node_placer(child_node)
return
node_placer(#output node object here)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment