Commit Graph

89 Commits

Author SHA1 Message Date
03b2371387 Cleanup: move trailing comments to avoid wrapping code
Some statements were split across multiple lines because of their
trailing comments.

In most cases it's clearer to put the comments above.
2019-08-14 23:32:24 +10:00
909665a0d4 ClangFormat: run with ReflowComments on source/
Prepare for enabling ReflowComments.
2019-05-01 11:13:14 +10:00
ee192a35e8 Cleanup: comments (long lines) in bmesh 2019-04-29 22:06:26 +10:00
e12c08e8d1 ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.

For details on usage and instructions for migrating branches
without conflicts, see:

https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-17 06:21:24 +02:00
8d7005d715 Cleanup: style, use braces for bmesh 2019-03-27 17:14:36 +11:00
109cbdf2e1 Cleanup: use BLI_kdtree_3d prefix
Use prefix now there isn't only the 3d version.
2019-03-20 00:48:51 +11:00
de13d0a80c doxygen: add newline after \file
While \file doesn't need an argument, it can't have another doxy
command after it.
2019-02-18 08:22:12 +11:00
eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
65ec7ec524 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
2f372654b6 BMesh: keep selection history when removing doubles
Auto-merge would loose the active vertex.
2019-01-17 12:36:17 +11:00
371006ddea BMesh: Remove doubles now merges face-flags 2019-01-17 12:32:12 +11:00
c5ae1cde5c Cleanup: variable names 2019-01-17 12:29:09 +11:00
7c4803367f BMesh: prevent weld-verts bmop creating selected+hidden verts/edges
Related to error exposed by T59640
Would have fixed crash too, but we want to ignore hidden verts.
2019-01-16 15:31:54 +11:00
854db8951b Cleanup: strip trailing space in bmesh module 2018-06-04 08:49:47 +02:00
60956397ca Cleanup: BLI_utildefines prefix for header-only libs
This allows to have different macro headers without them sharing
similar names to regular C modules.
2017-09-19 20:16:05 +10:00
4d148471b6 Fix T52634: EditMesh Remove doubles could hang
A single diagonal axis was used for sorting coordinates,
the algorithm relied on users not having vertices axis aligned.

Use BLI_kdtree to remove doubles instead.

Overall speed varies, it's more predictable than the previous method.
Some typical tests gave speedup of ~1.4x - 1.7x.
2017-09-03 23:52:10 +10:00
2ca1f29748 BMesh: use predictable order for remove-doubles
Each qsort implementation may give different results when values match.

Now fallback to sorting by index.
2017-09-02 03:30:09 +10:00
ab4b7b5368 Fix T51648: Inconsistent edge collapse point depending on orientation
Edge collapse was using bounding box center as the point to collapse to.
When collapsing multiple adjacent edges together, this caused
inconsistencies in placement of the collapsed point, depending on the
orientation of the edges in relation to the space axis.

This makes edge collapse use the mean point instead.
2017-06-09 10:03:46 +02:00
89120cd241 bmesh: use 'uint' instead of 'unsigned int'
no functional changes.
2017-05-06 14:19:08 +10:00
fc9fa07c0e BMesh: BM_face_exists no longer uses return arg
Just return the face or NULL, like BM_edge_exists(),
Also for BM_face_exists_overlap & bm_face_exists_tri_from_loop_vert.
No functional changes.

Old code did some partial overlap checks where this made some sense,
but it's since been removed.
2016-11-14 04:33:35 +11:00
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
1883dbd8c3 Fix T48616: Auto-merge selects extra edges
Auto-merge caused all edges between selected vertices to be selected.
This only makes sense in vertex-select-mode.

Correct edge-flag merging code, which now merges flags from multiple edges.
2016-06-13 18:07:59 +10:00
4e500101a7 Cleanup: quiet -Wcomma, cast to void where needed 2016-03-05 09:16:12 +11:00
9a1ea681e6 BMesh: remove doubles fix/optimization
Changes to remove doubles face creation,
Recent change to remove doubles broke when the new faces already existed (rare occurrence),
however theres no point to return an existing double face.

Now check if the face exists before creating it.

Other changes:

- avoid 2x hash lookups on all mapped verts.
- fill in the vert array instead of calculating from edges.
- remove inefficient search of entire edge-array before adding to it.
  (flag verts to ensure they're not used multiple times).
- move logic for transfusing edge-flags to edge creation.
2015-12-24 20:30:05 +11:00
6d10bf7c44 Fix bad selection after symmetrize
Weld verts now keeps original faces so callers don't need to keep track of newly created face data.
2015-12-22 16:41:01 +11:00
b2e36dcd7d Fix auto-merge loosing edge/faces selection 2015-12-01 22:12:12 +11:00
cdb0cf3ec7 BMesh: replace BLI_array -> BLI_stack
Also use more direct custom-data access.
2015-06-21 09:19:12 +10:00
ea5f9fee8d Cleanup: function arg wrapping 2015-05-05 16:34:38 +10:00
74d31279cd Fix T44560: Merge Collapse tool - UVs operator panel option ignored with Collapse but not with other merge types.
Was missing parameter for collapse bmesh operator...
2015-05-01 17:10:39 +02:00
9e9cd77b8d Compiler warning: double-promotion 2015-02-01 01:17:21 +11:00
aab4f2b762 cleanup: redundant casts & const cast correctness 2015-01-01 23:42:28 +11:00
55d3277d0c BMesh: use a smaller dist3 threshold
Matches array modifier remove-doubles
2014-08-14 12:49:02 +10:00
d9f39257f4 Math Lib: add compare_len_squared_v3v3 from paint branch 2014-07-14 11:55:38 +10:00
f32079d4b9 BLI_stackdefines
Bounds check the stack while debugging, also add STACK_PEEK
2014-06-29 05:57:48 +10:00
c5ccbacdaa move STACK_* macros into BLI_stackdefines.h 2014-06-25 00:01:33 +10:00
7e78322eef BMesh Walker: rename BMW_SHELL -> BMW_VERT_SHELL 2014-05-23 20:50:27 +10:00
e4c2a3c31c Various fixes/improvements regarding BMesh's elem_index_dirty and BM_LOOP handling.
Most notably, BM_LOOP and BM_FACE index recompute should now be fully decoupled.
2014-04-15 16:20:07 +02:00
933c2b0521 BMesh: collapse_uvs - avoid clearing and flagging for every cd-layer 2014-01-22 17:16:38 +11:00
477a84a738 BMesh: minor optimization for remove doubles
- replace heap allocation with stack for small arrays.
- remove edge-lookup when its already known.
2014-01-17 17:21:41 +11:00
7df8452d1a BMesh: add bmesh delete functions that dont depend on operator flags 2014-01-17 14:55:06 +11:00
3ffba79ac6 Fix for own recent commit 2013-12-24 18:56:07 +11:00
04a902965e BMesh optimize face splitting by taking loops rather then verts
- add BM_vert_pair_share_face
- add BM_loop_is_adjacent
- remove BM_verts_connect
2013-12-24 11:13:58 +11:00
0959482acb fix [#36913] GHASH_FLAG_ALLOW_DUPES assert and crash in Edge Collapse 2013-10-02 04:12:06 +00:00
75383a79f6 array modifier was adding vertices to the 'targetmap' multiple times.
this is supported by weldop but would prefer not to allow multiple keys in the map.
2013-08-27 23:32:11 +00:00
377475f979 remove doubles: source/target can be swapped, check both flags. 2013-08-27 23:23:19 +00:00
d5469dd5c2 mesh remove doubles was adding verts into the weld_verts.targetmap multiple times (new paranoid asserts find this stuff). 2013-08-27 22:38:55 +00: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
0b00ba4ee0 remove unused function 2013-08-17 13:08:09 +00:00
20376f3337 code cleanup: move beauty fill calculation into its own function and some style cleanup 2013-03-30 09:57:35 +00:00
b1f4e2b4db code comments: bmesh operator doxy header descriptions. 2013-03-30 08:54:50 +00:00