Commit Graph

151536 Commits

Author SHA1 Message Date
Jonas Holzman
95abfc00a5 Merge branch 'blender-v4.5-release' 2025-07-03 00:07:52 +02:00
Jonas Holzman
b0ffd4cb07 Fix: macOS: Support multi-monitor window positioning
This commit brings multi-monitor window positioning support to the macOS
GHOST backend. This fixes a plethora of issues with macOS window
creation and positioning, such as:

 * Windows not being properly restored when loading a file with Load UI
 * Users default startup windows not being properly restored on multiple
   screens
 * Temporary windows (Settings, Render, Playblast, etc..) wrongly
   appearing in unexpected places / other screens
 * Duplicating an area into a new window (AKA popping out an editor) not
   working on non-primary screens.
 * etc..

Internally, this makes all macOS windows coordinates be relative to the
user primary monitor, instead of being local to the currently focused
one. I have tested this to properly work using all sorts of multiple
screen arrangements, and can also confirm that restoring windows from
screens that do not exist anymore / are now out of bounds (due to being
unplugged or re-arranged) also works properly, in which case they get
snapped back to the closest available screen similarly to other backends.

This fixes issue #126410 and implements behavior described in TODO task #69819.

Pull Request: https://projects.blender.org/blender/blender/pulls/141159
2025-07-03 00:05:52 +02:00
Sean Kim
412452fe39 Cleanup: Add comments for adjacency maps in SubdivCCG
Pull Request: https://projects.blender.org/blender/blender/pulls/141306
2025-07-02 20:59:30 +02:00
Hans Goudey
f3399a41e2 Fix #141355: Set attribute operator broken for meshes
Mistake in 1f92fd7577

Also unify the code a bit between geometry types.
2025-07-02 12:40:00 -04:00
Guillermo Venegas
d00a0f29b4 UI: Make uiLayout NonCopyable and NonMovable
Almost all uiLayout methods that creates sub-layouts returns a uiLayout
reference, API users must use the returned sub-layout to add items,
this prevents a accidental copy that could break Blender.

Pull Request: https://projects.blender.org/blender/blender/pulls/141051
2025-07-02 18:31:04 +02:00
Julien Duroure
2aed558f08 Fix #141345 - glTF: Fixes after recent Blender changes on IDprops 2025-07-02 18:04:00 +02:00
Clément Foucault
f5022c14ab Merge branch 'blender-v4.5-release' 2025-07-02 17:47:14 +02:00
Clément Foucault
bdad5325a7 Fix #141112: Plane Probe is cut off in camera view if Shift X/Y in certain way
Previous fix 531bc5ca69 broke the tracing part of planar
probe. This is because the code was relying on assumption that
are no longer true. Fix this by passing the correct
projection matrix and inverse proj mat to the tracing code.

Pull Request: https://projects.blender.org/blender/blender/pulls/141349
2025-07-02 17:46:45 +02:00
Clément Foucault
b30938a15f Fix #141112: Plane Probe is cut off in camera view if Shift X/Y in certain way
Previous fix 531bc5ca69 broke the tracing part of planar
probe. This is because the code was relying on assumption that
are no longer true. Fix this by passing the correct
projection matrix and inverse proj mat to the tracing code.

Pull Request: https://projects.blender.org/blender/blender/pulls/141349
2025-07-02 17:45:41 +02:00
Jacques Lucke
ebf9449518 Fix #141070: missing viewport update after disabling viewer
Pull Request: https://projects.blender.org/blender/blender/pulls/141320
2025-07-02 17:32:37 +02:00
Falk David
56dc3539ce Merge branch 'blender-v4.5-release' 2025-07-02 17:17:24 +02:00
Falk David
92d72467a7 Fix #141222: Assert hit when resizing CurvesGeometry to 0
The `CurvesGeometry::resize` function would not work properly when
passing a new size of zero.
1) The `CustomData_realloc` would allocate an array with zero size.
2) A new size of 1 is passed to `implicit_sharing::resize_trivial_array`
   for the curve offsets when it should pass 0.
3) A value is written out-of-bounds to `curve_offsets`

This fixes the issues in the following ways:
1) `CustomData_realloc` now doesn't allocate any data when the new
    size is 0 and sets the `layer->data` to `nullptr`.
2) When the new number of curves is 0, resize the `curve_offsets` to 0
  not to 1. This also ensures that the data pointer is `nullptr`.
3) Make sure to only write the first and last curve offset when the
  number of curves is greater than 0.

Pull Request: https://projects.blender.org/blender/blender/pulls/141333
2025-07-02 17:16:50 +02:00
Hans Goudey
9e2ffcf7b6 Merge branch 'blender-v4.5-release' 2025-07-02 10:55:51 -04:00
Hans Goudey
37a8e5c06a Fix: "Layer" shows as mesh attribute domain option
Use a more consistent pattern to filter domains that aren't
supported for each geometry type.
2025-07-02 10:54:00 -04:00
Jacques Lucke
fd377916c6 Fix: RNA_property_string_get returns string of incorrect length for id properties
The returned string was one byte too large, because it contained the null
terminator for string `IDProperty`. Noticed this when retrieving strings
parameters in an operator which are stored as id properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/141321
2025-07-02 16:41:39 +02:00
Clément Foucault
b4ca7b5022 Fix: Workbench: Broken render tests after AA fix
Broken since c49e9e1773
2025-07-02 16:31:12 +02:00
Hans Goudey
bf57be965c Fix #141325: Convert attribute operator broken for meshes
Mistake in 1f92fd7577
2025-07-02 10:23:23 -04:00
Guillermo Venegas
3f9d9c9e6b UI: Add Move to Collection Menu
This replaces the Move/Link to Collection operator popup with a menu,
allowing this to be able to search collection to move and to expand
this menu from other menus.
This removes the expected memory leak of using the popup.

Move to Collection operator now uses `session_uid` to identify
target collection, this now allows to target a collection from another
scene, however, is not exposed throw UI)

Resolves #133772

Pull Request: https://projects.blender.org/blender/blender/pulls/140883
2025-07-02 16:21:36 +02:00
Campbell Barton
3d15acee1f GHOST/Wayland: correct tablet serial argument for setting cursors
While the previous logic tended to work as it would use the serial
for the last active table event - follow the spec and and always pass
in the serial for the proximity_in event.
2025-07-02 23:13:29 +10:00
Falk David
2b9b6fc5eb Merge branch 'blender-v4.5-release' 2025-07-02 14:52:31 +02:00
Falk David
dd16e5f96d Fix #94253: Grease Pencil: Transparency yellow color shift in viewport
In the viewport, semi-transparent strokes could appear more yellowish.

This was because the `reveal_tx` uses the `GPU_R11F_G11F_B10F` format
(loosing precision in the blue channel).

Now using `GPU_RGB10_A2` for `reveal_tx` to fix the issue.
We don't need to change the format for the `color_tx`.

Pull Request: https://projects.blender.org/blender/blender/pulls/141335
2025-07-02 14:50:59 +02:00
Falk David
4990edd94d Fix #136560: Grease Pencil: Alpha issue with "multiply" layer blending
The alpha channel wasn't properly handled when using "multiply" layer
blending.

The formula in `blend_mode_output` for `MODE_MULTIPLY` was first
multiplying the `color.a` by `opacity`, storing the result back into
`color` but then multiplying by `color.a` again.

Instead, multiply `color.a` and `color` by the `opacity` separately.

Pull Request: https://projects.blender.org/blender/blender/pulls/141337
2025-07-02 14:50:24 +02:00
Sebastian Parborg
0d006c6078 Merge branch 'blender-v4.5-release' 2025-07-02 13:58:22 +02:00
Guillermo Venegas
d83610e701 Fix #129232: Regression in drag toggle keyframe with upward motion
While drag toggle decorators, the button where drag started
still is active, so it can conflict with the button to add/remove
keyframe while dragging upward.

Use `UI_BUT_ACTIVE_OVERRIDE` flag since it has precedence in
`ui_context_button_active`.

Last tested to work in 2.83.

Ref !141317
2025-07-02 21:54:24 +10:00
Sebastian Parborg
48b5906cba Fix #141111: Time remapping should not affect the audio playback
We do not do any audio time stretching when doing time remapping.
As we also use the audio to keep track of time passed, we should always
pass the actual timestamp we are starting playback from.

The issue was that the old logic would try to undo time remapping on cfra.
However cfra is already correct and is not remapped. I'm guessing that
this changed at some point and we forgot to fix it up in the sound code.

Pull Request: https://projects.blender.org/blender/blender/pulls/141288
2025-07-02 13:44:51 +02:00
Campbell Barton
53a5eef579 Cleanup: minor tweaks to ghost cursor internals
- Use the typed enum for wayland cursor ID's.
- Return an std::optional<...> for cursor access,
  with std::nullopt when the cursor doesn't have an equivalent value
  from ghost.
- Add "stub" calls to `update_cursor_scale` where removed as part of
  !140366 but will be needed when custom cursors support updating
  based on output scale.
2025-07-02 21:34:27 +10:00
Ian Yoo
477d44867f Tests: Add bilateral-blur single_value tests
`node_bilateralblur.blend` covered a specific case where the
determinator was a single value. This was renamed to
`node_bilateralblur_det_single_value.blend` and added a single value
 input test for the image, and a standard bilateral blur test for cpu/gpu

Coverage:
- Function: 66.67% -> 100%
- Line: 39.10% -> 100%
- Region: 45.71% -> 100%
- Branch: 22.22% -> 88.89%

Pull Request: https://projects.blender.org/blender/blender/pulls/141315
2025-07-02 12:33:05 +02:00
Bastien Montagne
d334f78496 Merge branch 'blender-v4.5-release' 2025-07-02 12:27:12 +02:00
Bastien Montagne
78d78223b8 Fix #139715: Issue when duplicating Scene/Collection/Object with objects in EditMode.
Detection of whether an object is in Edit mode can rely on checking its
obdata ID status (for meshes e.g.), which will falsly make remapping
code think it is remapping the obdata of an edited object.

Somewhat work around the issue by forcing such remapping for the time
being. On the long run, check should be updated to only rely on the
Object's status.
2025-07-02 12:24:54 +02:00
Campbell Barton
3817b476ca Merge branch 'blender-v4.5-release' 2025-07-02 20:13:03 +10:00
Campbell Barton
8ce2756b18 Fix brush toggle not working when using tools with multiple scenes
Follow up to #140668 that fixes the same issue when using multiple
windows & scenes. This is needed as the active tool can apply to
multiple scenes.

Ref !141260
2025-07-02 20:10:53 +10:00
Clément Foucault
5f1f997ed9 Fix #102264: EEVEE: Shader recompilation when editing Vector Transform Node
Fixed by using uniform instead of constants.
2025-07-02 11:56:30 +02:00
Omar Emara
977e82e887 Nodes: Allow auto linking of Extend sockets
The Make Links operator does not work with Extend Sockets and generally
do not respect the node's link function. This patch makes it such that
the operator will fallback to an Extend socket if all else fails,
connecting to the first available socket that is not already linked to
the target node.

The main motivation for supporting this is to allow rapid connections to
the File Output node from big nodes like the Render Layers and Image
nodes, which is typically a slow process for users.

Pull Request: https://projects.blender.org/blender/blender/pulls/141287
2025-07-02 11:24:25 +02:00
Falk David
bc70bed850 Cleanup: Grease Pencil: Remove "fast draw" code
This was used by the legacy Grease Pencil system while using the draw
tool to quickly render a stroke buffer.

Nowadays, we don't use this buffer anymore and just rerender
the Grease Pencil object.
2025-07-02 11:12:15 +02:00
Clément Foucault
06dff0151d Fix #103499: View Pan not working for smaller clip start value
Changing the computation to be split in 2 steps (one for each matrix)
fixes the issue.

However, it seems this function is used in a lot of places which
I am not sure if this has the potential to slow down some other
operations. So I will simply add a precise version of the function
for now.

Pull Request: https://projects.blender.org/blender/blender/pulls/141327
2025-07-02 10:59:12 +02:00
Clément Foucault
0df7b4daed Fix #103710: Crash on calling bpy.ops.mesh.loopcut in python script
In this case `region->runtime->type` is null in background mode.

This patch fixes it by just adding nullptr checks.

Pull Request: https://projects.blender.org/blender/blender/pulls/141324
2025-07-02 10:50:27 +02:00
Sergey Sharybin
9ace788faf Merge branch 'blender-v4.5-release' 2025-07-02 10:42:01 +02:00
Michael Jones
681eed7e4d Fix #135659: Some types of motion are incorrect at low step counts with MetalRT
Following #136253, this PR enables decomposed MetalRT motion
interpolation on macOS 15.6. The bounding box issue is fixed
in the latest macOS 15.6 beta (24G5054d).

Pull Request: https://projects.blender.org/blender/blender/pulls/141207
2025-07-02 10:41:42 +02:00
Guillermo Venegas
a0f9e25682 Refector: UI: Add uiLayout decorator, menu_contents and progress_indicator methods
This replaces uiItemMContents, uiItemDecoratorR* and
uiItemProgressIndicator API with uiLayout methods following
uiLayout refactors and the Python API.

`eButProgressType` is changed to a typed enum class
`blender::ui::ButProgressType`

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/141189
2025-07-02 10:06:48 +02:00
Aras Pranckevicius
9809385ffa Merge remote-tracking branch 'origin/blender-v4.5-release' 2025-07-02 11:01:45 +03:00
Aras Pranckevicius
21870da9e2 Fix #141282: VSE cache issues when rendering at reduced resolution scale
If render settings resolution scale had lowered resolution, cached
images from render image/animation session could "stay around"
and be incorrectly used in the VSE preview area. Two cases I found are
fixed here:
- Intra-frame cache was not flushed upon actual final resolution
  change,
- "Source images" for effect/scene strips were not removed when
  requested resolution no longer matches their rendered resolution.

Pull Request: https://projects.blender.org/blender/blender/pulls/141297
2025-07-02 09:58:11 +02:00
Lukas Tönne
b613216864 Refactor: clean up bone envelope falloff function and modernize math
This just refactors the `distfactor_to_bone` function using modern C++
math and better variable names to clarify what it does.
No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/141289
2025-07-02 09:57:34 +02:00
Jacques Lucke
21d603895e Refactor: Geometry Nodes: support detection of syncable closure/bundle nodes
This is extracted from #140967.

Previously, it was possible to sync a bundle/closure node based on what's linked.
However, it was not possible to detect if the syncing was possible or necessary
in the first place. Knowing this helps building UI features that inform the user
about outdated nodes.
2025-07-02 07:38:30 +02:00
Jacques Lucke
bd65e9c6ba Geometry Nodes: support tracing bundles and closures through closure calls
This makes the "sync sockets" operation work on more cases than before.

Pull Request: https://projects.blender.org/blender/blender/pulls/141014
2025-07-02 06:23:24 +02:00
Jacques Lucke
0596c7f119 Fix: crash using tab in attribute search
The crash happens when hitting tab while using attribute search in the Geometry
Nodes modifier. This triggers some auto-completion code (which doesn't work here
currently, but that's potentially a separate problem). However, the
auto-completion code did not handle the case when the string that's
auto-completed does not have a maximum length, i.e. it is dynamic.

This patch adds some handling for the case when the auto-completed string
storage has a dynamic size.

Pull Request: https://projects.blender.org/blender/blender/pulls/141200
2025-07-02 06:22:34 +02:00
Laurynas Duburas
d21517c6c7 UI: Curves: NURBS weight in Transform panel
Adds NURBS weight, radius and tilt to Transform panel.
To avoid code duplication  code is a bit refactored and `struct TransformMedian_GreasePencil` is removed.
Also GP case has a race condition in existing version. It is fixed using `std::atomic`.

Pull Request: https://projects.blender.org/blender/blender/pulls/141079
2025-07-02 05:38:21 +02:00
Sean Kim
5bd6f41ff5 Fix: Silence deprecated warning
Introduced in d73b8dd4f3

Unfortunately, the `Sculpt` struct has an implicitly generated copy
constructor which accesses the deprecated field in `sculpt_ops.cc`,
instead of allowing access to potentially deprecated fields at runtime,
this commit silences the warning by appending `_deprecated` to the field
and removing `DNA_DEPRECATED` from it.

Additionally, to preserve forward compatibility, the field is added to
`dna_rename_defs.h`

Pull Request: https://projects.blender.org/blender/blender/pulls/141298
2025-07-02 05:27:00 +02:00
Hans Goudey
1f92fd7577 Refactor: Use AttrType instead of CustomData type in attribute API
Change `eCustomDataType` to `bke::AttrType` for uses of the attribute
API (the `AttributeAccessor` one anyway). I didn't touch any values that
might be saved in files; those should be handled on a case by case basis.

Part of #122398

Pull Request: https://projects.blender.org/blender/blender/pulls/141301
2025-07-01 22:14:26 +02:00
Hans Goudey
09902044ff Fix: Default value ignored for some new builtin attributes
0dbe435aa8 was not complete.

Pull Request: https://projects.blender.org/blender/blender/pulls/141304
2025-07-01 21:27:14 +02:00
Jesse Yurkovich
2683c876f0 Fix: Increase maximum collection name length for Collection Export
Follow up to fdaaea6328

The initial collection export code used the wrong define.

Pull Request: https://projects.blender.org/blender/blender/pulls/141239
2025-07-01 20:14:35 +02:00