[Bf-blender-cvs] [677212b0165] tracking_tools: UI: Tracking: Move Object Scale to objects panel

Aaron Carlisle noreply at git.blender.org
Mon Jul 19 00:09:13 CEST 2021


Commit: 677212b0165b335543286b1c9ed108b6d1f147fc
Author: Aaron Carlisle
Date:   Sun Jul 18 18:05:45 2021 -0400
Branches: tracking_tools
https://developer.blender.org/rB677212b0165b335543286b1c9ed108b6d1f147fc

UI: Tracking: Move Object Scale to objects panel

The goal of this patch is to simplify the object panel shown below to help the process of migrating the current toolbar to a new active tool based toolbar

{F10174064}

This moves the scale property from the rather hidden toolbar panel to the sidebar "Objects" panel in the sidebar:

{F10174050}

This also moves the two set scale operators to the same location and will change based on the active "object type" (Camera or Object)

Reviewed By: sebastian_k, sergey

Differential Revision: https://developer.blender.org/D9806

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

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 7ecac39c1e5..fd62647394c 100644
--- a/release/scripts/startup/bl_ui/space_clip.py
+++ b/release/scripts/startup/bl_ui/space_clip.py
@@ -724,7 +724,9 @@ class CLIP_PT_orientation(CLIP_PT_reconstruction_panel, Panel):
         layout.use_property_decorate = False
 
         sc = context.space_data
-        settings = sc.clip.tracking.settings
+        clip = sc.clip
+        tracking_object = clip.tracking.objects.active
+        settings = clip.tracking.settings
 
         col = layout.column(align=True)
 
@@ -743,46 +745,14 @@ class CLIP_PT_orientation(CLIP_PT_reconstruction_panel, Panel):
         col = layout.column()
 
         row = col.row(align=True)
-        row.operator("clip.set_scale")
-        row.operator("clip.apply_solution_scale", text="Apply Scale")
-
-        col.prop(settings, "distance")
-
-
-class CLIP_PT_tools_object(CLIP_PT_reconstruction_panel, Panel):
-    bl_space_type = 'CLIP_EDITOR'
-    bl_region_type = 'TOOLS'
-    bl_label = "Object"
-    bl_category = "Solve"
-
-    @classmethod
-    def poll(cls, context):
-        sc = context.space_data
-        if CLIP_PT_reconstruction_panel.poll(context) and sc.mode == 'TRACKING':
-            clip = sc.clip
-
-            tracking_object = clip.tracking.objects.active
-
-            return not tracking_object.is_camera
-
-        return False
-
-    def draw(self, context):
-        layout = self.layout
-
-        sc = context.space_data
-        clip = sc.clip
-        tracking_object = clip.tracking.objects.active
-        settings = sc.clip.tracking.settings
-
-        col = layout.column()
-
-        col.prop(tracking_object, "scale")
-
-        col.separator()
+        if tracking_object.is_camera:
+            row.operator("clip.set_scale")
+            col.prop(settings, "distance")
+        else:
+            row.operator("clip.set_solution_scale", text="Set Scale")
+            col.prop(settings, "object_distance")
 
-        col.operator("clip.set_solution_scale", text="Set Scale")
-        col.prop(settings, "object_distance")
+        row.operator("clip.apply_solution_scale", text="Apply Scale")
 
 
 class CLIP_PT_objects(CLIP_PT_clip_view_panel, Panel):
@@ -794,9 +764,12 @@ class CLIP_PT_objects(CLIP_PT_clip_view_panel, Panel):
 
     def draw(self, context):
         layout = self.layout
+        layout.use_property_split = True
+        layout.use_property_decorate = False
 
         sc = context.space_data
         tracking = sc.clip.tracking
+        tracking_object = sc.clip.tracking.objects.active
 
         row = layout.row()
         row.template_list("CLIP_UL_tracking_objects", "", tracking, "objects",
@@ -807,6 +780,10 @@ class CLIP_PT_objects(CLIP_PT_clip_view_panel, Panel):
         sub.operator("clip.tracking_object_new", icon='ADD', text="")
         sub.operator("clip.tracking_object_remove", icon='REMOVE', text="")
 
+        if not tracking_object.is_camera:
+            row = layout.row()
+            row.prop(tracking_object, "scale")
+
 
 class CLIP_PT_track(CLIP_PT_tracking_panel, Panel):
     bl_space_type = 'CLIP_EDITOR'



More information about the Bf-blender-cvs mailing list