diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-03-25 12:20:19 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-03-25 12:20:19 +0400 |
commit | 3b711a6ed009b35bb69cd0ca878eeb8d55fa0e77 (patch) | |
tree | b3fdb366cb49bdea5b57dfa6ba4a82635c68d0ee /source/blender/bmesh/operators/bmo_dupe.c | |
parent | a2ebfc82dbe954acc432ae017ac62a30a11b6a16 (diff) | |
parent | e99a23fc6b33b5097eab44aac19c2a089ddebce6 (diff) |
Merged changes in the trunk up to revision 45133.
Conflicts resolved:
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/bmesh/intern/bmesh_construct.c
source/blender/bmesh/intern/bmesh_mesh_conv.c
source/blender/bmesh/intern/bmesh_mesh_conv.h
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/resources.c
source/blender/editors/mesh/bmesh_select.c
source/blender/editors/mesh/bmesh_tools.c
source/blender/editors/space_view3d/drawobject.c
source/blender/render/intern/source/shadeoutput.c
Diffstat (limited to 'source/blender/bmesh/operators/bmo_dupe.c')
-rw-r--r-- | source/blender/bmesh/operators/bmo_dupe.c | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/source/blender/bmesh/operators/bmo_dupe.c b/source/blender/bmesh/operators/bmo_dupe.c index 5c800ba083a..9a87acbb84f 100644 --- a/source/blender/bmesh/operators/bmo_dupe.c +++ b/source/blender/bmesh/operators/bmo_dupe.c @@ -198,7 +198,7 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target) GHash *vhash; GHash *ehash; - /* initialize pointer hashe */ + /* initialize pointer hashes */ vhash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "bmesh dupeops v"); ehash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "bmesh dupeops e"); @@ -235,12 +235,12 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target) } } - /* now we dupe all the edge */ + /* now we dupe all the edges */ for (e = BM_iter_new(&edges, source, BM_EDGES_OF_MESH, source); e; e = BM_iter_step(&edges)) { if ( BMO_elem_flag_test(source, e, DUPE_INPUT) && !BMO_elem_flag_test(source, e, DUPE_DONE)) { - /* make sure that verts are copie */ + /* make sure that verts are copied */ if (!BMO_elem_flag_test(source, e->v1, DUPE_DONE)) { copy_vertex(source, e->v1, target, vhash); BMO_elem_flag_enable(source, e->v1, DUPE_DONE); @@ -249,13 +249,13 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target) copy_vertex(source, e->v2, target, vhash); BMO_elem_flag_enable(source, e->v2, DUPE_DONE); } - /* now copy the actual edg */ + /* now copy the actual edge*/ copy_edge(op, source, e, target, vhash, ehash); BMO_elem_flag_enable(source, e, DUPE_DONE); } } - /* first we dupe all flagged faces and their elements from sourc */ + /* first we dupe all flagged faces and their elements from source */ for (f = BM_iter_new(&faces, source, BM_FACES_OF_MESH, source); f; f = BM_iter_step(&faces)) { if (BMO_elem_flag_test(source, f, DUPE_INPUT)) { /* vertex pas */ @@ -266,7 +266,7 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target) } } - /* edge pas */ + /* edge pass */ for (e = BM_iter_new(&edges, source, BM_EDGES_OF_FACE, f); e; e = BM_iter_step(&edges)) { if (!BMO_elem_flag_test(source, e, DUPE_DONE)) { copy_edge(op, source, e, target, vhash, ehash); @@ -286,7 +286,7 @@ static void copy_mesh(BMOperator *op, BMesh *source, BMesh *target) } } - /* free pointer hashe */ + /* free pointer hashes */ BLI_ghash_free(vhash, NULL, NULL); BLI_ghash_free(ehash, NULL, NULL); @@ -325,17 +325,17 @@ void bmo_dupe_exec(BMesh *bm, BMOperator *op) bm2 = bm; /* flag inpu */ - BMO_slot_buffer_flag_enable(bm, dupeop, "geom", DUPE_INPUT, BM_ALL); + BMO_slot_buffer_flag_enable(bm, dupeop, "geom", BM_ALL, DUPE_INPUT); - /* use the internal copy functio */ + /* use the internal copy function */ copy_mesh(dupeop, bm, bm2); /* Outpu */ - /* First copy the input buffers to output buffers - original dat */ + /* First copy the input buffers to output buffers - original data */ BMO_slot_copy(dupeop, dupeop, "geom", "origout"); - /* Now alloc the new output buffer */ - BMO_slot_buffer_from_flag(bm, dupeop, "newout", DUPE_NEW, BM_ALL); + /* Now alloc the new output buffers */ + BMO_slot_buffer_from_flag(bm, dupeop, "newout", BM_ALL, DUPE_NEW); } #if 0 /* UNUSED */ @@ -343,12 +343,12 @@ void bmo_dupe_exec(BMesh *bm, BMOperator *op) * type flag etypeflag and header flag flag to it. note, * to get more useful information (such as the mapping from * original to new elements) you should run the dupe op manually */ -void BMO_dupe_from_flag(BMesh *bm, int etypeflag, const char hflag) +void BMO_dupe_from_flag(BMesh *bm, int htype, const char hflag) { BMOperator dupeop; BMO_op_init(bm, &dupeop, "dupe"); - BMO_slot_buffer_from_hflag(bm, &dupeop, "geom", hflag, etypeflag); + BMO_slot_buffer_from_hflag(bm, &dupeop, "geom", htype, hflag); BMO_op_exec(bm, &dupeop); BMO_op_finish(bm, &dupeop); @@ -388,7 +388,7 @@ void bmo_split_exec(BMesh *bm, BMOperator *op) BMO_slot_copy(splitop, &dupeop, "geom", "geom"); BMO_op_exec(bm, &dupeop); - BMO_slot_buffer_flag_enable(bm, splitop, "geom", SPLIT_INPUT, BM_ALL); + BMO_slot_buffer_flag_enable(bm, splitop, "geom", BM_ALL, SPLIT_INPUT); if (use_only_faces) { BMVert *v; @@ -427,9 +427,9 @@ void bmo_split_exec(BMesh *bm, BMOperator *op) } } - /* connect outputs of dupe to delete, exluding keep geometr */ + /* connect outputs of dupe to delete, exluding keep geometry */ BMO_slot_int_set(&delop, "context", DEL_FACES); - BMO_slot_buffer_from_flag(bm, &delop, "geom", SPLIT_INPUT, BM_ALL); + BMO_slot_buffer_from_flag(bm, &delop, "geom", BM_ALL, SPLIT_INPUT); BMO_op_exec(bm, &delop); @@ -453,7 +453,7 @@ void bmo_del_exec(BMesh *bm, BMOperator *op) BMOperator *delop = op; /* Mark Buffer */ - BMO_slot_buffer_flag_enable(bm, delop, "geom", DEL_INPUT, BM_ALL); + BMO_slot_buffer_flag_enable(bm, delop, "geom", BM_ALL, DEL_INPUT); BMO_remove_tagged_context(bm, DEL_INPUT, BMO_slot_int_get(op, "context")); @@ -486,11 +486,12 @@ void bmo_spin_exec(BMesh *bm, BMOperator *op) phi = BMO_slot_float_get(op, "ang") * (float)M_PI / (360.0f * steps); do_dupli = BMO_slot_bool_get(op, "do_dupli"); + /* BMESH_TODO - can replace this with BLI_math? */ si = (float)sin(phi); q[0] = (float)cos(phi); - q[1] = axis[0]*si; - q[2] = axis[1]*si; - q[3] = axis[2]*si; + q[1] = axis[0] * si; + q[2] = axis[1] * si; + q[3] = axis[2] * si; quat_to_mat3(rmat, q); BMO_slot_copy(op, op, "geom", "lastout"); |