fix remove casting for removed asset

pull/5/head
ChristopheSeux 2023-10-02 14:56:40 +02:00
parent 47e311b7b5
commit a113aca633
1 changed files with 9 additions and 4 deletions

View File

@ -143,7 +143,7 @@ class VSETB_OT_casting_remove(Operator):
scn = context.scene
settings = get_strip_settings()
asset = settings.active_casting.asset
asset_id = settings.active_casting.id
strips = get_strips('Shots', selected_only=True)
strips_modified = 0
@ -151,7 +151,7 @@ class VSETB_OT_casting_remove(Operator):
strip_settings = strip.vsetb_strip_settings
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)
@ -161,9 +161,14 @@ class VSETB_OT_casting_remove(Operator):
strips_modified += 1
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"}