Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRohan Rathi <rohanrathi08@gmail.com>2017-07-18 16:10:50 +0300
committerRohan Rathi <rohanrathi08@gmail.com>2017-07-18 16:10:50 +0300
commit604bd8799e88960bb3472178f25c4f3889b0c791 (patch)
tree02e2fa7d04710961f108a518deddb0eec6e2365e /source/blender/editors/transform/transform.c
parent94007a1769864dc0c509f5d46da26adde74b6f70 (diff)
Added snapping to rotate normal.
Also added a ui function to point_normals which allows easier editing by creating a sphere box. Shown when align is enabled.
Diffstat (limited to 'source/blender/editors/transform/transform.c')
-rw-r--r--source/blender/editors/transform/transform.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 0088ca51338..50a68f439fc 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -4267,6 +4267,13 @@ static void initNormalRotation(TransInfo *t)
setInputPostFct(&t->mouse, postInputRotation);
initMouseInputMode(t, &t->mouse, INPUT_ANGLE);
+ t->idx_max = 0;
+ t->num.idx_max = 0;
+ t->snap[0] = 0.0f;
+ t->snap[1] = DEG2RAD(5.0);
+ t->snap[2] = DEG2RAD(1.0);
+
+ copy_v3_fl(t->num.val_inc, t->snap[2]);
t->num.unit_sys = t->scene->unit.system;
t->num.unit_use_radians = (t->scene->unit.system_rotation == USER_UNIT_ROT_RADIANS);
t->num.unit_type[0] = B_UNIT_ROTATION;
@@ -4307,6 +4314,10 @@ static void applyNormalRotation(TransInfo *t, const int mval[2])
float angle = t->values[0];
copy_v3_v3(axis, t->axis);
+ snapGridIncrement(t, &angle);
+
+ applySnapping(t, &angle);
+
applyNumInput(&t->num, &angle);
headerRotation(t, str, angle);