Blender Kitsu: Set Custom Thumbnail during Playblast #77

Merged
Nick Alberelli merged 12 commits from feature/custom-playblast-thumbnails into main 2023-06-15 21:26:54 +02:00
Showing only changes of commit 3be51efa93 - Show all commits

View File

@ -38,7 +38,10 @@ from blender_kitsu.types import (
TaskStatus,
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
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
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")
@classmethod
@ -77,7 +81,6 @@ class KITSU_OT_playblast_create(bpy.types.Operator):
)
def execute(self, context: bpy.types.Context) -> Set[str]:
addon_prefs = prefs.addon_prefs_get(context)
if not self.task_status:
@ -97,12 +100,14 @@ class KITSU_OT_playblast_create(bpy.types.Operator):
# Render and save playblast
if self.use_user_shading:
output_path = playblast_user_shading_settings(
self, context, context.scene.kitsu.playblast_file)
self, context, context.scene.kitsu.playblast_file
)
else:
# Get output path.
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)
@ -153,7 +158,9 @@ class KITSU_OT_playblast_create(bpy.types.Operator):
# Setup video sequence editor space.
if "Video Editing" not in [ws.name for ws in bpy.data.workspaces]:
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)
bpy.ops.workspace.append_activate(
idname="Video Editing",
@ -275,7 +282,6 @@ class KITSU_OT_playblast_create(bpy.types.Operator):
webbrowser.open(url)
class KITSU_OT_playblast_set_version(bpy.types.Operator):
bl_idname = "kitsu.anim_set_playblast_version"
bl_label = "Version"
@ -373,7 +379,6 @@ class KITSU_OT_playblast_increment_playblast_version(bpy.types.Operator):
return True
def execute(self, context: bpy.types.Context) -> Set[str]:
# Incremenet version.
version = opsdata.add_playblast_version_increment(context)
@ -473,7 +478,6 @@ def register():
def unregister():
# Clear handlers.
bpy.app.handlers.load_post.remove(load_post_handler_check_frame_range)
bpy.app.handlers.load_post.remove(load_post_handler_init_version_model)