[Blender_Kitsu] Publish VSE Edit as Revision on Kitsu #7

Merged
Nick Alberelli merged 28 commits from :feature/upload_render_to_kitsu into master 2023-04-17 19:02:15 +02:00
Showing only changes of commit 87e0066618 - Show all commits

View File

@ -324,7 +324,7 @@ class KITSU_OT_sqe_push_new_edit(bpy.types.Operator):
return [(item.get("id"), item.get("name"), f'Created at: "{item.get("created_at")}" {item.get("description")}') for item in tasks] return [(item.get("id"), item.get("name"), f'Created at: "{item.get("created_at")}" {item.get("description")}') for item in tasks]
comment: bpy.props.StringProperty(name="comment") comment: bpy.props.StringProperty(name="comment")
edit_entry: bpy.props.EnumProperty(name="Edit Entry", items=get_edit_entry_enum) edit_entry: bpy.props.EnumProperty(name="Edit Entry", items=get_edit_entry_enum_key)
task: bpy.props.EnumProperty(name="Edit Tasks", items=get_edit_task_items) task: bpy.props.EnumProperty(name="Edit Tasks", items=get_edit_task_items)
render_dir: bpy.props.StringProperty( render_dir: bpy.props.StringProperty(
name="Render Directory", name="Render Directory",
@ -339,8 +339,11 @@ class KITSU_OT_sqe_push_new_edit(bpy.types.Operator):
) )
def invoke(self, context, event): def invoke(self, context, event):
self.render_dir = context.scene.render.filepath.rsplit("\\", 1)[0] # Remove file name if set in render.filepath
self.render_name = bpy.path.basename(context.blend_data.filepath).replace('.blend','') dir_path = bpy.path.abspath(context.scene.render.filepath)
if not os.path.isdir(Path(dir_path)):
dir_path = Path(dir_path).parent
self.render_dir = str(dir_path)
return context.window_manager.invoke_props_dialog(self) return context.window_manager.invoke_props_dialog(self)
def draw(self, context: bpy.types.Context) -> None: def draw(self, context: bpy.types.Context) -> None:
@ -358,6 +361,12 @@ class KITSU_OT_sqe_push_new_edit(bpy.types.Operator):
# Build render_path # Build render_path
render_dir = bpy.path.abspath(self.render_dir) render_dir = bpy.path.abspath(self.render_dir)
if not os.path.isdir(Path(render_dir)):
self.report(
{"ERROR"},
f"Render path is not set to a directory. '{self.render_dir}'"
)
return {"CANCELLED"}
render_name = f"{self.render_name.replace('.','_')}.mp4" render_name = f"{self.render_name.replace('.','_')}.mp4"
render_path = Path(render_dir).joinpath(render_name) render_path = Path(render_dir).joinpath(render_name)