Last active
January 11, 2019 13:56
-
-
Save iCyP/698029242f72ae8de6d6f847eece9ac7 to your computer and use it in GitHub Desktop.
blender_node_placer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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