From 06c8c280712e2304b56015cbf68c2c9cd60f988c Mon Sep 17 00:00:00 2001 From: "christophe.seux" Date: Wed, 5 Feb 2025 14:57:25 +0100 Subject: [PATCH] active_sequence_strip poll issue --- operators/casting.py | 17 +++++++---------- operators/sequencer.py | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/operators/casting.py b/operators/casting.py index 4f322c2..6cd68e5 100644 --- a/operators/casting.py +++ b/operators/casting.py @@ -87,7 +87,7 @@ class VSETB_OT_casting_add(Operator): #asset_name : EnumProperty(name='', items=get_scene_settings().active_project.get('asset_items', [])) @classmethod def poll(cls, context): - active_strip = context.scene.sequence_editor.active_strip + active_strip = context.active_sequence_strip if active_strip: return True @@ -135,7 +135,7 @@ class VSETB_OT_casting_remove(Operator): @classmethod def poll(cls, context): - active_strip = context.scene.sequence_editor.active_strip + active_strip = context.active_sequence_strip if active_strip: return True @@ -190,7 +190,7 @@ class VSETB_OT_casting_move(Operator): @classmethod def poll(cls, context): - active_strip = context.scene.sequence_editor.active_strip + active_strip = context.active_sequence_strip if active_strip: return True @@ -229,16 +229,15 @@ class VSETB_OT_copy_casting(Operator): @classmethod def poll(cls, context): - active_strip = context.scene.sequence_editor.active_strip + if not context.scene.sequence_editor: + return + active_strip = context.active_sequence_strip strip_settings = get_strip_settings() if active_strip and strip_settings.casting: return True def execute(self, context): - scn = context.scene - - active_strip = scn.sequence_editor.active_strip strip_settings = get_strip_settings() datas = [c.to_dict() for c in strip_settings.casting] @@ -257,9 +256,7 @@ class VSETB_OT_paste_casting(Operator): @classmethod def poll(cls, context): - active_strip = context.scene.sequence_editor.active_strip - if active_strip: - return True + return context.active_sequence_strip def invoke(self, context, event): self.mode = 'REPLACE' diff --git a/operators/sequencer.py b/operators/sequencer.py index 2b36492..c4c2c2f 100644 --- a/operators/sequencer.py +++ b/operators/sequencer.py @@ -427,7 +427,7 @@ class VSETB_OT_next_shot(Operator): bpy.ops.sequencer.select_all(action="DESELECT") next_shot.select = True - context.scene.sequence_editor.active_strip = next_shot + context.active_sequence_strip = next_shot return {"FINISHED"}