From 26210d1448d63edd05aeab1145ab2ce2aea2823d Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Mon, 26 Feb 2024 10:24:08 -0500 Subject: [PATCH 01/11] Rename `edit_render_version` to `edit_export_version` --- scripts-blender/addons/blender_kitsu/edit/ops.py | 8 ++++---- scripts-blender/addons/blender_kitsu/edit/opsdata.py | 8 ++++---- scripts-blender/addons/blender_kitsu/edit/ui.py | 2 +- scripts-blender/addons/blender_kitsu/props.py | 2 +- scripts-blender/addons/blender_kitsu/propsdata.py | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts-blender/addons/blender_kitsu/edit/ops.py b/scripts-blender/addons/blender_kitsu/edit/ops.py index fc532881..d50491ad 100644 --- a/scripts-blender/addons/blender_kitsu/edit/ops.py +++ b/scripts-blender/addons/blender_kitsu/edit/ops.py @@ -129,7 +129,7 @@ class KITSU_OT_edit_render_publish(bpy.types.Operator): if self.use_frame_start: edit_entity.set_frame_start(self.frame_start) - self.report({"INFO"}, f"Submitted new comment 'Revision {kitsu_props.edit_render_version}'") + self.report({"INFO"}, f"Submitted new comment 'Revision {kitsu_props.edit_export_version}'") return {"FINISHED"} @@ -158,11 +158,11 @@ class KITSU_OT_edit_render_set_version(bpy.types.Operator): if not version: return {"CANCELLED"} - if kitsu_props.get('edit_render_version') == version: + if kitsu_props.get('edit_export_version') == version: return {"CANCELLED"} # Update global scene cache version prop. - kitsu_props.edit_render_version = version + kitsu_props.edit_export_version = version logger.info("Set edit render version to %s", version) # Redraw ui. @@ -189,7 +189,7 @@ class KITSU_OT_edit_render_increment_version(bpy.types.Operator): version = opsdata.add_edit_render_version_increment(context) # Update cache_version prop. - context.scene.kitsu.edit_render_version = version + context.scene.kitsu.edit_export_version = version # Report. self.report({"INFO"}, f"Add edit_render version {version}") diff --git a/scripts-blender/addons/blender_kitsu/edit/opsdata.py b/scripts-blender/addons/blender_kitsu/edit/opsdata.py index 8637f6c4..652761c3 100644 --- a/scripts-blender/addons/blender_kitsu/edit/opsdata.py +++ b/scripts-blender/addons/blender_kitsu/edit/opsdata.py @@ -57,12 +57,12 @@ def init_edit_render_file_model( if not EDIT_RENDER_FILE_MODEL.versions: EDIT_RENDER_FILE_MODEL.append_item("v001") - # Update edit_render_version prop. - kitsu_props.edit_render_Version = "v001" + # Update edit_export_version prop. + kitsu_props.edit_export_version = "v001" else: - # Update edit_render_version prop. - kitsu_props.edit_render_version = EDIT_RENDER_FILE_MODEL.versions[0] + # Update edit_export_version prop. + kitsu_props.edit_export_version = EDIT_RENDER_FILE_MODEL.versions[0] _edit_render_file_model_init = True diff --git a/scripts-blender/addons/blender_kitsu/edit/ui.py b/scripts-blender/addons/blender_kitsu/edit/ui.py index c48f51aa..516068d3 100644 --- a/scripts-blender/addons/blender_kitsu/edit/ui.py +++ b/scripts-blender/addons/blender_kitsu/edit/ui.py @@ -41,7 +41,7 @@ class KITSU_PT_edit_render_publish(bpy.types.Panel): row = layout.row(align=True) row.operator( KITSU_OT_edit_render_set_version.bl_idname, - text=context.scene.kitsu.edit_render_version, + text=context.scene.kitsu.edit_export_version, icon="DOWNARROW_HLT", ) # Edit Render increment version op. diff --git a/scripts-blender/addons/blender_kitsu/props.py b/scripts-blender/addons/blender_kitsu/props.py index 04cf1b38..3da27a8d 100644 --- a/scripts-blender/addons/blender_kitsu/props.py +++ b/scripts-blender/addons/blender_kitsu/props.py @@ -498,7 +498,7 @@ class KITSU_property_group_scene(bpy.types.PropertyGroup): search_options={'SORT'}, ) - edit_render_version: bpy.props.StringProperty(name="Version", default="v001") + edit_export_version: bpy.props.StringProperty(name="Version", default="v001") edit_render_file: bpy.props.StringProperty( # type: ignore name="Edit Render Filepath", diff --git a/scripts-blender/addons/blender_kitsu/propsdata.py b/scripts-blender/addons/blender_kitsu/propsdata.py index 58ffb36c..57f62296 100644 --- a/scripts-blender/addons/blender_kitsu/propsdata.py +++ b/scripts-blender/addons/blender_kitsu/propsdata.py @@ -172,7 +172,7 @@ def get_edit_render_file(self: Any) -> str: addon_prefs = prefs.addon_prefs_get(bpy.context) if not bool(addon_prefs.edit_render_dir): return "" - version = self.edit_render_version + version = self.edit_export_version file_pattern = addon_prefs.edit_render_file_pattern file_name = file_pattern.replace('v###', version) return Path(addon_prefs.edit_render_dir).joinpath(file_name).as_posix() -- 2.30.2 From 8d742097f9dbb6a82e68203335fd48a20c30d25b Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Mon, 26 Feb 2024 10:25:09 -0500 Subject: [PATCH 02/11] Rename prop `edit_render_file` to `edit_export_file` --- scripts-blender/addons/blender_kitsu/edit/ops.py | 2 +- scripts-blender/addons/blender_kitsu/edit/ui.py | 10 +++++----- scripts-blender/addons/blender_kitsu/props.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts-blender/addons/blender_kitsu/edit/ops.py b/scripts-blender/addons/blender_kitsu/edit/ops.py index d50491ad..ac18cd59 100644 --- a/scripts-blender/addons/blender_kitsu/edit/ops.py +++ b/scripts-blender/addons/blender_kitsu/edit/ops.py @@ -101,7 +101,7 @@ class KITSU_OT_edit_render_publish(bpy.types.Operator): return {"CANCELLED"} # Build render_path - render_path = Path(kitsu_props.edit_render_file) + render_path = Path(kitsu_props.edit_export_file) render_path_str = render_path.as_posix() render_name = render_path.name if not render_path.parent.exists(): diff --git a/scripts-blender/addons/blender_kitsu/edit/ui.py b/scripts-blender/addons/blender_kitsu/edit/ui.py index 516068d3..24276176 100644 --- a/scripts-blender/addons/blender_kitsu/edit/ui.py +++ b/scripts-blender/addons/blender_kitsu/edit/ui.py @@ -56,19 +56,19 @@ class KITSU_PT_edit_render_publish(bpy.types.Panel): row.operator(KITSU_OT_edit_render_publish.bl_idname, icon="RENDER_ANIMATION") # Edit Render path label. - if Path(context.scene.kitsu.edit_render_file).exists(): + if Path(context.scene.kitsu.edit_export_file).exists(): split = layout.split(factor=1 - split_factor_small, align=True) split.label(icon="ERROR") sub_split = split.split(factor=split_factor_small) - sub_split.label(text=context.scene.kitsu.edit_render_file) + sub_split.label(text=context.scene.kitsu.edit_export_file) sub_split.operator( KITSU_OT_open_path.bl_idname, icon="FILE_FOLDER", text="" - ).filepath = context.scene.kitsu.edit_render_file + ).filepath = context.scene.kitsu.edit_export_file else: row = layout.row(align=True) - row.label(text=context.scene.kitsu.edit_render_file) + row.label(text=context.scene.kitsu.edit_export_file) row.operator(KITSU_OT_open_path.bl_idname, icon="FILE_FOLDER", text="").filepath = ( - context.scene.kitsu.edit_render_file + context.scene.kitsu.edit_export_file ) diff --git a/scripts-blender/addons/blender_kitsu/props.py b/scripts-blender/addons/blender_kitsu/props.py index 3da27a8d..c4d2d78b 100644 --- a/scripts-blender/addons/blender_kitsu/props.py +++ b/scripts-blender/addons/blender_kitsu/props.py @@ -500,7 +500,7 @@ class KITSU_property_group_scene(bpy.types.PropertyGroup): edit_export_version: bpy.props.StringProperty(name="Version", default="v001") - edit_render_file: bpy.props.StringProperty( # type: ignore + edit_export_file: bpy.props.StringProperty( # type: ignore name="Edit Render Filepath", description="Output filepath of Edit Render", default="", -- 2.30.2 From fadbafced7a87a799d42c5e6e85bc7a2c9029d0d Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Mon, 26 Feb 2024 10:28:01 -0500 Subject: [PATCH 03/11] Rename function `get_edit_render_file` to `get_edit_export_file` --- scripts-blender/addons/blender_kitsu/props.py | 2 +- scripts-blender/addons/blender_kitsu/propsdata.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts-blender/addons/blender_kitsu/props.py b/scripts-blender/addons/blender_kitsu/props.py index c4d2d78b..1348f270 100644 --- a/scripts-blender/addons/blender_kitsu/props.py +++ b/scripts-blender/addons/blender_kitsu/props.py @@ -505,7 +505,7 @@ class KITSU_property_group_scene(bpy.types.PropertyGroup): description="Output filepath of Edit Render", default="", subtype="FILE_PATH", - get=propsdata.get_edit_render_file, + get=propsdata.get_edit_export_file, ) # Thumbnail props. diff --git a/scripts-blender/addons/blender_kitsu/propsdata.py b/scripts-blender/addons/blender_kitsu/propsdata.py index 57f62296..689f6cbd 100644 --- a/scripts-blender/addons/blender_kitsu/propsdata.py +++ b/scripts-blender/addons/blender_kitsu/propsdata.py @@ -168,7 +168,7 @@ def get_playblast_file(self: Any) -> str: return Path(self.playblast_dir).joinpath(file_name).as_posix() -def get_edit_render_file(self: Any) -> str: +def get_edit_export_file(self: Any) -> str: addon_prefs = prefs.addon_prefs_get(bpy.context) if not bool(addon_prefs.edit_render_dir): return "" -- 2.30.2 From 92cc5ec97dc82862d226aa63bb90f47bcfb6ce30 Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Mon, 26 Feb 2024 10:29:37 -0500 Subject: [PATCH 04/11] Update UI Name for `edit_export_file` from `"Edit Render Filepath"` to `"Edit Export Filepath"` --- scripts-blender/addons/blender_kitsu/props.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts-blender/addons/blender_kitsu/props.py b/scripts-blender/addons/blender_kitsu/props.py index 1348f270..4ec85c21 100644 --- a/scripts-blender/addons/blender_kitsu/props.py +++ b/scripts-blender/addons/blender_kitsu/props.py @@ -501,8 +501,8 @@ class KITSU_property_group_scene(bpy.types.PropertyGroup): edit_export_version: bpy.props.StringProperty(name="Version", default="v001") edit_export_file: bpy.props.StringProperty( # type: ignore - name="Edit Render Filepath", - description="Output filepath of Edit Render", + name="Edit Export Filepath", + description="Output filepath of Edit Export", default="", subtype="FILE_PATH", get=propsdata.get_edit_export_file, -- 2.30.2 From 76a23889ad0ab6a91fa2796786f02756e84db235 Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Mon, 26 Feb 2024 10:34:58 -0500 Subject: [PATCH 05/11] Rename all Edit Render related Preferences to Edit Exports --- .../addons/blender_kitsu/edit/core.py | 6 +- .../addons/blender_kitsu/edit/ops.py | 10 +-- .../addons/blender_kitsu/edit/opsdata.py | 6 +- .../addons/blender_kitsu/edit/ui.py | 2 +- scripts-blender/addons/blender_kitsu/prefs.py | 66 +++++++++---------- .../addons/blender_kitsu/propsdata.py | 6 +- 6 files changed, 48 insertions(+), 48 deletions(-) diff --git a/scripts-blender/addons/blender_kitsu/edit/core.py b/scripts-blender/addons/blender_kitsu/edit/core.py index 56b588ce..a9abe0ba 100644 --- a/scripts-blender/addons/blender_kitsu/edit/core.py +++ b/scripts-blender/addons/blender_kitsu/edit/core.py @@ -18,13 +18,13 @@ def edit_renders_get_all(context: bpy.types.Context): """Find latest render in editorial render directory""" addon_prefs = prefs.addon_prefs_get(context) - edit_render_path = Path(addon_prefs.edit_render_dir) + edit_render_path = Path(addon_prefs.edit_export_dir) files_list = [ f for f in edit_render_path.iterdir() if f.is_file() - and edit_render_is_valid_edit_name(addon_prefs.edit_render_file_pattern, f.name) + and edit_render_is_valid_edit_name(addon_prefs.edit_export_file_pattern, f.name) ] return files_list @@ -78,7 +78,7 @@ def edit_render_import_latest( frame_in = shot.data.get("frame_in") frame_3d_start = shot.get_3d_start() frame_3d_offset = frame_3d_start - addon_prefs.shot_builder_frame_offset - edit_export_offset = addon_prefs.edit_render_frame_offset + edit_export_offset = addon_prefs.edit_export_frame_offset # Set sequence strip start kitsu data. for strip in new_strips: diff --git a/scripts-blender/addons/blender_kitsu/edit/ops.py b/scripts-blender/addons/blender_kitsu/edit/ops.py index ac18cd59..ef5b7e0a 100644 --- a/scripts-blender/addons/blender_kitsu/edit/ops.py +++ b/scripts-blender/addons/blender_kitsu/edit/ops.py @@ -51,10 +51,10 @@ class KITSU_OT_edit_render_publish(bpy.types.Operator): if kitsu_props.task_type_active_id == "": cls.poll_message_set("Select a task type from Kitsu Context Menu") return False - if not addon_prefs.is_edit_render_root_valid: + if not addon_prefs.is_edit_export_root_valid: cls.poll_message_set("Edit Render Directory is Invalid, see Add-On preferences") return False - if not addon_prefs.is_edit_render_pattern_valid: + if not addon_prefs.is_edit_export_pattern_valid: cls.poll_message_set("Edit Render File Pattern is Invalid, see Add-On preferences") return False return True @@ -149,7 +149,7 @@ class KITSU_OT_edit_render_set_version(bpy.types.Operator): @classmethod def poll(cls, context: bpy.types.Context) -> bool: addon_prefs = prefs.addon_prefs_get(context) - return bool(addon_prefs.edit_render_dir != "") + return bool(addon_prefs.edit_export_dir != "") def execute(self, context: bpy.types.Context) -> Set[str]: kitsu_props = context.scene.kitsu @@ -223,7 +223,7 @@ class KITSU_OT_edit_render_import_latest(bpy.types.Operator): if cache.shot_active_get().id == "": cls.poll_message_set("Please set an active shot in Kitsu Context UI") return False - if not prefs.addon_prefs_get(context).is_edit_render_root_valid: + if not prefs.addon_prefs_get(context).is_edit_export_root_valid: cls.poll_message_set("Edit Render Directory is Invalid, see Add-On Preferences") return False return True @@ -287,7 +287,7 @@ class KITSU_OT_edit_render_import_latest(bpy.types.Operator): if all_edit_render_paths == []: self.report( {"WARNING"}, - f"No Edit Renders found in '{addon_prefs.edit_render_dir}' using pattern '{addon_prefs.edit_render_file_pattern}' See Add-On Preferences", + f"No Edit Renders found in '{addon_prefs.edit_export_dir}' using pattern '{addon_prefs.edit_export_file_pattern}' See Add-On Preferences", ) return {"CANCELLED"} diff --git a/scripts-blender/addons/blender_kitsu/edit/opsdata.py b/scripts-blender/addons/blender_kitsu/edit/opsdata.py index 652761c3..eba7f369 100644 --- a/scripts-blender/addons/blender_kitsu/edit/opsdata.py +++ b/scripts-blender/addons/blender_kitsu/edit/opsdata.py @@ -43,17 +43,17 @@ def init_edit_render_file_model( addon_prefs = prefs.addon_prefs_get(context) kitsu_props = context.scene.kitsu - edit_render_dir = Path(addon_prefs.edit_render_dir) + edit_export_dir = Path(addon_prefs.edit_export_dir) # Is None if invalid. - if addon_prefs.edit_render_dir == "" or not edit_render_dir.exists(): + if addon_prefs.edit_export_dir == "" or not edit_export_dir.exists(): logger.error( "Failed to initialize edit render file model. Invalid path. Check addon preferences" ) return EDIT_RENDER_FILE_MODEL.reset() - EDIT_RENDER_FILE_MODEL.root_path = edit_render_dir + EDIT_RENDER_FILE_MODEL.root_path = edit_export_dir if not EDIT_RENDER_FILE_MODEL.versions: EDIT_RENDER_FILE_MODEL.append_item("v001") diff --git a/scripts-blender/addons/blender_kitsu/edit/ui.py b/scripts-blender/addons/blender_kitsu/edit/ui.py index 24276176..364fd850 100644 --- a/scripts-blender/addons/blender_kitsu/edit/ui.py +++ b/scripts-blender/addons/blender_kitsu/edit/ui.py @@ -33,7 +33,7 @@ class KITSU_PT_edit_render_publish(bpy.types.Panel): split_factor_small = 0.95 # # ERROR. - if not addon_prefs.is_edit_render_root_valid: + if not addon_prefs.is_edit_export_root_valid: box = ui.draw_error_box(layout) ui.draw_error_invalid_edit_render_root_dir(box) diff --git a/scripts-blender/addons/blender_kitsu/prefs.py b/scripts-blender/addons/blender_kitsu/prefs.py index d39074fa..1fa502a0 100644 --- a/scripts-blender/addons/blender_kitsu/prefs.py +++ b/scripts-blender/addons/blender_kitsu/prefs.py @@ -358,60 +358,60 @@ class KITSU_addon_preferences(bpy.types.AddonPreferences): subtype='DIR_PATH', ) - def set_edit_render_dir(self, input): - self['edit_render_dir'] = input + def set_edit_export_dir(self, input): + self['edit_export_dir'] = input return - def get_edit_render_dir( + def get_edit_export_dir( self, ) -> str: - if get_safely_string_prop(self, 'edit_render_dir') == "" and self.project_root_path: + if get_safely_string_prop(self, 'edit_export_dir') == "" and self.project_root_path: dir = self.project_root_path.joinpath("shared/editorial/export/") if dir.exists(): return dir.as_posix() - return get_safely_string_prop(self, 'edit_render_dir') + return get_safely_string_prop(self, 'edit_export_dir') - edit_render_dir: bpy.props.StringProperty( # type: ignore - name="Render Directory", + edit_export_dir: bpy.props.StringProperty( # type: ignore + name="Export Directory", options={"HIDDEN", "SKIP_SAVE"}, - description="Directory path to editorial's render folder containing storyboard/animatic renders. Path should be similar to '~/shared-{proj_name}/editorial/export/'", + description="Directory path to editorial's export folder containing storyboard/animatic renders. Path should be similar to '~/shared-{proj_name}/editorial/export/'", subtype="DIR_PATH", - get=get_edit_render_dir, - set=set_edit_render_dir, + get=get_edit_export_dir, + set=set_edit_export_dir, ) - def set_edit_render_file_pattern(self, input): - self['edit_render_file_pattern'] = input + def set_edit_export_file_pattern(self, input): + self['edit_export_file_pattern'] = input return - def get_edit_render_file_pattern( + def get_edit_export_file_pattern( self, ) -> str: active_project = cache.project_active_get() - if get_safely_string_prop(self, 'edit_render_file_pattern') == "" and active_project: + if get_safely_string_prop(self, 'edit_export_file_pattern') == "" and active_project: proj_name = active_project.name.replace(' ', bkglobals.SPACE_REPLACER).lower() # HACK for Project Gold at Blender Studio if proj_name == "project_gold": return f"gold-edit-v###.mp4" return f"{proj_name}-edit-v###.mp4" - return get_safely_string_prop(self, 'edit_render_file_pattern') + return get_safely_string_prop(self, 'edit_export_file_pattern') - edit_render_file_pattern: bpy.props.StringProperty( # type: ignore - name="Render File Pattern", + edit_export_file_pattern: bpy.props.StringProperty( # type: ignore + name="Export File Pattern", options={"HIDDEN", "SKIP_SAVE"}, description=( - "File pattern for latest editorial render file. " + "File pattern for latest editorial export file. " "Typically '{proj_name}-edit-v###.mp4' where # represents a number. " "Pattern must contain exactly v### representing the version, pattern must end in .mp4" ), default="", - get=get_edit_render_file_pattern, - set=set_edit_render_file_pattern, + get=get_edit_export_file_pattern, + set=set_edit_export_file_pattern, ) - edit_render_frame_offset: bpy.props.IntProperty( # type: ignore - name="Render Offset", - description="Shift Editorial Render by this frame-range after import", + edit_export_frame_offset: bpy.props.IntProperty( # type: ignore + name="Export Offset", + description="Shift Editorial Export by this frame-range after import", default=-101, # HARD CODED FOR GOLD PROJECTS BLENDER FILM ) @@ -491,10 +491,10 @@ class KITSU_addon_preferences(bpy.types.AddonPreferences): # Editorial Settings box = col.box() box.label(text="Editorial", icon="SEQ_SEQUENCER") - box.row().prop(self, "edit_render_dir") + box.row().prop(self, "edit_export_dir") file_pattern_row = box.row(align=True) - file_pattern_row.alert = not self.is_edit_render_pattern_valid - file_pattern_row.prop(self, "edit_render_file_pattern") + file_pattern_row.alert = not self.is_edit_export_pattern_valid + file_pattern_row.prop(self, "edit_export_file_pattern") # Lookdev tools settings. self.lookdev.draw(context, col) @@ -527,7 +527,7 @@ class KITSU_addon_preferences(bpy.types.AddonPreferences): # Shot_Builder settings. box = col.box() box.label(text="Shot Builder", icon="MOD_BUILD") - box.row().prop(self, "edit_render_frame_offset") + box.row().prop(self, "edit_export_frame_offset") box.row().prop(self, "shot_builder_show_advanced") if self.shot_builder_show_advanced: start_frame_row = box.row() @@ -573,18 +573,18 @@ class KITSU_addon_preferences(bpy.types.AddonPreferences): return True @property - def is_edit_render_root_valid(self) -> bool: - if self.edit_render_dir.strip() == "": + def is_edit_export_root_valid(self) -> bool: + if self.edit_export_dir.strip() == "": return False - if not Path(self.edit_render_dir).exists(): + if not Path(self.edit_export_dir).exists(): return False return True @property - def is_edit_render_pattern_valid(self) -> bool: - if not self.edit_render_file_pattern.endswith(".mp4"): + def is_edit_export_pattern_valid(self) -> bool: + if not self.edit_export_file_pattern.endswith(".mp4"): return False - if not "###" in self.edit_render_file_pattern: + if not "###" in self.edit_export_file_pattern: return False return True diff --git a/scripts-blender/addons/blender_kitsu/propsdata.py b/scripts-blender/addons/blender_kitsu/propsdata.py index 689f6cbd..67d6d2a5 100644 --- a/scripts-blender/addons/blender_kitsu/propsdata.py +++ b/scripts-blender/addons/blender_kitsu/propsdata.py @@ -170,12 +170,12 @@ def get_playblast_file(self: Any) -> str: def get_edit_export_file(self: Any) -> str: addon_prefs = prefs.addon_prefs_get(bpy.context) - if not bool(addon_prefs.edit_render_dir): + if not bool(addon_prefs.edit_export_dir): return "" version = self.edit_export_version - file_pattern = addon_prefs.edit_render_file_pattern + file_pattern = addon_prefs.edit_export_file_pattern file_name = file_pattern.replace('v###', version) - return Path(addon_prefs.edit_render_dir).joinpath(file_name).as_posix() + return Path(addon_prefs.edit_export_dir).joinpath(file_name).as_posix() _active_category_cache_init: bool = False -- 2.30.2 From 63beef18273255e1d4da557e7ae28c89f78c046e Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Mon, 26 Feb 2024 10:36:48 -0500 Subject: [PATCH 06/11] Rename `draw_error_invalid_edit_render_root_dir` to `draw_error_invalid_edit_export_root_dir` --- scripts-blender/addons/blender_kitsu/edit/ui.py | 2 +- scripts-blender/addons/blender_kitsu/ui.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts-blender/addons/blender_kitsu/edit/ui.py b/scripts-blender/addons/blender_kitsu/edit/ui.py index 364fd850..0b9f6213 100644 --- a/scripts-blender/addons/blender_kitsu/edit/ui.py +++ b/scripts-blender/addons/blender_kitsu/edit/ui.py @@ -35,7 +35,7 @@ class KITSU_PT_edit_render_publish(bpy.types.Panel): # # ERROR. if not addon_prefs.is_edit_export_root_valid: box = ui.draw_error_box(layout) - ui.draw_error_invalid_edit_render_root_dir(box) + ui.draw_error_invalid_edit_export_root_dir(box) # Edit Render version op. row = layout.row(align=True) diff --git a/scripts-blender/addons/blender_kitsu/ui.py b/scripts-blender/addons/blender_kitsu/ui.py index 3dbc0747..0a996246 100644 --- a/scripts-blender/addons/blender_kitsu/ui.py +++ b/scripts-blender/addons/blender_kitsu/ui.py @@ -47,11 +47,11 @@ def draw_error_invalid_playblast_root_dir( ).module = __package__ -def draw_error_invalid_edit_render_root_dir( +def draw_error_invalid_edit_export_root_dir( box: bpy.types.UILayout, ) -> bpy.types.UILayout: row = box.row(align=True) - row.label(text="Invalid Edit Render Directory") + row.label(text="Invalid Edit Export Directory") row.operator("preferences.addon_show", text="Open Addon Preferences").module = __package__ -- 2.30.2 From d37282819c658394b044ceb5cfcde68af6ac0f8a Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Mon, 26 Feb 2024 10:41:25 -0500 Subject: [PATCH 07/11] Rename all edit.core functions to use "Export" instead of "Render" --- .../addons/blender_kitsu/edit/core.py | 25 +++++++++---------- .../addons/blender_kitsu/edit/ops.py | 10 ++++---- scripts-blender/addons/blender_kitsu/prefs.py | 2 +- .../addons/blender_kitsu/shot_builder/ops.py | 4 +-- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/scripts-blender/addons/blender_kitsu/edit/core.py b/scripts-blender/addons/blender_kitsu/edit/core.py index a9abe0ba..20a8fda0 100644 --- a/scripts-blender/addons/blender_kitsu/edit/core.py +++ b/scripts-blender/addons/blender_kitsu/edit/core.py @@ -4,32 +4,31 @@ import re from pathlib import Path -def edit_render_get_latest(context: bpy.types.Context): - """Find latest render in editorial render directory""" +def edit_export_get_latest(context: bpy.types.Context): + """Find latest render in editorial export directory""" - files_list = edit_renders_get_all(context) + files_list = edit_export_get_all(context) if len(files_list) >= 1: files_list = sorted(files_list, reverse=True) return files_list[0] return None -def edit_renders_get_all(context: bpy.types.Context): - """Find latest render in editorial render directory""" +def edit_export_get_all(context: bpy.types.Context): + """Find all renders in editorial export directory""" addon_prefs = prefs.addon_prefs_get(context) - edit_render_path = Path(addon_prefs.edit_export_dir) + edit_export_path = Path(addon_prefs.edit_export_dir) files_list = [ f - for f in edit_render_path.iterdir() - if f.is_file() - and edit_render_is_valid_edit_name(addon_prefs.edit_export_file_pattern, f.name) + for f in edit_export_path.iterdir() + if f.is_file() and edit_export_is_valid_name(addon_prefs.edit_export_file_pattern, f.name) ] return files_list -def edit_render_is_valid_edit_name(file_pattern: str, filename: str) -> bool: +def edit_export_is_valid_name(file_pattern: str, filename: str) -> bool: """Verify file name matches file pattern set in preferences""" # Prevents un-expected matches file_pattern = re.escape(file_pattern) @@ -40,13 +39,13 @@ def edit_render_is_valid_edit_name(file_pattern: str, filename: str) -> bool: return False -def edit_render_import_latest( +def edit_export_import_latest( context: bpy.types.Context, shot ) -> list[bpy.types.Sequence]: # TODO add info to shot - """Loads latest render from editorial department""" + """Loads latest export from editorial department""" addon_prefs = prefs.addon_prefs_get(context) strip_channel = 1 - latest_file = edit_render_get_latest(context) + latest_file = edit_export_get_latest(context) if not latest_file: return None # Check if Kitsu server returned empty shot diff --git a/scripts-blender/addons/blender_kitsu/edit/ops.py b/scripts-blender/addons/blender_kitsu/edit/ops.py index ef5b7e0a..ce593ea6 100644 --- a/scripts-blender/addons/blender_kitsu/edit/ops.py +++ b/scripts-blender/addons/blender_kitsu/edit/ops.py @@ -8,7 +8,7 @@ from ..types import Task, TaskStatus from ..playblast.core import override_render_path, override_render_format from . import opsdata from ..logger import LoggerFactory -from .core import edit_render_import_latest, edit_renders_get_all, edit_render_get_latest +from .core import edit_export_import_latest, edit_export_get_all, edit_export_get_latest logger = LoggerFactory.getLogger() @@ -199,7 +199,7 @@ class KITSU_OT_edit_render_increment_version(bpy.types.Operator): class KITSU_OT_edit_render_import_latest(bpy.types.Operator): - bl_idname = "kitsu.edit_render_import_latest" + bl_idname = "kitsu.edit_export_import_latest" bl_label = "Import Latest Edit Render" bl_description = ( "Find and import the latest editorial render found in the Editorial Render Directory for the current shot. " @@ -258,7 +258,7 @@ class KITSU_OT_edit_render_import_latest(bpy.types.Operator): def check_if_latest_edit_render_is_imported(self, context: Context) -> bool: # Check if latest edit render is already loaded. for strip in self._existing_edit_renders: - latest_edit_render_path = edit_render_get_latest(context) + latest_edit_render_path = edit_export_get_latest(context) if self.compare_strip_to_path(strip, latest_edit_render_path): self._latest_render_name = latest_edit_render_path.name return True @@ -283,7 +283,7 @@ class KITSU_OT_edit_render_import_latest(bpy.types.Operator): addon_prefs = prefs.addon_prefs_get(context) # Get paths to all edit renders - all_edit_render_paths = edit_renders_get_all(context) + all_edit_render_paths = edit_export_get_all(context) if all_edit_render_paths == []: self.report( {"WARNING"}, @@ -307,7 +307,7 @@ class KITSU_OT_edit_render_import_latest(bpy.types.Operator): # Import new edit render shot = cache.shot_active_get() - strips = edit_render_import_latest(context, shot) + strips = edit_export_import_latest(context, shot) if strips is None: self.report({"WARNING"}, f"Loaded Latest Editorial Render failed to import!") diff --git a/scripts-blender/addons/blender_kitsu/prefs.py b/scripts-blender/addons/blender_kitsu/prefs.py index 1fa502a0..72e7952d 100644 --- a/scripts-blender/addons/blender_kitsu/prefs.py +++ b/scripts-blender/addons/blender_kitsu/prefs.py @@ -41,7 +41,7 @@ from .auth.ops import ( ) from .context.ops import KITSU_OT_con_productions_load from .lookdev.prefs import LOOKDEV_preferences -from .edit.core import edit_render_get_latest +from .edit.core import edit_export_get_latest logger = LoggerFactory.getLogger() diff --git a/scripts-blender/addons/blender_kitsu/shot_builder/ops.py b/scripts-blender/addons/blender_kitsu/shot_builder/ops.py index 97c45f59..0f91fd60 100644 --- a/scripts-blender/addons/blender_kitsu/shot_builder/ops.py +++ b/scripts-blender/addons/blender_kitsu/shot_builder/ops.py @@ -16,7 +16,7 @@ from .core import ( ) from ..context import core as context_core -from ..edit.core import edit_render_import_latest +from ..edit.core import edit_export_import_latest from .file_save import save_shot_builder_file from .template import replace_workspace_with_template from .assets import get_shot_assets @@ -236,7 +236,7 @@ class KITSU_OT_build_new_shot(bpy.types.Operator): link_task_type_output_collections(shot, task_type) if bkglobals.LOAD_EDITORIAL_REF.get(task_type_short_name): - edit_render_import_latest(context, shot) + edit_export_import_latest(context, shot) # Run Hooks hooks_instance = Hooks() -- 2.30.2 From 5221567590832444ba842b2462c67deacc49eae5 Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Mon, 26 Feb 2024 10:53:06 -0500 Subject: [PATCH 08/11] Rename Edit Operators from "Render" to "Export" including `Render & Publish` to `Export & Publish` --- .../addons/blender_kitsu/edit/ops.py | 118 +++++++++--------- .../addons/blender_kitsu/edit/opsdata.py | 4 +- .../addons/blender_kitsu/edit/ui.py | 16 +-- 3 files changed, 69 insertions(+), 69 deletions(-) diff --git a/scripts-blender/addons/blender_kitsu/edit/ops.py b/scripts-blender/addons/blender_kitsu/edit/ops.py index ce593ea6..fbb1cb8e 100644 --- a/scripts-blender/addons/blender_kitsu/edit/ops.py +++ b/scripts-blender/addons/blender_kitsu/edit/ops.py @@ -13,9 +13,9 @@ from .core import edit_export_import_latest, edit_export_get_all, edit_export_ge logger = LoggerFactory.getLogger() -class KITSU_OT_edit_render_publish(bpy.types.Operator): - bl_idname = "kitsu.edit_render_publish" - bl_label = "Render & Publish" +class KITSU_OT_edit_export_publish(bpy.types.Operator): + bl_idname = "kitsu.edit_export_publish" + bl_label = "Export & Publish" bl_description = ( "Renders current VSE Edit as .mp4" "Saves the set version to disk and uploads it to Kitsu with the specified " @@ -52,17 +52,17 @@ class KITSU_OT_edit_render_publish(bpy.types.Operator): cls.poll_message_set("Select a task type from Kitsu Context Menu") return False if not addon_prefs.is_edit_export_root_valid: - cls.poll_message_set("Edit Render Directory is Invalid, see Add-On preferences") + cls.poll_message_set("Edit Export Directory is Invalid, see Add-On preferences") return False if not addon_prefs.is_edit_export_pattern_valid: - cls.poll_message_set("Edit Render File Pattern is Invalid, see Add-On preferences") + cls.poll_message_set("Edit Export File Pattern is Invalid, see Add-On preferences") return False return True def invoke(self, context, event): self.thumbnail_frame = context.scene.frame_current - # Remove file name if set in render.filepath + # Remove file name if set in render filepath dir_path = bpy.path.abspath(context.scene.render.filepath) if not os.path.isdir(Path(dir_path)): dir_path = Path(dir_path).parent @@ -133,17 +133,17 @@ class KITSU_OT_edit_render_publish(bpy.types.Operator): return {"FINISHED"} -class KITSU_OT_edit_render_set_version(bpy.types.Operator): - bl_idname = "kitsu.edit_render_set_version" +class KITSU_OT_edit_export_set_version(bpy.types.Operator): + bl_idname = "kitsu.edit_export_set_version" bl_label = "Version" bl_property = "versions" bl_description = ( - "Sets version of edit render. Warning triangle in ui " + "Sets version of edit export. Warning triangle in ui " "indicates that version already exists on disk" ) versions: bpy.props.EnumProperty( - items=opsdata.get_edit_render_versions_enum_list, name="Versions" + items=opsdata.get_edit_export_versions_enum_list, name="Versions" ) @classmethod @@ -163,7 +163,7 @@ class KITSU_OT_edit_render_set_version(bpy.types.Operator): # Update global scene cache version prop. kitsu_props.edit_export_version = version - logger.info("Set edit render version to %s", version) + logger.info("Set edit export version to %s", version) # Redraw ui. util.ui_redraw() @@ -175,10 +175,10 @@ class KITSU_OT_edit_render_set_version(bpy.types.Operator): return {"FINISHED"} -class KITSU_OT_edit_render_increment_version(bpy.types.Operator): - bl_idname = "kitsu.edit_render_increment_version" +class KITSU_OT_edit_export_increment_version(bpy.types.Operator): + bl_idname = "kitsu.edit_export_increment_version" bl_label = "Add Version Increment" - bl_description = "Increment the edit_render version by one" + bl_description = "Increment the edit export version by one" @classmethod def poll(cls, context: bpy.types.Context) -> bool: @@ -186,31 +186,31 @@ class KITSU_OT_edit_render_increment_version(bpy.types.Operator): def execute(self, context: bpy.types.Context) -> Set[str]: # Incremenet version. - version = opsdata.add_edit_render_version_increment(context) + version = opsdata.add_edit_export_version_increment(context) # Update cache_version prop. context.scene.kitsu.edit_export_version = version # Report. - self.report({"INFO"}, f"Add edit_render version {version}") + self.report({"INFO"}, f"Add edit export version {version}") util.ui_redraw() return {"FINISHED"} -class KITSU_OT_edit_render_import_latest(bpy.types.Operator): +class KITSU_OT_edit_export_import_latest(bpy.types.Operator): bl_idname = "kitsu.edit_export_import_latest" - bl_label = "Import Latest Edit Render" + bl_label = "Import Latest Edit Export" bl_description = ( - "Find and import the latest editorial render found in the Editorial Render Directory for the current shot. " - "Will only Import if the latest render is not already imported. " - "Will remove any previous renders currently in the file's Video Sequence Editor" + "Find and import the latest editorial render found in the Editorial Export Directory for the current shot. " + "Will only Import if the latest export is not already imported. " + "Will remove any previous exports currently in the file's Video Sequence Editor" ) - _existing_edit_renders = [] + _existing_edit_exports = [] _removed_movie = 0 _removed_audio = 0 - _latest_render_name = "" + _latest_export_name = "" @classmethod def poll(cls, context: bpy.types.Context) -> bool: @@ -224,7 +224,7 @@ class KITSU_OT_edit_render_import_latest(bpy.types.Operator): cls.poll_message_set("Please set an active shot in Kitsu Context UI") return False if not prefs.addon_prefs_get(context).is_edit_export_root_valid: - cls.poll_message_set("Edit Render Directory is Invalid, see Add-On Preferences") + cls.poll_message_set("Edit Export Directory is Invalid, see Add-On Preferences") return False return True @@ -244,29 +244,29 @@ class KITSU_OT_edit_render_import_latest(bpy.types.Operator): return True return False - def get_existing_edit_renders( - self, context: Context, all_edit_render_paths: List[Path] + def get_existing_edit_exports( + self, context: Context, all_edit_export_paths: List[Path] ) -> List[Sequence]: sequences = context.scene.sequence_editor.sequences - # Collect Existing Edit Renders + # Collect Existing Edit Export for strip in sequences: - if self.compare_strip_to_paths(strip, all_edit_render_paths): - self._existing_edit_renders.append(strip) - return self._existing_edit_renders + if self.compare_strip_to_paths(strip, all_edit_export_paths): + self._existing_edit_exports.append(strip) + return self._existing_edit_exports - def check_if_latest_edit_render_is_imported(self, context: Context) -> bool: - # Check if latest edit render is already loaded. - for strip in self._existing_edit_renders: - latest_edit_render_path = edit_export_get_latest(context) - if self.compare_strip_to_path(strip, latest_edit_render_path): - self._latest_render_name = latest_edit_render_path.name + def check_if_latest_edit_export_is_imported(self, context: Context) -> bool: + # Check if latest edit export is already loaded. + for strip in self._existing_edit_exports: + latest_edit_export_path = edit_export_get_latest(context) + if self.compare_strip_to_path(strip, latest_edit_export_path): + self._latest_export_name = latest_edit_export_path.name return True - def remove_existing_edit_renders(self, context: Context) -> None: + def remove_existing_edit_exports(self, context: Context) -> None: # Remove Existing Strips to make way for new Strip sequences = context.scene.sequence_editor.sequences - for strip in self._existing_edit_renders: + for strip in self._existing_edit_exports: if strip.type == "MOVIE": self._removed_movie += 1 if strip.type == "SOUND": @@ -275,42 +275,42 @@ class KITSU_OT_edit_render_import_latest(bpy.types.Operator): def execute(self, context: bpy.types.Context) -> Set[str]: # Reset Values - self._existing_edit_renders = [] + self._existing_edit_exports = [] self._removed_movie = 0 self._removed_audio = 0 - self._latest_render_name = "" + self._latest_export_name = "" addon_prefs = prefs.addon_prefs_get(context) - # Get paths to all edit renders - all_edit_render_paths = edit_export_get_all(context) - if all_edit_render_paths == []: + # Get paths to all edit exports + all_edit_export_paths = edit_export_get_all(context) + if all_edit_export_paths == []: self.report( {"WARNING"}, - f"No Edit Renders found in '{addon_prefs.edit_export_dir}' using pattern '{addon_prefs.edit_export_file_pattern}' See Add-On Preferences", + f"No Edit Exports found in '{addon_prefs.edit_export_dir}' using pattern '{addon_prefs.edit_export_file_pattern}' See Add-On Preferences", ) return {"CANCELLED"} - # Collect all existing edit renders - self.get_existing_edit_renders(context, all_edit_render_paths) + # Collect all existing edit exports + self.get_existing_edit_exports(context, all_edit_export_paths) - # Stop latest render is already imported - if self.check_if_latest_edit_render_is_imported(context): + # Stop latest export is already imported + if self.check_if_latest_edit_export_is_imported(context): self.report( {"WARNING"}, - f"Latest Editorial Render already loaded '{self._latest_render_name}'", + f"Latest Editorial Export already loaded '{self._latest_export_name}'", ) return {"CANCELLED"} - # Remove old edit renders - self.remove_existing_edit_renders(context) + # Remove old edit exports + self.remove_existing_edit_exports(context) - # Import new edit render + # Import new edit export shot = cache.shot_active_get() strips = edit_export_import_latest(context, shot) if strips is None: - self.report({"WARNING"}, f"Loaded Latest Editorial Render failed to import!") + self.report({"WARNING"}, f"Loaded Latest Editorial Export failed to import!") return {"CANCELLED"} # Report. @@ -319,18 +319,18 @@ class KITSU_OT_edit_render_import_latest(bpy.types.Operator): f"Removed {self._removed_movie} Movie Strips and {self._removed_audio} Audio Strips" ) self.report( - {"INFO"}, f"Loaded Latest Editorial Render, '{strips[0].name}'. {removed_msg}" + {"INFO"}, f"Loaded Latest Editorial Export, '{strips[0].name}'. {removed_msg}" ) else: - self.report({"INFO"}, f"Loaded Latest Editorial Render, '{strips[0].name}'") + self.report({"INFO"}, f"Loaded Latest Editorial Export, '{strips[0].name}'") return {"FINISHED"} classes = [ - KITSU_OT_edit_render_publish, - KITSU_OT_edit_render_set_version, - KITSU_OT_edit_render_increment_version, - KITSU_OT_edit_render_import_latest, + KITSU_OT_edit_export_publish, + KITSU_OT_edit_export_set_version, + KITSU_OT_edit_export_increment_version, + KITSU_OT_edit_export_import_latest, ] diff --git a/scripts-blender/addons/blender_kitsu/edit/opsdata.py b/scripts-blender/addons/blender_kitsu/edit/opsdata.py index eba7f369..839b48d3 100644 --- a/scripts-blender/addons/blender_kitsu/edit/opsdata.py +++ b/scripts-blender/addons/blender_kitsu/edit/opsdata.py @@ -67,7 +67,7 @@ def init_edit_render_file_model( _edit_render_file_model_init = True -def add_edit_render_version_increment(context: bpy.types.Context) -> str: +def add_edit_export_version_increment(context: bpy.types.Context) -> str: # Init model if it did not happen. if not _edit_render_file_model_init: init_edit_render_file_model(context) @@ -85,7 +85,7 @@ def add_edit_render_version_increment(context: bpy.types.Context) -> str: return increment -def get_edit_render_versions_enum_list( +def get_edit_export_versions_enum_list( self: Any, context: bpy.types.Context, ) -> List[Tuple[str, str, str]]: diff --git a/scripts-blender/addons/blender_kitsu/edit/ui.py b/scripts-blender/addons/blender_kitsu/edit/ui.py index 0b9f6213..2c386662 100644 --- a/scripts-blender/addons/blender_kitsu/edit/ui.py +++ b/scripts-blender/addons/blender_kitsu/edit/ui.py @@ -3,10 +3,10 @@ from .. import prefs, ui from ..context import core as context_core from pathlib import Path from .ops import ( - KITSU_OT_edit_render_set_version, - KITSU_OT_edit_render_increment_version, - KITSU_OT_edit_render_publish, - KITSU_OT_edit_render_import_latest, + KITSU_OT_edit_export_set_version, + KITSU_OT_edit_export_increment_version, + KITSU_OT_edit_export_publish, + KITSU_OT_edit_export_import_latest, ) from ..generic.ops import KITSU_OT_open_path @@ -40,20 +40,20 @@ class KITSU_PT_edit_render_publish(bpy.types.Panel): # Edit Render version op. row = layout.row(align=True) row.operator( - KITSU_OT_edit_render_set_version.bl_idname, + KITSU_OT_edit_export_set_version.bl_idname, text=context.scene.kitsu.edit_export_version, icon="DOWNARROW_HLT", ) # Edit Render increment version op. row.operator( - KITSU_OT_edit_render_increment_version.bl_idname, + KITSU_OT_edit_export_increment_version.bl_idname, text="", icon="ADD", ) # Edit Render op. row = layout.row(align=True) - row.operator(KITSU_OT_edit_render_publish.bl_idname, icon="RENDER_ANIMATION") + row.operator(KITSU_OT_edit_export_publish.bl_idname, icon="RENDER_ANIMATION") # Edit Render path label. if Path(context.scene.kitsu.edit_export_file).exists(): @@ -96,7 +96,7 @@ class KITSU_PT_edit_render_tools(bpy.types.Panel): def draw(self, context: bpy.types.Context) -> None: box = self.layout.box() box.label(text="General", icon="MODIFIER") - box.operator(KITSU_OT_edit_render_import_latest.bl_idname) + box.operator(KITSU_OT_edit_export_import_latest.bl_idname) classes = [KITSU_PT_edit_render_publish, KITSU_PT_edit_render_tools] -- 2.30.2 From 60dccddc8a85ccc5437ad43a882588f7dacc1720 Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Mon, 26 Feb 2024 10:56:58 -0500 Subject: [PATCH 09/11] Rename all edit.opsdata functions/variables from "Render" to "Export" --- .../addons/blender_kitsu/edit/opsdata.py | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/scripts-blender/addons/blender_kitsu/edit/opsdata.py b/scripts-blender/addons/blender_kitsu/edit/opsdata.py index 839b48d3..4f4cd81e 100644 --- a/scripts-blender/addons/blender_kitsu/edit/opsdata.py +++ b/scripts-blender/addons/blender_kitsu/edit/opsdata.py @@ -26,20 +26,20 @@ import bpy from ..models import FileListModel from ..logger import LoggerFactory -EDIT_RENDER_FILE_MODEL = FileListModel() -_edit_render_enum_list: List[Tuple[str, str, str]] = [] -_edit_render_file_model_init: bool = False +EDIT_EXPORT_FILE_MODEL = FileListModel() +_edit_export_enum_list: List[Tuple[str, str, str]] = [] +_edit_export_file_model_init: bool = False logger = LoggerFactory.getLogger() # TODO Compare to Playblast opsdata, maybe centralize some repeated code -def init_edit_render_file_model( +def init_edit_export_file_model( context: bpy.types.Context, ) -> None: - global EDIT_RENDER_FILE_MODEL - global _edit_render_file_model_init + global EDIT_EXPORT_FILE_MODEL + global _edit_export_file_model_init addon_prefs = prefs.addon_prefs_get(context) kitsu_props = context.scene.kitsu @@ -48,32 +48,32 @@ def init_edit_render_file_model( # Is None if invalid. if addon_prefs.edit_export_dir == "" or not edit_export_dir.exists(): logger.error( - "Failed to initialize edit render file model. Invalid path. Check addon preferences" + "Failed to initialize edit export file model. Invalid path. Check addon preferences" ) return - EDIT_RENDER_FILE_MODEL.reset() - EDIT_RENDER_FILE_MODEL.root_path = edit_export_dir + EDIT_EXPORT_FILE_MODEL.reset() + EDIT_EXPORT_FILE_MODEL.root_path = edit_export_dir - if not EDIT_RENDER_FILE_MODEL.versions: - EDIT_RENDER_FILE_MODEL.append_item("v001") + if not EDIT_EXPORT_FILE_MODEL.versions: + EDIT_EXPORT_FILE_MODEL.append_item("v001") # Update edit_export_version prop. kitsu_props.edit_export_version = "v001" else: # Update edit_export_version prop. - kitsu_props.edit_export_version = EDIT_RENDER_FILE_MODEL.versions[0] + kitsu_props.edit_export_version = EDIT_EXPORT_FILE_MODEL.versions[0] - _edit_render_file_model_init = True + _edit_export_file_model_init = True def add_edit_export_version_increment(context: bpy.types.Context) -> str: # Init model if it did not happen. - if not _edit_render_file_model_init: - init_edit_render_file_model(context) + if not _edit_export_file_model_init: + init_edit_export_file_model(context) # Should be already sorted. - versions = EDIT_RENDER_FILE_MODEL.versions + versions = EDIT_EXPORT_FILE_MODEL.versions if len(versions) > 0: latest_version = versions[0] @@ -81,7 +81,7 @@ def add_edit_export_version_increment(context: bpy.types.Context) -> str: else: increment = "v001" - EDIT_RENDER_FILE_MODEL.append_item(increment) + EDIT_EXPORT_FILE_MODEL.append_item(increment) return increment @@ -89,24 +89,24 @@ def get_edit_export_versions_enum_list( self: Any, context: bpy.types.Context, ) -> List[Tuple[str, str, str]]: - global _edit_render_enum_list - global EDIT_RENDER_FILE_MODEL - global init_edit_render_file_model - global _edit_render_file_model_init + global _edit_export_enum_list + global EDIT_EXPORT_FILE_MODEL + global init_edit_export_file_model + global _edit_export_file_model_init # Init model if it did not happen. - if not _edit_render_file_model_init: - init_edit_render_file_model(context) + if not _edit_export_file_model_init: + init_edit_export_file_model(context) # Clear all versions in enum list. - _edit_render_enum_list.clear() - _edit_render_enum_list.extend(EDIT_RENDER_FILE_MODEL.versions_as_enum_list) + _edit_export_enum_list.clear() + _edit_export_enum_list.extend(EDIT_EXPORT_FILE_MODEL.versions_as_enum_list) - return _edit_render_enum_list + return _edit_export_enum_list def add_version_custom(custom_version: str) -> None: - global _edit_render_enum_list - global EDIT_RENDER_FILE_MODEL + global _edit_export_enum_list + global EDIT_EXPORT_FILE_MODEL - EDIT_RENDER_FILE_MODEL.append_item(custom_version) + EDIT_EXPORT_FILE_MODEL.append_item(custom_version) -- 2.30.2 From a82a2be7969b73dae4a6a73b9867c75af0a4d206 Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Mon, 26 Feb 2024 10:58:46 -0500 Subject: [PATCH 10/11] Rename Edit UI Panel from `Render & Publish` to `Export & Publish` --- .../addons/blender_kitsu/edit/ui.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts-blender/addons/blender_kitsu/edit/ui.py b/scripts-blender/addons/blender_kitsu/edit/ui.py index 2c386662..2c4392d2 100644 --- a/scripts-blender/addons/blender_kitsu/edit/ui.py +++ b/scripts-blender/addons/blender_kitsu/edit/ui.py @@ -11,13 +11,13 @@ from .ops import ( from ..generic.ops import KITSU_OT_open_path -class KITSU_PT_edit_render_publish(bpy.types.Panel): +class KITSU_PT_edit_export_publish(bpy.types.Panel): """ - Panel in sequence editor that exposes a set of tools that are used to render latest edit + Panel in sequence editor that exposes a set of tools that are used to export latest edit """ bl_category = "Kitsu" - bl_label = "Render & Publish" + bl_label = "Export & Publish" bl_space_type = "SEQUENCE_EDITOR" bl_region_type = "UI" bl_options = {"DEFAULT_CLOSED"} @@ -37,25 +37,25 @@ class KITSU_PT_edit_render_publish(bpy.types.Panel): box = ui.draw_error_box(layout) ui.draw_error_invalid_edit_export_root_dir(box) - # Edit Render version op. + # Edit Export version op. row = layout.row(align=True) row.operator( KITSU_OT_edit_export_set_version.bl_idname, text=context.scene.kitsu.edit_export_version, icon="DOWNARROW_HLT", ) - # Edit Render increment version op. + # Edit Export increment version op. row.operator( KITSU_OT_edit_export_increment_version.bl_idname, text="", icon="ADD", ) - # Edit Render op. + # Edit Export op. row = layout.row(align=True) row.operator(KITSU_OT_edit_export_publish.bl_idname, icon="RENDER_ANIMATION") - # Edit Render path label. + # Edit Export path label. if Path(context.scene.kitsu.edit_export_file).exists(): split = layout.split(factor=1 - split_factor_small, align=True) split.label(icon="ERROR") @@ -72,7 +72,7 @@ class KITSU_PT_edit_render_publish(bpy.types.Panel): ) -class KITSU_PT_edit_render_tools(bpy.types.Panel): +class KITSU_PT_edit_export_tools(bpy.types.Panel): """ Panel in sequence editor that exposes a set of tools that are used to load the latest edit """ @@ -99,7 +99,7 @@ class KITSU_PT_edit_render_tools(bpy.types.Panel): box.operator(KITSU_OT_edit_export_import_latest.bl_idname) -classes = [KITSU_PT_edit_render_publish, KITSU_PT_edit_render_tools] +classes = [KITSU_PT_edit_export_publish, KITSU_PT_edit_export_tools] def register(): -- 2.30.2 From 4edae3ef6d842aec6c714ec61f8f00fac7bee01d Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Mon, 26 Feb 2024 11:12:48 -0500 Subject: [PATCH 11/11] Update Edit Preference Names --- scripts-blender/addons/blender_kitsu/prefs.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts-blender/addons/blender_kitsu/prefs.py b/scripts-blender/addons/blender_kitsu/prefs.py index 72e7952d..080d1f58 100644 --- a/scripts-blender/addons/blender_kitsu/prefs.py +++ b/scripts-blender/addons/blender_kitsu/prefs.py @@ -372,7 +372,7 @@ class KITSU_addon_preferences(bpy.types.AddonPreferences): return get_safely_string_prop(self, 'edit_export_dir') edit_export_dir: bpy.props.StringProperty( # type: ignore - name="Export Directory", + name="Edit Export Directory", options={"HIDDEN", "SKIP_SAVE"}, description="Directory path to editorial's export folder containing storyboard/animatic renders. Path should be similar to '~/shared-{proj_name}/editorial/export/'", subtype="DIR_PATH", @@ -397,7 +397,7 @@ class KITSU_addon_preferences(bpy.types.AddonPreferences): return get_safely_string_prop(self, 'edit_export_file_pattern') edit_export_file_pattern: bpy.props.StringProperty( # type: ignore - name="Export File Pattern", + name="Edit Export File Pattern", options={"HIDDEN", "SKIP_SAVE"}, description=( "File pattern for latest editorial export file. " @@ -410,7 +410,7 @@ class KITSU_addon_preferences(bpy.types.AddonPreferences): ) edit_export_frame_offset: bpy.props.IntProperty( # type: ignore - name="Export Offset", + name="Edit Export Offset", description="Shift Editorial Export by this frame-range after import", default=-101, # HARD CODED FOR GOLD PROJECTS BLENDER FILM ) @@ -491,10 +491,10 @@ class KITSU_addon_preferences(bpy.types.AddonPreferences): # Editorial Settings box = col.box() box.label(text="Editorial", icon="SEQ_SEQUENCER") - box.row().prop(self, "edit_export_dir") + box.row().prop(self, "edit_export_dir", text="Export Directory") file_pattern_row = box.row(align=True) file_pattern_row.alert = not self.is_edit_export_pattern_valid - file_pattern_row.prop(self, "edit_export_file_pattern") + file_pattern_row.prop(self, "edit_export_file_pattern", text="Export File Pattern") # Lookdev tools settings. self.lookdev.draw(context, col) -- 2.30.2