Commit Graph

119374 Commits

Author SHA1 Message Date
Hans Goudey
2037145e43 Fix: Broken VectorSet move construction after recent change
Caused by a2fac05e9d.
Like the move constructor for `Vector`, all the template arguments must
be specified for the compiler to pick the move constructor over the copy
constructor when the defaults aren't used. We can test this with a non-
moveable type like unique_ptr.

Pull Request: https://projects.blender.org/blender/blender/pulls/138215
2025-04-30 18:51:33 +02:00
Habib Gahbiche
439e65c77c Tests: add tests for node tree iterator
This is a preparation for a small cleanup to the node tree iterator, see
https://projects.blender.org/blender/blender/pulls/138205

Pull Request: https://projects.blender.org/blender/blender/pulls/138195
2025-04-30 18:36:23 +02:00
Clément Foucault
60d01f9c29 Fix: EEVEE: Missing shadows in render tests file on Mac
There seems to be a synchronization issue with the
non-workaround version of texture atomics on macos.

This fixes some other broken test from #138147
2025-04-30 16:33:09 +02:00
Clément Foucault
64399ddfcd Fix: EEVEE: Missing shadow update during light baking
This is the root cause of the non-deterministic behavior of
light baking. The shadow system was not given enough update
iteration to fully render all tiles of the Virtual shadow maps.

This would resulte in missing tiles inside the bakes.
The value of the tiles seems to have been implementation
dependant, which, on some implementation created light leaks.

This fixes some recent regressions on the MacOS builbot tests.

This is candidate for backporting to 4.2.

Fix #138147

Pull Request: https://projects.blender.org/blender/blender/pulls/138203
2025-04-30 16:32:43 +02:00
Aras Pranckevicius
9315af2170 Fix: some cases of bone scale were not handled correctly in new FBX importer
- Was not consistently adjusting for bone adjust_post_scale
- Map fbx node "igore parent scale" to Blender bone "inherit scale: none"

Pull Request: https://projects.blender.org/blender/blender/pulls/138204
2025-04-30 16:03:00 +02:00
Philipp Oeser
8409a5081b Fix #137998: Crash calling editmode_toggle overriding view_layer.objects.active
If the viewlayer active object was set to None, editmode toggle poll
would still be permissive (it checked `CTX_data_active_object`, exec was
checking `BKE_view_layer_active_object_get`...)

These two need to be in sync.

For this PR, just go with `BKE_view_layer_active_object_get`...

NOTE: other mode switching operators seem to have the same "problem".
Pull Request: https://projects.blender.org/blender/blender/pulls/138083
2025-04-30 15:54:27 +02:00
Philipp Oeser
1ae6d13b5f Fix #138178: Grease Pencil strokes loose vertexgroups after Re-Arrange
Caused by 9d13e39585

Compared to meshes (which in that commit did a
`BKE_mesh_copy_parameters_for_eval` on the new Mesh
[mesh_new_no_attributes] -- this includes copying `vertex_group_names`)
Curves were missing that.

Now added.

Pull Request: https://projects.blender.org/blender/blender/pulls/138202
2025-04-30 15:34:45 +02:00
Omar Emara
f216b3ca62 Compositor: Turn Directional Blur options to inputs
This patch turns the options of the Directional Blur node into inputs.

In the process, the node now allows scaling down, not just scaling up.
The transformation options were renamed to Translation, Rotation, and
Scale as opposed to Distance, Spin, and Zoom. Finally, scaling is now
defined as a scale instead of a delta. So 1 is identity, 2 means scale
up two times, and so on. While previously, 0 was an identity scale, 1
means scale up by two types.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/138198
2025-04-30 14:40:13 +02:00
Sergey Sharybin
6ff0726ef2 Refactor: const-correctness in GPU viewport
Make GPU_viewport_colorspace_set() const-crrect w.r.t view_settings.

Instead of doing in-place modifications of the view_settings argument
with restoring them later introduce new function for copying view
settings which keeps curve mapping unchanged in the destination.

Should be no functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/138189
2025-04-30 14:03:26 +02:00
Clément Foucault
4c4c21df76 DRW: Debug: Change debug scope to debug group
These are not the same. Debug Scope are for scoped
capture. These should be static to avoid flooding
debug tools with scopes. Since this code is
unlikely to be debugged, it is better to use
debug groups.
2025-04-30 13:40:27 +02:00
Campbell Barton
e8f1473da6 Refactor: add "filepath" property to CollectionExport to avoid hacks
Fixes for #137856 & #137507 were workarounds to ignore the
PROP_PATH_SUPPORTS_BLEND_RELATIVE for CollectionExport however they
were error prone - especially #137856 as it relied on the surrounding
buttons.

Instead of adding logic to ignore the flag for this specific case,
add a property to the CollectionExport which can have it's flags
and use this instead of the operators "filepath" property.

Internally this wraps the same IDProperty data used by the operator.

Ref !137883
2025-04-30 11:15:38 +00:00
Clément Foucault
0dba80c89c GPU: Add reserved GLSL keywords to C++ stubs
This avoid using them in our shader codebase.
2025-04-30 12:47:00 +02:00
Clément Foucault
82dd9f68a4 Fix: Overlay: Compilation error on OpenGL
Caused by reserved `active` keyword in GLSL.
2025-04-30 12:44:00 +02:00
Damien Picard
a4669e3a8f Fix: Bring back UI translation of node header labels
Translation of node header labels was removed in cleanup
commit 02281dd26a, likely by mistake.

Issue reported by Gabriel Gazzán.

Pull Request: https://projects.blender.org/blender/blender/pulls/138052
2025-04-30 12:29:00 +02:00
Omar Emara
7a6acfac62 Compositor: Turn Sun Beams options to inputs
This patch turns the options of the Sun Beams node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/138184
2025-04-30 11:46:36 +02:00
Pratik Borhade
3b9c03bb9b Fix: Add SequenceCache read-attributes flag to defaults
Include `MOD_MESHSEQ_READ_ATTRIBUTES` flag to defaults. Also in
`MOD_MESHSEQ_READ_ALL`

Continuation of !132475

Pull Request: https://projects.blender.org/blender/blender/pulls/138110
2025-04-30 11:04:31 +02:00
Clément Foucault
7714998537 Overlay: Remove macros for globals uniform buffer access
Pull Request: https://projects.blender.org/blender/blender/pulls/138068
2025-04-30 09:55:52 +02:00
Clément Foucault
cac80a9e3c Cleanup: Overlay: Rename GlobalsUboStorage to UniformData 2025-04-30 09:55:48 +02:00
Clément Foucault
6c4b410d3e Cleanup: Remove unused draw_common_shader_shared.hh 2025-04-30 09:55:48 +02:00
Clément Foucault
ec0da5bfe7 Overlay: Move GlobalsUboStorage to overlay_shader_shared.hh 2025-04-30 09:55:48 +02:00
Clément Foucault
27a8c00157 Overlay: Split theme colors and sizes into different structs
Centralize processing of each and allow
more semanticaly correct references.
2025-04-30 09:55:48 +02:00
Philipp Oeser
17d8650d2d Fix #137398: Transforming editbones can propagate wrong envelope radii
When tweaking envelope radii of (connected) envelope bones, we dont
always make sure that corresponding head and tail radii are in sync.
Using the `Bone Size` tool should take care of this (and it works to
some extend) but tweaking the radii through the sidepanel UI or the
Properties Editor (through RNA), then corresponding heads and tails
radii get out of sync.

Once we are in such unfortunate situation, then code in the transform
system's `recalcData_edit_armature` fails with wrong assumptions, it
propagates radii from children to parents which are unexpected / not in
use.

So one thing to do would be to add this syncing of radii to
`rna_Armature_editbone_transform_update`.
This alone would solve the "problem" in new files.

For existing files that are already out of sync we  add versioning that
corrects this on file load

Pull Request: https://projects.blender.org/blender/blender/pulls/137599
2025-04-30 09:18:34 +02:00
Campbell Barton
cf319d108d Cleanup: check pointers before visibility tests, reduce right-shift 2025-04-30 16:43:05 +10:00
Guillermo Venegas
7a1cd05b9b Refactor: UI: Replace uiLayoutColumnFlow and uiLayoutGridFlow with uiLayout class methods
This converts the public `uiLayoutColumnFlow` and `uiLayoutGridFlow` functions
to an object oriented API (an `uiLayout::column_flow` and `uiLayout::grid_flow` respectively),
matching the python API.
This reduces the difference between the C++ API with the python version,
its also helps while converting code from python to C++ code (or vice-versa),
making it almost seamless.

Both renamed functions now returns an `uiLayout` reference instead of a pointer.
New calls to this method should use references too.

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/138074
2025-04-30 08:27:31 +02:00
Laurynas Duburas
5888ae5d5d Fix: Curves: wrong behavior in split operator
Fixes problem with cyclic curves when non selected point is on (or near) loop stitch.
Also fixes crash when all points are selected.

Pull Request: https://projects.blender.org/blender/blender/pulls/137931
2025-04-30 08:12:20 +02:00
Campbell Barton
1d80d15b8f UV: support sticky modes when face sync-select is enabled
Previously UV sync-select in face mode would isolate UV selection
so dragging a face would disconnect it from adjacent faces.

Now the sticky mode is respected for face selection.

This is needed for #136817 so storing per-selection doesn't result
in a user visible change in behavior.
2025-04-30 15:54:26 +10:00
Campbell Barton
648c07329f RNA: improve the PPM description 2025-04-30 05:21:12 +00:00
YimingWu
a143a99634 Fix #128247: Show warning when applying rotation on invalid matrix
When a object matrix has a determinant of 0 (which typically means 0s on
one or more of the scale axes), the matrix inversion would become
invalid thus the inversion matrix will be quietly set to diag(0). This
would basically reset all vertices to the origin of the object after
applying the inversion matrix. This happens in the "apply rotation"
stage.

Now addtional warnings will be shown to the user when there are
objects that tries to go through such operation, and they will be
skipped.

-------

It will look like this when some objects failed, if you want to test, just scale some objects to 0 and apply rotation:

![图片](/attachments/8c80cf13-895f-4ec9-a631-9951bc961fca)

Pull Request: https://projects.blender.org/blender/blender/pulls/128273
2025-04-30 06:16:38 +02:00
Campbell Barton
70ae8606e2 Cleanup: pass tool-settings instead of scene to UV selection functions
Needed to extend UV selection functions.
2025-04-30 13:48:15 +10:00
John Kiril Swenson
d269ce1939 VSE: Show warning on slip if not enough content to clamp
Clamping behavior in the new slip operator (added in #137072) would
silently fail if any strip(s) in the selection did not have enough
underlying content to fill the strip bounds.

This patch allows the user to continue slipping along a clamp defined
by the strips that support it. A warning in the status bar
is also added in this case.

If no strips can clamp, the button is disabled entirely, with only the
warning present.

Images available in the PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/137980
2025-04-30 05:44:35 +02:00
Campbell Barton
18ba7d1f86 Cleanup: use const arguments for UV checking functions 2025-04-30 12:54:29 +10:00
Germano Cavalcante
9a4ee099e6 Fix #137680: Knife constraints not accurate in orthographic view
The code that updated the ray based on the constraint point was
incorrect in orthographic view. In this view, it's the ray origin that
changes, not the direction. This has now been fixed.

Additionally, as a further improvement, when snapping is not available,
a fallback point is now used as the constraint point.

Pull Request: https://projects.blender.org/blender/blender/pulls/137776
2025-04-29 22:43:34 +02:00
Sietse Brouwer
06624bbafb UI: In paint modes, don't overwrite a modal cursor with the paint cursor
In all paint and sculpt modes, it was practically impossible for modal
operators to set a modal cursor, because the cursor was immediately
overwritten by the paint cursor. In this patch the paint cursor function
checks for a modal cursor first. When a modal cursor exists, it isn't
overwritten by the paint cursor.

Pull Request: https://projects.blender.org/blender/blender/pulls/137893
2025-04-29 22:33:49 +02:00
Sean Kim
8c2888d578 Sculpt: Lower Mesh BVH leaf limit to 2500
This commit reduces the Mesh paint BVH node limit on vertices from
10000 to 2500. In general, a lower value here improves performance for
both raycasting and brush strokes, as smaller leaf nodes mean more nodes
can be filtered in the broad sphere tests instead of needing each
vertex to be processed.

There are a number of considerations that go into profiling this value:
* This change is most impactful for large meshes, where the user is
  going to be modifying a small total percentage of the model's area.
* Lower values may improve CPU performance, but overall responsiveness
  as perceived by the user goes down with values much smaller than 2500.

  This is likely due to GPU overhead, as each BVH node corresponds to a
  VBO.
* A lower node limits increase the BVH building time.

The new limit of 2500 corresponds to the following performance changes
as compared to the prior baseline:
* 1.12x ~ 1.52x FPS increase depending on the ratio of brush to mesh
  size.
* 1.27x ~ 2.88x performance increase for the brush evaluation.
* 1.31x slower BVH build times on a mesh with 10 million verts
  (0.2864s to 0.3761s).

Further performance data and comparison videos can be seen in the
associated PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/137871
2025-04-29 22:27:44 +02:00
Sean Kim
922e40eefe Sculpt: Convert all Scrape, Fill, Flatten brushes to Plane brush
Previously, the bundled essential brushes in Sculpt Mode were changed
from the Scrape, Fill, and Flatten types to the Plane brush type. This
commit does the same thing programmatically and removes the now old code
related to these obsolete brushes.

Resolves #134076

Pull Request: https://projects.blender.org/blender/blender/pulls/138022
2025-04-29 22:20:49 +02:00
John Kiril Swenson
385a8a4d6a Fix: Zooming certain editors disabled from recent fix
Adjust the logic in `view_zoomstep_apply_ex` to ensure that spaces
without the new flag `V2D_ZOOM_IGNORE_KEEPOFS` will still zoom if they
do not also have `keepofs` flags set.

This means spaces like Geometry Nodes can zoom again.
2025-04-29 12:43:56 -05:00
Nicola
a42fc3bcc1 Fix: Incorrect sculpt view normal calculation
The correct order is View Space -> World Space -> Object Space, which
implies that the view to world matrix `cache->vc->rv3d->viewinv` has to
be applied before `ob.world_to_object`.

Introduced in 5a21fa0ada

Pull Request: https://projects.blender.org/blender/blender/pulls/138146
2025-04-29 19:18:01 +02:00
Hans Goudey
a2fac05e9d BLI: Add configurable inline buffer to VectorSet
Allow configuring the inline buffer capacity for the slots array, and
add an inline buffer for the keys vector. Previously there was always
an allocation when adding an element.

The inline capacity is manually configured in a few places as part of
this commit.

Pull Request: https://projects.blender.org/blender/blender/pulls/136461
2025-04-29 18:52:30 +02:00
Hans Goudey
6e190bde4a Fix #137843: Crash with invalid NURBS order attribute values
Two separate fixes are needed to resolve the crash. First is in the
store named attribute node, which incorrectly retrieved an attribute
value validator without checking the field type. The other is various
missing checks for the case when the evaluated positions for a
specific curve are empty.

Pull Request: https://projects.blender.org/blender/blender/pulls/137861
2025-04-29 18:28:45 +02:00
Clément Foucault
daadf38780 Fix: DRW: Tests: Asserts in test_draw_submit_only
The setup was not setuping a correct rendering
environment (missing resource + framebuffer).
2025-04-29 18:16:10 +02:00
Clément Foucault
ab7731d05c Fix: GPU: Tests: Memory leak with vulkan backend tests 2025-04-29 18:16:10 +02:00
John Kiril Swenson
8b36cf3eac Fix #138018: VSE zooming left aligned
Create an option in `View2D.flag` that allows us to have separate
behavior for area resizing (left aligned with `V2D_KEEPOFS_X`) and
zooming (centered with the keepofs flags disabled). Add this to the
versioning code.

Pull Request: https://projects.blender.org/blender/blender/pulls/138041
2025-04-29 17:03:50 +02:00
Hans Goudey
600380cd98 Fix #137794: Ignore curve radius for legacy curve object bounds
Caused by 06f6d77979.

Legacy curve objects have not taken the radius into account in the
past. Better to stick with that behavior and only affect the new
curve object type. This only affects non-instanced legacy curve
objects; generally generated curves are presented to the depsgraph
iterator as the new object type.

Pull Request: https://projects.blender.org/blender/blender/pulls/137852
2025-04-29 16:16:44 +02:00
Jacques Lucke
40379c4dbd Fix #138102: Grease Pencil: Wrong frame used to retrieve visible drawings
`retrieve_visible_drawings` did not take frame remapping into account, which
leads to inconsistent result because other places do take it into account.

Pull Request: https://projects.blender.org/blender/blender/pulls/138135
2025-04-29 16:13:33 +02:00
Clément Foucault
954f7b0965 Fix #138048: Overlay: Transparent meshes hide overlays in Cycles
This happened only in material preview.

This is because the overlay engine was not considering material
preview as using EEVEE.
2025-04-29 16:06:53 +02:00
Clément Foucault
d24b0e4a4e GPU: Remove runtime parsing of GLSL source
See #129009 for context.

The preprocessor parses metadata and writes a header file containing
an inline function that inits the `GPUSource` with the metadata.

These header files are then included inside `gpu_shader_dependency.cc`.

This still keep the usage of the `metadata` enums and classes to avoid
pulling the whole blender module inside the preprocessor executable.

This speeds-up startup time in Debug build:
`gpu_shader_dependency_init`
- Before : 37ms
- After : 4ms

I didn't measure release, but it is unlikely to be noticeable (in the
order of 4ms > 1ms).

Pull Request: https://projects.blender.org/blender/blender/pulls/138070
2025-04-29 15:32:36 +02:00
Clément Foucault
8b70166214 GPU: Tests: Avoid test not passing on certain platform
These tests were using exact comparison on data that
was going through lossy conversion steps. Adding
casting or epsilon value fixes the issue.
2025-04-29 15:27:58 +02:00
Kabinet0
dd528023d9 Fix #138000: Retopology overlay broken
Do not skip the depth prepass for the retopology mesh.

Pull Request: https://projects.blender.org/blender/blender/pulls/138042
2025-04-29 15:24:28 +02:00
Omar Emara
93408e03a4 Compositor: Turn Ellipse Mask options to inputs
This patch turns the options of the Ellipse Mask node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/138130
2025-04-29 15:20:54 +02:00
Omar Emara
3d4900f412 Compositor: Turn Box Mask options to inputs
This patch turns the options of the Box Mask node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/138129
2025-04-29 14:34:23 +02:00