casting on selection
parent
f5284d18b1
commit
95e5610ff9
|
@ -101,10 +101,16 @@ class VSETB_OT_casting_add(Operator):
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
scn = context.scene
|
scn = context.scene
|
||||||
active_strip = scn.sequence_editor.active_strip
|
|
||||||
|
item = get_strip_settings().active_casting
|
||||||
|
label = item.asset.label if item.asset.label else 'Empty'
|
||||||
|
|
||||||
|
strips = get_strips('Shots', selected_only=True)
|
||||||
|
for strip in strips:
|
||||||
|
#active_strip = scn.sequence_editor.active_strip
|
||||||
|
|
||||||
settings = get_scene_settings()
|
settings = get_scene_settings()
|
||||||
strip_settings = get_strip_settings()
|
strip_settings = strip.vsetb_strip_settings
|
||||||
|
|
||||||
project = settings.active_project
|
project = settings.active_project
|
||||||
|
|
||||||
|
@ -122,6 +128,8 @@ class VSETB_OT_casting_add(Operator):
|
||||||
|
|
||||||
strip_settings.casting.update()
|
strip_settings.casting.update()
|
||||||
|
|
||||||
|
self.report({"INFO"}, f'Item {label} added in {len(strips)} shots')
|
||||||
|
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
|
@ -140,25 +148,30 @@ class VSETB_OT_casting_remove(Operator):
|
||||||
def invoke(self, context, event):
|
def invoke(self, context, event):
|
||||||
scn = context.scene
|
scn = context.scene
|
||||||
|
|
||||||
strip_settings = get_strip_settings()
|
item = get_strip_settings().active_casting
|
||||||
|
label = item.asset.label if item.asset.label else 'Empty'
|
||||||
|
|
||||||
|
strips = get_strips('Shots', selected_only=True)
|
||||||
|
strips_modified = 0
|
||||||
|
for strip in strips:
|
||||||
|
|
||||||
|
strip_settings = strip.vsetb_strip_settings
|
||||||
idx = strip_settings.casting_index
|
idx = strip_settings.casting_index
|
||||||
|
|
||||||
try:
|
try:
|
||||||
item = strip_settings.casting[idx]
|
item = strip_settings.casting[idx]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
pass
|
continue
|
||||||
else:
|
else:
|
||||||
item = strip_settings.casting[strip_settings.casting_index]
|
|
||||||
label = item.asset.label if item.asset.label else 'Empty'
|
|
||||||
info = f"Item {label} removed from casting"
|
|
||||||
strip_settings.casting.remove(idx)
|
strip_settings.casting.remove(idx)
|
||||||
|
|
||||||
if strip_settings.casting_index == 0:
|
if strip_settings.casting_index != 0:
|
||||||
strip_settings.casting_index = 0
|
|
||||||
else:
|
|
||||||
strip_settings.casting_index -= 1
|
strip_settings.casting_index -= 1
|
||||||
|
|
||||||
self.report({'INFO'}, info)
|
strips_modified += 1
|
||||||
|
|
||||||
|
self.report({"INFO"}, f'Item {label} removed in {strips_modified} shots')
|
||||||
|
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
|
@ -499,6 +499,9 @@ class VSETB_PGT_strip_settings(PropertyGroup):
|
||||||
metadata : PointerProperty(type=Metadata)
|
metadata : PointerProperty(type=Metadata)
|
||||||
description : StringProperty()
|
description : StringProperty()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def active_casting(self):
|
||||||
|
return self.casting[self.casting_index]
|
||||||
|
|
||||||
classes = (
|
classes = (
|
||||||
Asset,
|
Asset,
|
||||||
|
|
Loading…
Reference in New Issue