Commit Graph

76 Commits

Author SHA1 Message Date
0a026033ae BMesh: make toolflags optional
Saves 8 bytes per vert/edge/face.
Gives overall ~20-25% memory saving for dyntopo sculpting
and modifiers that use BMesh.
2016-07-01 19:29:22 +10:00
3863660c37 Fix face creation using incorrect loop-custom-data
Custom-data on newly created face data was often rotated.

Now the API doesn't copy data from adjacent loops when creating faces.
Most functions were already overwriting this anyway.

Since such decisions are better made at a higher level, now it's the responsibility of the caller.
2015-11-05 20:19:09 +11:00
133f79e449 Cleanup: warnings, typos 2014-10-29 14:15:21 +01:00
9470754fd3 bmesh api cleanup, face creation args now accept an example face (as with vertex and edge),
also replace BM_face_create_quad_tri_v with BM_face_create_verts
2013-08-21 07:51:47 +00:00
c5e14f62a6 bmesh improvements to face creation.
* fill-holes operator now takes advantage of new edge-net fill, works in many more cases then it did before.

* face-create that uses edge-net now initializes the normals based on surrounding geometry, only running normal calculation if there are no connected faces for a reference.
2013-08-18 15:14:55 +00:00
0f07ca6809 remove unused args from edgenet fill (since rewrite, but they weren't used before either) 2013-08-17 09:25:12 +00:00
ef8ea14f45 rewrite edgenet fill bmesh operator.
previous code created faces with mixed face-flipping and could get very slow,
test with ~60,000 edges here hung my system for over 2min (didnt wait for it to finish), new code executes in about 1 second.

new code doesn't attempt to flip faces correctly, its quite involved to do so, especially when the new faces are not created adjacent to eachother.
so simpler to calculate normals afterwards.
2013-08-16 14:18:54 +00:00
a4b922ad9b correct invalid sizeof() use in bmesh (harmless in practice) 2013-08-03 17:27:05 +00:00
a2492e0603 style cleanup: braces/indentation 2013-07-19 16:44:17 +00:00
b1f4e2b4db code comments: bmesh operator doxy header descriptions. 2013-03-30 08:54:50 +00:00
8e3d590b76 code cleanup: python/pep8 and double-promotion warnings. 2013-03-28 19:33:14 +00:00
765060acd4 BMesh: make the context create operator (Fkay) more logical, before calling each operator check the state that it can even run and do something. 2013-03-28 06:01:58 +00:00
d358458a8d fix for mesh face filling when a valid edge-loop was selected but unselected connecting geometry existed inside the loop.
In this case edgenet_fill operator failed and it would fallback to filling as unordered vertices which was mostly fine but failed on some concave loops.

Add a new bmesh operator 'edgeloop_fill' fills in closed loops even if they don't make a valid edge-net.
2013-03-27 07:54:11 +00:00
91b2b970ad api cleanup: move edgenet bmesh operator into its own file. 2013-03-27 06:49:16 +00:00
1390abfaa9 code cleanup: quiet shadow warnings 2013-03-27 04:41:20 +00:00
7ec47aa864 code cleanup: shadowing 2013-03-16 14:33:32 +00:00
c56b39c0e4 bmesh operator 'contextual_create' wasn't flagging single faces that were created (caused glitch in some cases with recent create-select functionality). 2013-03-09 14:42:10 +00:00
221a383366 use 'bool' for BLI_/BKE_ functions. 2013-03-09 05:35:49 +00:00
b27854bd47 use booleans for bmesh api. 2013-01-14 16:42:43 +00:00
e2f0a1e4db own cleanup commit in bmesh branch - removed last letters from ends of some comments. 2012-12-11 14:24:27 +00:00
07ccd3ee3f fix [#33029] Applying modifier leaks memory
Thanks for Sergey for finding the bug & patching, This fix works a bit differently.
Theres no need to allocate the customdata in the first place - since its written into. So add a flag for vert/edge/face/loop creation functions so they can skip customdata creation.
2012-11-29 16:26:39 +00:00
9982b283e6 fix for asserts added in own recent commit with more strict type-checking
- BMO_slot_copy now only copies compatible elements.

other minor changes
- don't use text.format(...), convention for UI scripts is C style string formatting.
- rename bmo_edgenet_prepare --> bmo_edgenet_prepare_exec
- float/double warning in bevel.
2012-11-27 02:34:40 +00:00
ebaf1306b8 bmesh operator api:
avoid per vert/edge/face string lookups in BMO_slot_map_* functions --- used in array modifier, subdivide, remove doubles and other tools.
2012-11-20 13:29:27 +00:00
dbdc76c9d0 code cleanup: make bmesh operator names more consistant since python has access to these as input arguments and return values.
all output values currently have ".out" suffix, this may go in the future, but for now it makes it clear in C code what are inputs and outputs.
2012-11-20 05:50:19 +00:00
48639af5f8 use input and output slots for bmesh operators, needed for the python api to get return values. 2012-11-19 14:58:31 +00:00
cdc4037f0d bmesh: BM_verts_in_face was using bmesh operator flag which is no longer ensured to be available,
use internal apiflag instead, Thanks to Nicholas Bishop for spotting.

also quiet some warnings.
2012-11-19 00:54:55 +00:00
0bfc92ff8e BM_iter_as_arrayN() can now take an optional existing array argument, useful to avoid many small malloc's by passing a fixes size stack variable instead.
Will give some speedup to edge-split modifier and bevel.
2012-11-12 05:53:43 +00:00
6cdb555e6e bmesh refactor - rename some of the BM_****_share_****_count() functions to BM_***_share_check()
some of these were only returning a boolean, others returned a count even though only a boolean was needed.

split some of the functions in two as well where check/count are both needed.
2012-11-09 14:52:05 +00:00
d599b643b7 style cleanup: bge, switch statements mostly.
also left bmesh decimator on in previous commit.
2012-10-21 07:58:38 +00:00
c9c76a9a68 add compiler hints that failing to create a bmesh face is unlikely. 2012-10-01 11:12:49 +00:00
aa49ca25d5 incorrect spelling in comments 2012-09-26 20:05:38 +00:00
25c96bc9f3 code cleanup: remove unused macros, commet some which may be useful later - or good to keep for completeness. quieted some warnings and add flags -Wmissing-include-dirs and -Wno-div-by-zero to cmake/gcc 2012-09-20 01:02:39 +00:00
b5e90d6b1c fix [#32357] Subdivide fails on newly created edge
problem since bmesh merge, new edges were not selected.
2012-08-24 14:54:14 +00:00
b96c622015 style cleanup 2012-08-11 22:12:32 +00:00
9ff4fa6671 style cleanup 2012-08-04 12:30:16 +00:00
90d215535e add option so operators can be called with a flag, currently the only flag is to respect hidden geometry.
this is useful for bmesh tools that operate in object mode or for modifiers which would previously use hidden faces in some cases.
2012-07-21 00:58:02 +00:00
e6d75d8974 fix [#31674] BMesh Corrupt Stack around BMVert array "verts" - ONLY ON DEBUG VERSION 2012-06-03 17:16:20 +00:00
c0bd076bfd style cleanup: and add missing files to cmake 2012-05-17 23:12:15 +00:00
ed33320e3f Code cleanup: simplify standard GHash creation.
Added four new functions as shortcuts to creating GHashes that use the
standard ptr/str/int/pair hash and compare functions.

GHash *BLI_ghash_ptr_new(const char *info);
GHash *BLI_ghash_str_new(const char *info);
GHash *BLI_ghash_int_new(const char *info);
GHash *BLI_ghash_pair_new(const char *info);

Replaced almost all occurrences of BLI_ghash_new() with one of the
above functions.
2012-05-16 00:51:36 +00:00
2a1ba8c85b style cleanup: formatting and some float/double promotion 2012-05-03 19:57:24 +00:00
ef054e165c style cleanup: format 'for' loop macros the same as for loops, some renaming to BLI_array macros. 2012-04-28 15:14:16 +00:00
1c54eaecd8 fix [#31049] New Faces (F) always solid shaded 2012-04-21 13:58:29 +00:00
b26865ba99 code cleanup: prefer BM_face/edge/vert_select_set() over BM_elem_select_set() when the type is known (saves switch statement check on the type).
Add asserts so the correct types are ensured.
2012-04-20 16:55:47 +00:00
b40476455e code cleanup: remove unused BMesh args. 2012-04-19 14:38:09 +00:00
475ecbb0ce remove BM_ITER, BM_ITER_INDEX macros, use ELEM or MESH variants only (the maceros had unused args in both cases). 2012-04-19 13:47:58 +00:00
75b869e428 style cleanup: BM_ITER / BM_ITER_INDEX / BMO_ITER 2012-04-19 11:44:12 +00:00
f5bb4635c6 fix [#30852] Wrong Material ID applied for the new faces 2012-04-09 05:17:07 +00:00
8fa17c5362 code cleanup: no functional changes
- memset(..., -1) is used incorrectly even though it worked: MOD_solidify.c - thanks Halley from IRC for noticing this. use fill_vn_i() instead.
- quiet warnings in editmesh_slide.c
- cleanup comments in bmesh and some other minor comment additions.
2012-04-07 12:37:15 +00:00
58064bdfc4 code cleanup: add doxygen headers to bmesh operator files, also add own include so definitions dont get out of sync. 2012-04-06 09:21:19 +00:00
c7aed8b2af For BMesh functions that test flags, add enabled/disabled variants. 2012-03-30 17:30:49 +00:00