Own TODO item: sculpting on constructive modifiers
[blender.git] / source / blender / blenkernel / intern / DerivedMesh.c
index 297489ee56fd3eeadd6e98c8cc405e1421129d7c..d9c98bc0200af2a4e782ec1b32add26497d7370e 100644 (file)
@@ -1772,11 +1772,20 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
                        modifier_setError(md, "Modifier requires original data, bad stack position.");
                        continue;
                }
-               if(sculpt_mode && (!has_multires || multires_applied))
-                       if(mti->type != eModifierTypeType_OnlyDeform || multires_applied) {
+               if(sculpt_mode && (!has_multires || multires_applied)) {
+                       int unsupported= 0;
+
+                       if(scene->toolsettings->sculpt->flags & SCULPT_ONLY_DEFORM)
+                               unsupported|= mti->type != eModifierTypeType_OnlyDeform;
+
+                       unsupported|= md->type == eModifierType_Multires && ((MultiresModifierData*)md)->sculptlvl==0;
+                       unsupported|= multires_applied;
+
+                       if(unsupported) {
                                modifier_setError(md, "Not supported in sculpt mode.");
                                continue;
                        }
+               }
                if(needMapping && !modifier_supportsMapping(md)) continue;
                if(useDeform < 0 && mti->dependsOnTime && mti->dependsOnTime(md)) continue;