From 863e661cc363067fbbe39f4e876e35268bb97ab8 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 16 Oct 2009 15:28:43 +0000 Subject: Bugfix: sculpting with a multires modifier at level 1 would crash. --- source/blender/editors/sculpt_paint/sculpt.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 4f667ab7976..c4c7f436f12 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -1107,7 +1107,7 @@ char sculpt_modifiers_active(Object *ob) it's the last modifier on the stack and it is not on the first level */ static struct MultiresModifierData *sculpt_multires_active(Object *ob) { - ModifierData *md; + ModifierData *md, *nmd; for(md= modifiers_getVirtualModifierList(ob); md; md= md->next) { if(md->type == eModifierType_Multires) { @@ -1115,12 +1115,11 @@ static struct MultiresModifierData *sculpt_multires_active(Object *ob) /* Check if any of the modifiers after multires are active * if not it can use the multires struct */ - for (md= md->next; md; md= md->next) { - if(md->mode & eModifierMode_Realtime) - return NULL; - } + for (nmd= md->next; nmd; nmd= nmd->next) + if(nmd->mode & eModifierMode_Realtime) + break; - if(mmd->lvl != 1) + if(!nmd && mmd->lvl != 1) return mmd; } } -- cgit v1.2.3