sculpt was checking if multires was the last modifier,
authorCampbell Barton <ideasman42@gmail.com>
Tue, 6 Oct 2009 11:21:57 +0000 (11:21 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 6 Oct 2009 11:21:57 +0000 (11:21 +0000)
instead check if its the last displayed modifier

source/blender/editors/sculpt_paint/sculpt.c

index 01a2ff3fdee8b279d6986c46920d00c0515e1342..982bd315b99dee37ec4982eb0dd1fb48372ad227 100644 (file)
@@ -1099,8 +1099,18 @@ static struct MultiresModifierData *sculpt_multires_active(Object *ob)
        ModifierData *md;
        
        for(md= modifiers_getVirtualModifierList(ob); md; md= md->next) {
-               if(md->type == eModifierType_Multires && !md->next) {
-                       MultiresModifierData *mmd = (MultiresModifierData*)md;
+               if(md->type == eModifierType_Multires) {
+                       MultiresModifierData *mmd;
+
+                       /* Check if any of the modifiers after multires are active
+                        * if not it can use the multires struct */
+                       ModifierData *md_next;
+                       for (md_next= md->next; md_next; md_next= md_next->next) {
+                               if(md_next->mode & eModifierMode_Realtime)
+                                       return NULL;
+                       }
+
+                       mmd = (MultiresModifierData*)md;
                        if(mmd->lvl != 1)
                                return mmd;
                }