From 13940cc78ece7b592a323123f31669034d73a833 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 23 Oct 2012 06:37:58 +0000 Subject: fix for issues in new decimator - when an edge exists across a quad, dont attempt to triangulate it. (such a case isn't so common anyway) - silly mistake when checking if anything needed to be done in the modifier, percent was being checked for 1.0 even when not used. --- source/blender/modifiers/intern/MOD_decimate.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'source/blender/modifiers') diff --git a/source/blender/modifiers/intern/MOD_decimate.c b/source/blender/modifiers/intern/MOD_decimate.c index a9bc9cbf83a..cf409c27b2f 100644 --- a/source/blender/modifiers/intern/MOD_decimate.c +++ b/source/blender/modifiers/intern/MOD_decimate.c @@ -103,13 +103,28 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, float *vweights = NULL; #ifdef USE_TIMEIT - TIMEIT_START(decim); + TIMEIT_START(decim); #endif - if (dmd->percent == 1.0f) { - return dm; + switch (dmd->mode) { + case MOD_DECIM_MODE_COLLAPSE: + if (dmd->percent == 1.0f) { + return dm; + } + break; + case MOD_DECIM_MODE_UNSUBDIV: + if (dmd->iter == 0) { + return dm; + } + break; + case MOD_DECIM_MODE_DISSOLVE: + if (dmd->angle == 0.0f) { + return dm; + } + break; } - else if (dm->getNumPolys(dm) <= 3) { + + if (dm->getNumPolys(dm) <= 3) { modifier_setError(md, "%s", TIP_("Modifier requires more than 3 input faces")); return dm; } -- cgit v1.2.3