From 48ea76de2b007d1c8cf2fda74bbe329523c54360 Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Mon, 8 Apr 2024 11:48:03 -0400 Subject: [PATCH 01/11] Add Episode to Multi Edit Shot Pattern --- scripts-blender/addons/blender_kitsu/prefs.py | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/scripts-blender/addons/blender_kitsu/prefs.py b/scripts-blender/addons/blender_kitsu/prefs.py index 5119a2b7..1d2b4fdf 100644 --- a/scripts-blender/addons/blender_kitsu/prefs.py +++ b/scripts-blender/addons/blender_kitsu/prefs.py @@ -316,10 +316,26 @@ class KITSU_addon_preferences(bpy.types.AddonPreferences): description="Show advanced settings that should already have good defaults", ) + def set_shot_pattern(self, input): + self['shot_pattern'] = input + return + + def get_shot_pattern( + self, + ) -> str: + active_project = cache.project_active_get() + if get_safely_string_prop(self, 'shot_pattern') == "": + if active_project.production_type == bkglobals.KITSU_TV_PROJECT: + return "__" + return "_" + return get_safely_string_prop(self, 'shot_pattern') + shot_pattern: bpy.props.StringProperty( # type: ignore name="Shot Pattern", - description="Pattern to define how Bulk Init will name the shots. Supported wildcards: , , ", - default="__A", + description="Pattern to define how Bulk Init will name the shots. Supported wildcards: , , , ", + default="_", + get=get_shot_pattern, + set=set_shot_pattern, ) shot_counter_digits: bpy.props.IntProperty( # type: ignore -- 2.30.2 From bc598dece2855688e6aecdf5e80c61b4e93c8476 Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Mon, 8 Apr 2024 11:48:03 -0400 Subject: [PATCH 02/11] If TV Show only show Multi Edit if Episode is Selected --- scripts-blender/addons/blender_kitsu/sqe/ui.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts-blender/addons/blender_kitsu/sqe/ui.py b/scripts-blender/addons/blender_kitsu/sqe/ui.py index 47679100..7e35c289 100644 --- a/scripts-blender/addons/blender_kitsu/sqe/ui.py +++ b/scripts-blender/addons/blender_kitsu/sqe/ui.py @@ -20,7 +20,7 @@ import bpy -from .. import cache, prefs, ui +from .. import cache, prefs, ui, bkglobals from ..sqe import checkstrip from ..context import core as context_core from ..logger import LoggerFactory @@ -366,6 +366,8 @@ class KITSU_PT_sqe_shot_tools(bpy.types.Panel): """ addon_prefs = prefs.addon_prefs_get(context) + active_project = cache.project_active_get() + nr_of_shots = len(context.selected_sequences) noun = get_selshots_noun(nr_of_shots) @@ -374,12 +376,15 @@ class KITSU_PT_sqe_shot_tools(bpy.types.Panel): box = layout.box() box.label(text="Multi Edit", icon="PROPERTIES") + if active_project.production_type == bkglobals.KITSU_TV_PROJECT: + if not cache.episode_active_get(): + box.label(text="Please Set Active Episode", icon="ERROR") + return + # Sequence - # TODO: use link sequence operator instead or sequence_enum ? col = box.column() sub_row = col.row(align=True) - # Sub_row.prop(context.window_manager, "sequence_name_display"). - sub_row.prop(context.window_manager, "sequence_enum", text="Sequence") + sub_row.prop(context.window_manager, "selected_sequence_name", text="Sequence") sub_row.operator(KITSU_OT_sqe_push_new_sequence.bl_idname, text="", icon="ADD") # Counter. -- 2.30.2 From c79beb7700d1e117143785587d4525df134a6c42 Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Mon, 8 Apr 2024 11:48:03 -0400 Subject: [PATCH 03/11] Use New Style Sequence Dropdown in Multi Edit --- scripts-blender/addons/blender_kitsu/props.py | 43 +++++++++++++++++-- .../addons/blender_kitsu/propsdata.py | 9 +++- .../addons/blender_kitsu/sqe/ops.py | 6 ++- 3 files changed, 51 insertions(+), 7 deletions(-) diff --git a/scripts-blender/addons/blender_kitsu/props.py b/scripts-blender/addons/blender_kitsu/props.py index 6c04680e..e15a3ed9 100644 --- a/scripts-blender/addons/blender_kitsu/props.py +++ b/scripts-blender/addons/blender_kitsu/props.py @@ -670,10 +670,44 @@ def _add_window_manager_props(): get=propsdata._get_project_active, ) - bpy.types.WindowManager.sequence_enum = bpy.props.EnumProperty( - name="Sequences", - items=propsdata._get_sequences, + ########### + # Sequence + ########### + bpy.types.WindowManager.selected_sequence_id = bpy.props.StringProperty( # type: ignore + name="Active Sequence ID", + description="ID that refers to the active sequence on server", + default="", + ) + + def get_sequences_via_name(self): + return get_safely_string_prop(self, "selected_sequence_name") + + def set_sequences_via_name(self, input): + key = set_kitsu_entity_id_via_enum_name( + self=self, + input_name=input, + items=cache.get_sequences_enum_list(self, bpy.context), + name_prop='selected_sequence_name', + id_prop='selected_sequence_id', + ) + if key: + cache.sequence_active_set_by_id(bpy.context, key) + else: + cache.sequence_active_reset_entity() + return + + def get_sequence_search_list(self, context, edit_text): + return get_enum_item_names(cache.get_sequences_enum_list(self, bpy.context)) + + bpy.types.WindowManager.selected_sequence_name = bpy.props.StringProperty( + name="Sequence", description="Name of Sequence the generated Shots will be assinged to", + default="", # type: ignore + get=get_sequences_via_name, + set=set_sequences_via_name, + options=set(), + search=get_sequence_search_list, + search_options={'SORT'}, ) # Advanced delete props. @@ -693,7 +727,8 @@ def _clear_window_manager_props(): del bpy.types.WindowManager.shot_counter_start del bpy.types.WindowManager.shot_preview del bpy.types.WindowManager.var_project_active - del bpy.types.WindowManager.sequence_enum + del bpy.types.WindowManager.selected_sequence_id + del bpy.types.WindowManager.selected_sequence_name def _calc_kitsu_3d_start(self): diff --git a/scripts-blender/addons/blender_kitsu/propsdata.py b/scripts-blender/addons/blender_kitsu/propsdata.py index 99ce3290..7ff611fc 100644 --- a/scripts-blender/addons/blender_kitsu/propsdata.py +++ b/scripts-blender/addons/blender_kitsu/propsdata.py @@ -77,12 +77,17 @@ def _gen_shot_preview(self: Any) -> str: shot_counter_start = self.shot_counter_start shot_pattern = addon_prefs.shot_pattern examples: List[str] = [] - sequence = self.sequence_enum + sequence = self.selected_sequence_name + episode = cache.episode_active_get() var_project = ( self.var_project_custom if self.var_use_custom_project else self.var_project_active ) var_sequence = self.var_sequence_custom if self.var_use_custom_seq else sequence - var_lookup_table = {"Sequence": var_sequence, "Project": var_project} + var_lookup_table = { + "Sequence": var_sequence, + "Project": var_project, + "Episode": episode.name, + } for count in range(3): counter_number = shot_counter_start + (shot_counter_increment * count) diff --git a/scripts-blender/addons/blender_kitsu/sqe/ops.py b/scripts-blender/addons/blender_kitsu/sqe/ops.py index e3ed2a15..7214f5e6 100644 --- a/scripts-blender/addons/blender_kitsu/sqe/ops.py +++ b/scripts-blender/addons/blender_kitsu/sqe/ops.py @@ -672,7 +672,7 @@ class KITSU_OT_sqe_multi_edit_strip(bpy.types.Operator): shot_counter_start = context.window_manager.shot_counter_start shot_pattern = addon_prefs.shot_pattern strip = context.scene.sequence_editor.active_strip - sequence = context.window_manager.sequence_enum + sequence = context.window_manager.selected_sequence_name var_project = ( addon_prefs.var_project_custom if context.window_manager.var_use_custom_project @@ -692,12 +692,14 @@ class KITSU_OT_sqe_multi_edit_strip(bpy.types.Operator): selected_sequences = sorted( selected_sequences, key=lambda x: x.frame_final_start ) + episode = cache.episode_active_get() for idx, strip in enumerate(selected_sequences): # Gen data for resolver. counter_number = shot_counter_start + (shot_counter_increment * idx) counter = str(counter_number).rjust(shot_counter_digits, "0") var_lookup_table = { + "Episode": episode.name, "Sequence": var_sequence, "Project": var_project, "Counter": counter, @@ -708,7 +710,9 @@ class KITSU_OT_sqe_multi_edit_strip(bpy.types.Operator): # Set metadata. strip.kitsu.sequence_name = sequence + strip.kitsu.sequence_id = context.window_manager.selected_sequence_id strip.kitsu.shot_name = shot + strip.name = shot succeeded.append(strip) logger.info( -- 2.30.2 From c4517b284c4bef9f171618ae60a064a9ffd33864 Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Mon, 8 Apr 2024 11:48:03 -0400 Subject: [PATCH 04/11] Use New Shot/Sequence Dropdown in Link Shot Operator - Add New Style Dropdown to strip kitsu property group - Use new dropdown in Link Shot Operator --- scripts-blender/addons/blender_kitsu/props.py | 91 +++++++++++++++++-- .../addons/blender_kitsu/sqe/ops.py | 22 ++--- 2 files changed, 95 insertions(+), 18 deletions(-) diff --git a/scripts-blender/addons/blender_kitsu/props.py b/scripts-blender/addons/blender_kitsu/props.py index e15a3ed9..72ba38bd 100644 --- a/scripts-blender/addons/blender_kitsu/props.py +++ b/scripts-blender/addons/blender_kitsu/props.py @@ -27,6 +27,7 @@ from bpy.app.handlers import persistent from . import propsdata, bkglobals from .logger import LoggerFactory from . import cache +from .types import Sequence logger = LoggerFactory.getLogger() @@ -49,21 +50,98 @@ class KITSU_property_group_sequence(bpy.types.PropertyGroup): They hold metadata that will be used to compose a data structure that can be pushed to backend. """ - def _get_shot_description(self): return self.shot_description - def _get_sequence_name(self): - return self.sequence_name + def _get_sequence_entity(self): + try: + return Sequence.by_id(self.sequence_id) + 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 + + ########### + # Shot + ########### + shot_id: bpy.props.StringProperty( # type: ignore + name="Shot ID", + description="ID that refers to the strip's shot on server", + default="", + ) + + def get_shot_via_name(self): + return get_safely_string_prop(self, "shot_name") + + def set_shot_via_name(self, input): + seq = self._get_sequence_entity() + if seq is None: + return + set_kitsu_entity_id_via_enum_name( + self=self, + input_name=input, + items=cache.get_shots_enum_for_seq(self, bpy.context, seq), + name_prop='shot_name', + id_prop='shot_id', + ) + return + + def get_shot_search_list(self, context, edit_text): + seq = self._get_sequence_entity() + if seq is None: + return [] + return get_enum_item_names(cache.get_shots_enum_for_seq(self, bpy.context, seq)) + + shot_name: bpy.props.StringProperty( # type: ignore + name="Shot", + description="Name that refers to the strip's shot on server", + default="", + get=get_shot_via_name, + set=set_shot_via_name, + options=set(), + search=get_shot_search_list, + search_options={'SORT'}, + ) + shot_description: bpy.props.StringProperty(name="Description", default="", options={"HIDDEN"}) # type: ignore - # Sequence. - sequence_name: bpy.props.StringProperty(name="Sequence", default="") # type: ignore - sequence_id: bpy.props.StringProperty(name="Seq ID", default="") # type: ignore + ########### + # Sequence + ########### + sequence_id: bpy.props.StringProperty( # type: ignore + name="Seq ID", + description="ID that refers to the active sequence on server", + default="", + ) + + def get_sequences_via_name(self): + return get_safely_string_prop(self, "sequence_name") + + def set_sequences_via_name(self, input): + key = set_kitsu_entity_id_via_enum_name( + self=self, + input_name=input, + items=cache.get_sequences_enum_list(self, bpy.context), + name_prop='sequence_name', + id_prop='sequence_id', + ) + return + + def get_sequence_search_list(self, context, edit_text): + return get_enum_item_names(cache.get_sequences_enum_list(self, bpy.context)) + + sequence_name: bpy.props.StringProperty( # type: ignore + name="Sequence", + description="Sequence", + default="", + get=get_sequences_via_name, + set=set_sequences_via_name, + options=set(), + search=get_sequence_search_list, + search_options={'SORT'}, + ) # Project. project_name: bpy.props.StringProperty(name="Project", default="") # type: ignore @@ -89,7 +167,6 @@ class KITSU_property_group_sequence(bpy.types.PropertyGroup): # Display props. shot_description_display: bpy.props.StringProperty(name="Description", get=_get_shot_description) # type: ignore - sequence_name_display: bpy.props.StringProperty(name="Sequence", get=_get_sequence_name) # type: ignore def to_dict(self): return { diff --git a/scripts-blender/addons/blender_kitsu/sqe/ops.py b/scripts-blender/addons/blender_kitsu/sqe/ops.py index 7214f5e6..d6bc0a94 100644 --- a/scripts-blender/addons/blender_kitsu/sqe/ops.py +++ b/scripts-blender/addons/blender_kitsu/sqe/ops.py @@ -528,8 +528,6 @@ class KITSU_OT_sqe_link_shot(bpy.types.Operator): bl_description = "Links selected sequence strip to shot on server. Pulls all metadata of shot from server" bl_options = {"REGISTER", "UNDO"} - sequence_enum: bpy.props.EnumProperty(items=cache.get_sequences_enum_list, name="Sequence") # type: ignore - shots_enum: bpy.props.EnumProperty(items=opsdata.get_shots_enum_for_link_shot_op, name="Shot") # type: ignore use_url: bpy.props.BoolProperty( name="Use URL", description="Use URL of shot on server to initiate strip. Paste complete URL", @@ -540,6 +538,8 @@ class KITSU_OT_sqe_link_shot(bpy.types.Operator): default="", ) + _strip = None + @classmethod def poll(cls, context: bpy.types.Context) -> bool: sqe = context.scene.sequence_editor @@ -555,9 +555,8 @@ class KITSU_OT_sqe_link_shot(bpy.types.Operator): ) def execute(self, context: bpy.types.Context) -> Set[str]: - strip = context.scene.sequence_editor.active_strip - shot_id = self.shots_enum + shot_id = self._strip.kitsu.shot_id # By url. if self.use_url: @@ -567,8 +566,8 @@ class KITSU_OT_sqe_link_shot(bpy.types.Operator): # By shot enum. else: - shot_id = self.shots_enum - if not shot_id: + shot_id = self._strip.kitsu.shot_id + if shot_id == "": self.report({"WARNING"}, "Invalid selection. Please choose a shot") return {"CANCELLED"} @@ -585,10 +584,10 @@ class KITSU_OT_sqe_link_shot(bpy.types.Operator): return {"CANCELLED"} # Pull shot meta. - pull.shot_meta(strip, shot) + pull.shot_meta(self._strip, shot) # Rename strip. - strip.name = shot.name + self._strip.name = shot.name # Pull sequence color. seq = Sequence.by_id(shot.parent_id) @@ -596,7 +595,7 @@ class KITSU_OT_sqe_link_shot(bpy.types.Operator): # Log. t = "Linked strip: %s to shot: %s with ID: %s" % ( - strip.name, + self._strip.name, shot.name, shot.id, ) @@ -609,6 +608,7 @@ class KITSU_OT_sqe_link_shot(bpy.types.Operator): def invoke(self, context: bpy.types.Context, event: bpy.types.Event) -> Set[str]: if context.window_manager.clipboard: self.url = context.window_manager.clipboard + self._strip = context.scene.sequence_editor.active_strip return context.window_manager.invoke_props_dialog( # type: ignore self, width=400 @@ -624,9 +624,9 @@ class KITSU_OT_sqe_link_shot(bpy.types.Operator): row.prop(self, "url", text="") else: row = layout.row() - row.prop(self, "sequence_enum") + row.prop(self._strip.kitsu, "sequence_name") row = layout.row() - row.prop(self, "shots_enum") + row.prop(self._strip.kitsu, "shot_name") row = layout.row() -- 2.30.2 From e1ed5005c6e9ae0859d185ab598ab0dd1a5395e8 Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Mon, 8 Apr 2024 11:48:03 -0400 Subject: [PATCH 05/11] Use new Sequence Dropdown in Metadata Box --- scripts-blender/addons/blender_kitsu/sqe/ui.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/scripts-blender/addons/blender_kitsu/sqe/ui.py b/scripts-blender/addons/blender_kitsu/sqe/ui.py index 7e35c289..c5be948c 100644 --- a/scripts-blender/addons/blender_kitsu/sqe/ui.py +++ b/scripts-blender/addons/blender_kitsu/sqe/ui.py @@ -300,17 +300,13 @@ class KITSU_PT_sqe_shot_tools(bpy.types.Panel): if not strip.kitsu.sequence_id: sub_row = split.row(align=True) - sub_row.prop(strip.kitsu, "sequence_name_display", text="") - sub_row.operator(KITSU_OT_sqe_link_sequence.bl_idname, text="", icon="DOWNARROW_HLT") + sub_row.prop(strip.kitsu, "sequence_name", text="") sub_row.operator(KITSU_OT_sqe_push_new_sequence.bl_idname, text="", icon="ADD") else: # Lots of splitting because color prop is too big by default - sub_split = split.split(factor=0.6, align=True) - sub_split.prop(strip.kitsu, "sequence_name_display", text="") - - sub_split = sub_split.split(factor=0.3, align=True) - sub_split.operator(KITSU_OT_sqe_link_sequence.bl_idname, text="", icon="DOWNARROW_HLT") + sub_split = split.split(factor=0.8, align=True) + sub_split.prop(strip.kitsu, "sequence_name", text="") # TODO Use new dropdown here too sub_sub_split = sub_split.split(factor=0.4, align=True) sub_sub_split.operator(KITSU_OT_sqe_push_new_sequence.bl_idname, text="", icon="ADD") -- 2.30.2 From 72a3bf3a44e4b49475e18020375860b3d3038eec Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Mon, 8 Apr 2024 11:48:03 -0400 Subject: [PATCH 06/11] Fix big in reset Episode --- scripts-blender/addons/blender_kitsu/props.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts-blender/addons/blender_kitsu/props.py b/scripts-blender/addons/blender_kitsu/props.py index 72ba38bd..e31b3c81 100644 --- a/scripts-blender/addons/blender_kitsu/props.py +++ b/scripts-blender/addons/blender_kitsu/props.py @@ -343,6 +343,8 @@ class KITSU_property_group_scene(bpy.types.PropertyGroup): if key: cache.episode_active_set_by_id(bpy.context, key) + else: + cache.episode_active_reset_entity() return def get_episode_search_list(self, context, edit_text): -- 2.30.2 From b142365c2eea16b9ef5172ecf52c87215bf54c54 Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Mon, 8 Apr 2024 11:48:03 -0400 Subject: [PATCH 07/11] Move Active Episode early return to top of Shot Tools --- scripts-blender/addons/blender_kitsu/sqe/ui.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts-blender/addons/blender_kitsu/sqe/ui.py b/scripts-blender/addons/blender_kitsu/sqe/ui.py index c5be948c..6727566d 100644 --- a/scripts-blender/addons/blender_kitsu/sqe/ui.py +++ b/scripts-blender/addons/blender_kitsu/sqe/ui.py @@ -105,6 +105,11 @@ class KITSU_PT_sqe_shot_tools(bpy.types.Panel): return bool(prefs.session_auth(context) or (sqe and sqe.sequences_all)) def draw(self, context: bpy.types.Context) -> None: + active_project = cache.project_active_get() + if active_project.production_type == bkglobals.KITSU_TV_PROJECT: + if not cache.episode_active_get(): + self.layout.label(text="Please Set Active Episode", icon="ERROR") + return if self.poll_error(context): self.draw_error(context) @@ -362,7 +367,6 @@ class KITSU_PT_sqe_shot_tools(bpy.types.Panel): """ addon_prefs = prefs.addon_prefs_get(context) - active_project = cache.project_active_get() nr_of_shots = len(context.selected_sequences) noun = get_selshots_noun(nr_of_shots) @@ -372,11 +376,6 @@ class KITSU_PT_sqe_shot_tools(bpy.types.Panel): box = layout.box() box.label(text="Multi Edit", icon="PROPERTIES") - if active_project.production_type == bkglobals.KITSU_TV_PROJECT: - if not cache.episode_active_get(): - box.label(text="Please Set Active Episode", icon="ERROR") - return - # Sequence col = box.column() sub_row = col.row(align=True) -- 2.30.2 From e88d2717c7a71aec32bfcdc96b1cdc3f5a1908c9 Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Mon, 8 Apr 2024 11:48:03 -0400 Subject: [PATCH 08/11] Add Poll Messages to Multi Edit Operator --- scripts-blender/addons/blender_kitsu/sqe/ops.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts-blender/addons/blender_kitsu/sqe/ops.py b/scripts-blender/addons/blender_kitsu/sqe/ops.py index d6bc0a94..1cded29d 100644 --- a/scripts-blender/addons/blender_kitsu/sqe/ops.py +++ b/scripts-blender/addons/blender_kitsu/sqe/ops.py @@ -647,10 +647,12 @@ class KITSU_OT_sqe_multi_edit_strip(bpy.types.Operator): # and they all have the same sequence name. sel_shots = context.selected_sequences if not sel_shots: + cls.poll_message_set("No sequences are selected") return False nr_of_shots = len(sel_shots) if nr_of_shots < 1: + cls.poll_message_set("Please more than one sequence") return False seq_name = sel_shots[0].kitsu.sequence_name @@ -660,8 +662,14 @@ class KITSU_OT_sqe_multi_edit_strip(bpy.types.Operator): or not s.kitsu.initialized or not checkstrip.is_valid_type(s) ): + cls.poll_message_set( + "Please select unlinked, initialized strips, of either MOVIE or COLOR type" + ) return False if s.kitsu.sequence_name != seq_name: + cls.poll_message_set( + "Strips have conflicting sequence names. Please select strips with the same sequence name, or no sequence" + ) return False return True -- 2.30.2 From 67c414e5ce7085a461b741daaefab8cfdb5e35fd Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Mon, 8 Apr 2024 11:48:03 -0400 Subject: [PATCH 09/11] Fix Bug in Shot Tool's 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 6727566d..56af9815 100644 --- a/scripts-blender/addons/blender_kitsu/sqe/ui.py +++ b/scripts-blender/addons/blender_kitsu/sqe/ui.py @@ -445,7 +445,7 @@ class KITSU_PT_sqe_shot_tools(bpy.types.Panel): strips_to_tb.append(s) strips_to_meta.append(s) - elif s.kitsu.initialized: + elif s.kitsu.initialized and s.kitsu.shot_id != "": strips_to_submit.append(s) return bool(strips_to_meta or strips_to_tb or strips_to_submit) -- 2.30.2 From 9da58ad73c453e6a5e97058ee2afad8255ada72a Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Mon, 8 Apr 2024 11:48:03 -0400 Subject: [PATCH 10/11] Add Icon to Show Advanced Menu --- 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 56af9815..f0197a76 100644 --- a/scripts-blender/addons/blender_kitsu/sqe/ui.py +++ b/scripts-blender/addons/blender_kitsu/sqe/ui.py @@ -385,7 +385,7 @@ class KITSU_PT_sqe_shot_tools(bpy.types.Panel): # Counter. row = box.row() row.prop(context.window_manager, "shot_counter_start", text="Shot Counter Start") - row.prop(context.window_manager, "show_advanced", text="") + row.prop(context.window_manager, "show_advanced", text="", icon="TOOL_SETTINGS") if context.window_manager.show_advanced: # Counter. -- 2.30.2 From 342c8f97e4c482d3b8bd682a8a0ba4f194a17aa9 Mon Sep 17 00:00:00 2001 From: Nick Alberelli Date: Mon, 8 Apr 2024 11:48:03 -0400 Subject: [PATCH 11/11] Rename `Multi Edit` to `Multi Edit Metadata` --- .../addons/blender_kitsu/sqe_multi_edit.jpg | 4 +-- .../blender_kitsu/sqe_multi_edit_advanced.jpg | 4 +-- .../addons/blender_kitsu/README.md | 28 ++++++++++--------- .../addons/blender_kitsu/sqe/ui.py | 8 ++++-- 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/docs/media/addons/blender_kitsu/sqe_multi_edit.jpg b/docs/media/addons/blender_kitsu/sqe_multi_edit.jpg index a7563151..19946636 100644 --- a/docs/media/addons/blender_kitsu/sqe_multi_edit.jpg +++ b/docs/media/addons/blender_kitsu/sqe_multi_edit.jpg @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a981a05bf3d60c1b7d68b663a519c50e63aad3259bfe00b23bb04a1ec48d4700 -size 10213 +oid sha256:4aeae44be510e09c918e6a7171be611b2703e428167fc8158b5cb893871bb713 +size 22742 diff --git a/docs/media/addons/blender_kitsu/sqe_multi_edit_advanced.jpg b/docs/media/addons/blender_kitsu/sqe_multi_edit_advanced.jpg index b20ab3d3..058390d9 100644 --- a/docs/media/addons/blender_kitsu/sqe_multi_edit_advanced.jpg +++ b/docs/media/addons/blender_kitsu/sqe_multi_edit_advanced.jpg @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3a2de2e6dc4309b4b0a175019b43e6cd5ad53f2918f3bc1b3e8a8ea2c780fb22 -size 14987 +oid sha256:627775c04f2e674964bbb852fa8c3eb12e921f87543f1ba339ac805eb10c17bc +size 41565 diff --git a/scripts-blender/addons/blender_kitsu/README.md b/scripts-blender/addons/blender_kitsu/README.md index 7591d626..bc615836 100644 --- a/scripts-blender/addons/blender_kitsu/README.md +++ b/scripts-blender/addons/blender_kitsu/README.md @@ -13,7 +13,7 @@ blender-kitsu is a Blender Add-on to interact with Kitsu from within Blender. It - [Metadata](#metadata) - [Push](#push) - [Pull](#pull) - - [Multi Edit](#multi-edit) + - [Multi Edit Metadata](#multi-edit-metadata) - [Import Media](#import-media) - [General Sequence Editor Tools](#general-sequence-editor-tools) - [Context](#context) @@ -185,13 +185,25 @@ As a result a bigger edit with nice sequence_colors can look pretty cool: ![image info](/media/addons/blender_kitsu/sqe_sequence_colors.jpg) -##### Multi Edit +##### Multi Edit Metadata -The `Multi Edit` panel only appears when you select multiple metadata strips that are all `initialized` but not `linked` yet.
+The `Multi Edit Metadata` panel only appears when you select multiple metadata strips that are all `initialized` but not `linked` yet.
![image info](/media/addons/blender_kitsu/sqe_multi_edit.jpg) It is meant to be way to quickly setup lots of shots if they don't exist on Kitsu yet. You specify the sequence all shots should belong to and adjust the `Shot Counter Start` value. In the preview property you can see how all shots will be named when you execute the `Multi Edit Strip` operator.
+ + +###### Advanced Settings +If you enable the `Advanced` mode (via the screwdriver/wrench icon) next to the counter value, you have access to advance settings to customize the operator even more. + +![image info](/media/addons/blender_kitsu/sqe_multi_edit_advanced.jpg) + +You can adjust the number of counter digits, the increment size and also the `Pattern` it will use to generate the shot name.
+>**Pattern**: supports 3 wildcards. ``, ``, ``, `Episode` that can be used multiple times in any order.
+**Custom Sequence Variable**: specify a custom string that should be used in the `` wildcard instead of the sequence name.
+**Custom Project Variable**: specify a custom string that should be used in the `` wildcard instead of the project name.
+ ##### Import Media A collection of operators to Import media based on the Shot associated with the selected metadata strip(s).
@@ -208,16 +220,6 @@ With a metadata strip selected `Import Image Sequence` Operator will find an ima Use this operator to import image sequences that have been approved via the [Render Review Add-On](/addons/render_review) Image Sequences can be loaded as either `EXR` or `JPG` sequences. -###### Advanced Settings -If you check the `Advanced` checkbox next to the counter value, you have access to advance settings to customize the operator even more. - -![image info](/media/addons/blender_kitsu/sqe_multi_edit_advanced.jpg) - -You can adjust the number of counter digits, the increment size and also the `Pattern` it will use to generate the shot name.
->**Pattern**: supports 3 wildcards. ``, ``, `` that can be used multiple times in any order.
-**Custom Sequence Variable**: specify a custom string that should be used in the `` wildcard instead of the sequence name.
-**Custom Project Variable**: specify a custom string that should be used in the `` wildcard instead of the project name.
- ##### General Sequence Editor Tools In the general tab you can find some tools that don't directly relate to Kitsu but are useful for editing. diff --git a/scripts-blender/addons/blender_kitsu/sqe/ui.py b/scripts-blender/addons/blender_kitsu/sqe/ui.py index f0197a76..35dbe565 100644 --- a/scripts-blender/addons/blender_kitsu/sqe/ui.py +++ b/scripts-blender/addons/blender_kitsu/sqe/ui.py @@ -355,6 +355,8 @@ class KITSU_PT_sqe_shot_tools(bpy.types.Panel): @classmethod def poll_multi_edit(cls, context: bpy.types.Context) -> bool: + if not prefs.session_auth(context): + return False sel_shots = context.selected_sequences nr_of_shots = len(sel_shots) unvalid = [s for s in sel_shots if s.kitsu.linked or not s.kitsu.initialized] @@ -374,7 +376,7 @@ class KITSU_PT_sqe_shot_tools(bpy.types.Panel): # Create box. layout = self.layout box = layout.box() - box.label(text="Multi Edit", icon="PROPERTIES") + box.label(text="Multi Edit Metadata", icon="PROPERTIES") # Sequence col = box.column() @@ -422,8 +424,8 @@ class KITSU_PT_sqe_shot_tools(bpy.types.Panel): row = box.row(align=True) row.operator( KITSU_OT_sqe_multi_edit_strip.bl_idname, - text=f"Edit {noun}", - icon="TRIA_RIGHT", + text=f"Set Metadata for {noun}", + icon="ALIGN_LEFT", ) @classmethod -- 2.30.2