Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormeta-androcto <meta.androcto1@gmail.com>2019-09-07 16:37:18 +0300
committermeta-androcto <meta.androcto1@gmail.com>2019-09-07 16:37:18 +0300
commit38b058643278b2459a3aded2c36c73e1c955b34a (patch)
tree51b969e746ae142eeb6e02ef21a233819c24eaeb /node_arrange.py
parent104a15ff9b2b00e3603d5bf07d8964af53f00772 (diff)
node_arrange: support align inside groups
Diffstat (limited to 'node_arrange.py')
-rw-r--r--node_arrange.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/node_arrange.py b/node_arrange.py
index 370cbeff..724401bb 100644
--- a/node_arrange.py
+++ b/node_arrange.py
@@ -19,7 +19,7 @@
bl_info = {
"name": "Node Arrange",
"author": "JuhaW",
- "version": (0, 2, 1),
+ "version": (0, 2, 2),
"blender": (2, 80, 4),
"location": "Node Editor > Properties > Trees",
"description": "Node Tree Arrangement Tools",
@@ -223,6 +223,19 @@ def nodemargin(self, context):
ntree = context.space_data.node_tree
+ #first arrange nodegroups
+ n_groups = []
+ for i in ntree.nodes:
+ if i.type == 'GROUP':
+ n_groups.append(i)
+
+ while n_groups:
+ j = n_groups.pop(0)
+ nodes_iterate(j.node_tree)
+ for i in j.node_tree.nodes:
+ if i.type == 'GROUP':
+ n_groups.append(i)
+
nodes_iterate(ntree)
# arrange nodes + this center nodes together
@@ -264,7 +277,7 @@ class NA_OT_ArrangeNodesOp(bpy.types.Operator):
def outputnode_search(ntree): # return node/None
outputnodes = []
- for node in bpy.context.space_data.node_tree.nodes:
+ for node in ntree.nodes:
if not node.outputs:
for input in node.inputs:
if input.is_linked: