Commit Graph

120055 Commits

Author SHA1 Message Date
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
Campbell Barton
f76d3c8eb6 Cleanup: past const arguments to UV selection testing functions 2025-03-23 05:35:17 +00:00
Campbell Barton
3e5de94c8e Fix #136188: Invalid read clicking on a menu socket button in modifier
Clicking the drop-down button for a Menu-type socket in geometry
modifier panel crashes with ASAN error.

Resolve by skipping the check for ID properties & assert the property
is an RNA property.
2025-03-22 08:06:42 +00:00
Campbell Barton
0d2fd12d8d Cleanup: format 2025-03-22 08:06:40 +00:00
Campbell Barton
818a1a6a35 Cleanup: replace int with wmOperatorStatus 2025-03-22 16:35:59 +11:00
Campbell Barton
28c282cdad Cleanup: return bool from outliner_open_back 2025-03-22 16:26:50 +11:00
Pratik Borhade
4281767fc0 Fix #113383: Clear button in selector input in redo panel closes the panel
`UI_OT_button_string_clear` clears the redo panel in `wm_operator_finished`.
hud_status is set to CLEAR due to undo flag on above the internal operator.
To fix the redo panel from closing, undo flag from the operator could be
removed. Alternative is, skip internal operators from closing the redo
panel with extra check `if (op->type->flag & OPTYPE_INTERNAL) {return;}`

Ref: !135727
2025-03-22 15:47:41 +11:00
Johnny Matthews
633b8d30db Fix #135071: Vertex Parenting: Provide Index Access Options
When using vertex parenting, an option for using the parent object
final evaluated indices is exposed in the Object Properties: Relations
panel. This allows the calculation of the parent vertex position to
ignore the the CD_ORIGINDEX layer and instead use the final indices
that may have been altered by the node tree evaluation.

The indices that will be used for the vertex parenting are also exposed
to the UI in the same panel, allowing them to be altered after the
vertex parent has been created.
2025-03-21 23:43:48 +01:00
Guillermo Venegas
61783caa7f UI: Rename Add File Node operator to Add Image as Node
`Add File Node` name is too generic. This operator only handles
opening images and movies as nodes, not script files or other kind of files as nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/122561
2025-03-21 22:49:13 +01:00
Jesse Yurkovich
01ddb320dd Fix #124263: Generate unique names during Alembic and USD export
While object names in Blender are already unique, the names themselves
may be "unsafe" for use in the various file formats. During processing
we make the names "safe". However, we did not guarantee that these new
safe names were themselves unique wrt each other. Consider object names
"Test 1" and "Test-1" which both become "Test_1" after being made safe.
These will collide during export; only 1 object would be exported and
it's undefined which object's data would "win".

To rectify this we add another name map to the hierarchy iterator which
is then used to handle collisions as they happen. The map is per-
hierarchy meaning that a name can appear more than once as long as its
under a different hierarchy. E.g.
- `/root/A/X` and another `/root/B/X` is OK
- `/root/A/X` and another `/root/A/X` is NOT OK

Pull Request: https://projects.blender.org/blender/blender/pulls/135418
2025-03-21 21:29:08 +01:00
Hans Goudey
321dbb0115 Cleanup: Use spans for mesh tangent calculation arguments 2025-03-21 15:27:24 -04:00
Hans Goudey
4e1e47f840 Fix: Assert in draw mesh tangents extraction
Avoid requesting mesh data when the mesh is an edit mesh wrapper. That
triggered asserts that hid the real issue in #136235.
2025-03-21 15:00:04 -04:00
Clément Foucault
410282e156 EEVEE: Add quantized geometric normal for shadow bias
This improves the situations where the shading normal is far from the
best shadow bias direction. This is particularly noticeable on low poly
meshes with smooth normals.

This patch fixes the issue by storing a quantized version of the
geometric normal in the Gbuffer.
Only 6 bits are used (each axis uses 2 bits). This is stored inside the
gbuffer header since it is always available and has some spare bits to
store this data.

This quantization is only done if the error introduced by using the
shading normal is higher than using the quantized normal. This means
that flat shaded surfaces will not have any quantization artifact.
For smooth shaded surfaces, the quantization is only effective if the
shading normal is quite different (greater than ~20° difference)
than the geometric normal.

The attached blendfile contains an example Material that shows
how the quantization is done. This was used to find the threshold
value with the least amount of error.

To compensate the quantization error,  we increase the normal bias by
~20% which is subpixel if the shadow texel density is high enough.

This also changes the forward shading pipeline to use the geometric
normal for bias.

The first Light closure normal is now used for the attenuation function
since this is the most representative of the final shading. This normal
being inverted for transmission closures, we have to negate the normal
in the attenuation computation.

Pull Request: https://projects.blender.org/blender/blender/pulls/136136
2025-03-21 19:07:46 +01:00
Clément Foucault
32fe65dc9b Fix #136098: Impossible to select of pose bones when in Weight Paint mode
This was caused by the select_id not being flushed to
the armature object.

This is because the selection code uses `FOREACH_OBJECT_IN_MODE_BEGIN`
to iterate over the objects. This doesn't call the depsgraph
which would, in normal circumstances, flush the select_id value
to the evaluated object.

Also fix #136141

Pull Request: https://projects.blender.org/blender/blender/pulls/136320
2025-03-21 18:15:23 +01:00