Blender Kitsu: Set Custom Thumbnail during Playblast #77
@ -38,7 +38,10 @@ from blender_kitsu.types import (
|
|||||||
TaskStatus,
|
TaskStatus,
|
||||||
TaskType,
|
TaskType,
|
||||||
)
|
)
|
||||||
from blender_kitsu.playblast.core import playblast_with_shading_settings, playblast_user_shading_settings
|
from blender_kitsu.playblast.core import (
|
||||||
|
playblast_with_shading_settings,
|
||||||
|
playblast_user_shading_settings,
|
||||||
|
)
|
||||||
from blender_kitsu.playblast import opsdata
|
from blender_kitsu.playblast import opsdata
|
||||||
|
|
||||||
logger = LoggerFactory.getLogger()
|
logger = LoggerFactory.getLogger()
|
||||||
@ -64,7 +67,8 @@ class KITSU_OT_playblast_create(bpy.types.Operator):
|
|||||||
task_status: bpy.props.EnumProperty(items=cache.get_all_task_statuses_enum) # type: ignore
|
task_status: bpy.props.EnumProperty(items=cache.get_all_task_statuses_enum) # type: ignore
|
||||||
|
|
||||||
use_user_shading: bpy.props.BoolProperty(
|
use_user_shading: bpy.props.BoolProperty(
|
||||||
name="Use Current Viewport Shading", default=True)
|
name="Use Current Viewport Shading", default=True
|
||||||
|
)
|
||||||
frame_number: bpy.props.IntProperty(name="Thumbnail Frame")
|
frame_number: bpy.props.IntProperty(name="Thumbnail Frame")
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -77,7 +81,6 @@ class KITSU_OT_playblast_create(bpy.types.Operator):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def execute(self, context: bpy.types.Context) -> Set[str]:
|
def execute(self, context: bpy.types.Context) -> Set[str]:
|
||||||
|
|
||||||
addon_prefs = prefs.addon_prefs_get(context)
|
addon_prefs = prefs.addon_prefs_get(context)
|
||||||
|
|
||||||
if not self.task_status:
|
if not self.task_status:
|
||||||
@ -97,12 +100,14 @@ class KITSU_OT_playblast_create(bpy.types.Operator):
|
|||||||
# Render and save playblast
|
# Render and save playblast
|
||||||
if self.use_user_shading:
|
if self.use_user_shading:
|
||||||
output_path = playblast_user_shading_settings(
|
output_path = playblast_user_shading_settings(
|
||||||
self, context, context.scene.kitsu.playblast_file)
|
self, context, context.scene.kitsu.playblast_file
|
||||||
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Get output path.
|
# Get output path.
|
||||||
output_path = playblast_with_shading_settings(
|
output_path = playblast_with_shading_settings(
|
||||||
self, context, context.scene.kitsu.playblast_file)
|
self, context, context.scene.kitsu.playblast_file
|
||||||
|
)
|
||||||
|
|
||||||
context.window_manager.progress_update(1)
|
context.window_manager.progress_update(1)
|
||||||
|
|
||||||
@ -153,7 +158,9 @@ class KITSU_OT_playblast_create(bpy.types.Operator):
|
|||||||
# Setup video sequence editor space.
|
# Setup video sequence editor space.
|
||||||
if "Video Editing" not in [ws.name for ws in bpy.data.workspaces]:
|
if "Video Editing" not in [ws.name for ws in bpy.data.workspaces]:
|
||||||
scripts_path = bpy.utils.script_paths(use_user=False)[0]
|
scripts_path = bpy.utils.script_paths(use_user=False)[0]
|
||||||
template_path = "/startup/bl_app_templates_system/Video_Editing/startup.blend"
|
template_path = (
|
||||||
|
"/startup/bl_app_templates_system/Video_Editing/startup.blend"
|
||||||
|
)
|
||||||
ws_filepath = Path(scripts_path + template_path)
|
ws_filepath = Path(scripts_path + template_path)
|
||||||
bpy.ops.workspace.append_activate(
|
bpy.ops.workspace.append_activate(
|
||||||
idname="Video Editing",
|
idname="Video Editing",
|
||||||
@ -275,7 +282,6 @@ class KITSU_OT_playblast_create(bpy.types.Operator):
|
|||||||
webbrowser.open(url)
|
webbrowser.open(url)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class KITSU_OT_playblast_set_version(bpy.types.Operator):
|
class KITSU_OT_playblast_set_version(bpy.types.Operator):
|
||||||
bl_idname = "kitsu.anim_set_playblast_version"
|
bl_idname = "kitsu.anim_set_playblast_version"
|
||||||
bl_label = "Version"
|
bl_label = "Version"
|
||||||
@ -373,7 +379,6 @@ class KITSU_OT_playblast_increment_playblast_version(bpy.types.Operator):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def execute(self, context: bpy.types.Context) -> Set[str]:
|
def execute(self, context: bpy.types.Context) -> Set[str]:
|
||||||
|
|
||||||
# Incremenet version.
|
# Incremenet version.
|
||||||
version = opsdata.add_playblast_version_increment(context)
|
version = opsdata.add_playblast_version_increment(context)
|
||||||
|
|
||||||
@ -473,7 +478,6 @@ def register():
|
|||||||
|
|
||||||
|
|
||||||
def unregister():
|
def unregister():
|
||||||
|
|
||||||
# Clear handlers.
|
# Clear handlers.
|
||||||
bpy.app.handlers.load_post.remove(load_post_handler_check_frame_range)
|
bpy.app.handlers.load_post.remove(load_post_handler_check_frame_range)
|
||||||
bpy.app.handlers.load_post.remove(load_post_handler_init_version_model)
|
bpy.app.handlers.load_post.remove(load_post_handler_init_version_model)
|
||||||
|
Loading…
Reference in New Issue
Block a user