[Bf-blender-cvs] [b7d656c] master: 2D stabilizer: Revert majority of UI change

Sergey Sharybin noreply at git.blender.org
Tue Aug 16 14:32:45 CEST 2016


Commit: b7d656c3b24cee4400d8bd4d5e5184e7657227ef
Author: Sergey Sharybin
Date:   Tue Aug 16 14:25:55 2016 +0200
Branches: master
https://developer.blender.org/rBb7d656c3b24cee4400d8bd4d5e5184e7657227ef

2D stabilizer: Revert majority of UI change

For now simply reshuffle option so they keep proper dependency flow.

Benefits:

- Has an ability to hide tracks lists to work with other sliders around.
  Could be really handy to quickly get rid of lenghty lists.

- From a feedback seems to be fitting workflow better.

Things to doublecheck on:

- Feels a bit misordered: first you define whether one want to have
  rotation stabilized, then have tracks, then scale options.

  While this follows dependency flow (which is really good and which
  we should not violate) it has weird feeling on whether things are
  really where they have to be.

- Autoscale controls visibility of max-scale, can we just make it
  active/inactive instead?

- Autoscale replaces slider with label. Can it be disabled slider
  instead to reduce visual jumping (disabled slider prevents user
  input)

Hopefully we'll still want to have collapsable box after re-iterating
over this points, so we don't waste bits in DNA.

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

M	release/scripts/startup/bl_ui/space_clip.py
M	source/blender/blenkernel/intern/tracking.c
M	source/blender/blenloader/intern/versioning_270.c
M	source/blender/makesdna/DNA_tracking_types.h
M	source/blender/makesrna/intern/rna_tracking.c

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

diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py
index b226361..a9db126 100644
--- a/release/scripts/startup/bl_ui/space_clip.py
+++ b/release/scripts/startup/bl_ui/space_clip.py
@@ -916,58 +916,74 @@ class CLIP_PT_stabilization(CLIP_PT_reconstruction_panel, Panel):
 
         layout.prop(stab, "anchor_frame")
 
-        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)
+        layout.prop(stab, "use_stabilize_rotation")
 
-        sub = row.column(align=True)
+        box = layout.box()
+        row = box.row(align=True)
+        row.prop(stab, "show_tracks_expanded", text="", emboss=False)
 
-        sub.operator("clip.stabilize_2d_add", icon='ZOOMIN', text="")
-        sub.operator("clip.stabilize_2d_remove", icon='ZOOMOUT', text="")
+        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.menu('CLIP_MT_stabilize_2d_specials', text="",
-                 icon='DOWNARROW_HLT')
+            sub = row.column(align=True)
 
-        col.label(text="Expected Position")
-        row = col.row()
-        row.prop(stab, "target_pos", text="")
-        col.prop(stab, "influence_location")
+            sub.operator("clip.stabilize_2d_add", icon='ZOOMIN', text="")
+            sub.operator("clip.stabilize_2d_remove", icon='ZOOMOUT', text="")
 
-        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.menu('CLIP_MT_stabilize_2d_specials', text="",
+                     icon='DOWNARROW_HLT')
 
-        sub = row.column(align=True)
+            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)
 
-        sub.operator("clip.stabilize_2d_rotation_add", icon='ZOOMIN', text="")
-        sub.operator("clip.stabilize_2d_rotation_remove", icon='ZOOMOUT', text="")
+            sub = row.column(align=True)
 
-        sub.menu('CLIP_MT_stabilize_2d_rotation_specials', text="",
-                 icon='DOWNARROW_HLT')
+            sub.operator("clip.stabilize_2d_rotation_add", icon='ZOOMIN', text="")
+            sub.operator("clip.stabilize_2d_rotation_remove", icon='ZOOMOUT', text="")
 
-        col.prop(stab, "target_rot")
-        col.prop(stab, "influence_rotation")
+            sub.menu('CLIP_MT_stabilize_2d_rotation_specials', text="",
+                     icon='DOWNARROW_HLT')
 
-        layout.separator()
-        col = layout.column()
-        col.active = stab.use_stabilize_rotation
-        col.prop(stab, "use_stabilize_scale")
-        col.prop(stab, "use_autoscale")
+        row = layout.row()
+        row.active = stab.use_stabilize_rotation
+        row.prop(stab, "use_stabilize_scale")
         if stab.use_autoscale:
-            col.prop(stab, "scale_max", text="Max")
-            col.label(text="Auto Scale Factor: %5.3f" % (1.0 / stab.target_zoom))
+            row = layout.row(align=True)
+            row.prop(stab, "use_autoscale")
+            row.prop(stab, "scale_max", text="Max")
         else:
-            col.prop(stab, "target_zoom")
+            layout.prop(stab, "use_autoscale")
 
-        col.prop(stab, "influence_scale")
+        layout.separator()
+        layout.label(text="Expected Position")
+        layout.prop(stab, "target_pos", text="")
+        layout.prop(stab, "target_rot")
+        if stab.use_autoscale:
+            layout.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 = 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")
+
         layout.prop(stab, "filter_type")
 
 
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c
index e50218c..d5d3384 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -345,6 +345,7 @@ 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");
 }
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index 18b6088..d735f09 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -91,6 +91,9 @@ 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)
diff --git a/source/blender/makesdna/DNA_tracking_types.h b/source/blender/makesdna/DNA_tracking_types.h
index 8c22fa0..42b72c1 100644
--- a/source/blender/makesdna/DNA_tracking_types.h
+++ b/source/blender/makesdna/DNA_tracking_types.h
@@ -463,6 +463,7 @@ enum {
 	TRACKING_AUTOSCALE          = (1 << 1),
 	TRACKING_STABILIZE_ROTATION = (1 << 2),
 	TRACKING_STABILIZE_SCALE    = (1 << 3),
+	TRACKING_SHOW_STAB_TRACKS   = (1 << 5)
 };
 
 /* MovieTrackingStrabilization->filter */
diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c
index 2787ec4..0591c65 100644
--- a/source/blender/makesrna/intern/rna_tracking.c
+++ b/source/blender/makesrna/intern/rna_tracking.c
@@ -1815,6 +1815,13 @@ 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)




More information about the Bf-blender-cvs mailing list