Move Anim_Setup module into Blender_Kitsu #5

Merged
Nick Alberelli merged 27 commits from :feature/merge_anim_setup_into_blender_kitsu into master 2023-04-05 17:38:41 +02:00
3 changed files with 22 additions and 0 deletions
Showing only changes of commit 853bf6d303 - Show all commits

View File

@ -40,6 +40,8 @@ from blender_kitsu import (
ui, ui,
) )
from blender_kitsu.anim_setup import ops #TODO Fix Registraion
from blender_kitsu.logger import LoggerFactory, LoggerLevelManager from blender_kitsu.logger import LoggerFactory, LoggerLevelManager
logger = LoggerFactory.getLogger(__name__) logger = LoggerFactory.getLogger(__name__)
@ -79,6 +81,7 @@ if _need_reload:
context.reload() context.reload()
tasks.reload() tasks.reload()
anim.reload() anim.reload()
#ops.reload()
def register(): def register():
@ -94,6 +97,7 @@ def register():
playblast.register() playblast.register()
anim.register() anim.register()
shot_builder.register() shot_builder.register()
ops.register()
LoggerLevelManager.configure_levels() LoggerLevelManager.configure_levels()
logger.info("Registered blender-kitsu") logger.info("Registered blender-kitsu")
@ -112,6 +116,7 @@ def unregister():
lookdev.unregister() lookdev.unregister()
playblast.unregister() playblast.unregister()
shot_builder.unregister() shot_builder.unregister()
ops.unregister()
LoggerLevelManager.restore_levels() LoggerLevelManager.restore_levels()

View File

@ -0,0 +1,15 @@
import bpy
from typing import Set
from blender_kitsu import prefs
class ANIM_SETUP_OT_setup_workspaces(bpy.types.Operator):
bl_idname = "anim_setup.setup_workspaces"
bl_label = "Setup Workspace"
bl_description = "Sets up the workspaces for the animation task"
def execute(self, context: bpy.types.Context) -> Set[str]:
# Remove non anim workspaces.
for ws in bpy.data.workspaces:
if ws.name != "Animation":
bpy.ops.workspace.delete({"workspace": ws})
self.report({"INFO"}, "Deleted non Animation workspaces")
return {"FINISHED"}

View File

@ -158,6 +158,8 @@ class SHOTBUILDER_OT_NewShotFile(bpy.types.Operator):
shot_builder.create_build_steps() shot_builder.create_build_steps()
shot_builder.build() shot_builder.build()
# Load Anim Workspace
bpy.ops.anim_setup.setup_workspaces()
return {'FINISHED'} return {'FINISHED'}
def draw(self, context: bpy.types.Context) -> None: def draw(self, context: bpy.types.Context) -> None: