From 6cc8ea7b778a54f6d19b902bfcf335db5ce304f8 Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Mon, 27 May 2024 18:22:36 -0400 Subject: [PATCH 1/3] Blender Kitsu: Improve Init New Shot Workflow --- scripts-blender/addons/blender_kitsu/props.py | 8 +++++--- scripts-blender/addons/blender_kitsu/sqe/checkstrip.py | 4 ++-- scripts-blender/addons/blender_kitsu/sqe/ops.py | 6 ++++-- scripts-blender/addons/blender_kitsu/sqe/ui.py | 5 ++++- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/scripts-blender/addons/blender_kitsu/props.py b/scripts-blender/addons/blender_kitsu/props.py index a19e356a..4a6c1d2e 100644 --- a/scripts-blender/addons/blender_kitsu/props.py +++ b/scripts-blender/addons/blender_kitsu/props.py @@ -59,9 +59,11 @@ class KITSU_property_group_sequence(bpy.types.PropertyGroup): except AttributeError: return None - # Shot. - shot_id: bpy.props.StringProperty(name="Shot ID") # type: ignore - shot_name: bpy.props.StringProperty(name="Shot", default="") # type: ignore + manual_shot_name: bpy.props.StringProperty( + name="Shot", + description="Enter a new Shot name to submit to Kitsu Server", + default="", + ) # type: ignore ########### # Shot diff --git a/scripts-blender/addons/blender_kitsu/sqe/checkstrip.py b/scripts-blender/addons/blender_kitsu/sqe/checkstrip.py index ab84461f..ee0e67f7 100644 --- a/scripts-blender/addons/blender_kitsu/sqe/checkstrip.py +++ b/scripts-blender/addons/blender_kitsu/sqe/checkstrip.py @@ -135,12 +135,12 @@ def shot_exists_by_name( if clear_cache: Cache.clear_all() - shot = project.get_shot_by_name(sequence, strip.kitsu.shot_name) + shot = project.get_shot_by_name(sequence, strip.kitsu.manual_shot_name) if not shot: logger.info( "Strip: %s Shot %s does not exist on server", strip.name, - strip.kitsu.shot_name, + strip.kitsu.manual_shot_name, ) return None diff --git a/scripts-blender/addons/blender_kitsu/sqe/ops.py b/scripts-blender/addons/blender_kitsu/sqe/ops.py index 7bf8e83e..deb37ff0 100644 --- a/scripts-blender/addons/blender_kitsu/sqe/ops.py +++ b/scripts-blender/addons/blender_kitsu/sqe/ops.py @@ -168,7 +168,7 @@ class KITSU_OT_sqe_push_new_shot(bpy.types.Operator): prefs.session_auth(context) and cache.project_active_get() and strip.kitsu.sequence_name - and strip.kitsu.shot_name + and strip.kitsu.manual_shot_name ) return bool(prefs.session_auth(context) and cache.project_active_get()) @@ -239,6 +239,8 @@ class KITSU_OT_sqe_push_new_shot(bpy.types.Operator): failed.append(strip) continue + strip.kitsu.shot_name = strip.kitsu.manual_shot_name + # Push update to sequence. opsdata.push_sequence_color(context, seq) @@ -293,7 +295,7 @@ class KITSU_OT_sqe_push_new_shot(bpy.types.Operator): for s in selected_sequences if s.kitsu.initialized and not s.kitsu.linked - and s.kitsu.shot_name + and s.kitsu.manual_shot_name and s.kitsu.sequence_name ] diff --git a/scripts-blender/addons/blender_kitsu/sqe/ui.py b/scripts-blender/addons/blender_kitsu/sqe/ui.py index 83cefb96..af49904e 100644 --- a/scripts-blender/addons/blender_kitsu/sqe/ui.py +++ b/scripts-blender/addons/blender_kitsu/sqe/ui.py @@ -333,7 +333,10 @@ class KITSU_PT_sqe_shot_tools(bpy.types.Panel): # Shot. split = col.split(factor=split_factor, align=True) split.label(text="Shot") - split.prop(strip.kitsu, "shot_name", text="") + if not strip.kitsu.shot_id: + split.prop(strip.kitsu, "manual_shot_name", text="") + else: + split.prop(strip.kitsu, "shot_name", text="") # Description. split = col.split(factor=split_factor, align=True) -- 2.30.2 From f49fb483a8d1acd2c59969aaf203d082086c75b0 Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Tue, 28 May 2024 15:38:50 -0400 Subject: [PATCH 2/3] Fix Push Poll --- scripts-blender/addons/blender_kitsu/sqe/ui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts-blender/addons/blender_kitsu/sqe/ui.py b/scripts-blender/addons/blender_kitsu/sqe/ui.py index af49904e..d7486f1b 100644 --- a/scripts-blender/addons/blender_kitsu/sqe/ui.py +++ b/scripts-blender/addons/blender_kitsu/sqe/ui.py @@ -479,7 +479,7 @@ class KITSU_PT_sqe_shot_tools(bpy.types.Panel): strips_to_tb.append(s) strips_to_meta.append(s) - elif s.kitsu.initialized and s.kitsu.shot_name != "": + elif s.kitsu.initialized and s.kitsu.manual_shot_name != "": strips_to_submit.append(s) return bool(strips_to_meta or strips_to_tb or strips_to_submit) -- 2.30.2 From 33ff32e6720362871a5999500a70679a3ca54f4b Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Tue, 28 May 2024 15:39:05 -0400 Subject: [PATCH 3/3] Fix check if strip has metadata --- scripts-blender/addons/blender_kitsu/sqe/checkstrip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts-blender/addons/blender_kitsu/sqe/checkstrip.py b/scripts-blender/addons/blender_kitsu/sqe/checkstrip.py index ee0e67f7..791223da 100644 --- a/scripts-blender/addons/blender_kitsu/sqe/checkstrip.py +++ b/scripts-blender/addons/blender_kitsu/sqe/checkstrip.py @@ -63,7 +63,7 @@ def is_linked(strip: bpy.types.Sequence, log: bool = True) -> bool: def has_meta(strip: bpy.types.Sequence) -> bool: """Returns True if strip.kitsu.shot_name and strip.kitsu.sequence_name is Truethy else False""" seq = strip.kitsu.sequence_name - shot = strip.kitsu.shot_name + shot = strip.kitsu.manual_shot_name if not bool(seq and shot): logger.info("Strip: %s. Missing metadata", strip.name) -- 2.30.2