2D stabilization: Modify interface so dependency goes strictly from top to bottom
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 16 Aug 2016 11:30:47 +0000 (13:30 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 16 Aug 2016 11:32:11 +0000 (13:32 +0200)
release/scripts/startup/bl_ui/space_clip.py
source/blender/blenkernel/intern/tracking.c
source/blender/blenloader/intern/versioning_270.c
source/blender/makesdna/DNA_tracking_types.h
source/blender/makesrna/intern/rna_tracking.c

index 9b1c0a166031765d547ea14886b6f85bb36b982b..b22636187198a09ea762c8fcff1b4b01dfdf4f8d 100644 (file)
@@ -916,73 +916,58 @@ class CLIP_PT_stabilization(CLIP_PT_reconstruction_panel, Panel):
 
         layout.prop(stab, "anchor_frame")
 
-        box = layout.box()
-        row = box.row(align=True)
-        row.prop(stab, "show_tracks_expanded", text="", emboss=False)
+        col = layout.column()
+        col.label(text="Location")
+        row = col.row()
+        row.template_list("UI_UL_list", "stabilization_tracks", stab, "tracks",
+                          stab, "active_track_index", rows=2)
 
-        if not stab.show_tracks_expanded:
-            row.label(text="Tracks For Stabilization")
-        else:
-            row.label(text="Tracks For Location")
-            row = box.row()
-            row.template_list("UI_UL_list", "stabilization_tracks", stab, "tracks",
-                              stab, "active_track_index", rows=2)
+        sub = row.column(align=True)
 
-            sub = row.column(align=True)
+        sub.operator("clip.stabilize_2d_add", icon='ZOOMIN', text="")
+        sub.operator("clip.stabilize_2d_remove", icon='ZOOMOUT', text="")
 
-            sub.operator("clip.stabilize_2d_add", icon='ZOOMIN', text="")
-            sub.operator("clip.stabilize_2d_remove", icon='ZOOMOUT', text="")
+        sub.menu('CLIP_MT_stabilize_2d_specials', text="",
+                 icon='DOWNARROW_HLT')
 
-            sub.menu('CLIP_MT_stabilize_2d_specials', text="",
-                     icon='DOWNARROW_HLT')
+        col.label(text="Expected Position")
+        row = col.row()
+        row.prop(stab, "target_pos", text="")
+        col.prop(stab, "influence_location")
 
-            row = box.row()
-            row.label(text="Tracks For Rotation / Scale")
-            row = box.row()
-            row.active = stab.use_stabilize_rotation
-            row.template_list("UI_UL_list", "stabilization_rotation_tracks", stab, "rotation_tracks",
-                              stab, "active_rotation_track_index", rows=2)
+        layout.separator()
+        layout.prop(stab, "use_stabilize_rotation")
+        col = layout.column()
+        col.active = stab.use_stabilize_rotation
+        row = col.row()
+        row.template_list("UI_UL_list", "stabilization_rotation_tracks", stab, "rotation_tracks",
+                          stab, "active_rotation_track_index", rows=2)
 
-            sub = row.column(align=True)
+        sub = row.column(align=True)
 
-            sub.operator("clip.stabilize_2d_rotation_add", icon='ZOOMIN', text="")
-            sub.operator("clip.stabilize_2d_rotation_remove", icon='ZOOMOUT', text="")
+        sub.operator("clip.stabilize_2d_rotation_add", icon='ZOOMIN', text="")
+        sub.operator("clip.stabilize_2d_rotation_remove", icon='ZOOMOUT', text="")
 
-            sub.menu('CLIP_MT_stabilize_2d_rotation_specials', text="",
-                     icon='DOWNARROW_HLT')
+        sub.menu('CLIP_MT_stabilize_2d_rotation_specials', text="",
+                 icon='DOWNARROW_HLT')
 
-        layout.prop(stab, "use_stabilize_rotation")
-        row = layout.row()
-        row.active = stab.use_stabilize_rotation
-        row.prop(stab, "use_stabilize_scale")
-        if stab.use_autoscale:
-            row = layout.row(align=True)
-            row.prop(stab, "use_autoscale")
-            row.prop(stab, "scale_max", text="Max")
-        else:
-            layout.prop(stab, "use_autoscale")
+        col.prop(stab, "target_rot")
+        col.prop(stab, "influence_rotation")
 
         layout.separator()
-        layout.label(text="Expected Position")
-        layout.prop(stab, "target_pos", text="")
-        layout.prop(stab, "target_rot")
+        col = layout.column()
+        col.active = stab.use_stabilize_rotation
+        col.prop(stab, "use_stabilize_scale")
+        col.prop(stab, "use_autoscale")
         if stab.use_autoscale:
-            layout.label(text="Auto Scale Factor: %5.3f" % (1.0 / stab.target_zoom))
+            col.prop(stab, "scale_max", text="Max")
+            col.label(text="Auto Scale Factor: %5.3f" % (1.0 / stab.target_zoom))
         else:
-            layout.prop(stab, "target_zoom")
-
-        layout.separator()
-        row = layout.row()
-        row.active = 0 < len(stab.tracks.values())
-        row.prop(stab, "influence_location")
+            col.prop(stab, "target_zoom")
 
-        col = layout.column()
-        col.active = stab.use_stabilize_rotation and 0 < len(stab.rotation_tracks.values())
-        row = col.row()
-        row.prop(stab, "influence_rotation")
-        row = col.row()
-        row.prop(stab, "influence_scale")
+        col.prop(stab, "influence_scale")
 
+        layout.separator()
         layout.prop(stab, "filter_type")
 
 
index d5d3384bb48894a7083beb3a41eb4d7b13e39c58..e50218c2a193bb4a2cb612050d405110d90fdff9 100644 (file)
@@ -345,7 +345,6 @@ void BKE_tracking_settings_init(MovieTracking *tracking)
        tracking->stabilization.rotinf = 1.0f;
        tracking->stabilization.maxscale = 2.0f;
        tracking->stabilization.filter = TRACKING_FILTER_BILINEAR;
-       tracking->stabilization.flag |= TRACKING_SHOW_STAB_TRACKS;
 
        BKE_tracking_object_add(tracking, "Camera");
 }
index 394547757e925d50d6a36b4a689983768865a3d0..45c73edf90879f6910bf79cfe81f12d11c22086a 100644 (file)
@@ -91,9 +91,6 @@ static void migrate_single_rot_stabilization_track_settings(MovieTrackingStabili
                }
        }
        stab->rot_track = NULL; /* this field is now ignored */
-
-       /* by default show the track lists expanded, to improve "discoverability" */
-       stab->flag |= TRACKING_SHOW_STAB_TRACKS;
 }
 
 static void do_version_constraints_radians_degrees_270_1(ListBase *lb)
index 42b72c1ff93409af67d9a2f6127a83f7a01a9cf6..8c22fa09477686222354ce8e286b66963f0c1c7a 100644 (file)
@@ -463,7 +463,6 @@ enum {
        TRACKING_AUTOSCALE          = (1 << 1),
        TRACKING_STABILIZE_ROTATION = (1 << 2),
        TRACKING_STABILIZE_SCALE    = (1 << 3),
-       TRACKING_SHOW_STAB_TRACKS   = (1 << 5)
 };
 
 /* MovieTrackingStrabilization->filter */
index 0591c65d4844e7ab6ac78823fae7f4604fe0438a..2787ec4ca2175fdb34befa0329bc322fd682e439 100644 (file)
@@ -1815,13 +1815,6 @@ static void rna_def_trackingStabilization(BlenderRNA *brna)
        RNA_def_property_enum_items(prop, filter_items);
        RNA_def_property_ui_text(prop, "Interpolate", "Interpolation to use for sub-pixel shifts and rotations due to stabilization");
        RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_tracking_flushUpdate");
-
-       /* UI display : show participating tracks */
-       prop = RNA_def_property(srna, "show_tracks_expanded", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
-       RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_SHOW_STAB_TRACKS);
-       RNA_def_property_ui_text(prop, "Show Tracks", "Show UI list of tracks participating in stabilization");
-       RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
 }
 
 static void rna_def_reconstructedCamera(BlenderRNA *brna)