[Bf-blender-cvs] [3e1b755ead4] blender2.8: UI: Center ID Blocks in Node Editor

William Reynish noreply at git.blender.org
Thu Jun 28 00:49:26 CEST 2018


Commit: 3e1b755ead48e7d739c33fa8da5d0c5ea3bf5553
Author: William Reynish
Date:   Thu Jun 28 00:30:22 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB3e1b755ead48e7d739c33fa8da5d0c5ea3bf5553

UI: Center ID Blocks in Node Editor

See T55635

===================================================================

M	release/scripts/startup/bl_ui/space_node.py

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py
index 521c510ad2d..d8b06662830 100644
--- a/release/scripts/startup/bl_ui/space_node.py
+++ b/release/scripts/startup/bl_ui/space_node.py
@@ -57,6 +57,16 @@ class NODE_HT_header(Header):
 
             ob = context.object
             if snode.shader_type == 'OBJECT' and ob:
+
+                NODE_MT_editor_menus.draw_collapsible(context, layout)
+
+                # No shader nodes for Eevee lamps
+                if snode_id and not (context.engine == 'BLENDER_EEVEE' and ob.type == 'LAMP'):
+                    row = layout.row()
+                    row.prop(snode_id, "use_nodes")
+
+                layout.separator_spacer()
+
                 row = layout.row()
                 # disable material slot buttons when pinned, cannot find correct slot within id_from (#36589)
                 row.enabled = not snode.pin
@@ -67,56 +77,60 @@ class NODE_HT_header(Header):
                 if id_from and ob.type != 'LAMP':
                     row.template_ID(id_from, "active_material", new="material.new")
 
-                # No shader nodes for Eevee lamps
-                if snode_id and not (context.engine == 'BLENDER_EEVEE' and ob.type == 'LAMP'):
-                    row.prop(snode_id, "use_nodes")
+            if snode.shader_type == 'WORLD':
 
                 NODE_MT_editor_menus.draw_collapsible(context, layout)
 
-            if snode.shader_type == 'WORLD':
-                row = layout.row()
-                row.enabled = not snode.pin
-                row.template_ID(scene, "world", new="world.new")
-
                 if snode_id:
+                    row = layout.row()
                     row.prop(snode_id, "use_nodes")
 
-                NODE_MT_editor_menus.draw_collapsible(context, layout)
+                layout.separator_spacer()
+
+                row = layout.row()
+                row.enabled = not snode.pin
+                row.template_ID(scene, "world", new="world.new")
 
             if snode.shader_type == 'LINESTYLE':
                 view_layer = context.view_layer
                 lineset = view_layer.freestyle_settings.linesets.active
-                if lineset is not None:
-                    row = layout.row()
-                    row.enabled = not snode.pin
-                    row.template_ID(lineset, "linestyle", new="scene.freestyle_linestyle_new")
 
+                if lineset is not None:
                     NODE_MT_editor_menus.draw_collapsible(context, layout)
 
                     if snode_id:
+                        row = layout.row()
                         row.prop(snode_id, "use_nodes")
 
+                    layout.separator_spacer()
+
+                    row = layout.row()
+                    row.enabled = not snode.pin
+                    row.template_ID(lineset, "linestyle", new="scene.freestyle_linestyle_new")
+
         elif snode.tree_type == 'TextureNodeTree':
             layout.prop(snode, "texture_type", text="", expand=True)
 
+            NODE_MT_editor_menus.draw_collapsible(context, layout)
+
+            if snode_id:
+                layout.prop(snode_id, "use_nodes")
+
+            layout.separator_spacer()
+
             if id_from:
                 if snode.texture_type == 'BRUSH':
                     layout.template_ID(id_from, "texture", new="texture.new")
                 else:
                     layout.template_ID(id_from, "active_texture", new="texture.new")
 
-            if snode_id:
-                layout.prop(snode_id, "use_nodes")
+        elif snode.tree_type == 'CompositorNodeTree':
 
             NODE_MT_editor_menus.draw_collapsible(context, layout)
 
-        elif snode.tree_type == 'CompositorNodeTree':
-
             if snode_id:
                 layout.prop(snode_id, "use_nodes")
 
-            NODE_MT_editor_menus.draw_collapsible(context, layout)
-
             layout.prop(snode, "use_auto_render")
             layout.prop(snode, "show_backdrop")
             if snode.show_backdrop:
@@ -125,9 +139,11 @@ class NODE_HT_header(Header):
 
         else:
             # Custom node tree is edited as independent ID block
-            layout.template_ID(snode, "node_tree", new="node.new_node_tree")
             NODE_MT_editor_menus.draw_collapsible(context, layout)
 
+            layout.separator_spacer()
+
+            layout.template_ID(snode, "node_tree", new="node.new_node_tree")
         layout.separator_spacer()
 
         layout.prop(snode, "pin", text="")



More information about the Bf-blender-cvs mailing list