From 566e734a1a0d2f447da5d9d45a5f222c2154479c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cchristopheseux=E2=80=9D?= <“seuxchristophe@hotmail.fr”> Date: Tue, 25 Apr 2023 10:29:02 +0200 Subject: [PATCH] rename store in project --- operators/operators.py | 32 ++++++++++++++++++-------------- properties.py | 6 ++++++ 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/operators/operators.py b/operators/operators.py index 43c476c..9a24834 100644 --- a/operators/operators.py +++ b/operators/operators.py @@ -724,16 +724,16 @@ class VSETB_OT_rename(Operator): bl_description = "Rename Strips" bl_options = {"REGISTER", "UNDO"} - template : StringProperty(name="Strip Name", default="") - increment : IntProperty(name="Increment", default=0) + #template : StringProperty(name="Strip Name", default="") + #increment : IntProperty(name="Increment", default=0) channel_name : StringProperty(name="Channel Name", default="") - #selected_only : BoolProperty(name="Selected Only", default=False) - start_number : IntProperty(name="Start Number", default=0, min=0) - by_sequence : BoolProperty( - name="Reset By Sequence", - description="Reset Start Number for each sequence", - default=False - ) + selected_only : BoolProperty(name="Selected Only", default=False) + #start_number : IntProperty(name="Start Number", default=0, min=0) + #by_sequence : BoolProperty( + # name="Reset By Sequence", + # description="Reset Start Number for each sequence", + # default=False + #) @classmethod def poll(cls, context): @@ -752,16 +752,20 @@ class VSETB_OT_rename(Operator): layout = self.layout col = layout.column() col.use_property_split = True - col.prop(self, 'template') - col.prop(self, 'start_number') if self.channel_name == 'Shots': - col.prop(self, 'by_sequence') - #col.prop(self, 'selected_only') + col.prop(settings, 'shot_template') + col.prop(settings, 'shot_start_number') + col.prop(settings, 'reset_by_sequence') + elif self.channel_name == 'Shots': + col.prop(settings, 'sequence_template') + col.prop(settings, 'sequence_start_number') + + col.prop(self, 'selected_only') def execute(self, context): scn = context.scene #strips = get_strips(channel=self.channel_name, selected_only=self.selected_only) - strips = get_strips(channel=self.channel_name, selected_only=True) + strips = get_strips(channel=self.channel_name, selected_only=self.selected_only) rename_strips( strips, self.template, diff --git a/properties.py b/properties.py index 13d579d..369f86a 100644 --- a/properties.py +++ b/properties.py @@ -181,6 +181,12 @@ class Project(PropertyGroup): shot_start_number : IntProperty(name="Shot Start Number", default=10, min=0) sequence_start_number : IntProperty(name="Sequence Start Number", default=10, min=0) + reset_by_sequence : BoolProperty( + name="Reset By Sequence", + description="Reset Start Number for each sequence", + default=False + ) + sequence_increment : IntProperty( name="Sequence Increment", default=10, min=0, step=10)