Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-07-21 04:58:02 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-07-21 04:58:02 +0400
commit90d215535ec4160740fb19f90e453cb1ea053ffd (patch)
tree867f1a10586e5f2ab552356bdb9e9cd555546796 /source/blender/modifiers
parent16516238e2b25ce53144c2dcea5323dc7313b724 (diff)
add option so operators can be called with a flag, currently the only flag is to respect hidden geometry.
this is useful for bmesh tools that operate in object mode or for modifiers which would previously use hidden faces in some cases.
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r--source/blender/modifiers/intern/MOD_array.c19
-rw-r--r--source/blender/modifiers/intern/MOD_bevel.c3
-rw-r--r--source/blender/modifiers/intern/MOD_edgesplit.c3
-rw-r--r--source/blender/modifiers/intern/MOD_skin.c22
4 files changed, 31 insertions, 16 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_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_skin.c b/source/blender/modifiers/intern/MOD_skin.c
index f24898ccee2..50e7a3e6da9 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;
}
@@ -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);
}