Move Anim_Setup
module into Blender_Kitsu
#5
@ -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()
|
||||||
|
|
||||||
|
15
blender_kitsu/anim_setup/ops.py
Normal file
15
blender_kitsu/anim_setup/ops.py
Normal 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"}
|
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user