Fix part of #20090: boolean modifier would lose link to object
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 27 Jan 2010 14:13:01 +0000 (14:13 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 27 Jan 2010 14:13:01 +0000 (14:13 +0000)
if evaluation failed, it should display an error message instead.

source/blender/blenkernel/intern/modifier.c

index e0e9112d1de50692100c9f2abe887d82c388a873..50fbdffd23c6415d1c148b75ba360b3bdb907c57 100644 (file)
@@ -6577,7 +6577,6 @@ static DerivedMesh *booleanModifier_applyModifier(
                ModifierData *md, Object *ob, DerivedMesh *derivedData,
   int useRenderParams, int isFinalCalc)
 {
-       // XXX doesn't handle derived data
        BooleanModifierData *bmd = (BooleanModifierData*) md;
        DerivedMesh *dm = bmd->object->derivedFinal;
 
@@ -6587,20 +6586,14 @@ static DerivedMesh *booleanModifier_applyModifier(
                DerivedMesh *result = NewBooleanDerivedMesh(dm, bmd->object, derivedData, ob,
                                1 + bmd->operation);
 
-               if(dm)
-                       dm->release(dm);
-
                /* if new mesh returned, return it; otherwise there was
                * an error, so delete the modifier object */
                if(result)
                        return result;
                else
-                       bmd->object = NULL;
+                       modifier_setError(md, "Can't execute boolean operation.");
        }
        
-       if(dm)
-                       dm->release(dm);
-
        return derivedData;
 }