Commit Graph

51 Commits

Author SHA1 Message Date
964f29797b avoid using BLI_array for remove double helper function - bmesh_find_doubles_common(), was growing and array one at a time (with re-allocs), when the size is known. 2012-11-05 14:39:49 +00:00
eb69d1c1ae style cleanup: also quiet harmless compiler warning. 2012-10-29 15:43:54 +00:00
c9dade4fe0 Big i18n commit: add "reports" from bmesh/readfile/tracking/dynapaint (and a few others), and another bunch of UI messages tweaks/fixes, as well as some BKE_report()<->BKE_reportf()... 2012-10-26 17:32:50 +00:00
aff591c6e1 code cleanup: typos and set exceptional cases of zero length normals as UNLIKELY(). 2012-09-17 22:22:06 +00:00
1a7eb3454e style cleanup 2012-09-08 08:59:47 +00:00
d9fcbe2f59 remove BMO_OP_FLAG_RATIONALIZE_NORMALS option which wasnt used anywhere. 2012-07-21 01:09:11 +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
2ed69a95f4 add bmesh/python operator support for vector and matrix args.
also rename BMO_OP_SLOT_PNT to BMO_OP_SLOT_PTR (matches RNA and sounds less like 'point')
2012-07-02 20:28:43 +00:00
69a7e0af02 rename bmesh ops since they are exposed in an api now. 2012-06-30 15:27:13 +00:00
e6d55c97dd add support for passing lists of verts/edges/faces to bmesh operators 2012-06-30 12:58:04 +00:00
3e99ec8d3d all bmesh operators can now be accessed from bmesh.ops.* using a generic wrapper,
argument parsing still needs to have support added for vector, matrix and element types.
2012-06-30 11:14:10 +00:00
35d8424273 code cleanup: rename some members of bmesh operators, 'slots' is a C++ keyword which confuses some IDE's.
also added missing BMO_op_vinitf args to comments.
2012-06-30 09:55:04 +00:00
a18b303a76 Fix incorrectly deleted elements in array modifier caps.
Add check for merging vertices into vertices that are themselves
marked for merge, was already done for array eleements but not end
caps.

Fixes bug [#31695] Array Modifier: End Cap fails if all vertices are merged

Also corrected some reversed assert arguments.
2012-06-11 09:41:08 +00:00
2d2d36fe3b code cleanup:
- style - multi-line ifs move braces onto new lines.
- iterators - convert some to macros, other split up and move brace.
2012-05-20 19:49:27 +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
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
3ef7943910 code cleanup: first step to replace BM_ITER BM_ITER_INDEX macros. 2012-04-19 12:45:56 +00:00
75b869e428 style cleanup: BM_ITER / BM_ITER_INDEX / BMO_ITER 2012-04-19 11:44:12 +00:00
e9358a3806 bmesh api changes:
- remove recently added BM_mesh_select_flush_strip(), functions purpose wasn't clear.
- add BM_mesh_elem_hflag_disable_test(), BM_mesh_elem_hflag_enable_test()
  to match existing BM_mesh_elem_hflag_enable/disable_all(), these take a hflag to test before editing each element.
  This replaces the need for BM_mesh_select_flush_strip().
2012-04-13 04:02:26 +00:00
db9c9f6c64 fix [#30772] No more than two subdivions give correct result when adding an icosphere
bug was introduced in r45297, which inadvertently broke testing for multiple flags at once.

added BM_elem_flag_test_bool() and BMO_elem_flag_test_bool() to get TRUE/FALSE results rather then the flag value.
2012-04-03 02:38:27 +00:00
3f3b88ff42 bmesh iterators were passing the BMesh as data argument to BM_iter_new(), harmless but incorrect.
replace these cases with iterator macro.
2012-04-03 00:28:38 +00:00
c56bc8cb0f style cleanup: multi-line if's & whitespace. 2012-04-02 22:40:02 +00:00
3c1b5b5632 stule cleanup: edits for files which were recently cleaned up. 2012-04-02 22:26:00 +00:00
c7aed8b2af For BMesh functions that test flags, add enabled/disabled variants. 2012-03-30 17:30:49 +00:00
bbbbe1b00e Add BMO function to append to a buffer slot. 2012-03-30 17:30:24 +00:00
83ec6dd1bd Fix out-of-date slot type sizes.
The BMO_OPSLOT_TYPEINFO array was out of date, the last two entries
were off by one. Updated with correct values and added comments to
make it easier to match up in future.

Also changed the alloc string for mapping slot's ghash to something
more descriptive than "bemsh op".
2012-03-30 13:49:32 +00:00
30d128c7a7 bmesh: be more strict with operator string formatting, no tabs and only accept slot=%x style. 2012-03-28 08:42:19 +00:00
6f104aad3a code cleanup: bmesh api - make arg order consistent - htype before hflag or oflag. 2012-03-19 08:36:27 +00:00
ef2dc9b175 better error reporting when a bmesh operator fails. (give reason and show char number that fails) 2012-03-18 23:38:31 +00:00
bed5ae5366 *picky* fix for edge rotate
- Edge rotate would leave verts selected, this would give problems because those selections would leave edges that would try to rotate when run again. now de-select old verts on edge rotate.

- Rotating into hidden verts gave odd results, now make sure hidden state is ok.

- BMO_slot_buffer_hflag_disable / BMO_slot_buffer_hflag_enable now have flushing for the hide flag too.
2012-03-15 23:23:04 +00:00
b1b07fb951 Speedup for ngon normal calculation
- BM_mesh_normals_update was looping over all faces to find the largest one, this is no longer needed.
- calculating a face normal was looping over every faces corners twice, now only once - using the loops directly (not an iterator).
- face vert locations were being copied an array, now use directly.
- calculating the normals would copy a float vector for the next point in the face, which was never used (only current and previous used).
- was copying vectors to compute the normal, now just assign the float pointers.
2012-03-10 03:25:16 +00:00
17786b3b3e building without python works again, cleanup bmesh include paths (cmake and scons). 2012-03-08 03:25:53 +00:00
9d49fa0e63 style cleanup - spelling corrections & update some incorrect comments. 2012-03-03 11:45:08 +00:00
7bbf4b7831 style cleanup
- spelling - turns out we had tessellation spelt wrong all over.
- use \directive for doxy (not @directive)
- remove BLI_sparsemap.h - was from bmesh merge IIRC but entire file commented and not used.
2012-03-02 16:05:54 +00:00
bc767059cb Code Cleanup: update to mempool, use flag rather then bool args. 2012-03-01 22:59:18 +00:00
522b73a635 bmesh api:
* name bmesh operator func's BMO_slot_buffer_* rather then BMO_slot_* since it wasnt obvious some only dealt with buffer, some both.
* more typechecks and asserts of BMO_ functions (I lost some time calling a map with a buffer function that failed silently).
* small speedup for extrude check - test if the edge is wire _before_ doign a hash lookup.
2012-03-01 17:38:04 +00:00
4a5078d6c9 style cleanup
* add extra argument to BMO_slot_map_to_flag() to filter by vert/edge/face
* made BMO_slot_map_* / BMO_slot_buffer_* functions stricter with type checking.
2012-03-01 16:04:37 +00:00
a6f420b828 update doxygen comments for bmesh. 2012-02-29 06:55:10 +00:00
dcfd1dd7e2 code cleanup: de-duplicate bmesh face creation code, 2012-02-28 19:30:44 +00:00
2a7f1af61e Code Cleanup:
- apply some rules for function naming conventions, added to main bmesh doc in bmesh.h.
- remove unused function BM_loops_to_corners().
2012-02-28 19:10:53 +00:00
130668b12f minor bmesh api naming edits. 2012-02-27 14:07:19 +00:00
e17bf02c2d Code Cleanup:
* made bmesh_structure.h function names more consistant.
* remove unused code in bmesh_structure.c
* removed 'Edge Flip' operator (missing from bmesh but looked into trunk feature and dont think its worth keeping).
* tagged  some BMESH_TODO's
2012-02-27 13:47:53 +00:00
3ba37b65a3 style cleanup 2012-02-26 22:38:49 +00:00
c65b3b73fd bmesh api cleanup
* better type safety for BM_elem_flag_* and BM_elem_index_* functions.
* add BMElem type to be used where BMFace/Edge/Vert/Loop can be interchanged.
* fix bug in select manifold, found when making functions more strict.
2012-02-25 22:23:40 +00:00
98aececc8e bmesh code cleanup
* change BMO_elem_flag_* defines to inline functions.
* BMO_slot_map_insert() is too big for an inline function - un-inline it.
* remove redundant casts.
2012-02-25 20:58:03 +00:00
c6f340e6b0 previous fix wasnt working in edge mode, now selection +/- works in vert/edge/face modes. 2012-02-23 15:47:18 +00:00
c4e7cc3287 fix for leak in gpu.export_shader(), wasnt freeing the function.
also change the bmesh iterator so its possible to initialize without stepping.
2012-02-20 22:04:29 +00:00
2421058379 add type check asserts for bmesh operator get/set funcs so errors wont fail silently. 2012-02-20 02:04:13 +00:00
1953f042e6 added boolean type for bmesh operators, will make python wrapping clearer and also makes existing calls more obvious.
also corrected some error reports.
2012-02-20 01:52:35 +00:00