Commit Graph

121067 Commits

Author SHA1 Message Date
Julian Eisel
4b2d60a2c3 Ghost: Make special user directory query thread safe
Similar to e0ff7731e0.

Noticed a data race when working on blender/blender!130543, which calls
this function from a thread. Make this thread safe by avoiding returning
of static memory, instead use an optional `std::string`.

Pull Request: https://projects.blender.org/blender/blender/pulls/141083
2025-06-27 15:16:35 +02:00
Pratik Borhade
52caedb19e Fix #73072: Outliner: Alt click fails to enable toggle on selected objects
Alt click works perfect to disable restriction toggle (hide/selection
toogle) on selected object tree elements from outliner. But fails when
re-enabling them. This is because `screen_ctx_selected_editable_objects`
returns a list of selectable bases. When above two restriction toggles
are disabled, `selection` flag is cleared from resepective bases. To avoid
such situation, handle outliner case separately inside
`UI_context_copy_to_selected_list ()`, store list of objects that are selected
in outliner (i.e. `TSE_SELECTED` flag is set).

Also added few findings as comments in #133459

Pull Request: https://projects.blender.org/blender/blender/pulls/133469
2025-06-27 13:43:19 +02:00
Pablo Vazquez
a90ce938dd UI: Dope Sheet: Add Cache visualization
Add cache visualization to the Dope Sheet editor, previously limited to
just the Timeline.

See PR for details and screenshots.

Part of #131102

Pull Request: https://projects.blender.org/blender/blender/pulls/140966
2025-06-27 12:23:48 +02:00
Nathan Vegdahl
56d8c11304 Core: Add more variables for path templates
This PR adds several more built-in variables for path templates:

- `scene_name`: name of the current scene.
- `camera_name`: name of the current camera.
- `node_name`: only for paths owned by a node; the name of the node.
- `blend_name_lib`: name of the blend file of the ID the path property
  is on, sans file extension.
- `blend_dir`: path up to (but not including) the currently open blend
  file.
- `blend_dir_lib`: path up to (but not including) the blend file of the
  ID the path property is on.

Additionally, adding support for `node_name` required re-thinking the
"path template type" system a bit:

Previously, the the `PropertyPathTemplateType` of a property completely
dictated what variables were made available to it. However, if we stuck
with that system then we would need to split
`PROP_VARIABLES_RENDER_OUTPUT` into two enum items: one for "normal"
render output paths like the one that lives on the `Scene`, and one for
"node" render output paths like the ones on the File Output node.

Instead of doing that, this PR makes `PropertyPathTemplateType` only
responsible for dictating the "purpose-specific" variables. In this
case, render-specific variables like fps, resolution, etc. Then the
availability of variables like `node_name` are instead based on what
owns the path (a node or not, in this case). There are also general
variables, like `blend_name`, that are now available to all path
templates.

(Part of #133001)

Pull Request: https://projects.blender.org/blender/blender/pulls/139438
2025-06-27 11:07:04 +02:00
Campbell Barton
83ee7a3122 Merge branch 'blender-v4.5-release' 2025-06-27 18:58:40 +10:00
Andrej730
6dc0c85de6 Fix: PyDocs: GPUShader, use ref for better navigation
Also note removal version.

Ref !140846
2025-06-27 18:52:53 +10:00
Bastien Montagne
6027300715 Refactor: factorize 'ID reading' part of expand_doit_library.
Code to read placeholder IDs from other library vs. reading actual ID
from current library was virtually the same, so de-duplicate it into its
own utils.

NOTE: Done while investigating support of embedded linked IDs in
libraries, which will require some fairly involved changes in this area.

Pull Request: https://projects.blender.org/blender/blender/pulls/141049
2025-06-27 10:43:26 +02:00
Campbell Barton
4085111a31 Merge branch 'blender-v4.5-release' 2025-06-27 18:03:42 +10:00
Patryk-Skowronski
5f28ef5574 NDOF: Removed impact of the auto orbit center on Fly Mode
Remove the impact of Auto orbit center preference onto Fly mode.
Until now, it was possible to experience dynamic translation speed
changes in the Fly mode with Auto preference enabled for the orbit
center. This was not desired.

Ref !141035
2025-06-27 08:02:34 +00:00
Laurynas Duburas
c30e6a37b0 Fix #93078: users choice was overridden by former constraint
Ensure 'constraint_axis' is unset in the Rotate operator when user
sets 'orient_axis' via the operator panel. This prevents unintended
overrides and aligns with expected behavior.

Change is limited to avoid affecting Shear, Rotate Normals, and
Transform, though Rotate Normals may benefit from similar handling due
to overlapping axis properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/114779
2025-06-26 22:20:57 +02:00
Guillermo Venegas
86d6855ee8 Refactor: UI: Add uiLayout op_menu_hold, popover and separator_spacer
This replaces `uiItemFullOMenuHold_ptr`, `uiItemFullR_with_popover`,
`uiItemFullR_with_menu`, `uiItemPopoverPanel`* and `uiItemSpacer` API
with methods following uiLayout refactors and the Python API.

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/141050
2025-06-26 21:48:52 +02:00
Sean Kim
524e4879e5 Cleanup: Remove unused BKE_multires.hh methods
Pull Request: https://projects.blender.org/blender/blender/pulls/140951
2025-06-26 21:01:40 +02:00
Sean Kim
6531ba34f0 Cleanup: Use blender::Array instead of manually allocated int arrays
Pull Request: https://projects.blender.org/blender/blender/pulls/140949
2025-06-26 21:00:01 +02:00
Howard Trickey
08015e7401 Fix #141026: Degenerate Dissolve crashes Blender.
The code added in commit ffc204d1fa to dissolve redundant 2-edged
vertices after a manifold boolean assumed that after dissolving such
vertices a valid face would remain. This is not true of the face
started out degenerate (all vertices on the same line).
Fixed by checking for such cases and in any case not creating
any faces with less than three vertices.
2025-06-26 14:26:44 -04:00
Harley Acheson
0ea03b5137 UI: Fade In Active Editor Border Highlight
Our themes have two colors that we use as outlines for the editors, so
that we can differentiate the active area. This PR just fades in the
"Active Editor Outline" color rather than show it instantly. It makes
the change a little less jarring. As this transitions in the old active
area similarly transitions out. Note that this is very fast, only 150
milliseconds, so barely noticeable. Just a "softening" of the effect.

Pull Request: https://projects.blender.org/blender/blender/pulls/140836
2025-06-26 20:19:01 +02:00
Jesse Yurkovich
72de50483e Cleanup: USD: Prevent some unneeded char to string conversions
Notably, there were several code paths which could end up converting to
strings, sometimes multiple times, when passing data into USD APIs.

Reduce the use of raw `char *` in the asset interface and use
`std::string` instead to match what will be passed into USD. Using
string views, of any variety, will not help here since the APIs don't
natively support those.

Pull Request: https://projects.blender.org/blender/blender/pulls/140997
2025-06-26 20:13:25 +02:00
Howard Trickey
a20f367379 Fix #141026: Degenerate Dissolve crashes Blender.
The code added in commit ffc204d1fa to dissolve redundant 2-edged
vertices after a manifold boolean assumed that after dissolving such
vertices a valid face would remain. This is not true of the face
started out degenerate (all vertices on the same line).
Fixed by checking for such cases and in any case not creating
any faces with less than three vertices.
2025-06-26 13:59:20 -04:00
Bastien Montagne
9be9858675 Fix (studio-reported) missing handling of new system properties for VSE Strips.
Unclear if that got lost or was forgotten all together, but the
Sequencer's Strip RNA struct did not have expected access to its system
properties.

Regression since 7276b2009a.
2025-06-26 19:54:38 +02:00
Clément Foucault
a29be9c5a2 Fix #85015: Selection: Objects with negative and small scale cant be selected
... using Select Box.

This is caused by our hack to make each triangle always output
at least 1 pixel. It stretches the triangle with a specific
winding order that is correct for any geometry even if it is
backfacing as long as it is subpixel. But if the mesh is
negatively scaled, the culling mode is flipped. Which make the
hardcoded offsets winding inverted, and then culled by the rasterizer
(or the fragment shader code).

The fix is to flip the winding order of the offsets depending on
the object matrix negativity.
This is rather expensive so we only do it for the triangles we know
are subpixels.
2025-06-26 18:54:43 +02:00
Sergey Sharybin
1985de790b Merge branch 'blender-v4.5-release' 2025-06-26 17:33:28 +02:00
Sergey Sharybin
5ae21e5518 Fix: Dead-lock in VSE audio waveform preview
The VSE preview job was pushing tasks while holding a lock
which is also used by the task. This could lead to a dead-lock
situation if scheduling decides to run the task immediately.

The easiest way to reproduce the issue is to run Blender with
`-t 1` command line argument and add WAV file.

The solution is to iterate over queue and create tasks while
holding a lock, but push them to the pool after releasing the
lock.

Pull Request: https://projects.blender.org/blender/blender/pulls/140972
2025-06-26 17:31:46 +02:00
Hans Goudey
165c344e98 Fix: Assert in barbershop file calculating GPU subdiv orco buffer
For some reason the orco vertex buffer is requested after the position
buffer, but they are computed together. In case that happens, just
discard the position buffer.

Pull Request: https://projects.blender.org/blender/blender/pulls/141043
2025-06-26 17:17:17 +02:00
Hans Goudey
f74e304b00 Attributes: Use AttributeStorage instead of CustomData for Instances
Part of #122398.

This commit moves the runtime instances type to use `AttributeStorage`.
Besides sharing some utility functions with point clouds, a resize
method is implemented.

Pull Request: https://projects.blender.org/blender/blender/pulls/140991
2025-06-26 17:03:56 +02:00
YimingWu
516e12c0df Fix: Manifold boolean assert copying vertex group names twice
They will be copied in subsequent `BKE_mesh_copy_parameters_for_eval`,
copying the list again will cause an assert.

Pull Request: https://projects.blender.org/blender/blender/pulls/141031
2025-06-26 17:03:19 +02:00
Clément Foucault
1073abe62f Fix #140152: EEVEE: Crash while playing animation
This happened because the velocity module is referencing
batche to be able to copy them after drawing.

Make sure to call step swap even when shaders are not
ready to ensure we don't dereference these possibly
freed batches on the next draw.

This also fixes the crashing benchmarks.

Pull Request: https://projects.blender.org/blender/blender/pulls/141022
2025-06-26 16:52:50 +02:00
Clément Foucault
ea2284af11 Fix #140762: Overlay: Curve doesn't display Bevel Preview in Edit Mode
This was caused by the retopology visibility check being faulty.

See https://projects.blender.org/blender/blender/issues/140762#issuecomment-1612468
for more detail.

Pull Request: https://projects.blender.org/blender/blender/pulls/141037
2025-06-26 16:40:26 +02:00
Hans Goudey
9bc67b78ce Merge branch 'blender-v4.5-release' 2025-06-26 10:33:20 -04:00
Hans Goudey
62726f486b Cleanup: Add missing include to make header independent 2025-06-26 10:06:58 -04:00
Clément Foucault
6fee44760a Fix: Overlay: Missing refresh when toggling retopology overlay
This appear as meshes still present or missing when toggling
the option.

This was caused by the change in update detection from the
overlay properties.
2025-06-26 15:39:10 +02:00
Germano Cavalcante
9879132c7c Fix #141017: Rotation snapping increment is wrong after changing mode
After changing the transform mode, `initSnapping` was called, resetting
the increment values.

The solution is to create the `transform_snap_reset_from_mode` function
with only the changes needed when changing modes.

This commit also makes the properties set in the operator take priority
over the scene properties.
2025-06-26 10:37:05 -03:00
Hans Goudey
8ebb759046 Fix: Realize Instances use-after-free with collections
The calls to `to_geometry_set` in this file can create a temporary
Instances struct for collections. That instances component will contain
two attributes, which are currently referenced in the attributes map
even after the temporary compoment storage goes out of scope. A simple
fix is to avoid adding these attributes to the map in the first place.

An alternative that would also be more efficient would be to handle each
instance reference type explicitly, without converting it to a temporary
geometry set. That seems to significantly complicate the code though;
for now it doesn't seem worth it.

Pull Request: https://projects.blender.org/blender/blender/pulls/140999
2025-06-26 15:07:34 +02:00
quackarooni
28bd5a7832 Fix #140933: "Group Socket Node" theme property left unset
The theme property for group socket nodes was set to `#000000` for
default themes, which looked out of place against the other node
header colors. This patch adds colors to both the Blender Dark & Light
themes that should resemble their counterparts before 2ea3cd2188.

Colors:
Blender Dark - `#1d1d1d`
Blender Light - `#3d3d3d`

Pull Request: https://projects.blender.org/blender/blender/pulls/141011
2025-06-26 15:05:37 +02:00
Campbell Barton
517792ea5c Merge branch 'blender-v4.5-release' 2025-06-26 22:08:39 +10:00
Campbell Barton
d84aae280d Merge branch 'blender-v4.5-release' 2025-06-26 22:08:36 +10:00
Campbell Barton
0417719ae9 Help text: move Vulkan debugging option under "Debug Options" 2025-06-26 21:57:49 +10:00
Campbell Barton
0f590bbfb6 Cleanup: correct flag name for NDOF Y/Z axis swap 2025-06-26 21:50:03 +10:00
Pratik Borhade
59a971294c UI: Collection visibility number shortcuts for the Outliner
Move number shortcut keys for isolating collection to outliner space.
Resolves #140651

Same operator is also used in the collection list from the view3d N-panel,
video demonstration includes that part as well to ensure it is unaffected.

Pull Request: https://projects.blender.org/blender/blender/pulls/140653
2025-06-26 12:04:48 +02:00
Clément Foucault
1e79660a14 Fix: Overlay: Region info not working if gizmos and overlays are disabled
The depth test was not set properly and was relying on the
(now moved) text drawing to always disable it.
2025-06-26 11:42:11 +02:00
Campbell Barton
048fa8a327 Merge branch 'blender-v4.5-release' 2025-06-26 19:15:20 +10:00
Campbell Barton
d9b3bea356 Merge branch 'blender-v4.5-release' 2025-06-26 19:15:13 +10:00
Campbell Barton
c3d5e429ac Fix crash assigning non UTF8 path to imbuf.filepath 2025-06-26 19:10:54 +10:00
Sybren A. Stüvel
2ce3e8c877 Fix #140969: Joining armature objects that share their data fails assertion
Add a precondition check that verifies all to-be-joined armatures are
unique. If this is detected, an error is shown and the operator is
aborted.

Joining shared Armatures is non-trivial, because the corresponding
pose bones may actually have different drivers or constraints on them
(because those live on the Object ID, and not the Armature).
Duplicating any shared Armature ID could be a first step, but I am not
convinced this is always the right approach. This is why joining
shared Armatures is not supported for now. Users can choose how to
make each Armature unique, either by deselecting objects or by
duplicating their data.

Pull Request: https://projects.blender.org/blender/blender/pulls/140971
2025-06-26 11:01:41 +02:00
Sybren A. Stüvel
d17f5c09d5 Merge remote-tracking branch 'origin/blender-v4.5-release' 2025-06-26 10:49:57 +02:00
Pratik Borhade
7e17ec5562 Fix #140747: Ignore armature from custom shape list
When armature is selected for custom shape of a bone, we run into
stack overflow due to recursive calls. To prevent this situation,
exclude armature object type from the custom shape list.

This also clears the `pchan->custom` pointer after loading/linking a
blend file. Otherwise a linked Armature object can still be assigned
indirectly, by renaming objects in the library file.

Fixes: #140747
Fixes: #140959

Co-authored-by: Sybren A. Stüvel <sybren@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/140851
2025-06-26 10:48:06 +02:00
Campbell Barton
7bc5347d91 Merge branch 'blender-v4.5-release' 2025-06-26 18:39:03 +10:00
Campbell Barton
2355a32017 Fix crash calling bpy.data.file_path_map with non UTF8 paths 2025-06-26 18:35:37 +10:00
Campbell Barton
5d7c433a18 Merge branch 'blender-v4.5-release' 2025-06-26 18:17:16 +10:00
Campbell Barton
b914416613 Merge branch 'blender-v4.5-release' 2025-06-26 18:17:13 +10:00
Campbell Barton
d9eea24b06 Merge branch 'blender-v4.5-release' 2025-06-26 18:17:08 +10:00
Campbell Barton
521fae81fc Cleanup: remove redundant call to BLI_path_basename 2025-06-26 18:12:41 +10:00