diff options
author | Falk David <falkdavid@gmx.de> | 2021-10-04 09:14:06 +0300 |
---|---|---|
committer | Falk David <falkdavid@gmx.de> | 2021-10-04 09:15:03 +0300 |
commit | fc6228bd8528629da63cd9b5d012b36e0e5e9fee (patch) | |
tree | c78f395a8d1593dac999104691b9d5a00f07316c /release/scripts | |
parent | 93e92ac1263505ea3a3bc5a42c1b2f55607ccc45 (diff) |
Fix T91873: Crash when opening properties panel
This patch fixes a crash that was recently introduced by rB5cebcb415e76.
The reason were missing poll functions in the UI and operator.
Reviewed By: ISS
Maniphest Tasks: T91873
Differential Revision: https://developer.blender.org/D12736
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/startup/bl_ui/space_sequencer.py | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index 197e3efebda..6430d6bab9b 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -1048,16 +1048,23 @@ class SequencerButtonsPanel_Output: return cls.has_preview(context) -class SEQUENCER_PT_color_tag_picker(Panel): - bl_label = "Color Tag" +class SequencerColorTagPicker: bl_space_type = 'SEQUENCE_EDITOR' bl_region_type = 'UI' - bl_category = "Strip" - bl_options = {'HIDE_HEADER', 'INSTANCED'} + + @staticmethod + def has_sequencer(context): + return (context.space_data.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}) @classmethod def poll(cls, context): - return context.active_sequence_strip is not None + return cls.has_sequencer(context) and context.active_sequence_strip is not None + + +class SEQUENCER_PT_color_tag_picker(SequencerColorTagPicker, Panel): + bl_label = "Color Tag" + bl_category = "Strip" + bl_options = {'HIDE_HEADER', 'INSTANCED'} def draw(self, context): layout = self.layout @@ -1069,13 +1076,9 @@ class SEQUENCER_PT_color_tag_picker(Panel): row.operator("sequencer.strip_color_tag_set", icon=icon).color = 'COLOR_%02d' % i -class SEQUENCER_MT_color_tag_picker(Menu): +class SEQUENCER_MT_color_tag_picker(SequencerColorTagPicker, Menu): bl_label = "Set Color Tag" - @classmethod - def poll(cls, context): - return context.active_sequence_strip is not None - def draw(self, context): layout = self.layout |