[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43578] trunk/blender/source/blender/ blenkernel/intern/constraint.c: Fix [#29940] Stretch To constraint breaks scaling in Transform constraint.

Bastien Montagne montagne29 at wanadoo.fr
Sat Jan 21 10:41:37 CET 2012


Revision: 43578
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43578
Author:   mont29
Date:     2012-01-21 09:41:21 +0000 (Sat, 21 Jan 2012)
Log Message:
-----------
Fix [#29940] Stretch To constraint breaks scaling in Transform constraint.

Compute of dist between ob/bone and target was quite odd and causing that bug.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/constraint.c

Modified: trunk/blender/source/blender/blenkernel/intern/constraint.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/constraint.c	2012-01-21 05:27:25 UTC (rev 43577)
+++ trunk/blender/source/blender/blenkernel/intern/constraint.c	2012-01-21 09:41:21 UTC (rev 43578)
@@ -2775,13 +2775,14 @@
 		/* store Z orientation before destroying obmat */
 		normalize_v3_v3(zz, cob->matrix[2]);
 		
-		sub_v3_v3v3(vec, cob->matrix[3], ct->matrix[3]);
-		vec[0] /= size[0];
-		vec[1] /= size[1];
-		vec[2] /= size[2];
+		dist = len_v3v3(cob->matrix[3], ct->matrix[3]);
+		/* XXX What was all that for??? Makes the constraint buggy with scaled objects, see #29940. */
+/*		sub_v3_v3v3(vec, cob->matrix[3], ct->matrix[3]);*/
+/*		vec[0] /= size[0];*/
+/*		vec[1] /= size[1];*/
+/*		vec[2] /= size[2];*/
 		
-		dist = normalize_v3(vec);
-		//dist = len_v3v3( ob->obmat[3], targetmat[3]);
+/*		dist = normalize_v3(vec);*/
 		
 		/* data->orglength==0 occurs on first run, and after 'R' button is clicked */
 		if (data->orglength == 0)  



More information about the Bf-blender-cvs mailing list