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:
authorBastien Montagne <montagne29@wanadoo.fr>2015-03-17 20:14:38 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-03-17 21:57:16 +0300
commit2ab4489f179eebb1f1070a1d32f01f4e7f0c85c7 (patch)
tree67028c1033497bf48f68806ed820fb1c6ab058c0 /source/blender/modifiers/intern/MOD_normal_edit.c
parent6ceb84c21724c6c3278abb1bfc27813f7a8f4036 (diff)
Fix T44027: Normal Edit Mod : Radial from object normals affected by target object scale.
The way we were getting diff to apply to vcos from target object was just bad! Also, fixed another related issue - negated scale would be clamped to nearly zero, now only consider absolute version of size (we do not care about its sign here anyway). This should be backported to 2.74 (with previous commit too).
Diffstat (limited to 'source/blender/modifiers/intern/MOD_normal_edit.c')
-rw-r--r--source/blender/modifiers/intern/MOD_normal_edit.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/source/blender/modifiers/intern/MOD_normal_edit.c b/source/blender/modifiers/intern/MOD_normal_edit.c
index edb7278789b..80636986583 100644
--- a/source/blender/modifiers/intern/MOD_normal_edit.c
+++ b/source/blender/modifiers/intern/MOD_normal_edit.c
@@ -60,7 +60,8 @@ static void generate_vert_coordinates(
/* Get size (i.e. deformation of the spheroid generating normals), either from target object, or own geometry. */
if (ob_center) {
- copy_v3_v3(r_size, ob_center->size);
+ /* Not we are not interested in signs here - they are even troublesome actually, due to security clamping! */
+ abs_v3_v3(r_size, ob_center->size);
}
else {
minmax_v3v3_v3_array(min_co, max_co, r_cos, num_verts);
@@ -80,12 +81,10 @@ static void generate_vert_coordinates(
if (ob_center) {
/* Translate our coordinates so that center of ob_center is at (0, 0, 0). */
- float mat[4][4];
-
- /* Get ob_center coordinates in ob local coordinates. */
- invert_m4_m4(mat, ob_center->obmat);
- mul_m4_m4m4(mat, mat, ob->obmat);
- copy_v3_v3(diff, mat[3]);
+ /* Get ob_center (world) coordinates in ob local coordinates.
+ * No need to take into accound ob_center's space here, see T44027. */
+ mul_v3_m4v3(diff, ob->obmat, ob_center->obmat[3]);
+ negate_v3(diff);
do_diff = true;
}