We weren't handling the failure case of `IDP_AddToGroup` when the
property already exists. Arguably this is a bit bad because we're not
recording the type of the second socket with the same name, but we
don't really have the tools to solve that with IDProperties.
Add a Mesh implementation of triangulation, which is currently just
implemented for BMesh. The main benefit of this is performance and
decreased memory usage. The benefit is especially large because the
node currently converts to BMesh, triangulates, and then converts back.
But the BMesh implementation is entirely single threaded, so it will
always be much slower.
The new implementation uses the principle of "never just process a
single element at a time" but it also tries to avoid processing _too_
many elements at once, to decrease the size of temporary buffers.
Practically that means the work is organized into chunks of selected
faces, but within each chunk, each task is done in a separate loop.
Arguably I went a bit far with some optimizations, and some of the
complexity isn't necessary, but I hope everything is clear anyway.
Unlike some other Mesh ports like the extrude node or the split edges
code, this generates a new mesh. I still go back and forth on that
aspect, but reusing the same mesh would have required reallocating
face attributes from scratch anyway. Implicit sharing is used to
avoid copying vertex attributes though.
The result mesh is reorganized a bit. Unselected face data comes first,
then selected triangles, then triangulated NGons, then triangulated
quads. This makes attribute interpolation and internal calculations
more efficient.
The "Minimum Vertices" socket is replaced with versioning. In the new
implementation it would have an impact on code complexity, and for a
builtin "atomic" node it makes more sense as part of the selection.
The performance difference depends on the number of CPU threads, the
number of attributes, and the selection size. As all of those numbers
go up, the benefit will grow. The "modes" also affect the performance,
obviously.
With a Ryzen 7950x, I tested performance in a few situations (in ms):
| | Selection | Before | After | Change |
| -------------------------- | --------- | ------ | ----- | ------ |
| 1.4 m quads (fixed) | 50% | 1533 | 15.9 | 96x |
| 10 m quads (shortest) | 100% | 9700 | 165.0 | 59x |
| 1 m 10-side Ngons (beauty) | 90% | 3785 | 115.9 | 33x |
| 1 m quads many attributes | 100% | 54600 | 332.3 | 164x |
In follow-up commits, I'll move other areas to use mesh triangulation
instead of BMesh. This is the last geometry node using BMesh besides
the Ico Sphere primitive.
Pull Request: https://projects.blender.org/blender/blender/pulls/112264
When we enter Sculpt mode, a depsgraph evaluation is triggered. In 4.2,
a change was added in ada367a0e9 which
causes `sculpt_update_object` to exit early if it is unable to get the
evaluated mesh.
This function is responsible for ultimately ensuring the PBVH is built.
Later on when entering Sculpt Mode, we push an undo change to the stack
to signal changing and avoid a memfile undo push; this `undo::push_begin`
function was changed in 4.3 to require the PBVH, as it was expected to
only be used for cases where we needed the total number of mesh elements
(i.e. when making a stroke on the mesh)
Currently, this causes a crash because in this instance, the PBVH is now
no longer created. To fix this, this commit adds a new function to the
sculpt undo namespace to indicate that thsi special undo step is being
performed, which is similar to a geometry undo step and does not require
the PBVH.
Pull Request: https://projects.blender.org/blender/blender/pulls/130649
Affects both the Slide Relax brush when using the `shift` smooth mode
and the Relax mode of the mesh.
This commit simply changes the `calc_vert_neighbors_interior` method for
`calc_vert_neighbors` in the shared functions to avoid filtering out
boundary vertices by default.
Pull Request: https://projects.blender.org/blender/blender/pulls/130697
As part of the overall sculpt brush refactor project, the `corner_tris`
attribute was removed from the PBVH and accessed directly from the mesh
runtime data.
A new set of methods was introduced to the `TrianglesCache` `struct` to
prevent tagging the cache as dirty and requiring a subsequent evaluation
because the performance hit while in sculpt mode was significant. This
was enabled upon entering sculpt mode and disabled upon exiting it.
Unfortunately, there are some operations inside Sculpt mode which can
cause either the Mesh object itself or the MeshRuntime object to be
recreated, effectively unfreezing the cache. A few examples that cause
this are:
* Undoing the first brush operation on file load
* Performing a remesh operation
To fix this issue, this commit checks and re-freezes the cache if it
is detected to be in a bad state prior to tagging the cache as dirty.
Further changes to fix this on a more fundamental level are well
outside of the scope of a fix needed for 4.3.1.
Pull Request: https://projects.blender.org/blender/blender/pulls/130709
Changes to area splitting when dragging from a corner action zone.
Increases the distance you must drag into the area before anything
starts. Increases minimum size that you can create to about 2X the
header height. Slight snap to 50% when no modifier keys are held.
Pull Request: https://projects.blender.org/blender/blender/pulls/130706
Previously the spreadsheet always used vertex selections to figure
out which geometry elements to display. This caused unexpected
filtering because of generic domain propagation rules.
Instead, implement filtering separately for each domain. This
requires a bit more boilerplate but the code is much clearer
and should be a bit more efficient too.
I found the naming of these files awkward, where we prefixed them with
`asset_library_` to keep them grouped together, and then a library type
name. This resulted in rather un-natural names. Also, there are files
like `asset_library_service.cc`, which is in fact not another asset
library type, but seems like one with the old convention.
Moving these files to an own directory keeps the grouping while allowing
more natural sounding names.
Older drivers seems to not work correctly and stall on the first frame.
We encourage users to use the latest driver and this driver support
devices from GTX 750 to RTX 4000 series.
NOTE: Later we should review this issue as supporting more drivers is
always better. The current issue could also be related to sending empty
command buffers to the GPU. Ideally we should support 535 as well.
Some Linux distributions don't package 550.
Ref: #129157
Pull Request: https://projects.blender.org/blender/blender/pulls/130737
!129062 introduces a workaround for dynamic rendering. However that
change didn't marked dynamic rendering as an optional feature. GPU that
didn't had dynamic rendering would still not be able to start Blender.
This PR marks dynamic rendering optional so the device will be
considered when searching for compatible GPUs.
Ref: #129157
Pull Request: https://projects.blender.org/blender/blender/pulls/130736
Removes redundant variables and duplicated logic. Some expressions
simplified. Refactored to make use of `OffsetIndices`. For example,
`Span<IndexRange> curve_interval_ranges` is rewritten into
`OffsetIndices<int> intervals_by_curve`.
Pull Request: https://projects.blender.org/blender/blender/pulls/130229
Previously, it wasn't possible to copy a drawing from one frame to another
if that drawing was in another layer or object.
This allows the `frame.drawing` property to be set to any another drawing.
Setting `drawing` to `None` clears the drawing geometry.
Pull Request: https://projects.blender.org/blender/blender/pulls/130523
When binding sRGB textures as attachment to a none-sRGB framebuffer the
attachment description didn't match the image view. This results into a
validation error. This PR makes sure that the description and image view
uses the same VkFormat.
Pull Request: https://projects.blender.org/blender/blender/pulls/130730
Clamping the filter size when using scaling factor > 1 fixes
the issue.
Without this, the filter becomes a dirac and samples gets
only the fallback weight. This would results in a box
blur instead of no filtering.
Xray mode also need to draw the object surfaces.
The only difference is that the depth test is disabled
by `select_bind`. So the prepass do not write to depth
and it is safe to enable.
This patch makes it so collection assignments of bones are
symmetrized when the "Symmetrize" operator is run.
* Only collections with names that can be symmetrized are modified.
* Collections are created if they don't exist,
they are created under the same parent as the source collection
* In the case of a "left" bone assigned to a "right" collection the
resulting "right" bone will be assigned to a "left" collection.
The system does explicitly not try to be smart here.
Also adds unit tests.
Pull Request: https://projects.blender.org/blender/blender/pulls/130524
Copying editors to the swap chain is done by a series of draw and copy.
When doing draw, copy, draw the swap chain layout was not matching the
draw command as it resumed previous rendering.
This is solved by validating the pipeline barriers when resuming rendering.
There are also other cases that required this which have been updated.
Pull Request: https://projects.blender.org/blender/blender/pulls/130721
`eGP_FillDrawModes` case is ignored. When it's edit line, set
`radius_scale` to 0. Otherwise, vertex buffer will write value for thickness
attribute in vertex buffer inside `draw_grease_pencil_stroke`. Looking at
the `gpu_shader_gpencil_stroke_vert.glsl`, thickness attribute is later used
to tweak vertex position.
Pull Request: https://projects.blender.org/blender/blender/pulls/130578
This is incorrect after the changes in 839108f623.
It was only happening for non edit-mode object evaluation anyway
so it likely didn't have any effect in practice.
The legacy option is turned off by default and will be removed
in the following weeks. It is only there to check for
regression for a short period of time. Afterward checking
for regression will require to use 4.3 as a reference.
Rel #102179
Pull Request: https://projects.blender.org/blender/blender/pulls/130683
For this to work, we sample the infront second depth and mix it appropriately
to occlude the grid.
The content of the infront framebuffer can be undefined in this
case, so we clear it when appropriate.
Pull Request: https://projects.blender.org/blender/blender/pulls/130625