Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/modules/bpy_types.py
| Show First 20 Lines • Show All 777 Lines • ▼ Show 20 Lines | def _dyn_ui_initialize(cls): | ||||
| if workspace.use_filter_by_owner: | if workspace.use_filter_by_owner: | ||||
| owner_names = {owner_id.name for owner_id in workspace.owner_ids} | owner_names = {owner_id.name for owner_id in workspace.owner_ids} | ||||
| else: | else: | ||||
| owner_names = None | owner_names = None | ||||
| for func in draw_ls._draw_funcs: | for func in draw_ls._draw_funcs: | ||||
| # Begin 'owner_id' filter. | # Begin 'owner_id' filter. | ||||
| if owner_names is not None: | # Exclude Import/Export menus from this filtering (io addons should always show there) | ||||
| if self.bl_idname in ('TOPBAR_MT_file_import', 'TOPBAR_MT_file_export'): | |||||
campbellbarton: this could be related by a class variable, eg:
`if getattr(self, "bl_ui_no_filter", False):` | |||||
| pass | |||||
| elif owner_names is not None: | |||||
| owner_id = getattr(func, "_owner", None) | owner_id = getattr(func, "_owner", None) | ||||
| if owner_id is not None: | if owner_id is not None: | ||||
| if func._owner not in owner_names: | if func._owner not in owner_names: | ||||
| continue | continue | ||||
| # End 'owner_id' filter. | # End 'owner_id' filter. | ||||
| # so bad menu functions don't stop | # so bad menu functions don't stop | ||||
| # the entire menu from drawing | # the entire menu from drawing | ||||
| ▲ Show 20 Lines • Show All 249 Lines • Show Last 20 Lines | |||||
this could be related by a class variable, eg:
if getattr(self, "bl_ui_no_filter", False):