Instead of keeping track of a local array of positions in the modifier
stack itself, use the existing edit mode SoA "edit cache" which already
contains a contiguous array of positions. Combined with positions as a
generic attribute, this means the state is contained just in the mesh
(and the geometry set) making the code much easier to follow.
To do this we make more use of the mesh wrapper system, where we can
pass a `Mesh` that's actually stored with a `BMesh` and the extra
cached array of positions. This also resolves some confusion-- it was
weird to have the mesh wrapper system for this purpose but not use it.
Since we always created a wrapped mesh in edit mode, there's no need
for `MOD_deform_mesh_eval_get` at all anymore. That function was quite
confusing with "eval" in its name when it really retrieved the original
mesh.
Many deform modifiers had placeholder edit mode evaluation functions.
Since these didn't do anything and since the priority is node-based
deformation now, I removed these. The case is documented more in the
modifier type struct callbacks.
Pull Request: https://projects.blender.org/blender/blender/pulls/108637
ebe8f8ce71 and 5669c5a61b added multithreading but
a typo meant it wasn't used for half of the process. Fixing that gives a
30% improvement in my tests, from about 80 to 60 ms converting a grid.
No functional changes.
Previously, each navigation operation had its own method for restoring
the 3D View's state upon cancellation.
However, this approach did not provide significant advantages.
The number of affected variables was too small to justify considering
it for performance optimization, and the cancellation code was
duplicated across different operations.
To address this, the present commit unifies all restore code into a
single function:
- `void viewops_data_state_restore(ViewOpsData *vod);`
As a result, the `viewmove_apply_reset` function has been removed.
Moreover, since the state now has a dedicated restore function, it
seemed appropriate to create a function for capturing the state as
well.
Therefore, the code responsible for capturing the state (previously
scattered within `viewops_data_init_navigation`) has been extracted to
create the function:
- `void viewops_data_state_capture(ViewOpsData *vod);`
During this separation process, a potential error in the code was
identified, where the state may not be fully restored.
Although this issue persists, a comment has been added to clarify this
situation.
Pull Request: https://projects.blender.org/blender/blender/pulls/109760
Hierarchy lines (like we also have in the Outliner) make it easier to
visually parse the hierarchy, and avoid confusion about nesting level.
Especially when some items have icons and/or collapse chevrons and some
not (thus different levels of visual indentation).
They were planned for #93582 and #107881, also see
https://code.blender.org/2023/05/the-next-big-step-grease-pencil-3-0/#layer-groups.
The drawing is implemented as a general tree-view feature, so all
tree-views with collapsable items (which excludes the spreadsheet
data-set tree view) will get them without further setup.
The merging behavior of the Array, Mirror, Screw modifiers has changed
since 4369627e71.
Before, only the customdata of the destination vertex was kept. Source
vertices were completely removed.
With 4369627e71, all vertices in the merge group (whether source or
destination) now have their customdata interpolated.
But this can cause problems for example with the root vertex customdata
of the skin modifier, where if only one of the vertices of the group of
vertices has this flag, the resulting one will also have it.
This commit restores the behavior for the vertices customdata and does
not interpolate it if `do_mix_vert_data` is false.
Pull Request: https://projects.blender.org/blender/blender/pulls/109627
Only do `next++` if `next` is a non-`NULL` pointer. This doesn't change
the functionality of the code, but it does prevent a sanitizer warning.
No functional changes.
The FPS in the viewport is displayed in a string of the form "fps:
%.2f". The string that stores it is of length 16, which is plenty
enough in English. But the translated message in Hindi uses
Devanagari, which takes up 4 bytes per char. Because of this, it is
too long and there is not enough room for the numbers to actually
appear.
To solve this, the containing string length was doubled to 32 chars.
Pull Request: https://projects.blender.org/blender/blender/pulls/109408
Improve 3D text selection & feedback when moving the mouse outside of
the text. Previously mouse selection only worked if the mouse was over
the text, now there is more margin to select characters or lines.
Ref !109229
Co-authored-by: Campbell Barton <campbell@blender.org>
Co-authored-by: Harley Acheson <harley.acheson@gmail.com>
a8a454287a which moved edge creases out of `MEdge` only
retrieved the result data array if the mesh had vertex creases. Before
the processing always happened though. So process the result creases
if the input has edge creases too, and try to retrieve an existing array
instead of always adding a new one.
Add an offset indices utility to do fill constant size new offsets in
parallel, which was already done in the duplicate elements node.
For example, filling poly offsets for a new part of a mesh that is only
quads. In the extrude node this was single-threaded before, so the
new poly offsets is about 10x faster, saving about 10 out of 157 ms
when extruding 2 million faces.
In edit mode the uv map data length gets set to zero. The specialized
MLoopUV code used to have a check to detect this when trying to access
the UVs using foreach_get/set . Add this check for the Attribute code
path as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/109179
This moves the following `editors/*` directories to C++:
- animation, armature, lattice, mesh, metaball, object, scene.
Much of the changes in this commit (inserting casts in particular)
was automated. Further changes like switching to functional style
casts can be done separately by existing automated scripts.
See #103343
Pull Request: https://projects.blender.org/blender/blender/pulls/109715
First we copied the entire BMesh custom data layout to the Mesh, then we
decided not to copy some boolean layers like UV pinning if every value
was false. But that left the layers uninitialized. Instead, copy the
custom data layout _after_ finding which layers to skip.
The utility counts the number of occurrences of each index in an array.
It's used to build offsets for mesh topology maps, or to count the
number of connected elements. Some users are geometry nodes,
the subdivision draw cache, and mesh to curve conversion.
This PR parallelizes the counting to take advantage of multiple
threads. On a Ryzen 7950x, when counting connected edges to
vertices, I observed an improvement from 10.2 to 3.0 ms.
This most likely makes the counting less efficient, but it is
quite a nice performance improvement.
The new code was much slower for me at less than four threads,
so I added a check so that counting remains single threaded in
that case.
Pull Request: https://projects.blender.org/blender/blender/pulls/109628
The Texture margin 'adjacent faces' algorithm always used the
full UV map, even if not all polygons were actually part of the
baking. Remedy this by checking the mask if passed in.
Pull Request: https://projects.blender.org/blender/blender/pulls/109500
Instead of manipulating the selection attribute directly, we get an `IndexMask` of the random elements, and then apply the changes to the selection attribute in the operator.
Pull Request: https://projects.blender.org/blender/blender/pulls/109366
The file-name would be included twice, because an_stringdec worked
differently to BLI_path_sequence_encode.
Use BLI_path_sequence_{encode/decode} to resolve the issue.
While image-sequence `anim` doesn't seem to be relied on, it's
possible to use this code-path by referencing an image from a movie
sequence strip.