[Bf-blender-cvs] [5edff01] master: Transform: use snap-to-grid behavior from D910

Campbell Barton noreply at git.blender.org
Wed Jul 1 18:25:28 CEST 2015


Commit: 5edff01920a40319347a7796b1b1359e7a6fd92d
Author: Campbell Barton
Date:   Thu Jul 2 02:13:15 2015 +1000
Branches: master
https://developer.blender.org/rB5edff01920a40319347a7796b1b1359e7a6fd92d

Transform: use snap-to-grid behavior from D910

Excuse the trashing here, but seems users prefer this most (though both can be useful).

Note that the UI remains the same,
so this is an option for 'Incremental' snapping instead of a new snapping mode.

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

M	source/blender/editors/transform/transform_generics.c
M	source/blender/editors/transform/transform_snap.c
M	source/blender/makesrna/intern/rna_scene.c

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

diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 33aef92..338d4b5 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -709,12 +709,6 @@ static void recalcData_objects(TransInfo *t)
 {
 	Base *base = t->scene->basact;
 
-	if (t->state != TRANS_CANCEL) {
-		if (ELEM(t->tsnap.mode, SCE_SNAP_MODE_INCREMENT, SCE_SNAP_MODE_GRID) && t->tsnap.snap_spatial_grid) {
-			applyGridAbsolute(t);
-		}
-	}
-
 	if (t->obedit) {
 		if (ELEM(t->obedit->type, OB_CURVE, OB_SURF)) {
 			Curve *cu = t->obedit->data;
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c
index 4ccc05b..e86b11f 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -2469,7 +2469,7 @@ static void applyGridIncrement(TransInfo *t, float *val, int max_index, const fl
 	}
 
 	/* absolute snapping on grid based on global center */
-	if ((t->tsnap.mode == SCE_SNAP_MODE_GRID) && (t->mode == TFM_TRANSLATION)) {
+	if ((t->tsnap.snap_spatial_grid) && (t->mode == TFM_TRANSLATION)) {
 		for (i = 0; i <= max_index; i++) {
 			/* do not let unconstrained axis jump to absolute grid increments */
 			if (!(t->con.mode & CON_APPLY) || t->con.mode & (CON_AXIS0 << i)) {
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 2310320..4688e69 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2217,7 +2217,8 @@ static void rna_def_tool_settings(BlenderRNA  *brna)
 
 	prop = RNA_def_property(srna, "use_snap_grid_absolute", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_ABS_GRID);
-	RNA_def_property_ui_text(prop, "Absolute Grid Snap", "Grid align vertices during transform");
+	RNA_def_property_ui_text(prop, "Absolute Grid Snap",
+	                         "Absolute grid alignment while translating (based on the pivot center)");
 	RNA_def_property_ui_icon(prop, ICON_SNAP_INCREMENT, 0);
 	RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */




More information about the Bf-blender-cvs mailing list