Campbell Barton
444833a8fb
remove some redundant lines of code.
2011-12-21 07:36:30 +00:00
Campbell Barton
71edaceab9
avoid a loop over all faces in copy_mesh
2011-12-21 05:35:19 +00:00
Campbell Barton
8a8cb2c3ef
minor formatting edits
2011-12-21 04:56:04 +00:00
Campbell Barton
57e6ac47a0
use TRUE/FALSE rather then 1/0, no functional changes.
2011-12-21 03:33:32 +00:00
Howard Trickey
d0b70cffaf
Partial fix for #29601 - fixes infinite loop in edgesplit; but edgesplit (angles) messes the geometry still
2011-12-14 14:53:22 +00:00
Campbell Barton
e4b712608e
when calculating the size to bevel when the factor is measured against the face, use the shorter edge rather then the middle.
...
this reduces overlapping geometry.
2011-12-14 00:43:42 +00:00
Campbell Barton
6254cc1c70
2 new bevel options for the operator and the modifier.
...
* even offset, uses same shell distance method as solidify to give even with beveled faces.
* distance offset, this is mostly for compatibility with the modifier in trunk which uses the bevel width as a distance rather then a percentage. at the moment this is awkward for the operator since it makes percent act differently where the 0-1 range doesnt make sense.
still need to bring back more options from trunks bevel modifier.
2011-12-13 09:57:19 +00:00
Campbell Barton
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
Campbell Barton
8c521496dd
save 4 bytes per BMLoop, added some comments on index use.
2011-12-13 05:20:02 +00:00
Campbell Barton
30d129593b
non functional changes & de-duplicate yet another face center function
2011-12-12 23:58:05 +00:00
Campbell Barton
8d0dc29aba
remove BLI_blenlib since its not needed in quite a few bmesh files
2011-12-12 22:34:05 +00:00
Campbell Barton
3aebfe7a7f
formatting and variable rename edits only.
2011-12-12 22:25:28 +00:00
Campbell Barton
80da50270d
slight improvement to bevel, when using the edges to take the new vertex location into account, dont let the longer edge skew the new position.
...
also include an new & improved vertex placement method but left commented for now.
2011-12-12 09:28:46 +00:00
Campbell Barton
3d64d5afb6
minor bevel improvement
...
- concave vertices in a polygon were not correctly checked for.
- remove commented method of calculating bevel vertex positions, have a similar/better method coming.
2011-12-12 09:09:01 +00:00
Campbell Barton
6b674008a1
give a more useful error message when bmesh operators fail to pass, was also leaking memory in this case.
2011-12-08 02:08:07 +00:00
Campbell Barton
1ec4629d88
replace function in commented code incase we want to bring it back
2011-12-07 21:55:59 +00:00
Campbell Barton
c5e6b44748
split BM_Collapse_Vert into 2 functions
...
* BM_Collapse_Vert_Faces
* BM_Collapse_Vert_Edges
since these are both quite different operations and callers where checking for one case or another anyway.
2011-12-07 21:54:14 +00:00
Campbell Barton
4b09f86c32
rename iterator type from htype to itype (htype means header type for BMesh elements)
2011-12-07 20:55:28 +00:00
Campbell Barton
d1183814c4
BMESH TODO - BM_editselection_plane now returns a useful orientation from a tri/quad.
2011-12-07 20:13:15 +00:00
Campbell Barton
26db98293f
Quiet annoying warning:
...
Warning! Tesselation uvs or vcol data got out of sync, "had to reset!
This would happen on every editmode edit with UV's and wasn't too reassuring that blender was handling uvs/vcols correctly.
From looking into the problem I found that creating the undo mesh would act as if it was tessellating the existing mesh each time and complain that the data was out of sync, when infact the mesh was just created and being filled in.
Also, allocating uv and vcol customdata arrats for tessfaces isn't needed for undo mesh, so save some memory and dont allocate these in the first place.
2011-12-06 09:28:25 +00:00
Campbell Barton
0b805fcb5d
remove double lookus in BM_GetCDf/BM_SetCDf, also remove bm_cdata_get_single_float which was a duplicate of BM_GetCDf.
2011-12-06 08:07:12 +00:00
Campbell Barton
e4ced610ee
fix for crash calling rotate edge on a completely selected torus.
2011-12-06 03:31:28 +00:00
Campbell Barton
5431081472
yet another fix for [ #28645 ] TODO: dissolve edges doesn't delete lonely vertices on edges
...
this one finally does what Vilem Novak was asking for, however the other changes were still improvements.
2011-12-06 02:24:30 +00:00
Campbell Barton
e72534e398
fix for crash toggling editmode with vertex parenting, add check if the vertex map can even be created to save looping over all mesh data to do nothing, which is what was happening previously when it (wasnt crashing) in some cases.
2011-12-06 01:49:35 +00:00
Joseph Eagar
a115c02605
bmesh: fixed crash in bevel
2011-12-04 00:44:09 +00:00
Campbell Barton
d74c564235
svn merge ^/trunk/blender -r42333:42361
2011-12-02 23:02:21 +00:00
Campbell Barton
34c5698d2e
some formatting edits & #if 0 files which are not used.
2011-12-02 22:35:05 +00:00
Campbell Barton
9010378425
fix [ #28645 ] TODO: dissolve edges doesn't delete lonely vertices on edges
...
dissolving a vert on 2 edges now uses 'JOIN EDGE KILL VERT'
also removed a fairly large block of code since 'jekv' handles this too.
2011-12-02 05:54:48 +00:00
Campbell Barton
2bdd4c570f
changes to derived mesh editmode functions to be in closer sync with trunk.
2011-12-02 03:18:34 +00:00
Campbell Barton
78b60d3cbf
fix [ #28645 ] TODO: dissolve edges doesn't delete lonely vertices on edges
...
support for dissolving boundry & loose edges, previously this would only join adjacent faces,
now it collapses edge vertices when the edge has no face users.
2011-12-01 02:20:24 +00:00
Campbell Barton
f06bbaed92
split BMFlags_To_MEFlags & MEFlags_To_BMFlags into type specific calls, since we always know the types with these functions theres not much point in having generic calls with a type switch.
2011-12-01 01:41:56 +00:00
Andrew Wiggin
bc9b593909
More DM func renames, fixing some build breaks, renaming more stuff, also seems like it might be fixing the recent CDDM_copy corruption/leak bug
2011-11-30 18:03:56 +00:00
Campbell Barton
e3c6e47a38
macro for defining a fixed size array which may be heap or stack allocated, replaces inline code.
...
BLI_array_fixedstack_declare()
BLI_array_fixedstack_free()
2011-11-29 06:06:59 +00:00
Andrew Wiggin
4e86b48cbd
Rename DM *_face_* funcs to be either *_tessface_* or *_poly_* to avoid confusion
...
This is the first step in a few changes to cleanup confusing/missing DM funcs
2011-11-29 05:09:54 +00:00
Campbell Barton
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
Campbell Barton
eef0cdb1aa
inline BMIter_Step() and BMIter_New() since the compiler can optimize out the switch statement when BMIter_New() is called with the define (which is common).
2011-11-28 20:21:44 +00:00
Campbell Barton
ed29b35a3f
gpl header cleanup, some files didnt have a gpl header.
...
also added inline iterator file (not yet used)
2011-11-28 19:49:05 +00:00
Campbell Barton
d12fb5053c
trust 'bm->elem_index_dirty' is correct, this avoids looping over edges/faces/verts if its not needed, but if set wrong it could crash too so added verification when built with debeg.
...
also added debug define to help solve invalid values with valgrind's memcheck.
gives noticeable speedup since there was a loop no all faces to set index values on redraw.
2011-11-28 18:52:35 +00:00
Campbell Barton
40d6765de9
validate the index values when an operator finishes since the arrays are looped over anyway.
2011-11-28 18:43:34 +00:00
Campbell Barton
79ffbe96a3
fix for error filling in index data
2011-11-28 18:21:10 +00:00
Campbell Barton
063dd4f60a
svn merge ^/trunk/blender -r42197:42221
2011-11-28 17:09:13 +00:00
Campbell Barton
173b956ea2
fix for missing NULL check in remove doubles.
2011-11-28 15:31:34 +00:00
Campbell Barton
f8d5a01562
more work on getting bmesh dirty index flags reliable.
...
now there very close, some hard to redo cases to check on.
2011-11-28 06:49:16 +00:00
Campbell Barton
8d6b280cac
minor changes
...
- comment BM_SetIndex as setting dirty.
- have alloc_flag_layer validate the index data and clear the dirty flag since it loops on the data anyway.
2011-11-28 05:56:00 +00:00
Campbell Barton
969895a0bc
fix for minor memory leak for BMO_VInitOpf() in an error case, also use the BLI version of strdup().
2011-11-28 05:00:34 +00:00
Campbell Barton
8aeaa442bc
use lower angle when checking to draw an edge, adding uv sphere looked strange
2011-11-28 03:07:12 +00:00
Campbell Barton
f246672811
when comparing lengths no need to sqrt
2011-11-28 01:20:53 +00:00
Campbell Barton
ac4b9ffcf3
2 of the 3 places that check 2 edges share a vertex were incorrect (silly mistake)
...
so make into a function: BM_Edge_Share_Vert()
2011-11-28 00:27:26 +00:00
Campbell Barton
565e2b4d73
use faster method of getting vert/edge/face indices which uses BLI_mempool_findelem to skip over chunks rather than going over every element
2011-11-27 02:05:46 +00:00
Campbell Barton
8d9d3995c0
fix [ #29079 ] New face added with "F" has wrong winding
...
now newly created faces use the best winding order based on surrounding edges.
2011-11-25 01:18:48 +00:00