[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43662] trunk/blender/source/blender: New fix for [#29940] Stretch To constraint breaks scaling in Transform constraint, previous one caused bug [#29962] linked objects not correct on r4361, should be fixed now.

Bastien Montagne montagne29 at wanadoo.fr
Tue Jan 24 14:17:41 CET 2012


Revision: 43662
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43662
Author:   mont29
Date:     2012-01-24 13:17:32 +0000 (Tue, 24 Jan 2012)
Log Message:
-----------
New fix for [#29940] Stretch To constraint breaks scaling in Transform constraint, previous one caused bug [#29962] linked objects not correct on r4361, should be fixed now.

Org code was working with isotropic scaling, but when scaling only one axis, it was broken. First fix just disabled completly scale handling. This version only takes into account scaling along local Y axis, as this is the only one affecting that constraint!

Sorry for the mistake, hope this time it will be ok.

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=4361

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

Modified: trunk/blender/source/blender/blenkernel/intern/constraint.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/constraint.c	2012-01-24 12:25:03 UTC (rev 43661)
+++ trunk/blender/source/blender/blenkernel/intern/constraint.c	2012-01-24 13:17:32 UTC (rev 43662)
@@ -2775,8 +2775,7 @@
 		/* store Z orientation before destroying obmat */
 		normalize_v3_v3(zz, cob->matrix[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. */
+		/* XXX That makes the constraint buggy with asymmetrically scaled objects, see #29940. */
 /*		sub_v3_v3v3(vec, cob->matrix[3], ct->matrix[3]);*/
 /*		vec[0] /= size[0];*/
 /*		vec[1] /= size[1];*/
@@ -2784,10 +2783,14 @@
 		
 /*		dist = normalize_v3(vec);*/
 		
+		dist = len_v3v3(cob->matrix[3], ct->matrix[3]);
+		/* Only Y constrained object axis scale should be used, to keep same length when scaling it. */
+		dist /= size[1];
+		
 		/* data->orglength==0 occurs on first run, and after 'R' button is clicked */
-		if (data->orglength == 0)  
+		if (data->orglength == 0)
 			data->orglength = dist;
-		if (data->bulge == 0) 
+		if (data->bulge == 0)
 			data->bulge = 1.0;
 		
 		scale[1] = dist/data->orglength;

Modified: trunk/blender/source/blender/makesrna/intern/rna_scene.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_scene.c	2012-01-24 12:25:03 UTC (rev 43661)
+++ trunk/blender/source/blender/makesrna/intern/rna_scene.c	2012-01-24 13:17:32 UTC (rev 43662)
@@ -3722,7 +3722,7 @@
 
 	prop= RNA_def_property(srna, "use_simplify_triangulate", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", R_SIMPLE_NO_TRIANGULATE);
-	RNA_def_property_ui_text(prop, "Skip Quad to Triangles", "Disable non-planer quads being triangulated");
+	RNA_def_property_ui_text(prop, "Skip Quad to Triangles", "Disable non-planar quads being triangulated");
 
 	/* Scene API */
 	RNA_api_scene_render(srna);



More information about the Bf-blender-cvs mailing list