[Bf-blender-cvs] [04549c64acd] vfx-clip-ui-update: UI: Tracking: Move Object Scale to objects panel

Aaron Carlisle noreply at git.blender.org
Wed Jan 6 05:06:38 CET 2021


Commit: 04549c64acd18c0fafb1266a438b4ee17ced2548
Author: Aaron Carlisle
Date:   Tue Jan 5 22:54:10 2021 -0500
Branches: vfx-clip-ui-update
https://developer.blender.org/rB04549c64acd18c0fafb1266a438b4ee17ced2548

UI: Tracking: Move Object Scale to objects panel

This moves the scale property from the rather hidden toolbar panel to the sidebar panel.
This also moves the two set scale operators to the same location.
This change is needed to migrate the current toolbar to a new active tool based toolbar

This revision depends on D9805

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 f17e09c3234..a7c6ff2da9f 100644
--- a/release/scripts/startup/bl_ui/space_clip.py
+++ b/release/scripts/startup/bl_ui/space_clip.py
@@ -607,6 +607,9 @@ class CLIP_PT_tools_orientation(CLIP_PT_tracking_panel, Panel):
         layout.use_property_split = True
         layout.use_property_decorate = False
 
+        clip = context.space_data.clip
+        tracking_object = clip.tracking.objects.active
+
         col = layout.column(align=True)
 
         row = col.row(align=True)
@@ -624,44 +627,13 @@ class CLIP_PT_tools_orientation(CLIP_PT_tracking_panel, Panel):
         col = layout.column()
 
         row = col.row(align=True)
-        row.operator("clip.set_scale")
+        if tracking_object.is_camera:
+            row.operator("clip.set_scale")
+        else:
+            row.operator("clip.set_solution_scale", text="Set Scale")
         row.operator("clip.apply_solution_scale", text="Apply Scale")
 
 
-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
-
-        col = layout.column()
-
-        col.prop(tracking_object, "scale")
-
-        col.separator()
-
-        col.operator("clip.set_solution_scale", text="Set Scale")
-
-
 class CLIP_PT_objects(CLIP_PT_clip_view_panel, Panel):
     bl_space_type = 'CLIP_EDITOR'
     bl_region_type = 'UI'
@@ -671,9 +643,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",
@@ -684,6 +659,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:
+            col = layout.row()
+            row.prop(tracking_object, "scale")
+
 
 class CLIP_PT_track(CLIP_PT_tracking_panel, Panel):
     bl_space_type = 'CLIP_EDITOR'
@@ -1746,7 +1725,6 @@ classes = (
     CLIP_PT_tools_cleanup,
     CLIP_PT_tools_geometry,
     CLIP_PT_tools_orientation,
-    CLIP_PT_tools_object,
     CLIP_PT_objects,
     CLIP_PT_plane_track,
     CLIP_PT_track_settings,



More information about the Bf-blender-cvs mailing list