In edit mode, positions of selected points is not shown in transform
side panel. Following existing logic, now introduced
`TransformMedian_GreasePencil`, `TransformMedian_Curves` to track the
median of selected points of grease pencil and Curves respectively.
Resolves#136332
Pull Request: https://projects.blender.org/blender/blender/pulls/136592
When the user filters channels by name, collapsed channel groups weren't getting
filtered properly.
For example, consider the following situation:
- You have a channel group "Transforms" with the F-Curve "X Location" under it.
- You use the name filtering feature with the string "Z".
The single F-Curve under the group will get filtered out by the string, and thus
should be hidden. That also means that the group, now with no visible f-curves,
should also no longer be displayed.
With this bug, if the channel was expanded then this filtering still proceeded
correctly, and both the f-curve and the group were hidden. However, if the group
was *collapsed* then the group would *not* get filtered out, which is incorrect.
The underlying cause is that an early-out "we found an un-filtered fcurve,
that's all the info we need with these flags!" clause in the f-curve filtering
code was happening too early, so it wasn't accounting for name-based filtering.
This PR fixes the issue by moving that early-out code to *after* the name-based
filtering so that it's properly accounted for.
Pull Request: https://projects.blender.org/blender/blender/pulls/136929
The issue was that the offset would offset by a different
amount depending on the scale property.
This is a regression from the legacy behavior,
and also harder to control in general.
The versioning code only touches FCurves that are not marked
as "legacy" because the legacy noise didn't have that issue.
Pull Request: https://projects.blender.org/blender/blender/pulls/136502
The `Use Uniform Width` option did not work the intended way.
Like the comment and the manual says it should "enforce uniform
stroke width by averaging radius".
Instead (as far as I understand) it was simply checking if the stroke had
radii that were all within some margin from one another and then
returning the first radius if that was the case.
There were two other issues:
1. The widths were not computed correctly, multiplying the pixel size
instead of dividing it.
2. The epsilon to compare the radii was a bit too high (factoring in the
first issue, this actually never returned a value).
This now computes the widths in screen space and then returns the mean.
Pull Request: https://projects.blender.org/blender/blender/pulls/136903
When file with legacy GP is opened in newer version, dopesheet
channel color is not transferred, they appear dark instead. To
fix this, copy color value from legacy GP layers in versioning code.
Pull Request: https://projects.blender.org/blender/blender/pulls/136876
Partial redrawing of the 3d viewport has not worked since the transition
to 2.8. Despite this, we still calculate the paint BVH bounds of the
affected area.
To avoid this wasted work and simplify the code, we remove the related
functions. Further work to enable partial redraws would not necessarily
be integrated in the same way. Additionally, a minor speedup of 1.05x
(1.00ms to 0.95ms) can be observed with this commit when performing
weight painting on a mesh with 2 million elements.
Similar to #136471
Pull Request: https://projects.blender.org/blender/blender/pulls/136912
When sculpting high-res meshes, the total number of nodes in the BVH
tree can get quite high and — especially when the brush radius is low —
comparable to the number of vertices influenced by the brush. Under
these conditions, algorithms that run on each node of the BVH,
especially if single-threaded, can become a bottleneck. This issue is
particularly prominent in multires, where the leaf limit is 2500.
The main culprit is `BKE_pbvh_redraw_BB`, which is used when flushing an
update to calculate the redraw bounds. Because partial drawing is
currently broken, and because a future reimplementation of partial
drawing is unlikely to adopt the existing approach, this PR removes the
partial drawing logic from `flush_update_step`.
This patch provides a speedup ranging from 1.25x to 1.45x, depending on
the brush size, when sculpting a small portion of a multires mesh with
roughly 8.1 million faces and 12.6 million vertices using the draw
brush.
Pull Request: https://projects.blender.org/blender/blender/pulls/136471
* Change #define constant value to static constexpr
* Adds const where possible
* Uses reference instead of pointer where possible
* Uses `float3` instead of raw float array where possible
* Uses std::optional to indicate value that may be null
* Reduces scope of variables where possible
* Uses `std::array` instead of raw arrays where possible
* Combines assignment and declaration where possible
* Lengthens some names from single letters
Pull Request: https://projects.blender.org/blender/blender/pulls/135486
Changes only noticeable to pen users, this PR changes the status bar
information while pressing down on the corner zones but before moving
more than the threshold to start. Split-specific is not shown until
the threshold is met. Most mouse users are dead-still at this point,
but pen users have more movement which currently causes a status bar
change.
Pull Request: https://projects.blender.org/blender/blender/pulls/136900
Mistake in 4d7274b7f4.
The Previous code:
```
float(*deformedVerts)[3] = *deformcos;
float(*origVerts)[3] = static_cast<float(*)[3]>(MEM_dupallocN(deformedVerts));
```
Didn't create a copy of the positions for the `deformedVerts` variable.
It's meant to modify the input position array. It was probably done that way
since dealing with pointers to pointers in C was annoying. With `Array`,
it's not annoying anymore, we can just use that directly.
When the evaluated mesh doesn't have an edit mesh that corresponds
to the original edit mesh, don't use evaluated deformed positions, just
use the mesh's original positions instead.
It's better for performance to use a single thread pool for all areas of
Blender, and this gets us closer to that.
Bullet, Quadriflow, Mantaflow and Ceres still contain OpenMP code, but it
was already disabled.
On macOS, our OpenMP libraries are no longer compatible with the latest
Xcode 16.3. By removing OpenMP we no longer have to solve that problem.
OpenMP was disabled for bpy module builds on Windows ARM64, which also no
longer needs to be solved.
Pull Request: https://projects.blender.org/blender/blender/pulls/136865
To make adding a dependeny on TBB easier.
Additional changes:
* Using LIB for libmv tests, as it now brings in includes
* Removing Eigen header listing in iTaSC
Pull Request: https://projects.blender.org/blender/blender/pulls/136865
GPU_DEPTH_NONE leads to issues with Intel GPU drivers on Windows
where camera gizmos cannot be shifted. glGetQueryObjectuiv for
GL_SAMPLES_PASSED seems to return zero in all cases.
This might be due to undefined behavior of OpenGL when the depth
test is disabled and rendering to a depth render target-only
framebuffer. Using GPU_DEPTH_ALWAYS fixes the issue.
Pull Request: https://projects.blender.org/blender/blender/pulls/136607
Previously pressing `c` to cut through mesh will only update knife cuts
when mouse is moved again, this means if you press `c` at the end of
mouse stroke, it will not update cuts and you end up still only cutting
front faces. This fix makes it that the toggle refreshes knife cuts
immediately.
Pull Request: https://projects.blender.org/blender/blender/pulls/136870
`win->ime_data` could be non-null when it's read from a file, and
subsequent dependence of this value would crash on interface handlers.
Now always clear it when ghost window is ensured after reading the file.
The actual reset is put in `wm_window_ensure_eventstate`, since it's
also conceptually a part of "event state".
Pull Request: https://projects.blender.org/blender/blender/pulls/136833
Under some circumstances the `value_task` run by node tree updates
needs access to a node group topology cache. Unlike the `usage_task`
it was not ensuring the cache for the node group, so a stale cache
could be used (triggers assert).
Pull Request: https://projects.blender.org/blender/blender/pulls/136878
This was an issue previously not noticed. There were two bugs:
- When an out of range index was somehow detected, line art discards the
entire stroke after the point, which causes remaining point positions
to be invalid. In fact the index should never go out of range unless
total points in the scene exceeds `size_t`.
- Line art point index is global, not local to objects, previously the
"object starting index" was not subtracted from the final point index
when transferring weights, this will lead to incorrect weight being
transferred/discarded.
Now both problems have been properly taken care of.
Pull Request: https://projects.blender.org/blender/blender/pulls/136869
The goal is to be able to switch away from OpenMP by default.
In order to achieve this a new parallel_for() function is added,
which follows the same declaration as the one from TBB. For now
the simplest formulation is used where range is provided by start
and last indices (the last one is excluded from the range).
The side effect is that Libmv now expects the threading limits
to be imposed by the default thread area (or have an explicit
thread area with the limit in the caller). In a way this is
similar to other external libraries.
Pull Request: https://projects.blender.org/blender/blender/pulls/136834
Caused by not checking against key array size. The issue was introduced
in ee9e4ead8d. It looks like mistake done during refactoring, because
the code was supposed to fix previous transition segment, not only the
next one.
The previously code attempted to reduce levels of indentation, but it
was less readable and error prone. Now it should be more obvious what
the intent is.
Pull Request: https://projects.blender.org/blender/blender/pulls/136743
The bug was partially caused by the fact that
`translate_snap_increment_ex` would interpret sequencer-specific
snapping bit `SEQ_SNAP_TO_FRAME_RANGE` as `SCE_SNAP_TO_INCREMENT`. Add a
check to fix this.
Technically, #122759 never added snapping for cursors in the preview,
but we can take this opportunity to also add the support, which is
relatively simple.
Pull Request: https://projects.blender.org/blender/blender/pulls/136579
* Replace #define with constexpr
* Use float3 instead of float[3]
* Use C++ math library
* Use return values instead of r_ prefixed arguments
* Use const where possible
Pull Request: https://projects.blender.org/blender/blender/pulls/136851
Part of #131825
Currently, no change to an RNA property invoked from the UI while inside
Vertex Paint mode creates an undo step. This includes both tool
properties (e.g. brush size, tool settings) as well as mesh properties
(symmetry, active vertex group, selection mode).
This behavior was initially introduced to avoid creating extra undo
steps when painting or sculpting and changing tool settings, however,
it applied to all property changes performed while in any paint mode,
including changes to mesh datablock properties.
To fix this behavior, this commit removes the usage of the sculpt undo
system from Vertex Paint and removes it from the list of modes that
are incompatible with memfile undo.
This switch from Sculpt Undo to Memfile Undo improves the performance of
the undo operator from 90ms to 9ms, representing a 10x speedup.
This speedup is possible because Vertex Paint is not fully integrated
with the Paint BVH drawing system, which normally has the benefit of
skipping depsgraph reevaluation and subsequent BVH rebuilding on each
stroke.
Anecdotally, when painting with large strokes on a mesh of 2 million
vertices, this change to using Memfile undo also uses anywhere from
half as much to a third as much memory compared to the Sculpt Undo
implementation (6 GB vs 2 GB).
Pull Request: https://projects.blender.org/blender/blender/pulls/135830
Part of #131825
Currently, no change to an RNA property invoked from the UI while inside
Vertex Paint mode creates an undo step. This includes both tool
properties (e.g. brush size, tool settings) as well as mesh properties
(symmetry, active vertex group, selection mode).
This behavior was initially introduced to avoid creating extra undo
steps when painting or sculpting and changing tool settings, however,
it applied to all property changes performed while in any paint mode,
including changes to mesh datablock properties.
To fix this behavior, this commit removes the usage of the sculpt undo
system from Vertex Paint and removes it from the list of modes that
are incompatible with memfile undo.
This switch from Sculpt Undo to Memfile Undo improves the performance of
the undo operator from 90ms to 9ms, representing a 10x speedup.
This speedup is possible because Vertex Paint is not fully integrated
with the Paint BVH drawing system, which normally has the benefit of
skipping depsgraph reevaluation and subsequent BVH rebuilding on each
stroke.
Anecdotally, when painting with large strokes on a mesh of 2 million
vertices, this change to using Memfile undo also uses anywhere from
half as much to a third as much memory compared to the Sculpt Undo
implementation (6 GB vs 2 GB).
---
Similar to !135758
### Implementation Notes / Thoughts
An alternate approach to getting similar if not better performance in Vertex Paint mode is to integrate it with `BKE_sculptsession_use_pbvh_draw` and `flush_update_step`, however this represents an unknown amount of work and does not reduce the number of consumers of Sculpt Undo. Given that the general direction in the module right now is to reduce dependency upon this system and migrate more to using Memfile undo where possible, spending extra effort on integration does not seem like the correct decision to make.
### Testing
* Verified undo step is created when selection mode is changed
* Verified undo step is created when symmetry is changed
* Verified undo step is created when active color attribute is changed
* Verified undo step is created when color attribute underlying data is changed
Pull Request: https://projects.blender.org/blender/blender/pulls/135830
The scene isn't being changed here, especially object selection. The mesh
is being changed though (or rather its shape key data-block, but that really
means the objects using it need to be reevaluated). For some reason this
doesn't make a functional difference currently though.
- Remove useless wrapper function that checked redundant invariants
- Use Vector instead of looping over context variable twice
- Use references instead of pointers
- Make variable names non-cryptic
- Remove useless comment
- Use continue instead of indenting the rest of loops
- Fix grammar and improve text in comment