Commit Graph

42 Commits

Author SHA1 Message Date
8a8cb2c3ef minor formatting edits 2011-12-21 04:56:04 +00:00
143a654e6f formatting and minor refactor of some bmesh functions.
* BM_Make_Quadtriangle --> BM_Make_Face_QuadTri_v
* BM_Make_QuadTri      --> BM_Make_Face_QuadTri
2011-12-13 06:56:10 +00:00
8d0dc29aba remove BLI_blenlib since its not needed in quite a few bmesh files 2011-12-12 22:34:05 +00:00
f2551ff799 - add BM_NGON_STACK_SIZE define to use wherever ngon stack arrays are used.
- renamed BM_Compute_Face_Center() to BM_Compute_Face_CenterBounds() and added BM_Compute_Face_CenterMean() since there was code inline to find the mean center in transform.
2011-11-29 04:11:17 +00:00
0c017bf146 tag index arrays as dirty when any element is removed, also check validity on operator init/exit (check was missed in some cases before) 2011-11-16 14:36:23 +00:00
da849bbfc0 prepare for flagging the bmesh has having invalid index values, so we can skip looping over all elements if its already valid.
- went over every BM_SetIndex call and added comments about its use, if its setting dirty values or correct ones.
- replace loops over all elements _just_ to set index values, with a new function, BM_ElemIndex_Ensure(...), this will eventually only initialize values when they are dirty.
2011-11-16 12:38:40 +00:00
9842d845f8 don't write into bmesh edge indices when calculating solidify normals 2011-11-07 11:08:33 +00:00
a1e95e2e18 replace as many uses of BM_Get/SetIndex as possible with tagging with a temp flag, some uses need index values to be set, so this will need more effort to replace (crazy space and solidify for eg). 2011-11-01 12:51:38 +00:00
a7bf015f38 style edits
- rename var to match trunk shape key code
- reduce scope of some vars
- comment some unused vars
2011-10-29 11:23:37 +00:00
e9a194e55f More solidify cleanup: comment updates and make shell_angle_to_dist a continuous function in the edge case 2011-10-15 14:46:26 +00:00
e77b067407 Fixes for solidify when the selection does not form a completely closed 2-manifold 2011-10-11 05:18:33 +00:00
9494340dae svn merge ^/trunk/blender -r40432:40491 2011-09-23 13:04:01 +00:00
74e21161e3 Solidify bmesh op and edit mode tool 2011-09-23 12:06:47 +00:00
f7243ece07 remove redundant casts 2011-09-12 15:10:59 +00:00
bf71aa3626 use BM_Make_Vert example argument rather then calling inline, was also copying vertex normals twice in quite a few places. 2011-09-12 05:24:45 +00:00
6d4b46d96f patch [#28488] BMesh: fix for extrude individual faces
by Andrew Wiggin (ender79)
2011-09-06 03:21:55 +00:00
1852cf2692 Extrude Bug Fixes:
----------------------------------------------
Two extrude bug fixes provided by howardt in IRC

1: Edges getting extruded in sheets did not have
consistent normals.

2: Sometimes faces created by the extrusion
process were corrupt
2011-07-11 09:27:21 +00:00
27a728653e =bmesh= fixed weld bug in uv editor 2011-05-24 01:34:28 +00:00
5a2a3d7d82 more syncing with trunk, also cleared many warnings with gcc4.6 2011-05-09 04:06:48 +00:00
60aa74f9ee bmesh, less warnings 2011-03-20 14:49:16 +00:00
f01261d040 merge with/from trunk at r35190 2011-02-27 06:19:40 +00:00
a37bcf93ef wip commit; DO NOT USE. almost done with phase 1 of this restructuring, basically just some things that needed to be done before trunk (and some things that needed to be started, but can be finished much later). 2010-07-14 22:06:10 +00:00
0e165c55bb did math lib conversion, equivilent to merge with trunk/2.5 at r24464 2009-11-23 14:41:22 +00:00
0c65f27c79 part 1 of cleaning up my little array macro library to be a formal API. also removed some extraneous selection calls from loopcut.c. 2009-09-17 23:05:33 +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
454eb8793d Array modifier is now implemented using bmesh
(though it's not completely feature-complete yet).
I ported over the remove doubles code from the
old bmesh branch for this, and split it into two
bmops, "Weld Verts" and "Remove Doubles".

Weld verts welds specific verts together, while remove
doubles finds doubles and welds them.

I also reverted the hotkey change I made earlier.
2009-06-23 05:35:49 +00:00
5abbb20c89 extrude handles active face, and operators now properly restore unmodified mesh on failure 2009-06-18 07:11:55 +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
b7fe3258b6 some stability stuff related to undo, and more extrude stuff works 2009-05-19 00:33:54 +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
52fc6d7829 removed all those nasty enums from the operator api. yay! I'm
so happy.  so now operators and their slots are referred to by
string names.  so much easier to remember!
2009-03-22 23:16:43 +00:00
aa4915fdcf extrude region op now does wire vert extrudes too 2009-03-16 11:38:42 +00:00
ba4d6babbb some cleanup of bmesh_polygon.c. there were three winding functions, now there's just one, the original testedgeside, that has some additional tests that might fix some issues I was having. still need to decided if bmesh_polygon.c stuff should be entirely double or entire floats, right now there's a little half-and-half going on. 2009-03-16 10:12:52 +00:00
34ed34b572 some fixes for extrude, to better handle customdata, winding, etc. 2009-03-16 09:43:47 +00:00
f8b846ff8f some fixes for extrude, to better handle customdata, winding, etc. 2009-03-16 09:41:33 +00:00
302e796270 connect verts now does geometric tests to perform valid splits. it also supports multiple splits in a face, going around the face boundary in a loop and performing splits. 2009-03-14 13:16:35 +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
8be2a86ce1 split dissolve_disk into dissolve_vert dissolve_disk as agreed. also made dissolve vert bmop use the error api, and put in some code to report it to the user in the xkey ui code. I'm not sure how this should work; I don't think we can have utility code in bmesh/ for reporting errors to the user, so it'll have to go in editors/mesh somewhere. 2009-03-01 06:23:22 +00:00
aac8daa177 extrude uses dupe/delete rather then split, and it detects when to not delete geometry (though this could be smarter in the future). also BMO_pop had two lines out of order, which was causing flags layer to not always be freed when they should. 2009-02-15 00:47:19 +00:00
84b7ebd764 extrude handles loop customdata properly, also added a BM_Face_CopyShared function to copy loop customdata in a face from adjacent faces. it's not used (didn't work in this case) but it seemed fairly useful. may remove if it turns out to not be necassary. 2009-02-14 11:58:52 +00:00
1773084201 made extrude properly delete unneeded geometry 2009-02-12 18:05:34 +00:00
01a12fa553 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