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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-02-08 05:09:59 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-02-08 05:09:59 +0300
commit0242a96f3bc0d844c6ca1c3916671b891de10d9f (patch)
treee09e8d09479c4dbf1193f577c806c4b1c0c52018 /source
parent89bb5e6423b613173d5b71d5bab2789a34e3e059 (diff)
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.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/shrinkwrap.c7
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c6
2 files changed, 4 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c
index 75a955a09a9..48d9a4e0dee 100644
--- a/source/blender/blenkernel/intern/shrinkwrap.c
+++ b/source/blender/blenkernel/intern/shrinkwrap.c
@@ -378,9 +378,6 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc)
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 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc)
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);
}
}
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 33a6856db73..15da48a82d4 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -1900,11 +1900,11 @@ static void rna_def_modifier_shrinkwrap(BlenderRNA *brna)
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");