[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34708] trunk/blender/source/blender: Change in behavior to shrinkwrap modifier' s offset value with negative enabled.

Campbell Barton ideasman42 at gmail.com
Tue Feb 8 03:10:01 CET 2011


Revision: 34708
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=34708
Author:   campbellbarton
Date:     2011-02-08 02:09:59 +0000 (Tue, 08 Feb 2011)
Log Message:
-----------
Change in behavior to shrinkwrap modifier's offset value with negative enabled.
- negative ray casts would invert the offset direction.
  this meant if positive and negative were enabled at once and the mesh was slightly inside & outside the object it wrapped,
  the offset would be applied in opposite directions.
  This way the offset is always along the vertex normal.

- allow negative offset from RNA, could be useful and no benefit to disable.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/shrinkwrap.c
    trunk/blender/source/blender/makesrna/intern/rna_modifier.c

Modified: trunk/blender/source/blender/blenkernel/intern/shrinkwrap.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/shrinkwrap.c	2011-02-08 01:56:36 UTC (rev 34707)
+++ trunk/blender/source/blender/blenkernel/intern/shrinkwrap.c	2011-02-08 02:09:59 UTC (rev 34708)
@@ -378,9 +378,6 @@
 					normal_projection_project_vertex(0, tmp_co, tmp_no, &local2aux, auxData.tree, &hit, auxData.raycast_callback, &auxData);
 
 				normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, tmp_no, &calc->local2target, treeData.tree, &hit, treeData.raycast_callback, &treeData);
-
-				if(hit.index != -1)
-					madd_v3_v3v3fl(hit.co, hit.co, tmp_no, -calc->keepDist);
 			}
 
 			//Project over negative direction of axis
@@ -393,14 +390,12 @@
 					normal_projection_project_vertex(0, tmp_co, inv_no, &local2aux, auxData.tree, &hit, auxData.raycast_callback, &auxData);
 
 				normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, inv_no, &calc->local2target, treeData.tree, &hit, treeData.raycast_callback, &treeData);
-
-				if(hit.index != -1)
-					madd_v3_v3v3fl(hit.co, hit.co, tmp_no, calc->keepDist);
 			}
 
 
 			if(hit.index != -1)
 			{
+				madd_v3_v3v3fl(hit.co, hit.co, tmp_no, calc->keepDist);
 				interp_v3_v3v3(co, co, hit.co, weight);
 			}
 		}

Modified: trunk/blender/source/blender/makesrna/intern/rna_modifier.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_modifier.c	2011-02-08 01:56:36 UTC (rev 34707)
+++ trunk/blender/source/blender/makesrna/intern/rna_modifier.c	2011-02-08 02:09:59 UTC (rev 34708)
@@ -1900,11 +1900,11 @@
 	RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name");
 	RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ShrinkwrapModifier_vgroup_set");
 	RNA_def_property_update(prop, 0, "rna_Modifier_update");
-	
+
 	prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "keepDist");
-	RNA_def_property_range(prop, 0, FLT_MAX);
-	RNA_def_property_ui_range(prop, 0, 100, 1, 2);
+	RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
+	RNA_def_property_ui_range(prop, -100, 100, 1, 2);
 	RNA_def_property_ui_text(prop, "Offset", "Distance to keep from the target");
 	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 




More information about the Bf-blender-cvs mailing list