rename store in project

pull/5/head
“christopheseux” 2023-04-25 10:29:02 +02:00
parent cc27ed71bb
commit 566e734a1a
2 changed files with 24 additions and 14 deletions

View File

@ -724,16 +724,16 @@ class VSETB_OT_rename(Operator):
bl_description = "Rename Strips" bl_description = "Rename Strips"
bl_options = {"REGISTER", "UNDO"} bl_options = {"REGISTER", "UNDO"}
template : StringProperty(name="Strip Name", default="") #template : StringProperty(name="Strip Name", default="")
increment : IntProperty(name="Increment", default=0) #increment : IntProperty(name="Increment", default=0)
channel_name : StringProperty(name="Channel Name", default="") channel_name : StringProperty(name="Channel Name", default="")
#selected_only : BoolProperty(name="Selected Only", default=False) selected_only : BoolProperty(name="Selected Only", default=False)
start_number : IntProperty(name="Start Number", default=0, min=0) #start_number : IntProperty(name="Start Number", default=0, min=0)
by_sequence : BoolProperty( #by_sequence : BoolProperty(
name="Reset By Sequence", # name="Reset By Sequence",
description="Reset Start Number for each sequence", # description="Reset Start Number for each sequence",
default=False # default=False
) #)
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):
@ -752,16 +752,20 @@ class VSETB_OT_rename(Operator):
layout = self.layout layout = self.layout
col = layout.column() col = layout.column()
col.use_property_split = True col.use_property_split = True
col.prop(self, 'template')
col.prop(self, 'start_number')
if self.channel_name == 'Shots': if self.channel_name == 'Shots':
col.prop(self, 'by_sequence') col.prop(settings, 'shot_template')
#col.prop(self, 'selected_only') 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): def execute(self, context):
scn = context.scene scn = context.scene
#strips = get_strips(channel=self.channel_name, selected_only=self.selected_only) #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( rename_strips(
strips, self.template, strips, self.template,

View File

@ -181,6 +181,12 @@ class Project(PropertyGroup):
shot_start_number : IntProperty(name="Shot Start Number", default=10, min=0) shot_start_number : IntProperty(name="Shot Start Number", default=10, min=0)
sequence_start_number : IntProperty(name="Sequence 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( sequence_increment : IntProperty(
name="Sequence Increment", default=10, min=0, step=10) name="Sequence Increment", default=10, min=0, step=10)