diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2012-07-31 18:01:28 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2012-07-31 18:01:28 +0400 |
commit | 966d54d07df02c72b6c94e0e6e7c07c10d20389a (patch) | |
tree | 0133de4c4681eaa6d6d6a5a38852779b9f39fcde /source/blender/modifiers/intern | |
parent | ff8441dcd7a248df9e3562971f9d25fd4c22a973 (diff) | |
parent | e7e7972cd6b9bc22b4378b19db0b796ffd56fbb8 (diff) |
merge with trunk 49411
Diffstat (limited to 'source/blender/modifiers/intern')
-rw-r--r-- | source/blender/modifiers/intern/MOD_array.c | 19 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_bevel.c | 3 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_boolean.c | 14 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_cast.c | 6 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_edgesplit.c | 3 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_ocean.c | 12 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_particlesystem.c | 1 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_simpledeform.c | 6 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_skin.c | 24 |
9 files changed, 58 insertions, 30 deletions
diff --git a/source/blender/modifiers/intern/MOD_array.c b/source/blender/modifiers/intern/MOD_array.c index 57c230fcde6..26682e30841 100644 --- a/source/blender/modifiers/intern/MOD_array.c +++ b/source/blender/modifiers/intern/MOD_array.c @@ -172,7 +172,7 @@ static int *find_doubles_index_map(BMesh *bm, BMOperator *dupe_op, BMElem *ele; int *index_map, i; - BMO_op_initf(bm, &find_op, + BMO_op_initf(bm, &find_op, (BMO_FLAG_DEFAULTS & ~BMO_FLAG_RESPECT_HIDE), "find_doubles verts=%av dist=%f keep_verts=%s", amd->merge_dist, dupe_op, "geom"); @@ -234,7 +234,7 @@ static void bm_merge_dm_transform(BMesh *bm, DerivedMesh *dm, float mat[4][4], BMOIter oiter; BMOperator find_op; - BMO_op_initf(bm, &find_op, + BMO_op_initf(bm, &find_op, (BMO_FLAG_DEFAULTS & ~BMO_FLAG_RESPECT_HIDE), "find_doubles verts=%Hv dist=%f keep_verts=%s", BM_ELEM_TAG, amd->merge_dist, dupe_op, dupe_slot_name); @@ -286,7 +286,7 @@ static void merge_first_last(BMesh *bm, BMOIter oiter; BMVert *v, *v2; - BMO_op_initf(bm, &find_op, + BMO_op_initf(bm, &find_op, (BMO_FLAG_DEFAULTS & ~BMO_FLAG_RESPECT_HIDE), "find_doubles verts=%s dist=%f keep_verts=%s", dupe_first, "geom", amd->merge_dist, dupe_first, "geom"); @@ -410,9 +410,11 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, bmesh_edit_begin(em->bm, 0); if (amd->flags & MOD_ARR_MERGE) - BMO_op_init(em->bm, &weld_op, "weld_verts"); + BMO_op_init(em->bm, &weld_op, (BMO_FLAG_DEFAULTS & ~BMO_FLAG_RESPECT_HIDE), + "weld_verts"); - BMO_op_initf(em->bm, &dupe_op, "duplicate geom=%avef"); + BMO_op_initf(em->bm, &dupe_op, (BMO_FLAG_DEFAULTS & ~BMO_FLAG_RESPECT_HIDE), + "duplicate geom=%avef"); first_dupe_op = dupe_op; for (j = 0; j < count - 1; j++) { @@ -421,8 +423,11 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, BMOpSlot *newout_slot; BMOIter oiter; - if (j != 0) - BMO_op_initf(em->bm, &dupe_op, "duplicate geom=%s", &old_dupe_op, "newout"); + if (j != 0) { + BMO_op_initf(em->bm, &dupe_op, + (BMO_FLAG_DEFAULTS & ~BMO_FLAG_RESPECT_HIDE), + "duplicate geom=%s", &old_dupe_op, "newout"); + } BMO_op_exec(em->bm, &dupe_op); geom_slot = BMO_slot_get(&dupe_op, "geom"); diff --git a/source/blender/modifiers/intern/MOD_bevel.c b/source/blender/modifiers/intern/MOD_bevel.c index 6c91cd6e2d1..cdb200ff180 100644 --- a/source/blender/modifiers/intern/MOD_bevel.c +++ b/source/blender/modifiers/intern/MOD_bevel.c @@ -143,7 +143,8 @@ static DerivedMesh *applyModifier(ModifierData *md, struct Object *UNUSED(ob), } } - BMO_op_callf(bm, "bevel geom=%fe percent=%f use_even=%b use_dist=%b", + BMO_op_callf(bm, BMO_FLAG_DEFAULTS, + "bevel geom=%fe percent=%f use_even=%b use_dist=%b", EDGE_MARK, bmd->value, (bmd->flags & BME_BEVEL_EVEN) != 0, (bmd->flags & BME_BEVEL_DIST) != 0); BMO_pop(bm); diff --git a/source/blender/modifiers/intern/MOD_boolean.c b/source/blender/modifiers/intern/MOD_boolean.c index 6cd8745f5d9..fb9788fb278 100644 --- a/source/blender/modifiers/intern/MOD_boolean.c +++ b/source/blender/modifiers/intern/MOD_boolean.c @@ -127,7 +127,19 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, if (!bmd->object) return derivedData; - dm = bmd->object->derivedFinal; + + /* 2.63 used this... */ + /* dm = bmd->object->derivedFinal; */ + + /* but we want to make sure we can get the object + * in some cases the depsgraph fails us - especially for objects + * in other scenes when compositing */ + if (bmd->object != ob) { + dm = mesh_get_derived_final(md->scene, bmd->object, CD_MASK_MESH); + } + else { + dm = NULL; + } if (dm) { DerivedMesh *result; diff --git a/source/blender/modifiers/intern/MOD_cast.c b/source/blender/modifiers/intern/MOD_cast.c index 5e791a9f748..c80b4dfa4de 100644 --- a/source/blender/modifiers/intern/MOD_cast.c +++ b/source/blender/modifiers/intern/MOD_cast.c @@ -381,9 +381,9 @@ static void cuboid_do( } /* we want a symmetric bound box around the origin */ - if (fabs(min[0]) > fabs(max[0])) max[0] = fabs(min[0]); - if (fabs(min[1]) > fabs(max[1])) max[1] = fabs(min[1]); - if (fabs(min[2]) > fabs(max[2])) max[2] = fabs(min[2]); + if (fabsf(min[0]) > fabsf(max[0])) max[0] = fabsf(min[0]); + if (fabsf(min[1]) > fabsf(max[1])) max[1] = fabsf(min[1]); + if (fabsf(min[2]) > fabsf(max[2])) max[2] = fabsf(min[2]); min[0] = -max[0]; min[1] = -max[1]; min[2] = -max[2]; diff --git a/source/blender/modifiers/intern/MOD_edgesplit.c b/source/blender/modifiers/intern/MOD_edgesplit.c index 471317a279c..b1c3459bf51 100644 --- a/source/blender/modifiers/intern/MOD_edgesplit.c +++ b/source/blender/modifiers/intern/MOD_edgesplit.c @@ -103,7 +103,8 @@ static DerivedMesh *doEdgeSplit(DerivedMesh *dm, EdgeSplitModifierData *emd, Obj } } - BMO_op_callf(bm, "split_edges edges=%fe", EDGE_MARK); + BMO_op_callf(bm, BMO_FLAG_DEFAULTS, + "split_edges edges=%fe", EDGE_MARK); BMO_pop(bm); diff --git a/source/blender/modifiers/intern/MOD_ocean.c b/source/blender/modifiers/intern/MOD_ocean.c index dfbfbd22475..21836453eed 100644 --- a/source/blender/modifiers/intern/MOD_ocean.c +++ b/source/blender/modifiers/intern/MOD_ocean.c @@ -242,13 +242,13 @@ static void dm_get_bounds(DerivedMesh *dm, float *sx, float *sy, float *ox, floa copy_v3_v3(max, mvert->co); for (v = 1; v < totvert; v++, mvert++) { - min[0] = MIN2(min[0], mvert->co[0]); - min[1] = MIN2(min[1], mvert->co[1]); - min[2] = MIN2(min[2], mvert->co[2]); + min[0] = minf(min[0], mvert->co[0]); + min[1] = minf(min[1], mvert->co[1]); + min[2] = minf(min[2], mvert->co[2]); - max[0] = MAX2(max[0], mvert->co[0]); - max[1] = MAX2(max[1], mvert->co[1]); - max[2] = MAX2(max[2], mvert->co[2]); + max[0] = maxf(max[0], mvert->co[0]); + max[1] = maxf(max[1], mvert->co[1]); + max[2] = maxf(max[2], mvert->co[2]); } sub_v3_v3v3(delta, max, min); diff --git a/source/blender/modifiers/intern/MOD_particlesystem.c b/source/blender/modifiers/intern/MOD_particlesystem.c index 0cf36677807..ecdc5b53460 100644 --- a/source/blender/modifiers/intern/MOD_particlesystem.c +++ b/source/blender/modifiers/intern/MOD_particlesystem.c @@ -176,6 +176,7 @@ static void deformVerts(ModifierData *md, Object *ob, psmd->dm->needsFree = 0; /* report change in mesh structure */ + DM_ensure_tessface(psmd->dm); if (psmd->dm->getNumVerts(psmd->dm) != psmd->totdmvert || psmd->dm->getNumEdges(psmd->dm) != psmd->totdmedge || psmd->dm->getNumTessFaces(psmd->dm) != psmd->totdmface) diff --git a/source/blender/modifiers/intern/MOD_simpledeform.c b/source/blender/modifiers/intern/MOD_simpledeform.c index 14735810cad..bf5f6cd095e 100644 --- a/source/blender/modifiers/intern/MOD_simpledeform.c +++ b/source/blender/modifiers/intern/MOD_simpledeform.c @@ -161,7 +161,7 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object if (smd->limit[0] < 0.0f) smd->limit[0] = 0.0f; if (smd->limit[0] > 1.0f) smd->limit[0] = 1.0f; - smd->limit[0] = MIN2(smd->limit[0], smd->limit[1]); /* Upper limit >= than lower limit */ + smd->limit[0] = minf(smd->limit[0], smd->limit[1]); /* Upper limit >= than lower limit */ //Calculate matrixs do convert between coordinate spaces if (smd->origin) { @@ -190,8 +190,8 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object if (transf) space_transform_apply(transf, tmp); - lower = MIN2(lower, tmp[limit_axis]); - upper = MAX2(upper, tmp[limit_axis]); + lower = minf(lower, tmp[limit_axis]); + upper = maxf(upper, tmp[limit_axis]); } diff --git a/source/blender/modifiers/intern/MOD_skin.c b/source/blender/modifiers/intern/MOD_skin.c index f24898ccee2..0eacfd392b9 100644 --- a/source/blender/modifiers/intern/MOD_skin.c +++ b/source/blender/modifiers/intern/MOD_skin.c @@ -236,7 +236,8 @@ static int build_hull(SkinOutput *so, Frame **frames, int totframe) * selected after the operator is run */ BM_mesh_elem_hflag_disable_all(bm, BM_ALL, BM_ELEM_SELECT, 0); - BMO_op_initf(bm, &op, "convex_hull input=%hv", BM_ELEM_TAG); + BMO_op_initf(bm, &op, (BMO_FLAG_DEFAULTS & ~BMO_FLAG_RESPECT_HIDE), + "convex_hull input=%hv", BM_ELEM_TAG); BMO_op_exec(bm, &op); if (BMO_error_occurred(bm)) { @@ -319,7 +320,9 @@ static int build_hull(SkinOutput *so, Frame **frames, int totframe) BMO_op_finish(bm, &op); - BMO_op_callf(bm, "delete geom=%hef context=%i", BM_ELEM_TAG, DEL_ONLYTAGGED); + BMO_op_callf(bm, BMO_FLAG_DEFAULTS, + "delete geom=%hef context=%i", + BM_ELEM_TAG, DEL_ONLYTAGGED); return TRUE; } @@ -351,7 +354,7 @@ static void merge_frame_corners(Frame **frames, int totframe) BLI_assert(frames[i] != frames[k]); side_b = frame_len(frames[k]); - thresh = MIN2(side_a, side_b) / 2.0f; + thresh = minf(side_a, side_b) / 2.0f; /* Compare with each corner of all other frames... */ for (l = 0; l < 4; l++) { @@ -1039,7 +1042,7 @@ static BMFace *collapse_face_corners(BMesh *bm, BMFace *f, int n, int i; shortest_edge = BM_face_find_shortest_loop(f)->e; - BMO_op_initf(bm, &op, "weld_verts"); + BMO_op_initf(bm, &op, (BMO_FLAG_DEFAULTS & ~BMO_FLAG_RESPECT_HIDE), "weld_verts"); /* Note: could probably calculate merges in one go to be * faster */ @@ -1179,7 +1182,8 @@ static void skin_fix_hole_no_good_verts(BMesh *bm, Frame *frame, BMFace *split_f /* Extrude the split face */ BM_mesh_elem_hflag_disable_all(bm, BM_FACE, BM_ELEM_TAG, FALSE); BM_elem_flag_enable(split_face, BM_ELEM_TAG); - BMO_op_initf(bm, &op, "extrude_discrete_faces faces=%hf", BM_ELEM_TAG); + BMO_op_initf(bm, &op, (BMO_FLAG_DEFAULTS & ~BMO_FLAG_RESPECT_HIDE), + "extrude_discrete_faces faces=%hf", BM_ELEM_TAG); BMO_op_exec(bm, &op); /* Update split face (should only be one new face created @@ -1202,7 +1206,8 @@ static void skin_fix_hole_no_good_verts(BMesh *bm, Frame *frame, BMFace *split_f BM_mesh_elem_hflag_disable_all(bm, BM_EDGE, BM_ELEM_TAG, FALSE); BM_elem_flag_enable(longest_edge, BM_ELEM_TAG); - BMO_op_callf(bm, "subdivide_edges edges=%he numcuts=%i quadcornertype=%i", + BMO_op_callf(bm, BMO_FLAG_DEFAULTS, + "subdivide_edges edges=%he numcuts=%i quadcornertype=%i", BM_ELEM_TAG, 1, SUBD_STRAIGHT_CUT); } else if (split_face->len > 4) { @@ -1234,7 +1239,8 @@ static void skin_fix_hole_no_good_verts(BMesh *bm, Frame *frame, BMFace *split_f /* Delete split face and merge */ BM_face_kill(bm, split_face); - BMO_op_init(bm, &op, "weld_verts"); + BMO_op_init(bm, &op, (BMO_FLAG_DEFAULTS & ~BMO_FLAG_RESPECT_HIDE), + "weld_verts"); for (i = 0; i < 4; i++) { BMO_slot_map_ptr_insert(bm, &op, "targetmap", verts[i], frame->verts[best_order[i]]); @@ -1399,7 +1405,9 @@ static void hull_merge_triangles(SkinOutput *so, const SkinModifierData *smd) } } - BMO_op_callf(so->bm, "delete geom=%hef context=%i", BM_ELEM_TAG, DEL_ONLYTAGGED); + BMO_op_callf(so->bm, BMO_FLAG_DEFAULTS, + "delete geom=%hef context=%i", + BM_ELEM_TAG, DEL_ONLYTAGGED); BLI_heap_free(heap, NULL); } |