From 92915a4768a609ef3654ddd4d1c772fab7d1a26f Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Wed, 19 Jul 2023 10:54:43 -0400 Subject: [PATCH 1/3] Blender Kitsu: Add option to create tasks during Submit New Shot --- scripts-blender/addons/blender_kitsu/sqe/ops.py | 4 +++- scripts-blender/addons/blender_kitsu/sqe/push.py | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/scripts-blender/addons/blender_kitsu/sqe/ops.py b/scripts-blender/addons/blender_kitsu/sqe/ops.py index 9bd1949d..ce5dc75b 100644 --- a/scripts-blender/addons/blender_kitsu/sqe/ops.py +++ b/scripts-blender/addons/blender_kitsu/sqe/ops.py @@ -152,6 +152,7 @@ class KITSU_OT_sqe_push_new_shot(bpy.types.Operator): bl_description = "Creates a new shot for each selected sequence strip on server. Checks if shot already exists" confirm: bpy.props.BoolProperty(name="confirm") + add_tasks: bpy.props.BoolProperty(name="Add Default Tasks") @classmethod def poll(cls, context: bpy.types.Context) -> bool: @@ -238,7 +239,7 @@ class KITSU_OT_sqe_push_new_shot(bpy.types.Operator): opsdata.push_sequence_color(context, seq) # Push update to shot. - shot = push.new_shot(strip, seq, project_active) + shot = push.new_shot(strip, seq, project_active, add_tasks=self.add_tasks) pull.shot_meta(strip, shot) succeeded.append(strip) @@ -307,6 +308,7 @@ class KITSU_OT_sqe_push_new_shot(bpy.types.Operator): text="Submit %s to server. Will skip shots if they already exist" % (noun.lower()), ) + col.prop(self, "add_tasks", text="Add default tasks to shot") class KITSU_OT_sqe_push_new_sequence(bpy.types.Operator): diff --git a/scripts-blender/addons/blender_kitsu/sqe/push.py b/scripts-blender/addons/blender_kitsu/sqe/push.py index a8acd4af..db497793 100644 --- a/scripts-blender/addons/blender_kitsu/sqe/push.py +++ b/scripts-blender/addons/blender_kitsu/sqe/push.py @@ -25,6 +25,7 @@ import bpy from blender_kitsu import bkglobals from blender_kitsu.types import Sequence, Project, Shot from blender_kitsu.logger import LoggerFactory +from blender_kitsu import gazu # TODO REPLACE ONCE GAZU MODULE IS UPDATED logger = LoggerFactory.getLogger() @@ -60,9 +61,7 @@ def shot_meta(strip: bpy.types.Sequence, shot: Shot) -> None: def new_shot( - strip: bpy.types.Sequence, - sequence: Sequence, - project: Project, + strip: bpy.types.Sequence, sequence: Sequence, project: Project, add_tasks=False ) -> Shot: frame_range = (strip.frame_final_start, strip.frame_final_end) shot = project.create_shot( @@ -75,6 +74,10 @@ def new_shot( "fps": bkglobals.FPS, }, ) + + if add_tasks: + create_intial_tasks(shot, project) + # Update description, no option to pass that on create. if strip.kitsu.shot_description: shot.description = strip.kitsu.shot_description @@ -105,3 +108,10 @@ def delete_shot(strip: bpy.types.Sequence, shot: Shot) -> str: ) strip.kitsu.clear() return result + + +def create_intial_tasks(shot: Shot, project: Project): + shot_entity = gazu.shot.get_shot(shot.id) + for task_type in gazu.task.all_task_types_for_project(project.id): + if task_type["for_entity"] == "Shot": + gazu.task.new_task(shot_entity, task_type) -- 2.30.2 From c8a7db4cc203690d7023e36b994422a4c76dba3c Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Wed, 19 Jul 2023 10:54:44 -0400 Subject: [PATCH 2/3] Blender Kitsu: Fix Gazu Import --- scripts-blender/addons/blender_kitsu/sqe/push.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts-blender/addons/blender_kitsu/sqe/push.py b/scripts-blender/addons/blender_kitsu/sqe/push.py index db497793..254f8641 100644 --- a/scripts-blender/addons/blender_kitsu/sqe/push.py +++ b/scripts-blender/addons/blender_kitsu/sqe/push.py @@ -25,7 +25,7 @@ import bpy from blender_kitsu import bkglobals from blender_kitsu.types import Sequence, Project, Shot from blender_kitsu.logger import LoggerFactory -from blender_kitsu import gazu # TODO REPLACE ONCE GAZU MODULE IS UPDATED +import gazu logger = LoggerFactory.getLogger() -- 2.30.2 From 821bec4bfa2f36db3c240374f39cafbc491f5d14 Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Wed, 19 Jul 2023 10:54:45 -0400 Subject: [PATCH 3/3] Blender Kitsu: Submit Shot update Documentation --- scripts-blender/addons/blender_kitsu/README.md | 2 +- scripts-blender/addons/blender_kitsu/sqe/ops.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts-blender/addons/blender_kitsu/README.md b/scripts-blender/addons/blender_kitsu/README.md index 4a7f10cd..172a9c6c 100644 --- a/scripts-blender/addons/blender_kitsu/README.md +++ b/scripts-blender/addons/blender_kitsu/README.md @@ -132,7 +132,7 @@ This will import a metastrip.mp4 (1000 frame black video) file which is saved in 3.3 Type in the name of the new shot in the `Shot` field - 3.4 Execute the `Submit New Shot` operator in the `Push` Panel (Will warn you if the shot already exists on Kitsu) + 3.4 Execute the `Submit New Shot` operator in the `Push` Panel (Will warn you if the shot already exists on Kitsu). This operator can optionally populate each 'Shot' with a task set to the project's default task status. >**Note**: Most of the operator are selection sensitive. So you can do these operations for a batch of sequence strips. If you have nothing selected it will usually try to operate on all strips in the sequence editor.
![image info](/media/addons/blender_kitsu/sqe_init_selection.jpg) diff --git a/scripts-blender/addons/blender_kitsu/sqe/ops.py b/scripts-blender/addons/blender_kitsu/sqe/ops.py index ce5dc75b..eef15b14 100644 --- a/scripts-blender/addons/blender_kitsu/sqe/ops.py +++ b/scripts-blender/addons/blender_kitsu/sqe/ops.py @@ -308,7 +308,7 @@ class KITSU_OT_sqe_push_new_shot(bpy.types.Operator): text="Submit %s to server. Will skip shots if they already exist" % (noun.lower()), ) - col.prop(self, "add_tasks", text="Add default tasks to shot") + col.prop(self, "add_tasks", text="Add Tasks with the default status to shot(s)") class KITSU_OT_sqe_push_new_sequence(bpy.types.Operator): -- 2.30.2