diff --git a/operators/casting.py b/operators/casting.py index 9c130f0..4f322c2 100644 --- a/operators/casting.py +++ b/operators/casting.py @@ -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"}