diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-10-01 11:02:18 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-10-01 11:02:18 +0400 |
commit | 9550d05a1c1ab065d73fc1854739a6f0bf500bc2 (patch) | |
tree | 215e39ffca10339f85e6d5f778c3d089c5efb718 | |
parent | 86b28fc2fccfae34a97d96c76be4d25fe8f9ea6b (diff) |
fix [#36900] single spline handle can't be "scaled"
this works in the graph editor but didn't for curves, useful functionality to have.
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index ad31287fa93..7110e7a66c5 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -123,6 +123,17 @@ #include "transform.h" #include "bmesh.h" +/** + * Transforming around ourselves is no use, fallback to individual origins, + * useful for curve/armatures. + */ +static void transform_around_single_fallback(TransInfo *t) +{ + if (t->total == 1 && ELEM3(t->around, V3D_CENTER, V3D_CENTROID, V3D_ACTIVE)) { + t->around = V3D_LOCAL; + } +} + /* when transforming islands */ struct TransIslandData { float co[3]; @@ -1084,6 +1095,8 @@ static void createTransArmatureVerts(TransInfo *t) if (!t->total) return; + transform_around_single_fallback(t); + copy_m3_m4(mtx, t->obedit->obmat); pseudoinverse_m3_m3(smtx, mtx, PSEUDOINVERSE_EPSILON); @@ -1408,6 +1421,8 @@ static void createTransCurveVerts(TransInfo *t) else t->total = countsel; t->data = MEM_callocN(t->total * sizeof(TransData), "TransObData(Curve EditMode)"); + transform_around_single_fallback(t); + copy_m3_m4(mtx, t->obedit->obmat); pseudoinverse_m3_m3(smtx, mtx, PSEUDOINVERSE_EPSILON); |