[Bf-blender-cvs] [e1b8af9ba7d] master: Fix Unreported: Run time error in UI code

Aaron Carlisle noreply at git.blender.org
Sat Jan 2 22:12:03 CET 2021


Commit: e1b8af9ba7d833496ae222b93f889aa8e6df03fd
Author: Aaron Carlisle
Date:   Sat Jan 2 16:09:31 2021 -0500
Branches: master
https://developer.blender.org/rBe1b8af9ba7d833496ae222b93f889aa8e6df03fd

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

===================================================================

M	release/scripts/startup/bl_ui/space_clip.py

===================================================================

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



More information about the Bf-blender-cvs mailing list