Commit Graph

111 Commits

Author SHA1 Message Date
b9ccfb89ce Performance: Flush selection to edges/faces.
This patch uses threading to flush selection from verts to edges and
from edges to faces. The solution is lockless and should scale well on
modern CPU architectures.

Master:{F10185359}
Patch:{F10185361}

End user performance went from 3.9 to 4.6 FPS (Stanford Dragon) but that
was measured on a Intel Core i7-6700 CPU and AMD RX480 Gpu. The more
cores the better improvements you get.

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D11644
2021-06-21 16:35:28 +02:00
b2510b9e20 Fix T89271: Selecting all vertices doesn't select all edges.
Mistake in recent commit {rBea4309925f1d2d2a224bd1dce12269a58ade9b62}.
2021-06-21 07:55:49 +02:00
Jeroen Bakker
6d73d98fb6 BMesh: use threading to count total selection.
During selections the total selection is refreshed at the end. This
process was done single threaded. This patch will do a parallel iter
approach.

Master: 0.043612s Threaded 0.017964s.

Master: {F10179586}
This patch: {F10179587}

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D11622
2021-06-18 16:06:36 +02:00
Jeroen Bakker
ea4309925f Performance: Limit recounting during selection mode flushing.
This patch ensures that selection mode flushing updates total selection
counts internally. This reduces recounting when we are sure that the
input total selection counts were up to date.

For example for circle selection the total selection counts were
correct. But during flushing the selection could have been changed and
therefore the selection was always recounted.

This increased the performance on selected system from 6.90 FPS to 8.25
FPS during circle selection operations.

Before: {F10179981}
After: {F10179982}

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D11647
2021-06-18 15:44:08 +02:00
6aec6568a0 Cleanup: spelling, minor corrections
Also use doxygen comments for sculpt functions.
2021-03-03 06:20:27 +11:00
20a6255d49 Cleanup: spelling 2021-02-17 15:04:29 +11:00
4b188bb08c Cleanup: use over-line for doxy comments
Follow our code style for doxygen sections.
2020-10-27 21:45:55 +11:00
3d26cd01b9 Spelling: Apart Versus A Part
Corrects incorrect usages of the fragment 'apart of' when 'a part of' was required.

Differential Revision: https://developer.blender.org/D9245

Reviewed by Campbell Barton
2020-10-19 09:47:19 -07:00
2115232a16 Cleanup: Clang-Tidy readability-inconsistent-declaration-parameter-name fix
No functional changes
2020-09-04 21:04:16 +02:00
20869065b8 Cleanup: BMesh, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/bmesh` module.

No functional changes.
2020-07-03 14:48:37 +02:00
ae2f21f378 Fix T76533: Gizmo uses active face center in edge selection mode
Only use the active face when it's selected.
2020-06-02 18:38:58 +10:00
d138cbfb47 Code Quality: Replace for loops with LISTBASE_FOREACH
Note this only changes cases where the variable was declared inside
the for loop. To handle it outside as well is a different challenge.

Differential Revision: https://developer.blender.org/D7320
2020-04-03 19:27:46 +02:00
2d1cce8331 Cleanup: make format after SortedIncludes change 2020-03-19 09:33:58 +01:00
a22c2ceb0f Cleanup: line breaks with comments 2019-09-12 18:59:44 +10:00
b1959a96a2 Cleanup: spelling 2019-08-18 04:26:34 +10:00
760dbd1cbf Cleanup: misc spelling fixes
T68035 by @luzpaz
2019-08-01 14:02:41 +10:00
604fdb6e85 Spelling fixes in comments and descriptions, patch by luzpaz
Differential Revision: https://developer.blender.org/D3744
2019-07-31 14:27:35 +02:00
6529d20d79 Cleanup: spelling in comments 2019-06-12 09:43:49 +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
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
f0a481eebd Fix selection history clearing when selecting all 2018-12-14 11:38:02 +11:00
6e2d9ef2db Cleanup: naming (mean -> median) see T47811 2018-12-14 10:54:11 +11:00
3756f920f4 BMesh: backport minor changes from 2.8 2018-11-10 19:56:02 +11:00
854db8951b Cleanup: strip trailing space in bmesh module 2018-06-04 08:49:47 +02:00
d47d263b4b Cleanup: style 2017-12-04 16:37:31 +11:00
5f4058ddbc Removing OMP: get rid of usages in /bmesh/ area.
Just removing it, such cases are not bottlenecks and not worth the
complication of doing real threading with own BLI_task.

Other (remaining) usages may be relevant, need case-by-case check.
2017-11-21 22:25:22 +01:00
53e7a4a83c Correct asserts, un-hiding when selected is ok 2017-01-20 06:00:55 +11:00
666cb5ddd9 Cleanup: naming, comments assert for hide+selected 2017-01-19 22:59:41 +11:00
e2d02fee30 BMesh: improve hide-flush internal logic
- flushing hidden state ran when it didn't need to.
- flushing checks didn't early exit when first visible element found.
- low level BM_*_hide API calls like this can use skip iterators
  can loop over struct members directly.

No user-visible changes.
2017-01-19 22:50:56 +11:00
30d951ce34 Cleanup: spelling 2016-07-08 09:49:01 +10:00
65df2fd997 bmesh py api: expose BM_face_calc_tangent_*
D1988 by @wisaac, with own edits and improvements.

This improves on existing tangent calculation functions too.

- BM_face_calc_tangent_auto: Chooses method based on number of sides, used by manipulator (not exposed to Python).
- BM_face_calc_tangent_edge: from longest edge.
- BM_face_calc_tangent_edge_pair: from longest edge-pair (most useful with quads).
- BM_face_calc_tangent_edge_diagonal: edge farthest from any vertex.
- BM_face_calc_tangent_vert_diagonal: vert farthest from any vertex.

Also optimize BM_vert_tri_calc_tangent_edge* functions to avoid sqrt.
2016-06-12 15:12:34 +10:00
56bcda8bc6 Fix BMesh selection flushing w/ mixed modes
Fix for T46494 wasn't working properly when de-selecting faces,
adjacent faces would remain selected but have unselected edges.

Logic here is admittedly rather fragile since it relies on both
selection functions and flushing afterwards.
2015-11-02 17:04:29 +11:00
f53a21747c Fix T46494: Can't de-select a face w/ mixed modes 2015-10-15 19:57:51 +11:00
07e9fb8ec6 BMesh: calls to store selection at the list head 2015-05-19 23:51:57 +10:00
e59bd19fa7 Cleanup: style & const's 2015-05-05 05:19:49 +10:00
89f5a09ab4 Cleanup: use 8 space indent for multi-line args 2015-04-25 20:15:20 +10:00
488b342741 BMesh: optimize selection flushing
De-selecting a face would do flushing checks on each vertex 3 times, now only do once.
2015-02-03 19:59:39 +11:00
af2d75b9a7 cleanup: inconsistent BMesh select checks 2015-02-03 19:08:25 +11:00
75249259f4 BMesh: optimize edge select
It's called a lot, so avoid using a generic iterator for edges of vert.
2015-02-03 09:33:04 +11:00
e7f495d8a0 Cleanup: bool 2014-09-24 14:55:01 +10:00
47ad1a9720 Comments 2014-08-26 15:21:12 +10:00
ca1bca442a Fix T40993: Store selection history for extrude 2014-08-25 16:57:38 +10:00
d53ed58c57 BMesh: avoid OpenMP use for low poly meshes (counting selection)
also use schedule(static) for simple for loops.
2014-06-06 23:54:15 +10:00
b5b1ce9d21 BMesh: add overwrite option to BM_mesh_elem_hflag_enable/disable_test 2014-02-26 23:42:47 +11:00
8565b2042e Fix for BM_mesh_deselect_flush(), allowed faces with deselected edges 2014-02-21 08:16:49 +11:00