def is_option_region_visible(context, space): from bpy_extras.asset_utils import SpaceAssetInfo if SpaceAssetInfo.is_asset_browser(space): pass # For the File Browser, there must be an operator for there to be options # (irrelevant for the Asset Browser). elif not space.active_operator: return False for region in context.area.regions: if region.type == 'TOOL_PROPS' and region.width <= 1: return False return True
def draw(self, context): from bpy_extras.asset_utils import SpaceAssetInfo layout = self.layout space_data = context.space_data if space_data.active_operator is None: layout.template_header() FILEBROWSER_MT_editor_menus.draw_collapsible(context, layout) if SpaceAssetInfo.is_asset_browser(space_data): layout.separator() self.draw_asset_browser_buttons(context) else: layout.separator_spacer() if not context.screen.show_statusbar: layout.template_running_jobs()