From ba081eaec99e347b5e198a977cd7f274a31c3398 Mon Sep 17 00:00:00 2001 From: TinyNick Date: Mon, 17 Apr 2023 17:06:51 -0400 Subject: [PATCH 1/4] [Blender_Kitsu] Pub_Edit_Rev: Fix naming convention --- blender_kitsu/sqe/ops.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/blender_kitsu/sqe/ops.py b/blender_kitsu/sqe/ops.py index 2337094f..ae457701 100644 --- a/blender_kitsu/sqe/ops.py +++ b/blender_kitsu/sqe/ops.py @@ -2487,7 +2487,7 @@ class KITSU_OT_vse_publish_edit_revision(bpy.types.Operator): existing_previews = gazu.edit.get_all_previews_for_edit(self.edit_entry) len_previews = get_dict_len(existing_previews) - revision = set_revision_int(len_previews) + revision = str(set_revision_int(len_previews)).zfill(3) # Build render_path render_dir = bpy.path.abspath(self.render_dir) @@ -2498,7 +2498,8 @@ class KITSU_OT_vse_publish_edit_revision(bpy.types.Operator): ) return {"CANCELLED"} edit_entry = gazu.edit.get_edit(self.edit_entry) - render_name = f"{active_project.name}_{edit_entry.get('name')}_v{revision}.mp4" + prod_name = active_project.name.lower().replace(' ', '') + render_name = f"{prod_name}_v{revision}.mp4" render_path = Path(render_dir).joinpath(render_name) # Render Sequence to .mp4 -- 2.30.2 From ba78043a97640c822ac3fc4cc162a90fb60aeccf Mon Sep 17 00:00:00 2001 From: TinyNick Date: Mon, 17 Apr 2023 17:10:30 -0400 Subject: [PATCH 2/4] [Blender_Kitsu] Pub_Edit_Rev: Cancel if file exists --- blender_kitsu/sqe/ops.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/blender_kitsu/sqe/ops.py b/blender_kitsu/sqe/ops.py index ae457701..2d4ab20f 100644 --- a/blender_kitsu/sqe/ops.py +++ b/blender_kitsu/sqe/ops.py @@ -2501,6 +2501,13 @@ class KITSU_OT_vse_publish_edit_revision(bpy.types.Operator): prod_name = active_project.name.lower().replace(' ', '') render_name = f"{prod_name}_v{revision}.mp4" render_path = Path(render_dir).joinpath(render_name) + # check path exists + if render_path.is_file(): + self.report( + {"ERROR"}, + f"File '{render_name}' already exists at '{self.render_dir}'" + ) + return {"CANCELLED"} # Render Sequence to .mp4 with override_render_path(self, context, render_path.as_posix()): -- 2.30.2 From 8d6aecbcbe54bb9b3f168b18e0db999e31718719 Mon Sep 17 00:00:00 2001 From: TinyNick Date: Mon, 17 Apr 2023 21:13:26 -0400 Subject: [PATCH 3/4] [Blender_Kitsu] Update tooltip with "will not overwrite" --- blender_kitsu/sqe/ops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blender_kitsu/sqe/ops.py b/blender_kitsu/sqe/ops.py index 2d4ab20f..63c68cfa 100644 --- a/blender_kitsu/sqe/ops.py +++ b/blender_kitsu/sqe/ops.py @@ -2418,7 +2418,7 @@ def set_revision_int(prev_rev=None): class KITSU_OT_vse_publish_edit_revision(bpy.types.Operator): bl_idname = "kitsu.vse_publish_edit_revision" bl_label = "Render and 'Publish as Revision'" - bl_description = "Renders current VSE Edit as .mp4 and publishes as revision on 'Edit Task'" + bl_description = "Renders current VSE Edit as .mp4 and publishes as revision on 'Edit Task' \n will not overwrite existing files." def get_edit_entry_items(self: Any, context: bpy.types.Context) -> List[Tuple[str, str, str]]: sorted_edits = [] -- 2.30.2 From da137b1597aa99683485d5844a5d50113ba80369 Mon Sep 17 00:00:00 2001 From: TinyNick Date: Mon, 17 Apr 2023 21:19:52 -0400 Subject: [PATCH 4/4] [Blender_Kitsu] Pub_Edit_Rev Fix tooltip grammar --- blender_kitsu/sqe/ops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blender_kitsu/sqe/ops.py b/blender_kitsu/sqe/ops.py index 63c68cfa..d7914cdd 100644 --- a/blender_kitsu/sqe/ops.py +++ b/blender_kitsu/sqe/ops.py @@ -2418,7 +2418,7 @@ def set_revision_int(prev_rev=None): class KITSU_OT_vse_publish_edit_revision(bpy.types.Operator): bl_idname = "kitsu.vse_publish_edit_revision" bl_label = "Render and 'Publish as Revision'" - bl_description = "Renders current VSE Edit as .mp4 and publishes as revision on 'Edit Task' \n will not overwrite existing files." + bl_description = "Renders current VSE Edit as .mp4 and publishes as revision on 'Edit Task'.\nWill not overwrite existing files" def get_edit_entry_items(self: Any, context: bpy.types.Context) -> List[Tuple[str, str, str]]: sorted_edits = [] -- 2.30.2