Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-07-16Cleanup: sort struct declarationsCampbell Barton
2021-07-16Cleanup: remove redundant parenthesesCampbell Barton
2021-07-15Cleanup: replace BLI_assert(!"text") with BLI_assert_msg(0, "text")Campbell Barton
This shows the text as part of the assertion message.
2021-07-14Cleanup: use BMLoop.next/prev for BMesh auto-smooth logicCampbell Barton
Use more direct access to next/previous vertices. - `BM_edge_other_vert(l_curr->e, l_curr->v)` -> `l_curr->next->v`. - `BM_edge_other_vert(l_curr->prev->e, l_curr->v)` -> `l_curr->prev->v`. Add asserts to keep the intention clear.
2021-07-13Cleanup: replace BKE_customdata.h in BKE_editmesh.hCampbell Barton
Only DNA_customdata_types.h is needed for BMEditMesh.
2021-07-11Cleanup: correct spelling in comments, remove profanityCampbell Barton
2021-07-07Cleanup: update filename referencesCampbell Barton
2021-07-07Cleanup: spelling in commentsCampbell Barton
2021-07-06Cleanup: rename 'count' to 'len'Campbell Barton
Reserve the term count for values that require calculation (typically linked lists).
2021-07-05BMesh: remove redundant mesh-backups from EDBM_op_* APICampbell Barton
Using BMesh operators through the edit-mesh API created a full copy of the mesh so it was possible to restore the mesh in case one of the operators raised an error. Remove support for automatic backup/restore from the EDBM_op_* API's as it adds significant overhead and was rarely used. Operators that need this can use the BMBackup API to backup & restore the mesh in case of failure. Add warning levels to BMO_error_raise so operators can report problems without it being interpreted as a request to cancel the operation. For high-poly meshes creating and freeing a full copy is an expensive operation, removing this gives a speedup of ~1.77x for most operators except for "connect_verts" / "connect_vert_pair" which still uses this functionality.
2021-07-05BMesh: dissolve faces no longer fails when some faces can't dissolveCampbell Barton
Previously, any face groups that could not be merged into a face caused the entire operation to report an error and do nothing. Now these cases are skipped over, dissolving faces where possible.
2021-07-05Cleanup: minor improvements to BMesh dissolve facesCampbell Barton
- Only create arrays with groups of two or more faces. - Remove raising exception for zero length arrays. - Remove redundant exception check (assert there is no exception). - Use a struct for face array & it's length instead of a NULL terminated array (removes the need to count faces in a loop).
2021-07-03Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXXCampbell Barton
Also use doxy style function reference `#` prefix chars when referencing identifiers.
2021-07-02Cleanup: spelling in commentsCampbell Barton
2021-07-01Cleanup: remove redundant calls to BMO_error_clearCampbell Barton
2021-07-01Cleanup: remove bmesh-operator error codeCampbell Barton
The error codes could be used to look up messages from a table of messages however this wasn't especially useful. Now all calls to BMO_error_raise must inclue a message.
2021-07-01Cleanup: split normal calculation into it's own fileCampbell Barton
Normals now includes many functions including normal splitting & custom normal manipulation split this into it's own file to centralize related functions.
2021-06-28Cleanup: update commentsCampbell Barton
2021-06-28Cleanup: repeated terms in code comments & error messagesCampbell Barton
2021-06-26Cleanup: full sentences in comments, improve comment formattingCampbell Barton
2021-06-26Edit Mesh: optimize common use-cases for partial updatesCampbell Barton
Skip updating normals & tessellation for contiguous geometry regions for operations such as translate & uniform scale. This means when all geometry is selected, no updates are needed as the relative locations of vertices aren't being modified. Performance: As this is skipping a multi-threaded operation, larger improvements are noticeable on systems with fewer cores. - ~1.15x to ~1.3x overall gain for 32 cores. - ~1.7x to ~2.2x overall gain for 1 core (limited using `-t 1` argument). Details: - Rotate & non-uniform scale only skip tessellation. - Proportional editing and axis-mirror have special handling ensure geometry is properly grouped before considering a face part of a single group that can be skipped. - Loose vertices always need their normals to be recalculated since they're calculated based on the location. - Non-affine transform operations such as shrink-fatten & bend, don't take advantage of this optimization. - Snap projection also disables the optimization.
2021-06-26BMesh: skip partial updates when there is nothing to doCampbell Barton
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-06-23Fix T89269: Memory corruption during extrusions of overlapping edgesGermano Cavalcante
The "extrude" operator with the "use_dissolve_ortho_edges" option assumed the edges were connected.
2021-06-23Cleanup: reformat trailing comments that caused line wrappingCampbell Barton
2021-06-22Cleanup: Spelling MistakesLeon Zandman
This patch fixes many minor spelling mistakes, all in comments or console output. Mostly contractions like can't, won't, don't, its/it's, etc. Differential Revision: https://developer.blender.org/D11663 Reviewed by Harley Acheson
2021-06-22Fix T89345: Edit-mesh decimate doesn't update face normalsCampbell Barton
Invalid face normals were used for tessellation.
2021-06-21Performance: Flush selection to edges/faces.Jeroen Bakker
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-21Fix T89271: Selecting all vertices doesn't select all edges.Jeroen Bakker
Mistake in recent commit {rBea4309925f1d2d2a224bd1dce12269a58ade9b62}.
2021-06-20Mesh: minor optimization to concave quad check for tessellationCampbell Barton
Use the face normal (when available) for a faster concave quad test.
2021-06-18Fix T89261: Crash when calculating bmesh tessellationGermano Cavalcante
Error passing `false` instead of a `BMeshCalcTessellation_Params` struct.
2021-06-18BMesh: use threading to count total selection.Jeroen Bakker
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-18Performance: Limit recounting during selection mode flushing.Jeroen Bakker
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-18Cleanup: use 'bmesh' prefix for BMesh tessellation utilitiesCampbell Barton
2021-06-18Cleanup: move mesh tessellation into it's own fileCampbell Barton
This matches BMesh which also has tessellation in it's own file. Using a separate file helps with organization when extracting code into smaller functions.
2021-06-18Fix T89247: Dereference arguments to comparison function correctlyFen
`bm_face_len_cmp` incorrectly interpreted its arguments as `BMFace *` instead of `BMFace **`, causing an out-of-bounds read. Ref D11637
2021-06-15Fix warning treated as an errorGermano Cavalcante
"void' function returning a value".
2021-06-15BMesh: assert that face normals have been updated for tessellationCampbell Barton
This catches missing normal updates that may cause invalid tessellation.
2021-06-15Cleanup: remove return value from face normal calculationCampbell Barton
This value is always 'sides - 2', no need to return this value.
2021-06-14BMesh: support face-normal calculation in normal & looptri functionsCampbell Barton
Support calculating face normals when tessellating. When this is done before updating vertex normals it gives ~20% performance improvement. Now vertex normal calculation only needs to perform a single pass on the mesh vertices when called after tessellation. Extended versions of normal & looptri update functions have been added: - BM_mesh_calc_tessellation_ex - BM_mesh_normals_update_ex Most callers don't need to be aware of this detail by using: - BKE_editmesh_looptri_and_normals_calc - BKE_editmesh_looptri_and_normals_calc_with_partial - EDBM_update also takes advantage of this, where calling EDBM_update with calc_looptri & calc_normals enabled uses the faster normal updating logic.
2021-06-14BMesh: remove unit-length edge-vector cache from normal calculationCampbell Barton
Bypass stored edge-vectors for ~16% performance gains. While this increases unit-length edge-vector calculations by around ~4x the overhead of a parallel loop over all edges makes it worthwhile. Note that caching edge-vectors per-vertex performs better and may be worth investigating further, although in my tests this increases code complexity with barley measurable benefits over not using cache at all. Details about performance and possible optimizations are noted in bm_vert_calc_normals_impl.
2021-06-13Cleanup: redundant initializationCampbell Barton
These were limited to obvious cases. Some less obvious cases were kept as refactoring might make them necessary in future.
2021-06-09BMesh: multi-thread face tessellationCampbell Barton
Use BM_iter_parallel for face tessellation, this gives around 6.5x speedup for BM_mesh_calc_tessellation on high poly meshes in my tests, although exact speedup depends on available cores.
2021-06-09BLI_task: add TLS support to BLI_task_parallel_mempoolCampbell Barton
Support thread local storage for BLI_task_parallel_mempool, as well as support for the reduce and free callbacks. mempool_iter_threadsafe_* functions have been moved into a private header thats only shared between task_iterator.c and BLI_mempool.c so the TLS can be made part of the iterator array without having to rely on passing in struct offsets. Add test task.MempoolIterTLS that ensures reduce and free are working as expected. Reviewed By: mont29 Ref D11548
2021-06-08BMesh: simplify normal calculation, resolve partial update errorCampbell Barton
Simplify vertex normal calculation by moving the main normal accumulation function to operate on vertices instead of faces. Using faces had the down side that it needed to zero, accumulate and normalize the vertex normals in 3 separate passes, accumulating also needed a spin-lock for thread since the face would write it's normal to all of it's vertices which could be shared with other faces. Now a single loop over vertices is performed without locking. This gives 5-6% speedup calculating all normals. This also simplifies partial updates, fixing a problem where all connected faces were being read from when calculating normals. While this could have been resolved separately, it's simpler to operate on vertices directly.
2021-06-07Cleanup: use doxy groups for bmesh_mesh_normals.cCampbell Barton
2021-06-07Cleanup: split bmesh normal calculation into separate filesCampbell Barton
2021-06-07Cleanup: remove redundant cast, use const castsCampbell Barton
2021-06-05BMesh: avoid extra faces-of-edges loop building partial update dataCampbell Barton
2021-06-05Edit Mesh: partial updates for normal and face tessellationCampbell Barton
This patch exposes functionality for performing partial mesh updates for normal calculation and face tessellation while transforming a mesh. The partial update data only needs to be generated once, afterwards the cached connectivity information can be reused (with the exception of changing proportional editing radius). Currently this is only used for transform, in the future it could be used for other operators as well as the transform panel. The best-case overall speedup while transforming geometry is about 1.45x since the time to update a small number of normals and faces is negligible. For an additional speedup partial face tessellation is multi-threaded, this gives ~15x speedup on my system (timing tessellation alone). Exact results depend on the number of CPU cores available. Ref D11494 Reviewed By: mano-wii