Commit Graph

121236 Commits

Author SHA1 Message Date
Campbell Barton
def2db3bdb Build: resolve error building without TBB 2025-07-03 18:36:29 +10:00
Bastien Montagne
841b518bf6 Refactor: Make Main struct a non-trivial C++ one.
Allows to use regular constructor/destructors. And standard CPP data
like string, maps, etc.

Main is defined as non-movable and non-copyable for the time being.

The existing creating/deleting API is kept as-is, moving to direct
MEM_new/MEM_delete usages in the code is kept as a later cleanup commit.

The 'ListBase' of split-by-libraries Mains has been replaced by a VectorSet.

This is an unfortunate consequence of making Main a non-trivial C++
struct: it is no more guaranteed that next/prev pointers required for
ListBase remain immediately at the top of the struct anymore - and on
Windows they indeed don't.

So move to a more modern form of storage for split-by-libraries mains,
with a few other related changes to internal readfile code.

WARNING: This is quite a sensitive change, extensively tested locally
(including library-related changes across undos and redos, in complex
production scenes).

Pull Request: https://projects.blender.org/blender/blender/pulls/141086
2025-07-03 10:22:30 +02:00
Jeroen Bakker
b1fc86cc75 Merge branch 'blender-v4.5-release' 2025-07-03 09:56:23 +02:00
Jeroen Bakker
eeb2dc8a9e Fix #141305: Vulkan: Animation player memory leak
When playing back render result a separate process is started for
playback. This process didn't call the GPU_context_frame_begin/end
functions resulting in post-poning destroying discarded resources until
the playback process was 'exited'.

Pull Request: https://projects.blender.org/blender/blender/pulls/141376
2025-07-03 09:55:09 +02:00
Jeroen Bakker
5e17f5f41a Fix #141347: Assert in polybuild
Polybuild didn't select a point shaders when
drawing points.

Pull Request: https://projects.blender.org/blender/blender/pulls/141373
2025-07-03 09:54:45 +02:00
Jeroen Bakker
2d00580471 Fix #141274: Assert drawing debug drivers
Fixes an assert when drawing debug drivers. Here a poly shader was used
to draw points. This isn't valid and Vulkan backend warns developers
about it.

Pull Request: https://projects.blender.org/blender/blender/pulls/141372
2025-07-03 09:54:21 +02:00
YimingWu
95259228d9 Fix #140430: Nodes: Hide panel names when socket is shown on modifier UI
Previously, if a socket inside a panel has the same name prefix as the
panel name, the panel name will be removed from socket names when
displayed inside nodes, but this is not done when displaying them on the
modifier interface, which is too verbose visually. Now panel names are
removed from these property labels as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/140448
2025-07-03 08:58:34 +02:00
Campbell Barton
e48dd42804 Merge branch 'blender-v4.5-release' 2025-07-03 14:53:51 +10:00
Campbell Barton
b50a525076 Fix #141336: Modeling: Don't assume gizmo available in polybuild tool
Check the polybuild gizmo is drawn before using it,
also account for it being empty (the cause of the crash), although this
shouldn't happen in practice.
2025-07-03 14:50:23 +10:00
илья _
9c30e3577e Fix: Nodes: Correct label translation
Use `N_` for default labels in case value is invalid.
So no double translation.

Synchronize translation context with related property if exist.
So enum item translated like property with such enum.

Use nodes context for zone labels.

Pull Request: https://projects.blender.org/blender/blender/pulls/138393
2025-07-03 05:27:03 +02:00
Campbell Barton
21e9be6c5e UI: show the ~/ abbreviation for $HOME in the title on Unix systems
Avoid overly long paths in the title bar using the `~` prefix.

Based on feedback from !141059 there is consensus on supporting this
on Linux, that PR also supports abbreviations on other systems but
platform maintainers had concerns (see PR for details).

Apply the functionality for generic Linux/Unix systems,
the functionality for other platforms can be evaluated separately.
2025-07-03 02:50:38 +00:00
YimingWu
abbd4eb9b8 Fix (unreported): Prevent crash when duplicating linked collections
If any of the selected collection entries in the outliner is a linked
collection, `outliner_collection_from_tree_element` can return null and
it will crash in `BKE_collection_child_find`. This patch handles this
case by skipping those entries and modified the warning message to show
how many selected entries have failed.

----

This is how the message looks like now:

<img width="746" alt="image.png" src="attachments/b91f2a64-7f2d-42d4-8657-7deaf00e90b6">

Pull Request: https://projects.blender.org/blender/blender/pulls/140847
2025-07-03 09:53:13 +08:00
YimingWu
8a3d773b16 Fix (unreported): Prevent crash when duplicating linked collections
If any of the selected collection entries in the outliner is a linked
collection, `outliner_collection_from_tree_element` can return null and
it will crash in `BKE_collection_child_find`. This patch handles this
case by skipping those entries and modified the warning message to show
how many selected entries have failed.

----

This is how the message looks like now:

<img width="746" alt="image.png" src="attachments/b91f2a64-7f2d-42d4-8657-7deaf00e90b6">

Pull Request: https://projects.blender.org/blender/blender/pulls/140847
2025-07-03 03:51:56 +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
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
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
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
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
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