Commit Graph

59 Commits

Author SHA1 Message Date
3c67cf9594 from bug report [#34984] bmesh.ops.recalc_face_normals() ignores use_flip=True
the name `use_flip` is misleading, option in fact tags faces that have been flipped, rename to `use_face_tag`
2013-04-22 20:15:42 +00:00
dad7afa1af code cleanup: remove double call to BKE_node_instance_key(), rename ruler (lots of tools are 3d :)), and redundant assignment. 2013-03-21 14:16:55 +00:00
00ef8896fd fix for own error in recent BLI_array commit 2013-01-20 16:58:14 +00:00
b27854bd47 use booleans for bmesh api. 2013-01-14 16:42:43 +00:00
0526fcf13f revert part of r52720, Id rather leave these as-is, even if they give warnings under some configurations. 2012-12-03 08:11:04 +00:00
818a345be3 Silent a bunch of gcc warnings (usually dummy, but noisy!). 2012-12-02 16:01:06 +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
8ecce451ab bmesh operator naming - use clearer names for args eg: (mat -> matrix, use_singleedge -> use_single_edge)
also remove duplicate docs for operator arg formatting.
2012-11-28 00:16:06 +00:00
c00a1b7493 use clearer names for 'single' bmesh operator args & add '%e' to BMO_op_vinitf comments. 2012-11-27 09:41:08 +00:00
a9855c227e py/bmesh api - add support for single item buffers (odd feature but used quite a bit with bmesh operators).
also add utility functions BMO_slot_buffer_from_single(), BMO_slot_buffer_get_single()
2012-11-27 09:21:57 +00:00
f8bc346eff bmesh/py operator api:
add type checking for element buffers, there was nothing stopping python from passing any element type into an argument when in some cases only verts/edges/faces were expected.
now operator args define which types they support.
2012-11-27 00:50:59 +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
617a73c573 code cleanup: unused defines & some formatting. 2012-11-08 06:46:10 +00:00
199e597922 code cleanup: move select-similar bmesh operators into their own file since there are 3 operators here that share
utility functions with eachother but have nothing in common with other operators in bmo_utils.c
2012-10-30 07:59:25 +00:00
330c0178ce add the option to select Equal/Greater/Less when selecting similar.
Recently addons were submitted for review and this was the only advantage they had over blenders existing internal
select-similar tool.
2012-10-30 07:29:17 +00:00
b5e8e8da6f add option to select face by matching number of sides. 2012-10-30 06:43:30 +00:00
248b2fc6d6 bmesh-decimator update
- update face normals when triangulating.
- avoid divide by zero when interpolating customdata on a zero length edge.
- replace zero float comparisons with fabsf() < FLT_EPSILON to avoid numeric error.

also renamed BLI_heap_empty() --> BLI_heap_is_empty() so its obviously readonly function.
2012-10-21 15:20:53 +00:00
da9394f596 code cleanup: define sizes of vectors for function args and use C style comments 2012-10-15 09:11:17 +00:00
84e80b6904 Fix #32301: mesh select more/less not taking hidden vertices/faces into account. 2012-08-22 15:10:07 +00:00
f608b3c444 code cleanup:
- building without python works again
- rename maxi/mini to i_max/i_min (so thay are available for function names)
- some minor edits to IK stretch setting (no functional changes).
2012-07-29 17:49:14 +00:00
718569dc16 Fix #32199: Smooth Vertex no longer has X, Y and Z options. 2012-07-27 17:35:02 +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
32cf7fcdb1 code cleanup: spelling 2012-07-16 23:23:33 +00:00
69a7e0af02 rename bmesh ops since they are exposed in an api now. 2012-06-30 15:27:13 +00:00
bd9192670b Added option in shift-g to select verts by number of connected edges (valence). 2012-06-15 01:43:01 +00:00
56c5c63f57 code cleanup: doxy comment filename corrections 2012-06-08 23:43:11 +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
23c0d49a7c optimization for select similar
- use angle_normalized_v3v3() where both vectors are known to be normalized.
- remove needless radian to degrees conversions.
- move checks for customdata layers outside the inner loop (for bevel and crease).
2012-05-12 14:25:14 +00:00
821b231bd6 add bevel to select similar edges operator 2012-05-12 14:06:35 +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
792f536b36 code cleanup: better use of BLI_array_* (grow in larger steps where possible), include BMO_iter_new in for loops. 2012-04-23 02:17:57 +00:00
16ff7e40e6 code cleanup: change C naming convention (so py and C api match), eg:
C: BM_face_calc_area(f), Py: BMFace.calc_area()
2012-04-23 01:19:50 +00:00
8765dfccf7 style cleanup: correct typos 2012-04-21 14:14:58 +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
db53faffa3 make ngon_perimeter into a public api function and expose to python. 2012-04-15 10:09:27 +00:00
11a4dab32b bmesh minor change - avoid increasing array sizes one by one and use iterator macros. 2012-04-06 11:50:16 +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
be116242d4 style cleanup 2012-03-20 04:27:14 +00:00
6f104aad3a code cleanup: bmesh api - make arg order consistent - htype before hflag or oflag. 2012-03-19 08:36:27 +00:00
4f19c1a995 spelling cleanup 2012-03-18 07:38:51 +00:00
17786b3b3e building without python works again, cleanup bmesh include paths (cmake and scons). 2012-03-08 03:25:53 +00:00
4d84e869a0 Improvements to bmesh edge rotate
On a user level, edge rotate now works better with multiple edges selected, it wont make zero area faces or rotate edges into existing ones.

With a single edge selected - rotate is less strict and will allow ugly resulting faces but still checks on duplicate edges.

API:
* BM_edge_rotate now takes a flag, to optionally...
** check for existing edge
** splice edge (rotate and merge)
** check for degenerate resulting faces (overlapping geometry, zero area)
** beauty - only rotate to a better fit.
... this allows it to still be used as a low level API function since all checks can be skipped.

* BM_edge_rotate() now works a bit different, it find the new edge rotation before joining the faces - exposed by BM_edge_rotate_calc().

* Added api call bmesh_radial_faceloop_find_vert() - Radial Find a Vertex Loop in Face
2012-03-05 00:50:18 +00:00
95670e03a0 style cleanup / comment formatting for bli/bke/bmesh 2012-03-03 20:19:11 +00:00
cbc07986b5 bmesh support for rotating multiple edges at once. 2012-03-03 12:49:03 +00:00
9c18ade898 bmesh edge rotate
* improve check to see if edge rotate can be done,
  was checking if both edges verts have an edge count of 2, which is really a meaningless test since the verts can have stray edges connected and the result wont work right.
  instead check if the next verts in both faces share a vertex.

* add utility function BM_face_other_vert_loop() which gets the next loop in a face.
* add convenience function BM_edge_face_pair() which returns 2 faces for edges that have exactly 2 face users. (saves ugly e->l->radial_next ... in code) and is more readable.
2012-03-03 12:35:37 +00:00
21280a6386 Code Cleanup - naming consistancy for bmesh struct types 2012-03-02 12:44:34 +00:00