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-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
2021-06-03Cleanup: use ascii characters instead of unicode where possibleCampbell Barton
Follow own code style docs.
2021-06-01Cleanup: split face tessellation into inline functionsCampbell Barton
Prepare for multiple code-paths that recalculate tessellation.
2021-06-01Cleanup: split bmesh tessellation into it's own fileCampbell Barton
Prepare for further refactoring for these functions.
2021-06-01Cleanup: remove disabled face tessellation logicCampbell Barton
This was kept since these blocks are easier to follow. Remove as the overall result wasn't so readable (especially with nested ifdef's). Replace disabled code with comment on the indices used for quads/tris.
2021-06-01BMesh: remove checks for tessellating 2 sided facesCampbell Barton
2 sided faces aren't supported and will cause problems in many areas of Blender's code. Removing (implied) support for faces with fewer than 3 sides means the total number of triangles is known ahead of time. This simplifies adding support for multi-threading and partial updates to an existing tessellation - as the face and loop indices can be used to access the range of triangles associated with a face. Also correct outdated comments.
2021-05-31Win: Fix warnings as errors being off for bmeshRay Molenkamp
bf_bmesh historically always build with the /WX flag on windows making all warnings errors, somewhere along the way this has broken for msbuild, ninja still exhibits the expected behaviour. The flags are still passed to the target, and I've validated they are there when the add_library call fires, but they somehow never make it to the generated msbuild project files. I suspect this is a cmake bug but I'm seemingly unable to extract a repro case to file a bug upstream. Setting the same options target_compile_options seems to work, I'm not happy about the unexplained nature of the breakage but this will have to do for now.
2021-04-30Cleanup: comments in BMesh bisect, use doxygen sectionsCampbell Barton
2021-04-29Clean-up: Edit and commentsPratik Borhade
- Corrected spellings - Comments added and edited Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D10991
2021-04-29Fix T86799: Boolean crashes duplicating object with "Fast" solverCampbell Barton
BMesh intersect could leave invalid items in the selection list, causing a crash. The list is now cleared since boolean is such a destructive operation, it's unlikely the selection order would be useful. Thanks to @lukastoenne for finding the root cause.
2021-04-29Fix T87779: Asymmetric position vertices in circles primitives.Campbell Barton
Incrementing a floating point value in a loop resulted in the vertex locations for circles in primitives being slightly asymmetric.
2021-04-29Fix build error: use of unintialized variableWannes Malfait
Differential Revision: https://developer.blender.org/D11115
2021-04-29Fix T87863: Bisect fails when edges of an N-gon lie on the planeCampbell Barton
Logic for bisect handled edges in the face crossing the plane, but not concave N-gons containing multiple edges that lie on the plane.
2021-04-15Fix missing NULL checks in adb21faa83d69069418d7bb14e0211261072f3a9Campbell Barton
2021-04-15Fix T70286: Dissolve vertices/edges creates duplicate faceCampbell Barton
2021-04-12Fix T87259: Un-Subdivide creates duplicate facesCampbell Barton
Add argument to BM_vert_collapse_faces to remove any faces that become duplicate as result of the collapse.
2021-04-09Cleanup: use our own code style for doxy-gen comment blocksCampbell Barton
2021-04-02Cleanup: Remove unecessary C API for direct mesh booleanHans Goudey
The main goal here is to remove the need for a C API to the code in `mesh_boolean_convert.cc`. This is achieved by moving `MOD_boolean.c` to C++ and making the necessary changes for it to compile. On top of that there are some other slight simplifications possible to the direct mesh boolean code: it doesn't need to copy the material remaps, and the modifier code can use some other C++ types directly.
2021-03-21Cleanup: spelling, doxygen comment formattingCampbell Barton
2021-03-20Bevel code: add a null pointer check.Howard Trickey
2021-03-18Cleanup: spellingCampbell Barton
2021-03-16Fix T86168: Add primitive Grid. Wrong number of subdivisionsPratik Borhade
Changes to increase subdivision by one along both axis (X and Y) For example with x_segment = 3 and y_segment = 3. There should be 16 vertices ((3 + 1) * (3 + 1)) for correct number of subdivisions. Currently they are 3 * 3 = 9 vertices. Ref D10699
2021-03-10Fix T67190: Edge Loop Select doesn't support non-manifold edgesPratik Borhade
- New Walker added `bmw_NonManifoldedgeWalker_type`. - This walks over edges connected with 3 or more faces connected. Ref D10497 with edits.
2021-03-08Speedup for usual non-manifold exact boolean case.Howard Trickey
The commit rB6f63417b500d that made exact boolean work on meshes with holes (like Suzanne) unfortunately dramatically slowed things down on other non-manifold meshes that don't have holes and didn't need the per-triangle insideness test. This adds a hole_tolerant parameter, false by default, that the user can enable to get good results on non-manifold meshes with holes. Using false for this parameter speeds up the time from 90 seconds to 10 seconds on an example with 1.2M triangles.
2021-03-02Cleanup: spelling, minor correctionsCampbell Barton
Also use doxygen comments for sculpt functions.
2021-03-01Cleanup: spellingCampbell Barton
2021-02-28Fix T86082 Bevel messed up UVs on some multisegment bevels.Howard Trickey
When polygons around a bevel are rebuilt, sometimes UVs are merged around a new vertex in the case of the face opposite a single edge being beveled on a 3-edge vertex. This should not have been done if any of the edges at that vertex were a seam.
2021-02-24Docs: clarify radial/cycle use for BMesh loopsCampbell Barton
Also add minor corrections clarifications elsewhere.
2021-02-22Fix T85753: Default UVs for Icosphere are flipped horizontallyPhilipp Oeser
These were flipped since their introduction in rBa070a5befa11. Maniphest Tasks: T85753 Differential Revision: https://developer.blender.org/D10465
2021-02-22Fix proportional connected not working with loose edges due to hidden geometryPablo Dobarro
This was introduced in the new geodesic distances algorithm for proportional editing. When all faces of an edge are hidden, that edge should be considered as loose geometry. Initial patch by Pablo with modifications by Brecht. Differential Revision: https://developer.blender.org/D10488
2021-02-17Cleanup: spellingCampbell Barton
2021-02-13Cleanup: macro hygiene, use parenthesis around operatorsCampbell Barton
2021-02-10Cleanup: spellingCampbell Barton
2021-02-10Cleanup: update old commentsCampbell Barton
2021-02-09Cleanup: spellingCampbell Barton
2021-02-07Fix T84493 et al: New Boolean on Suzanne.Howard Trickey
While Boolean is not guaranteed to work if the operands are not volume-enclosing (technically: PWN - piecewise constant winding number), it needs to do something in those cases. This change makes more cases meet user expectations in T84493, T64544, T83403, T82642 (though very slow on that one). The original new boolean code used "generalized winding number" for this fallback; replaced this with code that uses raycasting. Raycasting would have been faster, but for unfortunately also switchd to per-triangle tests rather than per-patch tests since it is possible (e.g., with Suzanne) to have patches that are both inside and outside the other shape. That can make it much slower in some cases, sadly.
2021-02-06UI: Fix Typos in Comments and Docsluzpaz
Approximately 91 spelling corrections, almost all in comments. Differential Revision: https://developer.blender.org/D10288 Reviewed by Harley Acheson