* Shift call to the Draw Face Set brush implementation as it is
irrelevant for other brushes.
* Instead of checking for the first brush step, check to see if the
value is still `SCULPT_FACE_SET_NONE`.
Pull Request: https://projects.blender.org/blender/blender/pulls/138949
The drawing of the background of panel categories is out by one pixel,
but was covered by the area borders until recently. This PR just draws
one pixel more to the edge.
Pull Request: https://projects.blender.org/blender/blender/pulls/138956
This converts the public `uiItemMenuF` and `uiItemMenuFN`
functions to an object oriented API (an `uiLayout::menu_fn`
and `uiLayout::menu_fn_argN_free` respectively), following
recent uiLayout changes.
Part of: #117604
Pull Request: https://projects.blender.org/blender/blender/pulls/138902
Currently, there was a lot of boilerplate to compute the compute context hash.
Now, the complexity is abstracted away to make it a simple function call.
Furthermore, this makes the compute context hash generation lazy. The goal here
is to make it very cheap to construct the compute context hash in the first,
while making it a little bit more expensive (still quite cheap overall) to
access the hash when any data has to be logged. This trade-off makes sense when
we want to pass the compute context to more lower-level places in order to be
able to create better error messages with more contextual information. For
example, we'd want to create error messages during multi-function evaluation
which happens during field evaluation within a node.
Pull Request: https://projects.blender.org/blender/blender/pulls/138912
This implements a new operator that automatically fits the width of a column to
its content. It's triggered by double-clicking on the column edge in the header
row. This is common functionality in other spreadsheet software.
Pull Request: https://projects.blender.org/blender/blender/pulls/138924
Currently, removing a node frame a frame is rather annoying. The `alt+P`
shortcut is hard to reach and probably not very intuitive. Furthermore, often
one only notices that one wants to remove a node from a frame after starting to
move the node. So one would have to put the node back down, detach it from the
frame and then start moving again.
This patch simplifies this entire process by adding a new shortcut that can be
used while dragging nodes. When `F` is pressed, the selected nodes are detached
from their parents. Alternatively, if the nodes are detached already, they may
be attached to the frame under the cursor.
Pull Request: https://projects.blender.org/blender/blender/pulls/138650
Currently, the steps required to add a named frame in the node editor are quite
cumbersome:
* Press ctrl+J, which is hard to reach.
* Press F2, to rename.
This is bad, because frames are a key part of making node trees understandable.
Therefore, we should lower the barrier to adding them as much as possible.
Additionally, named frames help significantly more with readability. Therefore,
it's good to lower the barrier to adding those even more. Of course it's still
possible to click in empty space to avoid having to give a frame a name.
This patch adds a new operator to join nodes in a named frame. When triggered,
it adds the frame and automatically opens the rename menu to set the name.
Keymap changes:
* Remove `ctrl+J` which was creating a frame without label.
* Move existing functionality of `F` key to `J` key
(including `shift+F -> shift+J`).
* Use `F` for this new operator to create a named frame.
Pull Request: https://projects.blender.org/blender/blender/pulls/138390
Replace `DRW_Attributes` with a VectorSet of std::string. The max number of
attributes is still the same. The inline buffer size is 4, and std::string's inline
buffer is smaller than the previous char array size of 64, but it seems
reasonable to save those optimizations for shorter attribute names and
fewer attributes. In return we significantly decrease the size of the batch
caches, simplify the code, and remove the attribute name length limit.
I observed roughly an 8% increase in the 30k cube objects file, a change from
12 to 13 FPS. I'm guessing this is mostly because `VectorSet<std::string>` is
smaller than `DRW_Attributes`.
Pull Request: https://projects.blender.org/blender/blender/pulls/138946
Regression caused by #138433
Somehow the lazy nature of the is_linear and is_srgb got lost in
the refactor and the fields were greedily initialized on startup
and it is not a cheap operation.
Pull Request: https://projects.blender.org/blender/blender/pulls/138945
Caused by 33bef53c3e
The change to return an empty IndexMask early from the clay strips brush
breaks some previous assumptions about data flow. To fix this, and
improve the overall resilance of related code to such changes, avoid
checking for a specific stroke step when initializing this data and
delay it in processing until needed.
Pull Request: https://projects.blender.org/blender/blender/pulls/138921
This avoid stalling the viewport when a preview job is running.
This is because both were fighting for the same GPU context.
This doesn't remove the blocking but allows to remove it using #136991.
Pull Request: https://projects.blender.org/blender/blender/pulls/138882
As evidenced by #138868, checking all colorspaces to see if they are sRGB
can be very slow, due to loading all LUTs into memory. Instead use a simpler
check by a list of names only, which is still better than the hardcoded
single name used in Blender 4.4.
Ideally recent configs will use the ColorInterop Forum alias so we can
find the sRGB colorspace reliably.
Switch from Standard Surface to OpenPBR as the exported MaterialX surface,
since this is the new standard more renderers are adopting and it more closely
matches the Principled BSDF implementation.
Anisotropy support is improved though still not quite the same, as formulas
are different. Nodes are generated to apply anisotropic rotation to the
tangent vector, as there is no corresponding parameter in OpenPBR.
Fixes#138164
Authored by Apple: Lee Kerley
Pull Request: https://projects.blender.org/blender/blender/pulls/138165
The F-Curve RNA path function assumed that the F-Curve would be owned by
an Action, which is not the case for drivers, NLA control curves, and
potentially other "free-floating" F-Curves.
This is now checked for, and if the owner is not an Action, the function
refuses to produce a data path. In the future this could be extended to
search through the aforementioned places as well.
Users almost always need a viewer node, so add one to the default node
tree.
Note that the backdrop is already enabled by default, so the backdrop
image will be visible as soon as a render is available (no need to
manually add viewer node or click `cltr+shift+LMB` to show a backdrop
image.
Pull Request: https://projects.blender.org/blender/blender/pulls/138890
This commit finishes removing the uses of the integer to float
vertex buffer fetch mode. Previous commits noted below already started
that process. The last usage was geometry attributes. Now integers are
converted to floats as part of the existing upload process.
The change makes the Vulkan vertex buffer type conversion unused, so
it's removed. That's nice because Vulkan vertex buffers go from 1040 to
568 bytes in size and have significantly less overhead on creation.
Related:
- 153abc372e
- 1e1ac2bb9b
- 617858e453
Pull Request: https://projects.blender.org/blender/blender/pulls/138873
The available mix modes on the Action Constraint only allowed
*combining* the Action's transforms with the input transforms, but
unlike most other constraints lacked a way to completely
override/replace those transforms.
This PR adds a "Replace" mix mode to the Action Constraint, bringing it
in line with most of the other constraints already in Blender.

----
Test file: [action_constraint_replace_mode.blend](/attachments/fc3417a8-b60a-4212-9840-5b59191e9ed9)
- The small bone at the top is the action constraint target (translating it right-left triggers the action constraint).
- Both two-bone chains are set up with action constraints. The base bones of each chain additionally have a copy location constraint to the small sideways bone, placed before the action constraint in their constraint stack.
- The chain on the left has the default mix mode, which allows you to manipulate the bones on top of what the action constraint does, and allows the copy location constraint on the base bone to work.
- The bones on the right have the new "Replace" mix mode, and therefore manipulating them does not affect the final constrained transformation, and the copy location on the base bone is overridden by the action constraint.
Pull Request: https://projects.blender.org/blender/blender/pulls/138316
The goal is to make the viewer node jump less often because each unnecessary
jump feels annoying. Previously, we already had a heuristic that would disable
the jumping if the new viewer location was further away than the old one. Now
the viewer never jumps when it's still visible in the node editor and already to
the right of the node-to-view.
As a byproduct this also fixes an issue where the initial viewer position does
not work properly, because the node does not have known draw-bounds yet.
Pull Request: https://projects.blender.org/blender/blender/pulls/138744
- Reduce artifacts during resizing to also recreate the swapchain
when acquire image is suboptimal
- Do not stretch when backbuffer and swapchain have a different size
Pull Request: https://projects.blender.org/blender/blender/pulls/138925
Always discard the context discard pile even when not submitted
When rendering animation it is not guaranteed that the submission
flag will ever be set.
This patch avoid clamping HSVA colors after being combined using a
Combine HSVA node in the GPU compositor. This is consistent with the CPU
compositor and other node editors.
This patch adds support for the Factor and Percentage subtypes for
vector sockets. This is needed by the compositor, since it has some node
inputs that specify locations and sizes relative to image size, and
having factor and percentage subtypes for those improves the UX quite a
bit according to user feedback.
Pull Request: https://projects.blender.org/blender/blender/pulls/138805
* Removes `SculptSession` from being passed to the raycast callbacks,
it was only used to determine the existence of the `StrokeCache` and
has been replaced with a boolean.
* Use C++ math library where possible.
* Use const where possible.
* Moves most related `SCULPT_` prefixed methods into the corresponding
namespace.
* Renames `SCULPT_stroke_get_location` to `stroke_get_location_bvh`
to avoid potential collisions in the `sculpt_paint` namespace with
other editors & be more clear about the usage.
Pull Request: https://projects.blender.org/blender/blender/pulls/138796
This is similar to how the value is shown when hovering over a value.
It's useful when the name does not fit into the column width.
Requested by Simon.
This patch renames `seq1` and `seq2` to `input1` and `input2` in `Strip`
and `StripSelection` structs to consist with recent refactors in
#132179. It also renames other instances of `seq1` and `seq2` (e.g.
local variables) to `strip1` and `strip2` instead.
There is only one small breaking change to the Python API with
`strips.new_effect()` taking in the new names now. There should be
no other functional changes involved.
Pull Request: https://projects.blender.org/blender/blender/pulls/138296
When using the View Normal automasking mode, the per-vertex calculation
is not prohibitively expensive, unlike the topology and boundary modes.
Additionally, we do not populate the view normal values in the cache
when the brush stroke starts.
Pull Request: https://projects.blender.org/blender/blender/pulls/138906
When performing a raycast into the paint BVH inside Sculpt Mode, there
are two possible values for the cursor's normal: the current vertex's
normal, or a sampled average of the normals in the cursor radius.
The "Grab Silhouette" option of the Grab brush and the "Area Normal"
option of brush automasking both use an initial normal value to
determine a relative influence factor. However, this normal was only
ever using the active vertex normal, not the sampled normal, leading to
a stronger than normal falloff on areas of a mesh that have a high
variance between individual vertex normals.
To further complicate matters, the "Area Normal" setting uses the
sampled normal when the Mesh Filter tool is used, but sculpt brushes
behave as described above. This commit aligns the behavior across all
tool types.
To fix this, check for the existence of this sampled normal when
populating the initial value and use it if found.
Pull Request: https://projects.blender.org/blender/blender/pulls/137692
Currently, depending on whether or not a brush asset is part of a
library, the context menu shown for it changes significantly.
To better support local brush asset modifications, and make the UI more
consistent, this commit exposes the following operators:
* `brush.asset_edit_metadata`
* `brush.asset_load_preview`
* `brush.asset_save`
* `brush.asset_revert`
Of these four operators, the first two are allowed to execute, whereas
the latter two are always disabled on local assets via the corresponding
`poll` methods, as neither is applicable for this usecase.
Related to #138105
Pull Request: https://projects.blender.org/blender/blender/pulls/138376
"Origin to Geometry" was also affected
With very large meshes (report was about this failing for imported
terrain data), we lack precision in `BKE_mesh_center_median`.
First intuition was to just use doubles, but based on the work done
in !132759 to get a more numerically stable way to compute a mean,
we can use that instead.
So this PR moves `compute_sum` into `blender::array_utils`
and re-uses that for `BKE_mesh_center_median`
Pull Request: https://projects.blender.org/blender/blender/pulls/138813
The Node Editor Add menu has filters for not drawing asset catalogs in
the root level. This is done so that catalogs that share names with
built-in menus are appended to said menus.
There is no "Unassigned" built-in menu, just a root level asset menu for
unassigned assets. This menu does not currently have the behavior to
support appending catalogs to it, so assigning assets to a catalog named
"Unassigned" renders said assets unaccessible in the Add Menu.
This patch removes that filter as it was deemed better to just allow the
user to have a root level catalog menu named "Unassigned" instead of
mushing it with the menu for unassigned assets.
Pull Request: https://projects.blender.org/blender/blender/pulls/138874