# Scene Workspaces - Blender Add-On # Copyright (C) 2024 Francesco Bellini # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . import bpy from .classes.funcs import select_all, draw_workspace_menu from .classes.ops import SW_OT_workspace, SW_OT_link_workspace, SW_OT_move, SW_OT_link_all, SW_OT_remove, SW_OT_switch, SW_OT_rename, SW_OT_copy_from_scene from .classes.topbar import TOPBAR_HT_upper_bar from .classes.panel import SW_PT_select_scene_workspaces from .classes.menu import SW_MT_missing_workspaces, SW_MT_copy_from from .classes.prefs import SWPreferences bl_info = { "id": "scene_workspaces", "name": "Scene Workspaces", "tagline": "Filter and rearrange workspaces individually for each scene", "blender": (4, 2, 0), "location": "Workspaces topbar, Properties > Scene", "category": ["System", "User Interface", "Scene"], "support": "COMMUNITY", "blender_manifest": "blender_manifest.toml" } classes = [ SW_OT_workspace, SW_OT_switch, SW_OT_move, SW_OT_remove, SW_OT_link_all, SW_OT_link_workspace, SW_OT_rename, SW_OT_copy_from_scene, SW_MT_missing_workspaces, SW_MT_copy_from, SW_PT_select_scene_workspaces, SWPreferences, TOPBAR_HT_upper_bar ] og_header = None; def register(): global og_header og_header = bpy.types.TOPBAR_HT_upper_bar; for c in classes: bpy.utils.register_class(c) bpy.types.TOPBAR_MT_workspace_menu.prepend(draw_workspace_menu) def unregister(): for c in reversed(classes): bpy.utils.unregister_class(c) bpy.utils.register_class(og_header) bpy.types.TOPBAR_MT_workspace_menu.remove(draw_workspace_menu) if __name__ == "__main__": register()