fix remove casting for removed asset
parent
47e311b7b5
commit
a113aca633
|
@ -143,7 +143,7 @@ class VSETB_OT_casting_remove(Operator):
|
||||||
scn = context.scene
|
scn = context.scene
|
||||||
|
|
||||||
settings = get_strip_settings()
|
settings = get_strip_settings()
|
||||||
asset = settings.active_casting.asset
|
asset_id = settings.active_casting.id
|
||||||
|
|
||||||
strips = get_strips('Shots', selected_only=True)
|
strips = get_strips('Shots', selected_only=True)
|
||||||
strips_modified = 0
|
strips_modified = 0
|
||||||
|
@ -151,7 +151,7 @@ class VSETB_OT_casting_remove(Operator):
|
||||||
strip_settings = strip.vsetb_strip_settings
|
strip_settings = strip.vsetb_strip_settings
|
||||||
|
|
||||||
for i, asset_casting in enumerate(list(strip_settings.casting)):
|
for i, asset_casting in enumerate(list(strip_settings.casting)):
|
||||||
if asset_casting.asset == asset:
|
if asset_casting.id == asset_id:
|
||||||
strip_settings.casting.remove(i)
|
strip_settings.casting.remove(i)
|
||||||
|
|
||||||
|
|
||||||
|
@ -161,9 +161,14 @@ class VSETB_OT_casting_remove(Operator):
|
||||||
strips_modified += 1
|
strips_modified += 1
|
||||||
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if asset := settings.active_casting.asset:
|
||||||
|
name = asset.label
|
||||||
|
else:
|
||||||
|
name = settings.active_casting.get('_name', '')
|
||||||
|
|
||||||
self.report({"INFO"}, f'Item {asset.label} removed in {strips_modified} shots')
|
|
||||||
|
self.report({"INFO"}, f'Item {name} removed in {strips_modified} shots')
|
||||||
|
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue