Blender Kitsu: Improve Init New Shot Workflow #302

Merged
Nick Alberelli merged 3 commits from TinyNick/blender-studio-pipeline:fix/init-shot-blender-kitsu into main 2024-05-29 17:27:59 +02:00
4 changed files with 17 additions and 10 deletions

View File

@ -59,9 +59,11 @@ class KITSU_property_group_sequence(bpy.types.PropertyGroup):
except AttributeError: except AttributeError:
return None return None
# Shot. manual_shot_name: bpy.props.StringProperty(
shot_id: bpy.props.StringProperty(name="Shot ID") # type: ignore name="Shot",
shot_name: bpy.props.StringProperty(name="Shot", default="") # type: ignore description="Enter a new Shot name to submit to Kitsu Server",
default="",
) # type: ignore
########### ###########
# Shot # Shot

View File

@ -63,7 +63,7 @@ def is_linked(strip: bpy.types.Sequence, log: bool = True) -> bool:
def has_meta(strip: bpy.types.Sequence) -> 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""" """Returns True if strip.kitsu.shot_name and strip.kitsu.sequence_name is Truethy else False"""
seq = strip.kitsu.sequence_name seq = strip.kitsu.sequence_name
shot = strip.kitsu.shot_name shot = strip.kitsu.manual_shot_name
if not bool(seq and shot): if not bool(seq and shot):
logger.info("Strip: %s. Missing metadata", strip.name) logger.info("Strip: %s. Missing metadata", strip.name)
@ -135,12 +135,12 @@ def shot_exists_by_name(
if clear_cache: if clear_cache:
Cache.clear_all() 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: if not shot:
logger.info( logger.info(
"Strip: %s Shot %s does not exist on server", "Strip: %s Shot %s does not exist on server",
strip.name, strip.name,
strip.kitsu.shot_name, strip.kitsu.manual_shot_name,
) )
return None return None

View File

@ -168,7 +168,7 @@ class KITSU_OT_sqe_push_new_shot(bpy.types.Operator):
prefs.session_auth(context) prefs.session_auth(context)
and cache.project_active_get() and cache.project_active_get()
and strip.kitsu.sequence_name 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()) 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) failed.append(strip)
continue continue
strip.kitsu.shot_name = strip.kitsu.manual_shot_name
# Push update to sequence. # Push update to sequence.
opsdata.push_sequence_color(context, seq) 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 for s in selected_sequences
if s.kitsu.initialized if s.kitsu.initialized
and not s.kitsu.linked and not s.kitsu.linked
and s.kitsu.shot_name and s.kitsu.manual_shot_name
and s.kitsu.sequence_name and s.kitsu.sequence_name
] ]

View File

@ -333,7 +333,10 @@ class KITSU_PT_sqe_shot_tools(bpy.types.Panel):
# Shot. # Shot.
split = col.split(factor=split_factor, align=True) split = col.split(factor=split_factor, align=True)
split.label(text="Shot") 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. # Description.
split = col.split(factor=split_factor, align=True) split = col.split(factor=split_factor, align=True)
@ -476,7 +479,7 @@ class KITSU_PT_sqe_shot_tools(bpy.types.Panel):
strips_to_tb.append(s) strips_to_tb.append(s)
strips_to_meta.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) strips_to_submit.append(s)
return bool(strips_to_meta or strips_to_tb or strips_to_submit) return bool(strips_to_meta or strips_to_tb or strips_to_submit)