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:
authorCampbell Barton <ideasman42@gmail.com>2013-06-03 03:20:49 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-06-03 03:20:49 +0400
commitdfad9b0c09eed2de2c3bedd64691bf11f637725c (patch)
tree86298761e9883ca7dc83b3b5a24a859bdd07bfce /source/blender/modifiers/intern/MOD_decimate.c
parent99b55ef6eb7d677ead66b4166afe45688147a5b3 (diff)
fix [#35555] Collada: export destroys mesh in some cases
add arguments to calculate normals when converting to bmesh: BM_mesh_bm_from_me, DM_to_bmesh This gives some speedup to undo (which didnt need to re-calculate vertex normals), and array modifier which doesnt need to calculate face normals at all
Diffstat (limited to 'source/blender/modifiers/intern/MOD_decimate.c')
-rw-r--r--source/blender/modifiers/intern/MOD_decimate.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/modifiers/intern/MOD_decimate.c b/source/blender/modifiers/intern/MOD_decimate.c
index b8dccd9ffbe..aacf622c185 100644
--- a/source/blender/modifiers/intern/MOD_decimate.c
+++ b/source/blender/modifiers/intern/MOD_decimate.c
@@ -97,6 +97,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
DecimateModifierData *dmd = (DecimateModifierData *) md;
DerivedMesh *dm = derivedData, *result = NULL;
BMesh *bm;
+ bool calc_face_normal;
float *vweights = NULL;
@@ -112,16 +113,19 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
if (dmd->percent == 1.0f) {
return dm;
}
+ calc_face_normal = true;
break;
case MOD_DECIM_MODE_UNSUBDIV:
if (dmd->iter == 0) {
return dm;
}
+ calc_face_normal = false;
break;
case MOD_DECIM_MODE_DISSOLVE:
if (dmd->angle == 0.0f) {
return dm;
}
+ calc_face_normal = true;
break;
}
@@ -159,7 +163,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
}
}
- bm = DM_to_bmesh(dm);
+ bm = DM_to_bmesh(dm, calc_face_normal);
switch (dmd->mode) {
case MOD_DECIM_MODE_COLLAPSE: