[Bf-blender-cvs] [cee7fbd] master: Fix T37413 - Fit-Curve option for Array Modifier ignores constraint results

Joshua Leung noreply at git.blender.org
Mon Nov 18 02:03:27 CET 2013


Commit: cee7fbdfaa647dd05a49b8450227b8c9a12e80a0
Author: Joshua Leung
Date:   Mon Nov 18 14:02:49 2013 +1300
http://developer.blender.org/rBcee7fbdfaa647dd05a49b8450227b8c9a12e80a0

Fix T37413 - Fit-Curve option for Array Modifier ignores constraint results

Unless I'm missing something here (probably with regards to parenting),
it makes more sense that constraint results are considered here as well
(for example, if Limit Scale constraints get applied on the object),
as this allows for greater flexibility when creating setups with this.

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

M	source/blender/modifiers/intern/MOD_array.c

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

diff --git a/source/blender/modifiers/intern/MOD_array.c b/source/blender/modifiers/intern/MOD_array.c
index 7c47fd5..bc38b0e 100644
--- a/source/blender/modifiers/intern/MOD_array.c
+++ b/source/blender/modifiers/intern/MOD_array.c
@@ -384,18 +384,14 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
 	if (amd->fit_type == MOD_ARR_FITCURVE && amd->curve_ob) {
 		Curve *cu = amd->curve_ob->data;
 		if (cu) {
-			float tmp_mat[3][3];
-			float scale;
-			
-			BKE_object_to_mat3(amd->curve_ob, tmp_mat);
-			scale = mat3_to_scale(tmp_mat);
-				
 			if (!amd->curve_ob->curve_cache || !amd->curve_ob->curve_cache->path) {
 				cu->flag |= CU_PATH; // needed for path & bevlist
 				BKE_displist_make_curveTypes(scene, amd->curve_ob, 0);
 			}
-			if (amd->curve_ob->curve_cache->path)
+			if (amd->curve_ob->curve_cache->path) {
+				float scale = mat4_to_scale(amd->curve_ob->obmat);
 				length = scale * amd->curve_ob->curve_cache->path->totdist;
+			}
 		}
 	}




More information about the Bf-blender-cvs mailing list