Replaced unified extrude edges/faces code (the stuff specificaly for
edges/faces,extrudeflag_edgess, not the entire extrude system) with
a bmesh version. This stress-tested the operator api, and I had to
code some new stuff,including:
* An api to iterate over Mapping slots and array slots. It's modeled
after the normal iterator api.
* The ability to copy mapping slots.
* More mapping functions.
* In addition to being able to flag elements in a buffer,
you can now unflag them (much clearer then passing in ~flag
I think).
The extrude edge/faces code has multiple layers. At the top
level is a funtion in editmesh_lib.c, which takes care of selection,
handles mirror modifiers, etc. It calls the extrude operator, which
in turns calls split, which calls dupe/del. Note that split needed
a slot to exclude things from being deleting (e.g. when extruding
a single isolated face).
The basic idea (reflected in original design of split/dupe/del by Briggs)
is to use the split function to do the heavy work of extrude. split spits
out new geometry and mappings from boundary edges, for extrude (it should
also spit out other mappings, but that's for later).
Briggs: you may want to look over this, hopefully I didn't do anything
too evil.
I probably should spend some time going over the 2.5 mesh operators and
cleaning them up, splitting ones that need splitting, etc, and in general
getting them to work properly.
2009-02-12 16:59:51 +00:00
|
|
|
#include "MEM_guardedalloc.h"
|
|
|
|
|
|
|
|
|
|
#include "BKE_utildefines.h"
|
|
|
|
|
|
|
|
|
|
#include "BLI_ghash.h"
|
|
|
|
|
#include "BLI_memarena.h"
|
|
|
|
|
#include "BLI_blenlib.h"
|
|
|
|
|
#include "BLI_arithb.h"
|
|
|
|
|
|
|
|
|
|
#include "bmesh.h"
|
|
|
|
|
#include "bmesh_operators_private.h"
|
|
|
|
|
|
|
|
|
|
#define EXT_INPUT 1
|
|
|
|
|
#define EXT_KEEP 2
|
2009-02-15 00:47:19 +00:00
|
|
|
#define EXT_DEL 4
|
Replaced unified extrude edges/faces code (the stuff specificaly for
edges/faces,extrudeflag_edgess, not the entire extrude system) with
a bmesh version. This stress-tested the operator api, and I had to
code some new stuff,including:
* An api to iterate over Mapping slots and array slots. It's modeled
after the normal iterator api.
* The ability to copy mapping slots.
* More mapping functions.
* In addition to being able to flag elements in a buffer,
you can now unflag them (much clearer then passing in ~flag
I think).
The extrude edge/faces code has multiple layers. At the top
level is a funtion in editmesh_lib.c, which takes care of selection,
handles mirror modifiers, etc. It calls the extrude operator, which
in turns calls split, which calls dupe/del. Note that split needed
a slot to exclude things from being deleting (e.g. when extruding
a single isolated face).
The basic idea (reflected in original design of split/dupe/del by Briggs)
is to use the split function to do the heavy work of extrude. split spits
out new geometry and mappings from boundary edges, for extrude (it should
also spit out other mappings, but that's for later).
Briggs: you may want to look over this, hopefully I didn't do anything
too evil.
I probably should spend some time going over the 2.5 mesh operators and
cleaning them up, splitting ones that need splitting, etc, and in general
getting them to work properly.
2009-02-12 16:59:51 +00:00
|
|
|
|
|
|
|
|
void extrude_edge_context_exec(BMesh *bm, BMOperator *op)
|
|
|
|
|
{
|
2009-02-15 00:47:19 +00:00
|
|
|
BMOperator dupeop, delop;
|
Replaced unified extrude edges/faces code (the stuff specificaly for
edges/faces,extrudeflag_edgess, not the entire extrude system) with
a bmesh version. This stress-tested the operator api, and I had to
code some new stuff,including:
* An api to iterate over Mapping slots and array slots. It's modeled
after the normal iterator api.
* The ability to copy mapping slots.
* More mapping functions.
* In addition to being able to flag elements in a buffer,
you can now unflag them (much clearer then passing in ~flag
I think).
The extrude edge/faces code has multiple layers. At the top
level is a funtion in editmesh_lib.c, which takes care of selection,
handles mirror modifiers, etc. It calls the extrude operator, which
in turns calls split, which calls dupe/del. Note that split needed
a slot to exclude things from being deleting (e.g. when extruding
a single isolated face).
The basic idea (reflected in original design of split/dupe/del by Briggs)
is to use the split function to do the heavy work of extrude. split spits
out new geometry and mappings from boundary edges, for extrude (it should
also spit out other mappings, but that's for later).
Briggs: you may want to look over this, hopefully I didn't do anything
too evil.
I probably should spend some time going over the 2.5 mesh operators and
cleaning them up, splitting ones that need splitting, etc, and in general
getting them to work properly.
2009-02-12 16:59:51 +00:00
|
|
|
BMOIter siter;
|
2009-02-15 00:47:19 +00:00
|
|
|
BMIter iter, fiter, viter;
|
|
|
|
|
BMEdge *e, *newedge, *e2;
|
2009-02-14 11:58:52 +00:00
|
|
|
BMLoop *l, *l2;
|
2009-02-15 00:47:19 +00:00
|
|
|
BMVert *verts[4], *v;
|
Replaced unified extrude edges/faces code (the stuff specificaly for
edges/faces,extrudeflag_edgess, not the entire extrude system) with
a bmesh version. This stress-tested the operator api, and I had to
code some new stuff,including:
* An api to iterate over Mapping slots and array slots. It's modeled
after the normal iterator api.
* The ability to copy mapping slots.
* More mapping functions.
* In addition to being able to flag elements in a buffer,
you can now unflag them (much clearer then passing in ~flag
I think).
The extrude edge/faces code has multiple layers. At the top
level is a funtion in editmesh_lib.c, which takes care of selection,
handles mirror modifiers, etc. It calls the extrude operator, which
in turns calls split, which calls dupe/del. Note that split needed
a slot to exclude things from being deleting (e.g. when extruding
a single isolated face).
The basic idea (reflected in original design of split/dupe/del by Briggs)
is to use the split function to do the heavy work of extrude. split spits
out new geometry and mappings from boundary edges, for extrude (it should
also spit out other mappings, but that's for later).
Briggs: you may want to look over this, hopefully I didn't do anything
too evil.
I probably should spend some time going over the 2.5 mesh operators and
cleaning them up, splitting ones that need splitting, etc, and in general
getting them to work properly.
2009-02-12 16:59:51 +00:00
|
|
|
BMFace *f;
|
2009-02-15 00:47:19 +00:00
|
|
|
int rlen, found, delorig=0, i;
|
Replaced unified extrude edges/faces code (the stuff specificaly for
edges/faces,extrudeflag_edgess, not the entire extrude system) with
a bmesh version. This stress-tested the operator api, and I had to
code some new stuff,including:
* An api to iterate over Mapping slots and array slots. It's modeled
after the normal iterator api.
* The ability to copy mapping slots.
* More mapping functions.
* In addition to being able to flag elements in a buffer,
you can now unflag them (much clearer then passing in ~flag
I think).
The extrude edge/faces code has multiple layers. At the top
level is a funtion in editmesh_lib.c, which takes care of selection,
handles mirror modifiers, etc. It calls the extrude operator, which
in turns calls split, which calls dupe/del. Note that split needed
a slot to exclude things from being deleting (e.g. when extruding
a single isolated face).
The basic idea (reflected in original design of split/dupe/del by Briggs)
is to use the split function to do the heavy work of extrude. split spits
out new geometry and mappings from boundary edges, for extrude (it should
also spit out other mappings, but that's for later).
Briggs: you may want to look over this, hopefully I didn't do anything
too evil.
I probably should spend some time going over the 2.5 mesh operators and
cleaning them up, splitting ones that need splitting, etc, and in general
getting them to work properly.
2009-02-12 16:59:51 +00:00
|
|
|
|
|
|
|
|
/*initialize our sub-operators*/
|
2009-02-15 00:47:19 +00:00
|
|
|
BMO_Init_Op(&dupeop, BMOP_DUPE);
|
Replaced unified extrude edges/faces code (the stuff specificaly for
edges/faces,extrudeflag_edgess, not the entire extrude system) with
a bmesh version. This stress-tested the operator api, and I had to
code some new stuff,including:
* An api to iterate over Mapping slots and array slots. It's modeled
after the normal iterator api.
* The ability to copy mapping slots.
* More mapping functions.
* In addition to being able to flag elements in a buffer,
you can now unflag them (much clearer then passing in ~flag
I think).
The extrude edge/faces code has multiple layers. At the top
level is a funtion in editmesh_lib.c, which takes care of selection,
handles mirror modifiers, etc. It calls the extrude operator, which
in turns calls split, which calls dupe/del. Note that split needed
a slot to exclude things from being deleting (e.g. when extruding
a single isolated face).
The basic idea (reflected in original design of split/dupe/del by Briggs)
is to use the split function to do the heavy work of extrude. split spits
out new geometry and mappings from boundary edges, for extrude (it should
also spit out other mappings, but that's for later).
Briggs: you may want to look over this, hopefully I didn't do anything
too evil.
I probably should spend some time going over the 2.5 mesh operators and
cleaning them up, splitting ones that need splitting, etc, and in general
getting them to work properly.
2009-02-12 16:59:51 +00:00
|
|
|
|
2009-02-12 18:05:34 +00:00
|
|
|
BMO_Flag_Buffer(bm, op, BMOP_EXFACE_EDGEFACEIN, EXT_INPUT);
|
Replaced unified extrude edges/faces code (the stuff specificaly for
edges/faces,extrudeflag_edgess, not the entire extrude system) with
a bmesh version. This stress-tested the operator api, and I had to
code some new stuff,including:
* An api to iterate over Mapping slots and array slots. It's modeled
after the normal iterator api.
* The ability to copy mapping slots.
* More mapping functions.
* In addition to being able to flag elements in a buffer,
you can now unflag them (much clearer then passing in ~flag
I think).
The extrude edge/faces code has multiple layers. At the top
level is a funtion in editmesh_lib.c, which takes care of selection,
handles mirror modifiers, etc. It calls the extrude operator, which
in turns calls split, which calls dupe/del. Note that split needed
a slot to exclude things from being deleting (e.g. when extruding
a single isolated face).
The basic idea (reflected in original design of split/dupe/del by Briggs)
is to use the split function to do the heavy work of extrude. split spits
out new geometry and mappings from boundary edges, for extrude (it should
also spit out other mappings, but that's for later).
Briggs: you may want to look over this, hopefully I didn't do anything
too evil.
I probably should spend some time going over the 2.5 mesh operators and
cleaning them up, splitting ones that need splitting, etc, and in general
getting them to work properly.
2009-02-12 16:59:51 +00:00
|
|
|
|
2009-02-15 00:47:19 +00:00
|
|
|
#if 1
|
|
|
|
|
for (e=BMIter_New(&iter, bm, BM_EDGES, NULL);e;e=BMIter_Step(&iter)) {
|
2009-03-01 06:23:22 +00:00
|
|
|
if (!BMO_TestFlag(bm, e, EXT_INPUT)) continue;
|
|
|
|
|
|
2009-02-15 00:47:19 +00:00
|
|
|
found = 0;
|
|
|
|
|
f = BMIter_New(&fiter, bm, BM_FACES_OF_EDGE, e);
|
|
|
|
|
for (rlen=0; f; f=BMIter_Step(&fiter), rlen++) {
|
|
|
|
|
if (!BMO_TestFlag(bm, f, EXT_INPUT)) {
|
|
|
|
|
found = 1;
|
|
|
|
|
delorig = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
Replaced unified extrude edges/faces code (the stuff specificaly for
edges/faces,extrudeflag_edgess, not the entire extrude system) with
a bmesh version. This stress-tested the operator api, and I had to
code some new stuff,including:
* An api to iterate over Mapping slots and array slots. It's modeled
after the normal iterator api.
* The ability to copy mapping slots.
* More mapping functions.
* In addition to being able to flag elements in a buffer,
you can now unflag them (much clearer then passing in ~flag
I think).
The extrude edge/faces code has multiple layers. At the top
level is a funtion in editmesh_lib.c, which takes care of selection,
handles mirror modifiers, etc. It calls the extrude operator, which
in turns calls split, which calls dupe/del. Note that split needed
a slot to exclude things from being deleting (e.g. when extruding
a single isolated face).
The basic idea (reflected in original design of split/dupe/del by Briggs)
is to use the split function to do the heavy work of extrude. split spits
out new geometry and mappings from boundary edges, for extrude (it should
also spit out other mappings, but that's for later).
Briggs: you may want to look over this, hopefully I didn't do anything
too evil.
I probably should spend some time going over the 2.5 mesh operators and
cleaning them up, splitting ones that need splitting, etc, and in general
getting them to work properly.
2009-02-12 16:59:51 +00:00
|
|
|
}
|
2009-02-15 00:47:19 +00:00
|
|
|
|
|
|
|
|
if (!found && (rlen > 1)) BMO_SetFlag(bm, e, EXT_DEL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*calculate verts to delete*/
|
|
|
|
|
for (v = BMIter_New(&iter, bm, BM_VERTS, NULL); v; v=BMIter_Step(&iter)) {
|
|
|
|
|
found = 0;
|
|
|
|
|
|
|
|
|
|
l = BMIter_New(&viter, bm, BM_LOOPS_OF_VERT, v);
|
|
|
|
|
for (; l; l=BMIter_Step(&viter)) {
|
|
|
|
|
if (!BMO_TestFlag(bm, l->e, EXT_INPUT)) {
|
|
|
|
|
found = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (!BMO_TestFlag(bm, l->f, EXT_INPUT)) {
|
|
|
|
|
found = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
Replaced unified extrude edges/faces code (the stuff specificaly for
edges/faces,extrudeflag_edgess, not the entire extrude system) with
a bmesh version. This stress-tested the operator api, and I had to
code some new stuff,including:
* An api to iterate over Mapping slots and array slots. It's modeled
after the normal iterator api.
* The ability to copy mapping slots.
* More mapping functions.
* In addition to being able to flag elements in a buffer,
you can now unflag them (much clearer then passing in ~flag
I think).
The extrude edge/faces code has multiple layers. At the top
level is a funtion in editmesh_lib.c, which takes care of selection,
handles mirror modifiers, etc. It calls the extrude operator, which
in turns calls split, which calls dupe/del. Note that split needed
a slot to exclude things from being deleting (e.g. when extruding
a single isolated face).
The basic idea (reflected in original design of split/dupe/del by Briggs)
is to use the split function to do the heavy work of extrude. split spits
out new geometry and mappings from boundary edges, for extrude (it should
also spit out other mappings, but that's for later).
Briggs: you may want to look over this, hopefully I didn't do anything
too evil.
I probably should spend some time going over the 2.5 mesh operators and
cleaning them up, splitting ones that need splitting, etc, and in general
getting them to work properly.
2009-02-12 16:59:51 +00:00
|
|
|
|
2009-02-15 00:47:19 +00:00
|
|
|
if (found) break;
|
2009-02-12 18:05:34 +00:00
|
|
|
}
|
Replaced unified extrude edges/faces code (the stuff specificaly for
edges/faces,extrudeflag_edgess, not the entire extrude system) with
a bmesh version. This stress-tested the operator api, and I had to
code some new stuff,including:
* An api to iterate over Mapping slots and array slots. It's modeled
after the normal iterator api.
* The ability to copy mapping slots.
* More mapping functions.
* In addition to being able to flag elements in a buffer,
you can now unflag them (much clearer then passing in ~flag
I think).
The extrude edge/faces code has multiple layers. At the top
level is a funtion in editmesh_lib.c, which takes care of selection,
handles mirror modifiers, etc. It calls the extrude operator, which
in turns calls split, which calls dupe/del. Note that split needed
a slot to exclude things from being deleting (e.g. when extruding
a single isolated face).
The basic idea (reflected in original design of split/dupe/del by Briggs)
is to use the split function to do the heavy work of extrude. split spits
out new geometry and mappings from boundary edges, for extrude (it should
also spit out other mappings, but that's for later).
Briggs: you may want to look over this, hopefully I didn't do anything
too evil.
I probably should spend some time going over the 2.5 mesh operators and
cleaning them up, splitting ones that need splitting, etc, and in general
getting them to work properly.
2009-02-12 16:59:51 +00:00
|
|
|
|
2009-02-15 00:47:19 +00:00
|
|
|
if (!found) {
|
|
|
|
|
BMO_SetFlag(bm, v, EXT_DEL);
|
|
|
|
|
}
|
|
|
|
|
}
|
Replaced unified extrude edges/faces code (the stuff specificaly for
edges/faces,extrudeflag_edgess, not the entire extrude system) with
a bmesh version. This stress-tested the operator api, and I had to
code some new stuff,including:
* An api to iterate over Mapping slots and array slots. It's modeled
after the normal iterator api.
* The ability to copy mapping slots.
* More mapping functions.
* In addition to being able to flag elements in a buffer,
you can now unflag them (much clearer then passing in ~flag
I think).
The extrude edge/faces code has multiple layers. At the top
level is a funtion in editmesh_lib.c, which takes care of selection,
handles mirror modifiers, etc. It calls the extrude operator, which
in turns calls split, which calls dupe/del. Note that split needed
a slot to exclude things from being deleting (e.g. when extruding
a single isolated face).
The basic idea (reflected in original design of split/dupe/del by Briggs)
is to use the split function to do the heavy work of extrude. split spits
out new geometry and mappings from boundary edges, for extrude (it should
also spit out other mappings, but that's for later).
Briggs: you may want to look over this, hopefully I didn't do anything
too evil.
I probably should spend some time going over the 2.5 mesh operators and
cleaning them up, splitting ones that need splitting, etc, and in general
getting them to work properly.
2009-02-12 16:59:51 +00:00
|
|
|
|
2009-02-15 00:47:19 +00:00
|
|
|
for (f=BMIter_New(&fiter, bm, BM_FACES, NULL); f; f=BMIter_Step(&fiter)) {
|
|
|
|
|
if (BMO_TestFlag(bm, f, EXT_INPUT))
|
|
|
|
|
BMO_SetFlag(bm, f, EXT_DEL);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
Printf-style method of calling operations now take a modified format string,
like so:
[opname] [slotname]=%[format code]
Before it was relying on the input format codes being in the same proper
order as the slots, which seemed like a potential maintainance nightmare to
me. Also the flags for creating buffers from bmop flags or header flags,
now support additional modifiers for combining vert/edge/face inputs.
E.g. %hfvef would accept all geometry with a header flag, and
%fef would accept edges and faces with a certain bmop flag set.
Example from the UI code:
if (!EDBM_CallOpf(em, op, "del geom=%hf context=%d", BM_SELECT, DEL_ONLYFACES))
return OPERATOR_CANCELLED;
(remember EDBM_CallOpf is the UI wrapper for this that does conversion,
error reporting, etc).
On todo is cleaning up/splitting bmesh_operators.h,
since it's kindof a mesh right now. I'm thinking of adding the slot
names in comments next to the slot ids, but I definitely would have to
clean up bmesh_operators.h first, or it'd just be too chaotic for me.
BTW, the operator API should now have enough meta info to wrap with
a scripting language, not that it matters since that's not happening till
much much later.
Also hopefully corrected some SConscripts, fix mostly provided by Elia Sarti,
though I also copied some SConscripts from 2.5 (not sure if doing
so was especially helpful).
Finally, I refactored a few places to use the new operator calling api,
as an example of how this is beneficial.
2009-03-04 08:21:10 +00:00
|
|
|
//if (delorig) BMO_Flag_To_Slot(bm, &delop, BMOP_DEL_MULTIN, EXT_DEL, BM_ALL);
|
|
|
|
|
//BMO_Set_Int(&delop, BMOP_DEL_CONTEXT, DEL_ONLYTAGGED);
|
|
|
|
|
|
|
|
|
|
if (delorig) BMO_InitOpf(bm, &delop, "del geom=%fvef context=%d",
|
|
|
|
|
EXT_DEL, DEL_ONLYTAGGED);
|
|
|
|
|
else BMO_InitOpf(bm, &delop, "del context=%d", DEL_ONLYTAGGED);
|
Replaced unified extrude edges/faces code (the stuff specificaly for
edges/faces,extrudeflag_edgess, not the entire extrude system) with
a bmesh version. This stress-tested the operator api, and I had to
code some new stuff,including:
* An api to iterate over Mapping slots and array slots. It's modeled
after the normal iterator api.
* The ability to copy mapping slots.
* More mapping functions.
* In addition to being able to flag elements in a buffer,
you can now unflag them (much clearer then passing in ~flag
I think).
The extrude edge/faces code has multiple layers. At the top
level is a funtion in editmesh_lib.c, which takes care of selection,
handles mirror modifiers, etc. It calls the extrude operator, which
in turns calls split, which calls dupe/del. Note that split needed
a slot to exclude things from being deleting (e.g. when extruding
a single isolated face).
The basic idea (reflected in original design of split/dupe/del by Briggs)
is to use the split function to do the heavy work of extrude. split spits
out new geometry and mappings from boundary edges, for extrude (it should
also spit out other mappings, but that's for later).
Briggs: you may want to look over this, hopefully I didn't do anything
too evil.
I probably should spend some time going over the 2.5 mesh operators and
cleaning them up, splitting ones that need splitting, etc, and in general
getting them to work properly.
2009-02-12 16:59:51 +00:00
|
|
|
|
2009-02-15 00:47:19 +00:00
|
|
|
BMO_CopySlot(op, &dupeop, BMOP_EXFACE_EDGEFACEIN, BMOP_DUPE_MULTIN);
|
Replaced unified extrude edges/faces code (the stuff specificaly for
edges/faces,extrudeflag_edgess, not the entire extrude system) with
a bmesh version. This stress-tested the operator api, and I had to
code some new stuff,including:
* An api to iterate over Mapping slots and array slots. It's modeled
after the normal iterator api.
* The ability to copy mapping slots.
* More mapping functions.
* In addition to being able to flag elements in a buffer,
you can now unflag them (much clearer then passing in ~flag
I think).
The extrude edge/faces code has multiple layers. At the top
level is a funtion in editmesh_lib.c, which takes care of selection,
handles mirror modifiers, etc. It calls the extrude operator, which
in turns calls split, which calls dupe/del. Note that split needed
a slot to exclude things from being deleting (e.g. when extruding
a single isolated face).
The basic idea (reflected in original design of split/dupe/del by Briggs)
is to use the split function to do the heavy work of extrude. split spits
out new geometry and mappings from boundary edges, for extrude (it should
also spit out other mappings, but that's for later).
Briggs: you may want to look over this, hopefully I didn't do anything
too evil.
I probably should spend some time going over the 2.5 mesh operators and
cleaning them up, splitting ones that need splitting, etc, and in general
getting them to work properly.
2009-02-12 16:59:51 +00:00
|
|
|
|
2009-02-15 00:47:19 +00:00
|
|
|
BMO_Exec_Op(bm, &dupeop);
|
|
|
|
|
if (delorig) BMO_Exec_Op(bm, &delop);
|
|
|
|
|
|
|
|
|
|
BMO_CopySlot(&dupeop, op, BMOP_DUPE_NEW, BMOP_EXFACE_MULTOUT);
|
|
|
|
|
e = BMO_IterNew(&siter, bm, &dupeop, BMOP_DUPE_BOUNDS_EDGEMAP);
|
|
|
|
|
for (; e; e=BMO_IterStep(&siter)) {
|
|
|
|
|
if (BMO_InMap(bm, op, BMOP_EXFACE_EXCLUDEMAP, e)) continue;
|
Replaced unified extrude edges/faces code (the stuff specificaly for
edges/faces,extrudeflag_edgess, not the entire extrude system) with
a bmesh version. This stress-tested the operator api, and I had to
code some new stuff,including:
* An api to iterate over Mapping slots and array slots. It's modeled
after the normal iterator api.
* The ability to copy mapping slots.
* More mapping functions.
* In addition to being able to flag elements in a buffer,
you can now unflag them (much clearer then passing in ~flag
I think).
The extrude edge/faces code has multiple layers. At the top
level is a funtion in editmesh_lib.c, which takes care of selection,
handles mirror modifiers, etc. It calls the extrude operator, which
in turns calls split, which calls dupe/del. Note that split needed
a slot to exclude things from being deleting (e.g. when extruding
a single isolated face).
The basic idea (reflected in original design of split/dupe/del by Briggs)
is to use the split function to do the heavy work of extrude. split spits
out new geometry and mappings from boundary edges, for extrude (it should
also spit out other mappings, but that's for later).
Briggs: you may want to look over this, hopefully I didn't do anything
too evil.
I probably should spend some time going over the 2.5 mesh operators and
cleaning them up, splitting ones that need splitting, etc, and in general
getting them to work properly.
2009-02-12 16:59:51 +00:00
|
|
|
|
2009-02-12 18:05:34 +00:00
|
|
|
newedge = BMO_IterMapVal(&siter);
|
|
|
|
|
newedge = *(BMEdge**)newedge;
|
2009-03-14 13:16:35 +00:00
|
|
|
if (!newedge) continue;
|
2009-02-12 18:05:34 +00:00
|
|
|
|
2009-02-15 00:47:19 +00:00
|
|
|
verts[0] = e->v1;
|
|
|
|
|
verts[1] = e->v2;
|
Replaced unified extrude edges/faces code (the stuff specificaly for
edges/faces,extrudeflag_edgess, not the entire extrude system) with
a bmesh version. This stress-tested the operator api, and I had to
code some new stuff,including:
* An api to iterate over Mapping slots and array slots. It's modeled
after the normal iterator api.
* The ability to copy mapping slots.
* More mapping functions.
* In addition to being able to flag elements in a buffer,
you can now unflag them (much clearer then passing in ~flag
I think).
The extrude edge/faces code has multiple layers. At the top
level is a funtion in editmesh_lib.c, which takes care of selection,
handles mirror modifiers, etc. It calls the extrude operator, which
in turns calls split, which calls dupe/del. Note that split needed
a slot to exclude things from being deleting (e.g. when extruding
a single isolated face).
The basic idea (reflected in original design of split/dupe/del by Briggs)
is to use the split function to do the heavy work of extrude. split spits
out new geometry and mappings from boundary edges, for extrude (it should
also spit out other mappings, but that's for later).
Briggs: you may want to look over this, hopefully I didn't do anything
too evil.
I probably should spend some time going over the 2.5 mesh operators and
cleaning them up, splitting ones that need splitting, etc, and in general
getting them to work properly.
2009-02-12 16:59:51 +00:00
|
|
|
verts[2] = newedge->v2;
|
|
|
|
|
verts[3] = newedge->v1;
|
|
|
|
|
|
|
|
|
|
//not sure what to do about example face, pass NULL for now.
|
|
|
|
|
f = BM_Make_Quadtriangle(bm, verts, NULL, 4, NULL, 0);
|
2009-02-14 11:58:52 +00:00
|
|
|
|
|
|
|
|
/*copy attributes*/
|
|
|
|
|
l=BMIter_New(&iter, bm, BM_LOOPS_OF_FACE, f);
|
|
|
|
|
for (; l; l=BMIter_Step(&iter)) {
|
|
|
|
|
l2 = l->radial.next->data;
|
|
|
|
|
|
|
|
|
|
if (l2 && l2 != l) {
|
|
|
|
|
/*copy data*/
|
|
|
|
|
if (l2->v == l->v) {
|
|
|
|
|
BM_Copy_Attributes(bm, bm, l2, l);
|
|
|
|
|
l2 = (BMLoop*) l2->head.next;
|
|
|
|
|
l = (BMLoop*) l->head.next;
|
|
|
|
|
BM_Copy_Attributes(bm, bm, l2, l);
|
|
|
|
|
} else {
|
|
|
|
|
l2 = (BMLoop*) l2->head.next;
|
|
|
|
|
BM_Copy_Attributes(bm, bm, l2, l);
|
|
|
|
|
l2 = (BMLoop*) l2->head.prev;
|
|
|
|
|
l = (BMLoop*) l->head.next;
|
|
|
|
|
BM_Copy_Attributes(bm, bm, l2, l);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
Replaced unified extrude edges/faces code (the stuff specificaly for
edges/faces,extrudeflag_edgess, not the entire extrude system) with
a bmesh version. This stress-tested the operator api, and I had to
code some new stuff,including:
* An api to iterate over Mapping slots and array slots. It's modeled
after the normal iterator api.
* The ability to copy mapping slots.
* More mapping functions.
* In addition to being able to flag elements in a buffer,
you can now unflag them (much clearer then passing in ~flag
I think).
The extrude edge/faces code has multiple layers. At the top
level is a funtion in editmesh_lib.c, which takes care of selection,
handles mirror modifiers, etc. It calls the extrude operator, which
in turns calls split, which calls dupe/del. Note that split needed
a slot to exclude things from being deleting (e.g. when extruding
a single isolated face).
The basic idea (reflected in original design of split/dupe/del by Briggs)
is to use the split function to do the heavy work of extrude. split spits
out new geometry and mappings from boundary edges, for extrude (it should
also spit out other mappings, but that's for later).
Briggs: you may want to look over this, hopefully I didn't do anything
too evil.
I probably should spend some time going over the 2.5 mesh operators and
cleaning them up, splitting ones that need splitting, etc, and in general
getting them to work properly.
2009-02-12 16:59:51 +00:00
|
|
|
}
|
2009-02-15 00:47:19 +00:00
|
|
|
|
Replaced unified extrude edges/faces code (the stuff specificaly for
edges/faces,extrudeflag_edgess, not the entire extrude system) with
a bmesh version. This stress-tested the operator api, and I had to
code some new stuff,including:
* An api to iterate over Mapping slots and array slots. It's modeled
after the normal iterator api.
* The ability to copy mapping slots.
* More mapping functions.
* In addition to being able to flag elements in a buffer,
you can now unflag them (much clearer then passing in ~flag
I think).
The extrude edge/faces code has multiple layers. At the top
level is a funtion in editmesh_lib.c, which takes care of selection,
handles mirror modifiers, etc. It calls the extrude operator, which
in turns calls split, which calls dupe/del. Note that split needed
a slot to exclude things from being deleting (e.g. when extruding
a single isolated face).
The basic idea (reflected in original design of split/dupe/del by Briggs)
is to use the split function to do the heavy work of extrude. split spits
out new geometry and mappings from boundary edges, for extrude (it should
also spit out other mappings, but that's for later).
Briggs: you may want to look over this, hopefully I didn't do anything
too evil.
I probably should spend some time going over the 2.5 mesh operators and
cleaning them up, splitting ones that need splitting, etc, and in general
getting them to work properly.
2009-02-12 16:59:51 +00:00
|
|
|
|
|
|
|
|
/*cleanup*/
|
2009-02-15 00:47:19 +00:00
|
|
|
BMO_Finish_Op(bm, &delop);
|
|
|
|
|
BMO_Finish_Op(bm, &dupeop);
|
Replaced unified extrude edges/faces code (the stuff specificaly for
edges/faces,extrudeflag_edgess, not the entire extrude system) with
a bmesh version. This stress-tested the operator api, and I had to
code some new stuff,including:
* An api to iterate over Mapping slots and array slots. It's modeled
after the normal iterator api.
* The ability to copy mapping slots.
* More mapping functions.
* In addition to being able to flag elements in a buffer,
you can now unflag them (much clearer then passing in ~flag
I think).
The extrude edge/faces code has multiple layers. At the top
level is a funtion in editmesh_lib.c, which takes care of selection,
handles mirror modifiers, etc. It calls the extrude operator, which
in turns calls split, which calls dupe/del. Note that split needed
a slot to exclude things from being deleting (e.g. when extruding
a single isolated face).
The basic idea (reflected in original design of split/dupe/del by Briggs)
is to use the split function to do the heavy work of extrude. split spits
out new geometry and mappings from boundary edges, for extrude (it should
also spit out other mappings, but that's for later).
Briggs: you may want to look over this, hopefully I didn't do anything
too evil.
I probably should spend some time going over the 2.5 mesh operators and
cleaning them up, splitting ones that need splitting, etc, and in general
getting them to work properly.
2009-02-12 16:59:51 +00:00
|
|
|
}
|