diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-15 11:34:48 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-15 11:36:32 +0300 |
commit | 48c137ad5d5ac0cff7b2427d52c418ab6f24ba3f (patch) | |
tree | 6b7bca59ce93f190cd406d873e54b1750e596da3 /release/scripts/modules | |
parent | b8d21f9b9bfced8fc82aa8a4ada98f5ee06c70d5 (diff) |
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.
Diffstat (limited to 'release/scripts/modules')
-rw-r--r-- | release/scripts/modules/nodeitems_utils.py | 20 |
1 files changed, 3 insertions, 17 deletions
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): |