Commit Graph

31 Commits

Author SHA1 Message Date
4652d66c0a editmode undo stores data as mesh dna now, instead of bmesh copies. also fixed a bug related to vpaint and hide flags. 2009-09-10 06:08:52 +00:00
e0a014a45f finished removedoubles, and inlined a bunch of functions. 2009-09-09 06:28:58 +00:00
971155b373 part one of profiling/optimizing. made cddm not update tesselations itself in cddm_from_mesh. also made BMO_Test/Set/ClearFlag into macros, and tweaked the way normals are calculated. 2009-09-05 06:10:30 +00:00
dae0b7a4a2 fix merge bug, this should fix this issue for now, but might need further work later. 2009-09-04 01:28:06 +00:00
8408a72d16 cddm's recalc tesselation function works, and some memory leak fixes 2009-08-29 23:55:35 +00:00
771a4dee0b commit of framework for uv/vcol rotate/mirror 2009-08-28 10:17:31 +00:00
eb34e3ad7c Brought Extrude all the way back. The contextual menu works,
as does only edges and individual faces extrude (individual vert 
extrude already did).

Note that I need to port this, after we all figure out how to handle
operators with variable transform follow-ons.

I also implemented the merge->collapse function, which is currently
accessable under ctrl->v, Bmesh Test Operator.  I still need to
implement the other merge modes, and properly hook everything into
the merge menu tool, which I plan on doing soon (tomorrow hopefully).

The cool thing about the collapse tool, is not only does it handle (all)
UV layers, it handles vcols as well.  To do this, I had to add a few math
functions to the customdata API, which seem to be working well.
2009-08-11 07:49:35 +00:00
88b43b52b1 select more/less properly uses bmops now, and also made a little start on documenting the bmops. 2009-08-06 05:06:55 +00:00
886b613363 bmeshafied the hide/reveal code. created a set of API functions for hiding/revealing elements in bmesh_marking.c. main function is BM_Hide, which can hide or reveal an element (vert/edge/face, NOT loops, obviously), and will handle any flushing necassary. also renamed BM_Is_Selected to BM_Selected, though I may get rid of that function altogether. 2009-08-05 06:06:58 +00:00
012b419549 select linked has been bmeshafied, yay 2009-08-05 02:34:54 +00:00
c691b2b037 edge and loop select work in uv editor again. 2009-07-24 07:39:41 +00:00
0b79b8f933 finished first pass at bmeshafying uvedit_ops.c. not everything works yet, loop select for example crashes. 2009-07-21 11:48:58 +00:00
19a2da9303 first pass at the uv code. uv editor now mostly uses new bmesh structures for uvs. 2009-07-21 08:39:58 +00:00
f2138686d9 moved the selection history stuff within bmesh itself, to avoid memory access problems. also committing some playing around I did with the edge subdivide code, which isn't doesn't really completely work. 2009-07-17 10:54:00 +00:00
0b1649b2b8 merge with 2.5 at r21568 2009-07-16 06:27:37 +00:00
6360db1554 missing free 2009-06-18 07:15:17 +00:00
5abbb20c89 extrude handles active face, and operators now properly restore unmodified mesh on failure 2009-06-18 07:11:55 +00:00
80effa20b1 moved the active face pointer to BMesh, where I think it belongs. also made some fixes to the ccgsubsurf derivedmesh, and some general modifier bugfixes. note that modifiers are still rather buggy and crashy at the moment, heh :) also made some functions for converting Mesh flags to BMesh flags, and back. 2009-06-12 14:02:37 +00:00
b5aa425dee Did some code cleanups. Added BM_ITER and
BMO_ITER macros to make defining iterator
loops easier.  Moved some files around.
And also made the editmesh conversion functions
tesselate ngons to triangle fans, since it's
more stable for conversion, and editmeshes are
never displayed to the user anyway.  And ported
akey to bmesh.

Next up I plan on adding face iterators to DerivedMesh,
since that's the last major chunk of major refactoring
left, I think, except perhaps the uv editor (at the
moment it's probably close to working, but it's still
converting to editmeshes for everything, which is very
bad).
2009-05-28 04:41:02 +00:00
5bb09886fb mesh DNA modficiations; two new structures added for storing ngons, MPoly and MLoop. 2009-05-26 04:17:47 +00:00
f026266e18 merge with 2.5 at r20307. note there were some python hacking necassary for this to work, so um hopefully there's not too much cruft from that.
[[Split portion of a mixed commit.]]
2009-05-23 03:24:15 +00:00
b7fe3258b6 some stability stuff related to undo, and more extrude stuff works 2009-05-19 00:33:54 +00:00
a8c0b748c9 fixed a few of the memory leaks 2009-05-18 15:53:30 +00:00
5e1fba0e43 extrude works now, though vert extrude does not. still plenty of work needed on this code. also did some work on the select infrastructure; the bmesh api now tracks the number of selected verts/edges/faces. 2009-05-18 14:55:34 +00:00
088579f36b selection now works. next up, undo, and also need to track down an odd bug with face selection and the subdivide tool, which may be related to the bmesh derivedmesh not being refreshed often enough. also committing a start on a set of docs, which are in mediawiki format. 2009-05-18 10:29:37 +00:00
0ba863de29 renamed BMTessMesh to BMEditMesh, did some more monkeywork, cleaned up the more serious warnings, and also non-backbuffered selection sortof works now, though it still needs plenty of work. 2009-05-18 08:46:04 +00:00
166c270f06 NOTE: do not test. work-in-progress commit with editmesh ripped out and replaced with bmesh. this is not usable by any means. for those who read through this, note the design is still fairly messy in places, and fyi BMTessMesh is the replacement for EditMesh, I need to rename it to BMEditMesh. 2009-05-16 16:18:08 +00:00
f2371cbbae tesselator works. . .FINALLYscons/scons.py BF_QUICK=bf_editors_mesh,bf_bmesh,bf_blenlib,bf_transform,bf_editors_transform also made transform code execute it after transform end. tesselator uses original algorithm, yay 2009-03-06 06:06:14 +00:00
2c33a51e3f 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
1bc67f36d6 Created a printf-style method of calling operators. I did this to cut down on duplicated
code, and also because calling operators was such a pain.  The basic form of the format
is "opname %[code]", where each % matches to an argument.

The codes are fairly simple:
 d - int
 i - int
 f - float
 h[v/e/f] - all verts/edges/faces with a certain header flag.
 f[v/e/f] - all verts/edges/faces with a certain flag.

For example:

  EDBM_CallOpf(em, op, "dissolveverts %hv", BM_SELECT)

will call the dissolve verts operator.

The relevent functions are:
//calls a bmesh operator, doing necassary conversions and error reporting.
int EDBM_CallOpf(EditMesh *em, struct wmOperator *op, char *fmt, ...);

//execute an operator
int BMO_CallOpf(BMesh *bm, char *fmt, ...);
//initializes but doesn't execute an op.
int BMO_InitOpf(BMesh *bm, BMOperator *op, char *fmt, ...);
//vlist version of above.
int BMO_VInitOpf(BMesh *bm, BMOperator *op, char *fmt, va_list vlist);

Note this system is dependant on getting the slot codes from the argument
order.  I'd like to make it better, possibly pass in slot names, but that'd
mean actually giving the slots names (which I can do, but wanted to discuss with
Briggs and others what I have now first).
2009-03-02 04:08:24 +00:00
3faf2b6db7 more tweaks to triangulator. also added a bmeshutils.c file in editors/mesh for ui-related bmesh functions. and made delete only faces use the bmesh del operator, so it can handle ngons. 2009-03-02 02:21:18 +00:00