[Bf-blender-cvs] [48c137ad5d5] blender2.8: UI: remove node tree panels
Campbell Barton
noreply at git.blender.org
Thu Nov 15 09:37:18 CET 2018
Commit: 48c137ad5d5ac0cff7b2427d52c418ab6f24ba3f
Author: Campbell Barton
Date: Thu Nov 15 19:34:48 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB48c137ad5d5ac0cff7b2427d52c418ab6f24ba3f
UI: remove node tree panels
This duplicates items in the add menu and uses a lot of vertical space.
This should be used for tools or disabled.
===================================================================
M release/scripts/modules/nodeitems_utils.py
===================================================================
diff --git a/release/scripts/modules/nodeitems_utils.py b/release/scripts/modules/nodeitems_utils.py
index 699b6ce0528..76342b9e645 100644
--- a/release/scripts/modules/nodeitems_utils.py
+++ b/release/scripts/modules/nodeitems_utils.py
@@ -105,7 +105,7 @@ def register_node_categories(identifier, cat_list):
raise KeyError("Node categories list '%s' already registered" % identifier)
return
- # works as draw function for both menus and panels
+ # works as draw function for menus
def draw_node_item(self, context):
layout = self.layout
col = layout.column()
@@ -113,7 +113,6 @@ def register_node_categories(identifier, cat_list):
item.draw(item, col, context)
menu_types = []
- panel_types = []
for cat in cat_list:
menu_type = type("NODE_MT_category_" + cat.identifier, (bpy.types.Menu,), {
"bl_space_type": 'NODE_EDITOR',
@@ -122,21 +121,10 @@ def register_node_categories(identifier, cat_list):
"poll": cat.poll,
"draw": draw_node_item,
})
- panel_type = type("NODE_PT_category_" + cat.identifier, (bpy.types.Panel,), {
- "bl_space_type": 'NODE_EDITOR',
- "bl_region_type": 'TOOLS',
- "bl_label": cat.name,
- "bl_category": cat.name,
- "category": cat,
- "poll": cat.poll,
- "draw": draw_node_item,
- })
menu_types.append(menu_type)
- panel_types.append(panel_type)
bpy.utils.register_class(menu_type)
- bpy.utils.register_class(panel_type)
def draw_add_menu(self, context):
layout = self.layout
@@ -145,8 +133,8 @@ def register_node_categories(identifier, cat_list):
if cat.poll(context):
layout.menu("NODE_MT_category_%s" % cat.identifier)
- # stores: (categories list, menu draw function, submenu types, panel types)
- _node_categories[identifier] = (cat_list, draw_add_menu, menu_types, panel_types)
+ # stores: (categories list, menu draw function, submenu types)
+ _node_categories[identifier] = (cat_list, draw_add_menu, menu_types)
def node_categories_iter(context):
@@ -165,8 +153,6 @@ def node_items_iter(context):
def unregister_node_cat_types(cats):
for mt in cats[2]:
bpy.utils.unregister_class(mt)
- for pt in cats[3]:
- bpy.utils.unregister_class(pt)
def unregister_node_categories(identifier=None):
More information about the Bf-blender-cvs
mailing list