Commit Graph

118468 Commits

Author SHA1 Message Date
Omar Emara
79743b68a8 UI: Use a red alert theme color for unsupported nodes
Undefined nodes are currently drawn using a red alert theme color to
make it easier to spot them and replace them. On the other hand, nodes
that are unsupported, that is, nodes whose poll method fail, are not
reported to the user in any way. So this patch also uses the same red
alert color for unsupported nodes.

The node_type_is_undefined function is moved to the draw file since it
seems to be specific to it and not used anywhere else.

Pull Request: https://projects.blender.org/blender/blender/pulls/136451
2025-03-25 09:25:17 +01:00
Omar Emara
577c46c081 Fix #136360: Crash in older versions for files from v4.5
Blender crashes in older versions when loading files saved from v4.5 and
contain nodes like Mix in the compositor. That's because those nodes do
not exist in older versions, that is, this is a forward compatibility
issue.

The compositor already has protections in place to not crash when
loading files from future versions containing new nodes. However, for
nodes like Mix which existed in other node trees, the node is not new,
it is just new to the compositor, so it goes undetected and the
compositor tries to execute it leading to a crash.

To fix this, we also check the poll method of the node when verifying
compositor node trees. This should be backported to the corrective
release, as well as LTSs. But for v4.5, a change will later follow to
make the compositor execute such undefined/unsupported nodes using a
default operation that initializes the output with default values.

Pull Request: https://projects.blender.org/blender/blender/pulls/136438
2025-03-25 09:15:04 +01:00
Lukas Tönne
93576e5832 Fix #136327: Deleting group node crashes when there are multiple outputs
The group output node is updated as part of the topology cache.
When there are multiple group output nodes the first one with an "active"
flag is picked. However, if no group output is flagged this will leave
the group output unchanged in the cache, even if that node has been deleted.

Always initialize the group output runtime cache to null to avoid invalid
pointers.

Pull Request: https://projects.blender.org/blender/blender/pulls/136436
2025-03-25 08:23:52 +01:00
Campbell Barton
e87827834b WM: print the NDOF progress identifier instead of a number
Gives more useful output when debugging events.
2025-03-25 13:36:33 +11:00
Campbell Barton
486bd6dd60 Cleanup: simplify wmEvent::modifier checks
Check on the modifier flag were explicitly masking all modifiers
which isn't needed as this flag is ensured to only have the four
expected modifier flags set.

Simplify logic by removing masking for "all" modifiers.
2025-03-25 13:03:24 +11:00
Campbell Barton
2126758bd4 Fix: modifiers set to "Any" were shown as pressed in the key-map string
It's possible only some modifiers are set to "Any", these shouldn't
be considered pressed as the "Any" option is handled per modifier.
2025-03-25 12:36:09 +11:00
Campbell Barton
ec511316d2 Cleanup: minor changes to wmKeyMapItem modifier comparisons
Some of the existing logic checked that modifiers were KM_MOD_HELD,
other logic checked the value wasn't KM_NOTHING or KM_ANY.

Simplify checks by comparing against KM_MOD_HELD in all cases
as this won't be set to other values.
2025-03-25 12:14:27 +11:00
Campbell Barton
93bf29a851 Cleanup: correct values for wmKeyMapItem modifiers, use smaller types
- Document values to use for modifiers in code-comments.
- Only compare modifier values with KM_ANY/NOTHING/MOD_HELD.
- Use smaller integer sizes where possible.
2025-03-25 11:40:53 +11:00
Charles Flèche
ce70f99b5d Fix crash from a missing check for an environment variable on macOS
Ref: !136472
2025-03-25 11:07:47 +11:00
il4n
442150b5be Fix: VSE timeline and outliner out of sync
This fixes some certain cases, where the outliner wasn't notified of
changes in strip selection.

Pull Request: https://projects.blender.org/blender/blender/pulls/136457
2025-03-24 20:49:22 +01:00
Harley Acheson
3e29f3eaa2 UI: Scroll Bars on the Left Side of Left-Aligned Regions
Toolbars and some other regions are aligned to the left sides of their
areas and have an (often hidden) right edge that can be dragged to
resize or hide it. If there isn't enough vertical space to show all of
its contents then you also get a scroll bar along that same edge. These
two things conflict badly and is almost impossible to use with a tablet
pen. The mouse cursor changes to indicate dragging over the scrollbar
but doesn't work. Dragging the scoll bar requires doing so to the right
of it. This PR moves the scroll bars to the left side of these left-
aligned areas. They are correctly changed to the right side if you flip
the region.

Pull Request: https://projects.blender.org/blender/blender/pulls/136218
2025-03-24 20:45:13 +01:00
Harley Acheson
daa417d304 UI: Increase Hit Size of the Close Region Action Zone
When regions are closed, like sidebars and toolbars, we show a little
arrow at the edge. This PR does not change that arrow, nor make any
noticable visual change, but almost doubles the hit size area. Much
easier to hit, especially with a tablet pen.  It also changes the mouse
cursor when hovering over it to ones that indicate movement in that one
direction, helping to reinforce that you are over the spot. Otherwise
the mouse cursor looks the same as when over the nearby edge.

Pull Request: https://projects.blender.org/blender/blender/pulls/136334
2025-03-24 20:04:28 +01:00
Jacques Lucke
0f9ef0eefc Fix: Nodes: unavailable sockets are always unused 2025-03-24 19:36:46 +01:00
YimingWu
2dfa57e8ac Fix #136420: Null check description in file_execute_get_description
`sfile->op->type->description` can be null if the user-registered
operator does not have description, so check that before returning a
translated string.

Pull Request: https://projects.blender.org/blender/blender/pulls/136421
2025-03-24 19:34:44 +01:00
Harley Acheson
e095e5889a Cleanup: Make format
Just changes resulting from running Make Format.
2025-03-24 11:31:47 -07:00
Richard Antalik
dfea0628c4 Cleanup: VSE: Use cached meta lookup
Some old code used to iterate over all strips to find metas. Use
`seq::lookup_meta_by_strip` instead, since it is cached.

Pull Request: https://projects.blender.org/blender/blender/pulls/136406
2025-03-24 19:11:44 +01:00
Jacques Lucke
6624cc5634 Nodes: take panel toggles in builtin nodes into account in socket usage inferencing
If a panel has a toggle, then it's a best practice that everything inside it is
grayed out of the toggle is off. It's not something we can enforce for node
groups, but should enforce it for built-in nodes.  Right now, we don't have
built-in nodes with panels, but that may change e.g. with #135990.

This patch makes it so that the socket usage inferencing takes panel toggles
into account when determining if an input socket in a built-in node in a panel
is used.

Pull Request: https://projects.blender.org/blender/blender/pulls/135993
2025-03-24 19:08:03 +01:00
Leon Schittek
f6da9ed9ea Fix: Nodes: Prevent jiggling when snapping multiple nodes
Snap nodes by first aligning their inital location to the grid and then
offsetting them in grid increments to avoid jiggling when multiple
unsnapped nodes are moved at once.

Pull Request: https://projects.blender.org/blender/blender/pulls/136437
2025-03-24 18:30:15 +01:00
Jacques Lucke
16dcc33cb8 Fix: Nodes: update supported node types check for dynamic legacy types
Newer nodes may not have a fixed `legacy_type`. This was not accounted for
correctly when reading nodes. Such newer nodes are exclusively identified by their idname.

Fortunately, Blender 4.4 was released without any new nodes that don't have
a fixed `legacy_type`. So this does not have to be backported.

Pull Request: https://projects.blender.org/blender/blender/pulls/136431
2025-03-24 17:54:08 +01:00
Sean Kim
1158bb33d0 Fix #88592: Avoid creating undo step when adding brush texture
When adding a texture to a brush datablock, currently, the resulting
undo step does not have any effect when undone. This is due to the
texture being added to the linked asset library. As we do not want this
extraneous undo step to be created since it has no effect, this commit
does the following:

* Removes the automatic undo handling with OPTYPE_UNDO
* Manually adds a undo step if the newly created Texture datablock was
  not moved to a library.

Pull Request: https://projects.blender.org/blender/blender/pulls/136336
2025-03-24 17:43:49 +01:00
Hans Goudey
aa1449bbae Cleanup: Use CustomIDVectorSet for operator types
Missing from c2fd4eb9cc.
2025-03-24 12:31:56 -04:00
Pratik Borhade
c40afd4225 Fix #136369: Grease Pencil: Tint brush ctrl key to erase vertex color
With tint brush active, holdinh ctrl key doesn't erase the color
attribute. Similar to vertex brush (`VertexPaintOperation`) reduce alpha
value from the influence

Pull Request: https://projects.blender.org/blender/blender/pulls/136424
2025-03-24 17:07:20 +01:00
Falk David
d32de62a08 Fix #134517: Grease Pencil: Crash hitting assert in armature modifier
The issue was that using `DEG_get_original_id` returned the same
evaluated ID, because the `GreasePencil` in the geometry set doesn't
have the original ID pointer set.

Instead, use the original ID pointer stored in the
`GreasePencilEditHints` (which is better anyway).

Also resolves #136307.

Pull Request: https://projects.blender.org/blender/blender/pulls/136455
2025-03-24 16:59:48 +01:00
Hans Goudey
84d94aaa15 Cleanup: Add missing include to header 2025-03-24 11:57:53 -04:00
Clément Foucault
eaea129e90 Fix #136273: Selection: Missing support for alt+B clipping
This was just left as TODO.
Passing the clipping state avoids `select_bind`
removing it.

Pull Request: https://projects.blender.org/blender/blender/pulls/136311
2025-03-24 16:53:43 +01:00
Clément Foucault
4fb3edd488 Fix #136335: Overlay: Always respect backface culling mode in selection
This reintroduce the same behavior as 4.3 with regard to
selection and depth drawing.

This patch also disables facing overlay during depth
drawing to avoid it conflicting with tge auto-depth
feature.

Also fix #136418

Pull Request: https://projects.blender.org/blender/blender/pulls/136427
2025-03-24 16:38:09 +01:00
Guillermo Venegas
cba18b006a Cleanup: UI: Avoid overallocation while adding button decorators
This will likely reserve a larger vector more than actually needed.
Reserve only the same count of decorators to be added, since they
likely match the number of buttons that needs to be temporally
retrieved.

Decorators buttons are added along animatable property buttons in each
`layout.prop` function call, when a property is a `XYZ` vector property,
drawing this property adds 3 inputs buttons and for each inputs buttons
this need to insert an aligned property decorator, since this decorators
are added just after the buttons are added this likely just takes out
temporally this last 3 elements and inserts them back with each
corresponding decorator.

Pull Request: https://projects.blender.org/blender/blender/pulls/136191
2025-03-24 16:03:55 +01:00
Brecht Van Lommel
f5c3b8be5c OpenEXR: Improve handling of ACES2065-1 chromaticities
Use aces_interchange role in OpenColorIO to identify the correct colorspace
for each config. Also use acesImageContainerFlag attribute from the ACES
container format to identify the colorspace.

Write ACES2065-1 chromaticities in EXR files when appropriate. This gets us
closer to supporting output of the ACES container format, though we don't
write acesImageContainerFlag. There are various restrictions that must be met
which are not very practical, and even exr2aces doesn't write it.

Pull Request: https://projects.blender.org/blender/blender/pulls/135823
2025-03-24 15:41:22 +01:00
Martin-Vignali
f7054a2d2f OpenEXR: Automatically set colorspace for XYZ E and ACES2065-1 chromaticities
The OpenEXR format has a chromaticities attribute that identifies the scene
referred linear color space. Detect these two cases now, and assign the
corresponding color space from the OpenColorIO configuration.

In general these chromaticities are known to be unreliable and missing support
in most software, with ideas to deprecate them entirely. However the ACES
container format standard requires them, and with this change we'll be able to
read such images with the right color space set by default.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>

Pull Request: https://projects.blender.org/blender/blender/pulls/135823
2025-03-24 15:41:22 +01:00
Lukas Tönne
13f862ec02 Fix #128769: Grease Pencil: Interpolation causes 1-point shift.
Interpolating between curves of the same length was shifting the target
points by 1 index position, starting about half-way along the curve.
The reason is that the `num_free_samples` count compared _points_ of the
destination curve to _segments_ of the source curve, and at equal point
count the segment count is 1 less.

This extra point would be consumed about half-way along the spline, and
then the end point of the source curve was not represented. Fixing
the count makes sure that source and target curve match exactly when
they have the same number of points.

Pull Request: https://projects.blender.org/blender/blender/pulls/136448
2025-03-24 15:34:32 +01:00
Falk David
03a34204ff Cleanup: Grease Pencil: Tint operation
Cleans up the code and removes some unecessary index range
computations. Also makes some better use of multi-threading
for long strokes.
2025-03-24 12:09:22 +01:00
Clément Foucault
2f3785cf33 Cleanup: Grease Pencil: Remove warning in Instance declaration 2025-03-24 11:59:08 +01:00
Clément Foucault
a5a61659a3 Cleanup: Grease Pencil: Remove redundant namespace prefixes
Pull Request: https://projects.blender.org/blender/blender/pulls/136426
2025-03-24 11:19:57 +01:00
Clément Foucault
a41aa0cb62 Cleanup: Grease Pencil: Move antialiasing into Instance methods 2025-03-24 11:19:55 +01:00
Clément Foucault
08c1437d6d Cleanup: Grease Pencil: Merge ViewLayerData into Instance
The former as no semantic meaning nowadays. Removes bloat.
2025-03-24 11:19:55 +01:00
Clément Foucault
76f6379e9c Cleanup: Grease Pencil: Remove GPENCIL prefix for engine types
These types are under the `draw::gpencil` namespace already
2025-03-24 11:19:55 +01:00
Clément Foucault
98e13aa1f1 Cleanup: Grease Pencil: Move engine static functions to Instance methods 2025-03-24 11:19:55 +01:00
Jeroen Bakker
409ce2b976 Vulkan: Swapchain synchronization
This PR adds swapchain synchronization. When the swapchain swaps the
buffers it can add a wait semaphore/signal semaphore to support GPU
based synchronization

10 times playback of `rain_restaurant.blend` on AMD RX 7700
Before: 10 × Animation playback: 72347.5540 ms, average: 7234.75539684 ms
After: 10 × Animation playback: 41523.2441 ms, average: 4152.32441425 ms

Getting around the OpenGL performance target.

Pull Request: https://projects.blender.org/blender/blender/pulls/136259
2025-03-24 10:28:52 +01:00
YimingWu
fa6e104362 Fix #136402: Gizmo: Removing ruler annotation layer can crash
`WM_gizmomap_group_find` can return null when removing ruler annotation
layer when current tool is not "Ruler" tool, this causes
`ruler_item_remove` to crash. This fix made it only remove ruler items
when `gzgroup` is not null (which is the same logic in
`view3d_ruler_remove_invoke`).

Pull Request: https://projects.blender.org/blender/blender/pulls/136416
2025-03-24 10:08:51 +01:00
Brecht Van Lommel
758e70d728 Fix #134756: Internal IES texture node flagged in missing file report
There was another fix for this, but it addressed a different problem than
what was reported.

Pull Request: https://projects.blender.org/blender/blender/pulls/136331
2025-03-24 09:39:22 +01:00
Brecht Van Lommel
583f4a7909 Fix #136010: Clarify meaning of Gamma in render settings and nodes
With more detailed tooltips.

Pull Request: https://projects.blender.org/blender/blender/pulls/136082
2025-03-24 09:39:00 +01:00
Jacques Lucke
06ddccac05 BLI: change strict flag from -Wshadow to -Wshadow=local
Previously, including `BLI_strict_flags.h` caused compile errors for all
shadowed values. Generally, this is fine, but sometimes it may catch more cases
than desirable. For example, adding `int U;` in `init_data` in
`MOD_correctivesmooth.cc` causes an error because there is the global `U` symbol
(user prefs).

While not an issue right now, this can cause unexpected compile errors when
adding additional includes. I ran into this while working on a tool that adds
additional includes automatically as part of its operation.

Fortunately, GCC supports a slightly weaker variant of this error:
`-Wshadow=local`. This only covers the case we mainly care about where local
variables are shadowed by other local variables.

Pull Request: https://projects.blender.org/blender/blender/pulls/136389
2025-03-24 09:29:21 +01:00
Jacques Lucke
2a9ebda328 Cleanup: avoid duplicate definition of unit_m3 and unit_m4
It does not seem worth it to avoid including `BLI_math_matrix.h` here nowadays.

Pull Request: https://projects.blender.org/blender/blender/pulls/136387
2025-03-24 09:28:54 +01:00
Omar Emara
55e09a6cbf Fix #136353: Mix node causes the compositor to misbehave
The newly added Mix node causes the compositor to assert and misbehave.
That's because its has unavailable sockets, and the compositor code base
was not designed to handle unavailable sockets. To this patch fixes that
by handing unavailable sockets everywhere that matters.
2025-03-24 10:00:52 +02:00
Omar Emara
fca510a4db Fix: Missing break in switch statement 2025-03-24 09:01:29 +02:00
Jeroen Bakker
2f41aa6a52 Fix #132968: OpenGL: Strip line directives on legacy AMD
Potential fix for legacy AMD driver issue.

- Updating drivers using a clean install has proven to fix the issue as well.
As driver can leave parts of an older driver active what it actually the cau
- Solution comments out the `#line` by replacing the first two characters.

Pull Request: https://projects.blender.org/blender/blender/pulls/136231
2025-03-24 07:31:29 +01:00
Brecht Van Lommel
0991ca7169 Fix: Shader node editor UI causes CPU subdivision to be used
Don't access Object.data through the RNA API.
2025-03-23 21:01:25 +01:00
Jacques Lucke
26c95c9968 Cleanup: avoid ambiguous type name
There was a potential conflict between blender::Map and Eigen::Map.
2025-03-23 13:35:48 +01:00
Jacques Lucke
3943a39c08 Cleanup: rename dot to dot_export namespace
Without this, including `BLI_dot_export.hh` in `delaunay_2d.cc` causes a
compile error because the name `dot` is ambiguous.

Pull Request: https://projects.blender.org/blender/blender/pulls/136385
2025-03-23 13:34:07 +01:00
Jacques Lucke
0c9f0709d3 Cleanup: remove duplicate math functions
Pull Request: https://projects.blender.org/blender/blender/pulls/136383
2025-03-23 13:28:20 +01:00