Commit Graph

150077 Commits

Author SHA1 Message Date
Pratik Borhade
703fce10f9 Fix: Complier warning
Following warning triggered after 6a90382390
`C4312: conversion from 'const uint' to 'const void *' of greater size`
As Jacques mentioned in the chat, do additional casting to resolve the
error.

Pull Request: https://projects.blender.org/blender/blender/pulls/138190
2025-05-02 07:51:30 +02:00
Pratik Borhade
3a3265581b Fix: Code comment about ignoring scale/rotate lock flags in global orientation
After 5f7d5c0809, just translate gizmo is listening to protection flags
in global orientation. Commit doesn't specify the reason behind the
change. It intentionally ignores scale/rotate lock flags in global
orientation. Added a code comment to explicitly mention the reason
behind it.

Resolves #116666

Pull Request: https://projects.blender.org/blender/blender/pulls/133286
2025-05-02 07:01:57 +02:00
Campbell Barton
9eb9493ecd Fix: build error WITH_CYCLES_OSL & GCC 15.1
Ref !138238
2025-05-02 14:22:27 +10:00
Jesse Yurkovich
bf6c847464 Tests: USD: Run the compliance validator for the MaterialX export test
We recently pulled in the upstream patch to address the incorrect
validation error we were experiencing. This was the only test which
previously required the validator to be disabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/138289
2025-05-02 06:19:28 +02:00
Sean Kim
e5e7b6232a UI: Add labels for local and essentials assets in tooltip
This commit changes the asset tooltips for Local and Essential assets to
include a static string indicating their library type.

Related to #138105
2025-05-02 02:16:29 +02:00
Sean Kim
0491c2c233 Fix #136940: brush.asset_save_as crashes in background mode
Calling `brush.asset_save_as` both creates an asset and also activates
the corresponding brush. When run while Blender is in background mode,
the `active_tool->runtime` field may be null. To avoid crashing in this
case, check for null when comparing active tool data.

Pull Request: https://projects.blender.org/blender/blender/pulls/138245
2025-05-02 00:45:06 +02:00
Hans Goudey
20b471e851 Cleanup: Resolve missing declaration warning 2025-05-01 16:05:00 -04:00
Clément Foucault
877abbe9f7 Cleanup: EEVEE: Remove next from EEVEE-Next from tests suite
It makes no sense to keep this suffix now that eevee-next is default.

Pull Request: https://projects.blender.org/blender/blender/pulls/138271
2025-05-01 17:54:22 +02:00
Sietse Brouwer
668aed18e9 Grease Pencil: Viewport option for showing onion skins of the active object only
This PR adds an option to only show the onion skins of the active
object. The option is added to the Grease Pencil overlay menu in the
3D viewport.
When enabled, only the onion skins of the active object are shown.
This keeps the viewport a lot cleaner when working with multiple
Grease Pencil objects.

This resolves #136820.

Pull Request: https://projects.blender.org/blender/blender/pulls/137405
2025-05-01 17:43:17 +02:00
Guillermo Venegas
5e2a856566 UI: Add shortcut to show active sidebar tab
Add a keyboard shortcut  (numpad period) to show the active sidebar
tab, so users can locate the tab without scrolling.

Pull Request: https://projects.blender.org/blender/blender/pulls/107752
2025-05-01 17:32:51 +02:00
Nathan Vegdahl
4e7dfcbe3f Modeling: Add Auto Normalize when Assigning vertex weights
Part of #135062.

This PR adds an Auto Normalize option in the Vertex Group panel that
when checked will normalize the other deform-bone vertex groups' weights
when assigning the weight of a deform-bone vertex group. For example if
a selected vertex has the following weights:

| Name    | Weight |
|---------|--------|
| Group 1 | 0.2    |
| Group 2 | 0.2    |
| Group 3 | 0.6    |

And the user selects Group 3, checks the Auto Normalize checkbox, sets
the weight to 0.8, and clicks Assign, the new weights will be:

| Name    | Weight |
|---------|--------|
| Group 1 | 0.1    |
| Group 2 | 0.1    |
| Group 3 | 0.8    |

Co-authored-by: Andy Beers <acbeers1@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/138133
2025-05-01 16:08:10 +02:00
Jeroen Bakker
41a69b76a6 Partial Fix #129592: Vulkan: Add support for line size
Add-ons can call a batch draw command for lines using a surface shader.
This is not intended and polylines shaders should be used. This PR
lighten this restriction to automatically replace the shader with the
correct polyline shader, similar to immediate mode.

This change is done inside the python wrapper as internally we should
use the correct polyline shader.

For point shaders we don't have a work around in place and that needs
more discussion. Therefore this is only a partial fix.

Pull Request: https://projects.blender.org/blender/blender/pulls/138138
2025-05-01 15:44:40 +02:00
Mattias Fredriksson
b028384749 Cleanup: Pass pointer to get_item_as()
Overloaded version for utility function `get_item_as()` taking a pointer
as an argument (rather then reference) performs type verification,
avoiding the additional manual check.

Pull Request: https://projects.blender.org/blender/blender/pulls/138067
2025-05-01 15:40:14 +02:00
Habib Gahbiche
90ea4f88f3 Refactor: Use test fixtures and C++ style initialization
Initiliaze global context only once per test suite. Test data relevant
to the respective tests is still allocated and freed with every test
case.

Also, `scene->nodetree` will be deprecated in a future PR, so use
`material->nodetree` to test embedded trees instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/137895
2025-05-01 15:37:26 +02:00
Omar Emara
4d0a70f638 Compositor: Remove unused Defocus node options
This patch marks the Preview and Threshold options as deprecated and
removes them from the UI. They have been unused since 4.3.
2025-05-01 15:59:43 +03:00
Omar Emara
a31dcdf5b5 Compositor: Remove Variable Size blur option
This patch removes the Variable Size blur option from the Blur and Bokeh
Blur nodes. So now, whatever the user connects to the size input will be
used, be it variable or constant.

The option previously could be used to force the node to ignore variable
size inputs and assume a size of 1, so it was useless.

Versioning would be difficult, as we don't know if incoming links to the
size input is variable or single. So this is a breaking change. But I
can't think of a real reason why the user might use this option, so this
seems safe from a practical point of view.

Pull Request: https://projects.blender.org/blender/blender/pulls/138261
2025-05-01 14:58:10 +02:00
Pablo Vazquez
bb215a37e2 UI: Keymap: Show alert when operator or property not found
When a keymap operator is not found, color the label and input field
in red. This can help identify issues when migrating preferences and
some operators no longer exist.

Screenshots in the pull request.

Pull Request: https://projects.blender.org/blender/blender/pulls/130675
2025-05-01 14:50:49 +02:00
Philipp Oeser
a5967aae81 Fix #138177: Wrong rearranging channel groups in the Dope Sheet
Similar to !138193

We are going over the `bAnimListElem` nested / multiple times:
- once in `animchannels_rearrange_exec`
- then again in `rearrange_layered_action_channel_groups`

So we are basically just rearranging **multiple times** (unnecessarily
for unrelated actions)

So to resolve, pass the current action to
`rearrange_layered_action_channel_groups`, then skip `bAnimListElem` if
its action does not match the action passed in.

Pull Request: https://projects.blender.org/blender/blender/pulls/138196
2025-05-01 14:20:32 +02:00
Sybren A. Stüvel
781e15671b Fix #138177: Wrong rearranging channel groups in the Dope Sheet
Fix an issue where rearranging animation channels ("Move Up", "Move
Down", etc.) would take multiple steps. This was caused by the Action of
these channels being visited multiple times, and each visit taking a
step.

Pull Request: https://projects.blender.org/blender/blender/pulls/138257
2025-05-01 14:14:37 +02:00
Lukas Tönne
ed93044f70 Fix #138206: Pasting nodes is ignoring offset for frame children
The copy/paste function for nodes is offsetting the node centroid to the
mouse cursor. This was skipping direct children of selected frames, because
the node position was originally relative to the frame parent. This behavior
changed in 4bf34d95, which causes child nodes to remain stuck at their
original location.

All nodes should simply be offset now, since their positions are no longer
relative.

Pull Request: https://projects.blender.org/blender/blender/pulls/138252
2025-05-01 13:41:47 +02:00
Hans Goudey
2894fd79d4 Vulkan: Inline small data conversion function
In a profile of sculpting with the Vulkan GPU backend enabled,
This function made up 0.7% of samples. Since it's just a single
comparison, inlining it should be helpful for the compiler.

Pull Request: https://projects.blender.org/blender/blender/pulls/138210
2025-05-01 13:37:36 +02:00
Campbell Barton
e1e0c041cf Fix: incorrect peak sharpen calculation with the ocean modifier
The initial port [0] incorrectly use `sqrt` where `sqr` was used in the
original code. This mistake was made in two places but the second
causes a significant change in behavior, so this has been left as is
noting the difference in a comment.

Resolve the following issues:

- Use square instead of sqrt when calculating the peak value,
  besides following the original implementation it avoids the result
  being NAN when "Fetch" is below 30.

- Pass in `sqrt(m_omega)` matching the `omega` argument to
  `alpha_beta_spectrum` as well as following the upstream code.

In most cases the user visible changes are subtle.

Ref !137607

Co-authored-by: Nicolas Paris <nicolas.paris490@gmail.com>

[0]: 6ce709dceb
2025-05-01 11:04:45 +00:00
Sybren A. Stüvel
2e0a8ea027 Fix: memory leak when rearranging animation channels
Fix a memory leak when moving animation channels up/down.

Pull Request: https://projects.blender.org/blender/blender/pulls/138256
2025-05-01 12:38:39 +02:00
Philipp Oeser
4c7c26440a Fix #138162: Crash rearranging ungrouped channels the Dope Sheet
This happend to ungrouped channels and in the case other Actions are
also visible in the Dopesheet (e.g. by having multiple objects
selected).

We are going over the `bAnimListElem` nested / twice:
- once in `animchannels_rearrange_exec`
- then again in `rearrange_layered_action_fcurves`

The inner workings are tied to specific actions from the first loop, but
we are going over FCurves possibly contained in **other** actions in the
second loop. Doing this with the "wrong" action goes wrong (e.g. in
`get_group_or_make_fake` where we try to get a channelbag for an FCurve
slot handle in the "wrong" action).

So to resolve, skip `bAnimListElem` if its action does not match the
action passed into `rearrange_layered_action_fcurves`

Pull Request: https://projects.blender.org/blender/blender/pulls/138193
2025-05-01 12:29:35 +02:00
Nathan Vegdahl
30698cf885 Fix #137932: compute correct armature bounds
There were actually two issues here:

1. The dimension reported for armatures were often wildly incorrect,
   including negative values and zero!
2. The dimensions reported for objects are supposed to be invariant with
   rotation, representing the dimensions along the object's local axes.
   However, armature objects' reported dimensions changed with rotation.

The respective causes were:

1. `BKE_armature_min_max()` was using an incorrect formula (acknowledged
   in a comment) for transforming the bounding box between spaces. This
   worked fine for some of the places that `BKE_armature_min_max()` was
   called, since they just reverse the transform using the same(!)
   erroneous formula, but it didn't work for others.
2. `BKE_armature_min_max()` first computed the bounds in world space,
   and then transformed them into object space, rather than computing
   them in object space directly like the respective functions for other
   object types. Even when done correctly, this causes the reported
   dimension to vary with rotation.

This PR fixes these issues by simply computing the armature bounding box
in object space directly instead.

There is one place in the code base that was directly using the
world-space bounds: `view3d_calc_minmax_selected()`. However, for every
object type other than armatures, it takes the object-space bounds and
transforms them (with an incorrect formula!) to world space.  So this PR
also changes `view3d_calc_minmax_selected()`'s armature code to do the
same, except with a correct formula.

Note that the reason for using the correct transform formula (departing
from other object types) is that the world-space bounds for armatures
were already correct prior to this PR due to being computed in that
space. Therefore using the incorrect formula has the potential to
introduce regressions in this case.

Pull Request: https://projects.blender.org/blender/blender/pulls/137961
2025-05-01 12:25:52 +02:00
Sybren A. Stüvel
a3b8ea843c Anim: Add 'unshare' node to driver evaluation dependency graph
Add a new node to the dependency graph, to act as a single entry point
before drivers are evaluated in parallel.

The node will take all the driven RNA properties, and write their
current value to the property again. This ensures that any implicitly
shared data is copied to ensure writability. Subsequent concurrent
writes by the driver evaluation will then be safe, as the
thread-unsafe part has already been performed.

Fixes: #132423

Pull Request: https://projects.blender.org/blender/blender/pulls/135802
2025-05-01 11:49:21 +02:00
Habib Gahbiche
987fc14ada Cleanup: simplify logic in node tree iterator
Return separately for each node tree type.

This patch originally started as a refactor to change the logic of
iterating through compositing node trees but we ended up choosing
a different solution so only the small cleanup part is submitted here.

Pull Request: https://projects.blender.org/blender/blender/pulls/138205
2025-05-01 11:08:13 +02:00
Habib Gahbiche
5c801a7600 Cleanup: Initialize memory of default materials
Pull Request: https://projects.blender.org/blender/blender/pulls/138219
2025-05-01 10:58:24 +02:00
Omar Emara
510130de07 Compositor: Turn Bilateral Blur options to inputs
This patch turns the options of the Bilateral Blur node into inputs.

In the process, the Sigma Space and Iterations were joined into a single
Size input, previously they were just added together then ceiled to get
the blur size. Furthermore, Sigma Color was renamed to threshold and now
represents the average color difference, not the sum, so it was
previously multiplied by 3.

Versioning and RNA compatibility is not perfect due to joining the two
size options.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/138249
2025-05-01 09:57:57 +02:00
Jordan Henshaw
10113a119e UI: Add missing periods to Overwrite file dialogue message
The paragraph message in the Overwrite File dialogue is missing periods.
Now added in this PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/127953
2025-05-01 08:46:02 +02:00
Sergey Sharybin
d568b78717 GPU: Add immediate drawing of textured rectangle
New function called immRectf_with_texco(), which resides next to the other
immRectf utilities.

Currently used in a single place in the sequencer, but it will be used in
a few other places in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/138222
2025-05-01 08:40:18 +02:00
Jesse Yurkovich
4a0391c4a1 Cleanup: USD: Shrink the USDPrimReader base class
Shrinks the USDPrimReader base class by 24 bytes
- Uses `StringRefNull` in place of a full `string` (prevents additional
  runtime allocations)
- The `prim_path` field is only used sparingly, mostly for tracing, and
  a few non-perf-critical paths. No use keeping it around when it's
  easily, and quickly, accessible through other means.

Pull Request: https://projects.blender.org/blender/blender/pulls/138232
2025-05-01 06:30:55 +02:00
Campbell Barton
2f2d26fc54 Cleanup: use float2 for wmTabletData::tilt & PaintStroke::tilt 2025-05-01 12:51:55 +10:00
Campbell Barton
c3692c7008 Cleanup: use int2 for pointer location & 3D snapping functions
Use the term `mval` as these values are region relative,
which wasn't so clear.
2025-05-01 12:39:46 +10:00
Campbell Barton
bf7d4dca79 Correct error in 229ca9b8f0 2025-05-01 12:18:40 +10:00
Campbell Barton
a37f2014fd Cleanup: sort CMake file lists 2025-05-01 12:16:00 +10:00
Campbell Barton
229ca9b8f0 Cleanup: quiet Python linter warnings 2025-05-01 12:15:23 +10:00
Campbell Barton
43af16a4c1 Cleanup: spelling in comments, correct comment block formatting
Also use doxygen comments more consistently.
2025-05-01 11:44:33 +10:00
Harley Acheson
89ad52b22a UI: Enum Tooltip Item Order
Tooltips for enum items currently show the enum name on one line, then
enum description, then the current value's name, then the value's
description on the next line. This PR changes that to display the
(short) names together then the (longer) descriptions together. This
also adds a small amount of padding under the title.

Pull Request: https://projects.blender.org/blender/blender/pulls/137571
2025-05-01 00:50:34 +02:00
John Kiril Swenson
2ab59859c9 Cleanup: VSE: Replace remaining seq and sequence references
Ref: #132179

Renames:
- `Editing.act_seq` -> `Editing.act_strip`
- `SequenceModifierData` -> `StripModifierData`
  - Its member `mask_sequence` is now `mask_strip`.
- `MetaStack.parseq` -> `MetaStack.parent_strip`
- Remaining function names/parameters that were not dealt with in #132748
- Various references to `seq` or `sequence` throughout code and docs when
  referring to a strip

Also moves `_get` to the end of the renamed function names where
applicable for standardization (unless "by" or "from" are used).

There should be no changes to current behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/138077
2025-05-01 00:22:04 +02:00
Richard Antalik
4c9e06066b Fix: VSE: Adding standalone effect was linked to selected strip
Caused by recent refactor of strip input querying in #136474.
This caused `Strip::seq1` to be set even if effect strip has no inputs.

Fix was applied to `vse::strip_effect_get_new_inputs`, so it is less
confusing during debugging, but also to `seq::add_effect_strip`, as
I think, that core function should never produce invalid strip.

Pull Request: https://projects.blender.org/blender/blender/pulls/138016
2025-04-30 23:37:00 +02:00
Hans Goudey
ec33994c62 Cleanup: Remove unused VertBuf::duplicate() function
This is completely unused, not implemented for the Vulkan backend, and
seems to add quite a bit of complexity to the Metal and OpenGL backends.
It was added for EEVEE legacy motion blur, and the last use was removed
along with EEVEE legacy. We're probably better off not maintaining it since
we should avoid duplicating vertex buffer data anyway.

Pull Request: https://projects.blender.org/blender/blender/pulls/138226
2025-04-30 22:35:47 +02:00
Bartosz Kosiorek
1e5ede1942 Physics: Increase precision of 4D vector normalization functions
More accurately normalize 4D vectors, to avoid potential
numerical stability issues in Mantaflow.

For consistency with changes from #136966.

Pull Request: https://projects.blender.org/blender/blender/pulls/137413
2025-04-30 21:01:36 +02:00
Miguel Pozo
d3f3dc4d72 Fix: Overlay: Material Preview when !bl_use_eevee_viewport 2025-04-30 20:46:00 +02:00
Hans Goudey
12e626f31f Shape Keys: Add operator to update keys from selected objects
This operator is very similar to the existing "Join as Shapes" operator,
which updates or adds shape key array values with the positions of
objects with the same name, but instead of creating new shape keys,
it just updates existing ones. The new operator is called "Update from
Objects" in the UI.

Internally, some logic was moved to a poll function shared between the
two operators, and a new argument for whether to ensure keys exist was
added to their shared implementation.

Part of #135095.

Pull Request: https://projects.blender.org/blender/blender/pulls/136853
2025-04-30 20:07:25 +02:00
Michael B Johnson
79c318f692 Fix #137973: Add MaterialX version info on USD export
This change adds MaterialX version information to the exported MaterialX
USD materials.

Details:

In USD 25.02, the MaterialXConfigAPI schema was introduced to allow
recording the MaterialX version used to author a material. When loading
MaterialX documents into USD, this schema is automatically applied and
the associated version attribute is created on the material.

Due to how the MaterialX export works (via copying the composed
MaterialX spec from a temporary stage), the MaterialXConfigAPI needs to
be explicitly applied to the final material being exported.

This change applies this MaterialXConfigAPI schema and copies the
version attribute from the temporary MaterialX stage to the final stage.

Authored by Apple: Dan Knowlton

Co-authored-by: Dan Knowlton <d_knowlton@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/137974
2025-04-30 19:54:17 +02:00
Brecht Van Lommel
2c99edbffa Cycles: Bump Embree minimum version to 4.0.0
The build is already failing with Embree 3, as noticed in #137556.
And Embree 4 was released 2 years ago.

Pull Request: https://projects.blender.org/blender/blender/pulls/138221
2025-04-30 19:50:14 +02:00
Bartosz Kosiorek
932fa1afb4 UI: Simplify Volumentric Data settings for Fluids
* Advanced was renamed to Volumetric Data
* Labels shortened to Format, Compression, Precision
* All Volumetric data settings are now under one category

Pull Request: https://projects.blender.org/blender/blender/pulls/137490
2025-04-30 19:43:05 +02:00
Bastien Montagne
d66a132c75 Doc: Update intro comment of MEM_guardedalloc.
This reflects better the more detailed info in comments of each sections
of the API in that file, and the info in the on-going work for a related
handbook page at blender/blender-developer-docs!139.
2025-04-30 19:41:43 +02:00
Bartosz Kosiorek
b3dcaa2e1e Physics: Improve liquid simulation performance
Move various computations out of a loop.

This can improve performance up to 1.25x - 1.5x depending on the scene.

Pull Request: https://projects.blender.org/blender/blender/pulls/137733
2025-04-30 19:39:57 +02:00