svn merge ^/trunk/blender -r43420:43436
[blender.git] / source / blender / modifiers / intern / MOD_boolean.c
index 16f0912bd9b0be3a5e513c70e365f56ce063327c..e773b772b2b35a445324812e6c4e557aa2274418 100644 (file)
@@ -93,15 +93,15 @@ static DerivedMesh *get_quick_derivedMesh(DerivedMesh *derivedData, DerivedMesh
 {
        DerivedMesh *result = NULL;
 
-       if(derivedData->getNumFaces(derivedData) == 0 || dm->getNumFaces(dm) == 0) {
+       if(derivedData->getNumPolys(derivedData) == 0 || dm->getNumPolys(dm) == 0) {
                switch(operation) {
                        case eBooleanModifierOp_Intersect:
-                               result = CDDM_new(0, 0, 0);
+                               result = CDDM_new(0, 0, 0, 0, 0);
                                break;
 
                        case eBooleanModifierOp_Union:
-                               if(derivedData->getNumFaces(derivedData)) result = derivedData;
-                               else result = CDDM_copy(dm);
+                               if(derivedData->getNumPolys(derivedData)) result = derivedData;
+                               else result = CDDM_copy(dm, FALSE);
 
                                break;
 
@@ -136,6 +136,10 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
                result = get_quick_derivedMesh(derivedData, dm, bmd->operation);
 
                if(result == NULL) {
+
+                       DM_ensure_tessface(dm);          /* BMESH - UNTIL MODIFIER IS UPDATED FOR MPoly */
+                       DM_ensure_tessface(derivedData); /* BMESH - UNTIL MODIFIER IS UPDATED FOR MPoly */
+
                        result = NewBooleanDerivedMesh(dm, bmd->object, derivedData, ob,
                                        1 + bmd->operation);
                }