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
diff options
context:
space:
mode:
authorAndre Susano Pinto <andresusanopinto@gmail.com>2008-07-22 02:36:05 +0400
committerAndre Susano Pinto <andresusanopinto@gmail.com>2008-07-22 02:36:05 +0400
commit3c8b695f726f1ee532219772c234e8e75436f981 (patch)
treee28dd1beafd7e5d365c338c83bd3c29118d470f1
parent4c76c57a77a2d955c53c071d2e9dee193960f7a2 (diff)
Fixed a bug relative to editmode..
now its calling CDDM_calc_normals when receiving a mesh to deform, since in edit mode the mesh doenst has normals calculated
-rw-r--r--source/blender/blenkernel/intern/shrinkwrap.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c
index 6e48c1b2dd0..0d085450bde 100644
--- a/source/blender/blenkernel/intern/shrinkwrap.c
+++ b/source/blender/blenkernel/intern/shrinkwrap.c
@@ -1096,7 +1096,8 @@ void shrinkwrap_projectToCutPlane(ShrinkwrapCalcData *calc_data)
if(calc.smd->cutPlane)
{
- calc.target = (DerivedMesh *)calc.smd->cutPlane->derivedFinal;
+ //TODO currently we need a copy in case object_get_derived_final returns an emDM that does not defines getVertArray or getFace array
+ calc.target = CDDM_copy( object_get_derived_final(calc.smd->cutPlane, CD_MASK_BAREMESH) );
if(!calc.target)
{
@@ -1139,6 +1140,7 @@ void shrinkwrap_projectToCutPlane(ShrinkwrapCalcData *calc_data)
//free memory
calc.final->release(calc.final);
+ calc.target->release(calc.target);
}
}
@@ -1164,6 +1166,8 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri
return dm;
}
+ CDDM_calc_normals(calc.final); //Normals maybe not be calculated yet
+
//remove loop dependencies on derived meshs (TODO should this be done elsewhere?)
if(smd->target == ob) smd->target = NULL;
if(smd->cutPlane == ob) smd->cutPlane = NULL;
@@ -1219,7 +1223,7 @@ DerivedMesh *shrinkwrapModifier_do(ShrinkwrapModifierData *smd, Object *ob, Deri
if(calc.moved)
{
//Adjust vertxs that didn't moved (project to cut plane)
-// shrinkwrap_projectToCutPlane(&calc);
+ shrinkwrap_projectToCutPlane(&calc);
//Destroy faces, edges and stuff
shrinkwrap_removeUnused(&calc);
@@ -1552,9 +1556,10 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc)
if(use_normal & MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL)
{
-
+/*
if(limit_tree)
normal_projection_project_vertex(0, tmp_co, tmp_no, &local2cut, limit_tree, &hit, limit_callback, &limit_userdata);
+*/
if(normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, tmp_no, &calc->local2target, tree, &hit, callback, &userdata))
moved = TRUE;
@@ -1565,10 +1570,10 @@ void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc)
{
float inv_no[3] = { -tmp_no[0], -tmp_no[1], -tmp_no[2] };
-
+/*
if(limit_tree)
normal_projection_project_vertex(0, tmp_co, inv_no, &local2cut, limit_tree, &hit, limit_callback, &limit_userdata);
-
+*/
if(normal_projection_project_vertex(calc->smd->shrinkOpts, tmp_co, inv_no, &calc->local2target, tree, &hit, callback, &userdata))
moved = TRUE;
}