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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-10-01 11:02:18 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-10-01 11:02:18 +0400
commit9550d05a1c1ab065d73fc1854739a6f0bf500bc2 (patch)
tree215e39ffca10339f85e6d5f778c3d089c5efb718 /source
parent86b28fc2fccfae34a97d96c76be4d25fe8f9ea6b (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.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/transform/transform_conversions.c15
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);