diff options
author | Aaron Carlisle <Blendify> | 2021-01-03 00:09:31 +0300 |
---|---|---|
committer | Aaron Carlisle <carlisle.b3d@gmail.com> | 2021-01-03 00:11:14 +0300 |
commit | e1b8af9ba7d833496ae222b93f889aa8e6df03fd (patch) | |
tree | 8cc8613525326af4c68bbca6eadc537a34a5f4d9 /release | |
parent | 0330b0552b90e647df3ea1f2094f4517df26250d (diff) |
Fix Unreported: Run time error in UI code
Steps to reproduce:
1. Add clip to clip editor
2. Open the tracking settings & tracking settings extra panels
To fix this the sub panel is only drawn if a track is active.
The main panel will exit early and display a "No active track" message.
This is consistent with other panels in the clip editor.
Reviewed By: HooglyBoogly
Differential Revision: https://developer.blender.org/D9727
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/space_clip.py | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index a0cf22877d5..35fd7333cf4 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -807,16 +807,19 @@ class CLIP_PT_track_settings(CLIP_PT_tracking_panel, Panel): layout.use_property_decorate = False clip = context.space_data.clip + active = clip.tracking.tracks.active - col = layout.column() + if not active: + layout.active = False + layout.label(text="No active track") + return - active = clip.tracking.tracks.active - if active: - col.prop(active, "motion_model") - col.prop(active, "pattern_match", text="Match") + col = layout.column() + col.prop(active, "motion_model") + col.prop(active, "pattern_match", text="Match") - col.prop(active, "use_brute") - col.prop(active, "use_normalization") + col.prop(active, "use_brute") + col.prop(active, "use_normalization") class CLIP_PT_track_settings_extras(CLIP_PT_tracking_panel, Panel): @@ -827,6 +830,12 @@ class CLIP_PT_track_settings_extras(CLIP_PT_tracking_panel, Panel): bl_parent_id = 'CLIP_PT_track_settings' bl_options = {'DEFAULT_CLOSED'} + @classmethod + def poll(cls, context): + clip = context.space_data.clip + + return clip.tracking.tracks.active + def draw(self, context): layout = self.layout layout.use_property_split = True |