Commit Graph

134656 Commits

Author SHA1 Message Date
Bastien Montagne e7abad23e0 Fix #118696: Nested override libraries can cause persistent resync warning.
The root of the issue was checking against the wrong RNA type to decide
whether a collection's item resolution could use the stored ID pointers
or not, leading to always only relying on names in CollectionObjects
case, leading to a lot of false 'need resync' detections in case names
would get out of sync between liboverrides and linked reference data.

Note that this probably had no other effect than resyncing when not
needed, since actual liboverride apply and resync code would already
do the right thing here.
2024-03-28 15:36:07 +09:00
Campbell Barton b4517ca148 Cleanup: replace suspicious use of "&" with "&&"
"&" was used in some cases where "&&" is more typically used,
while "&" works when both values happen to be 1, this doesn't read well.
2024-03-28 17:26:16 +11:00
Campbell Barton 0ef033750f Cleanup: pass arguments by const reference 2024-03-28 17:16:33 +11:00
Bastien Montagne 4e650294e2 Fix #119184: Crash due to extremely broken liboverrides.
The validation code (`BKE_lib_override_library_main_validate` & co)
would not properly handle some extreme cases of data corruptions well.
2024-03-28 13:39:51 +09:00
Harley Acheson 6789a88107 UI: Open Folder of Recent Items
Add an item to the context menu when right-clicking on an item in the
"Open Recent" file list for "Open File Location" that opens that
location in an OS Explorer/Finder window.

Pull Request: https://projects.blender.org/blender/blender/pulls/119988
2024-03-28 04:37:08 +01:00
Harley Acheson 27c95da888 Refactor: Remove BLF _ex functions using default arguments
Remove all BLF "_ex" versions of functions by using default arguments.
These functions only differ by having an optional argument that can
return extra details about the result of the operation. This PR just
make these part of the main function as optional arguments with default
values - all nullptr.

Pull Request: https://projects.blender.org/blender/blender/pulls/119994
2024-03-28 04:02:13 +01:00
Campbell Barton b28861682e Fix 2D cage gizmo failing to refresh when Shift is pressed/released
Detecting when the Shift state "changed" wasn't working because
of a self-assignment.

Since cursor motion always refreshes,
this isn't an especially noticeable an issue.
2024-03-28 13:45:24 +11:00
Campbell Barton b0328f67a9 Fix invalid sizes when clearing gpu::Batch
For Batch::verts some values weren't cleared,
for Batch::inst values after the array would be cleared,
although as these were already zeroed this probably didn't cause
problems in practice.
2024-03-28 13:45:22 +11:00
Campbell Barton 115f8b0c59 Cleanup: clarify variable being iterated over, avoid shadowing 2024-03-28 13:45:20 +11:00
Hans Goudey 2d9f19c962 Cleanup: Use std::move for asset identifier construction
Pass strings by value and move their result. This gives the caller
the potential to move existing strings into the class. Moving the
std::shared_ptr should just avoid reference counting here.
2024-03-27 22:31:44 -04:00
Hans Goudey 94b985371d Cleanup: Use const in more places in mesh modifier evaluation 2024-03-27 22:25:09 -04:00
Hans Goudey b35831ad6c Mesh: Use shared cache for shrinkwrap boundary data
This is mainly to make the computation threadsafe, to allow computing
the cache on a const mesh, and also to decrease the cost of copying
meshes. Computing caches on const meshes generally makes it easier
to avoid copying meshes unnecessarily in other ways, which would be
useful for some pending fixes and cleanups to modifier evaluation.
2024-03-27 22:25:09 -04:00
Hans Goudey 278c5c9c7e Cleanup: Simplify shrinkwrap cache creation
- Use C++ Array type
- Move to blender::bke::shrinkwrap namespace
- Use edge_is_boundary instead of edge_mode in a few places
- Avoid writing to edge_mode unnecessarily
2024-03-27 22:25:09 -04:00
Hans Goudey 7c01355cad Cleanup: Use forward declaration headers in a few places 2024-03-27 22:25:08 -04:00
Hans Goudey 5d09b0d373 Cleanup: Move remaining curves editors functions to C++ namespace 2024-03-27 22:25:08 -04:00
Harley Acheson 9489173f07 Refactor: Move UI Templates and Regions into Sub-directories
Move interface_region-* files into regions/ folder, and
interface_template-* files into templates/ folder.

Pull Request: https://projects.blender.org/blender/blender/pulls/119991
2024-03-28 03:06:49 +01:00
Campbell Barton d8c69c84e3 Cleanup: correct the vector copy size in ViewOpsData::state_backup
In practice this didn't cause problems as the correct value was
written afterwards.
2024-03-28 13:01:41 +11:00
Campbell Barton a2fa743364 Cleanup: pass std::string by reference instead of value 2024-03-28 13:01:39 +11:00
Campbell Barton 8f88487768 Cleanup: pass LogImageElement by reference or pointer instead of value 2024-03-28 13:01:38 +11:00
Campbell Barton 872c997c8f Cleanup: remove redundant break & return statements 2024-03-28 13:01:37 +11:00
Campbell Barton 939e076fdc Cleanup: remove redundant assignment & null check 2024-03-28 13:01:36 +11:00
Campbell Barton 3ad1a2eb62 Cleanup: remove redundant null check 2024-03-28 13:01:34 +11:00
Campbell Barton 49dd5fae40 Cleanup: remove redundant variable & check 2024-03-28 13:01:34 +11:00
Campbell Barton 868d6eb5e8 Cleanup: quiet signed integer overflow warning from cppcheck 2024-03-28 13:01:32 +11:00
Campbell Barton 481bcc14d7 Cleanup: quiet enum conversion warning 2024-03-28 13:01:31 +11:00
Campbell Barton 618788aa7a Cleanup: remove redundant std::string / c_str conversion 2024-03-28 12:23:46 +11:00
Campbell Barton 2a892012be Render: correct buffer sizes for render cache paths
FILE_CACHE_MAX was meant to be larger than FILE_MAX to make room
for additional layers in the path. An error in the define used
`FILE_MAXFILE + FILE_MAXFILE` instead of `FILE_MAXDIR + FILE_MAXFILE`
causing the value to be smaller allowing a buffer overflow when passing
the string into BLI_path_abs.

Correct the define and call on the directory component before
the file is added so it doesn't clamp the string length unnecessarily.

Note that some values weren't correct since the original commit [0],
although [1] moved them to a shared incorrect define.

[0]: 78cdc707ab
[1]: cef1b9c30f
2024-03-28 12:12:05 +11:00
Campbell Barton db466e9578 Fix buffer overflow from passing undersized buffers to BLI_path_abs 2024-03-28 11:40:50 +11:00
Campbell Barton da49873e89 Fix buffer overflow with BLI_str_format_uint64_grouped
Caused by cd4328dd82.
2024-03-28 11:40:23 +11:00
Campbell Barton 0d3ea69daa Fix sizeof(sizeof(...)) passed to BLI_path_slash_ensure
Regression in [0] which would cause ensuring the slash to do nothing
in most cases. Note that the slash may not be needed, but that should
be handled separately.

[0]: d66f24cfe3
2024-03-28 11:40:21 +11:00
Hans Goudey c28db1f0a0 Cleanup: Use C++ namespace for object editors module
Move the public functions from the editors/object (`ED_object.hh`)
header to the `blender::ed::object` namespace, and move all of the
implementation files to the namespace too. This provides better code
completion, makes it easier to use other C++ code, removes unnecessary
redundancy and verbosity from local uses of public functions, and more
cleanly separates different modules.

See the diff in `ED_object.hh` for the main renaming changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/119947
2024-03-28 01:30:38 +01:00
Hans Goudey 35c6c11c7e Cleanup: Make format 2024-03-27 20:20:07 -04:00
Hans Goudey aae9446599 Cleanup: Remove unnecessary "using namespace"
This file is in the blender namespace already
2024-03-27 20:19:23 -04:00
Hans Goudey fc06dc31d8 Cleanup: Sort forward declaration lists, remove duplicate 2024-03-27 20:19:23 -04:00
Hans Goudey 0bde788d63 Cleanup: Use "All" asset library to simplify node link drag search
The "All" library didn't exist internally when this code was first
written. The "skip_local" check that complicated this isn't necessary
because we don't add local node groups that aren't assets anyway.
2024-03-27 20:19:23 -04:00
Campbell Barton ed5cca4021 Cleanup: quiet missing-declarations warnings 2024-03-28 08:48:03 +11:00
Campbell Barton cd0b0a9272 CMake: remove non-existing include directory
As of [0] this is no longer created.

[0]: f5f7024040
2024-03-28 08:48:02 +11:00
Harley Acheson c433a90138 UI: Minimum Width for Large Confirmation Dialogs
We currently have a single minimum width value for confirmation
dialogs, but we need to set this based on which of the two sizes it
is. Otherwise the larger confirmations with icon look too squished
when the content is shorter.

Pull Request: https://projects.blender.org/blender/blender/pulls/119978
2024-03-27 22:28:00 +01:00
Habib Gahbiche 8377f5d0fb Fix: Compositor GPU backdrop not updating when image transform operators are applied
How to reproduce:
- Have image editor and GPU compositor backdrop enabled and showing the same image
- In image editor, apply operator flip horizontally
- Notice how image editor gets updated but compositor backdrop doesn't

Fixes backdrop for GPU compositor for the following operations:
- image -> transform -> Flip horizontally
- image -> transform -> Flip vertically
- image -> transform -> Rotate 90° clockwise
- image -> transform -> Rotate 90° counter-clockwise
- image -> transform -> Rotate 180°

Pull Request: https://projects.blender.org/blender/blender/pulls/119819
2024-03-27 21:42:47 +01:00
Habib Gahbiche e1a0b6cd9e Fix compositor backdrop not updating for image invert operator
How to reproduce:
- Have image editor and GPU compositor backdrop enabled and showing the same image
- In image editor, apply inver image colors operator
- Notice how image editor gets updated but compositor backdrop doesn't

Fixes backdrop updates for GPU compositor for the following operators:
- Image -> Invert -> Invert image colors
- Image -> Invert -> Invert red channel
- Image -> Invert -> Invert green channel
- Image -> Invert -> Invert blue channel
- Image -> Invert -> Invert alpha channel

Pull Request: https://projects.blender.org/blender/blender/pulls/119820
2024-03-27 21:41:25 +01:00
Brecht Van Lommel 53e9fb6b78 Fix #117566: Cycles persistent data not updated by device preferences
Pull Request: https://projects.blender.org/blender/blender/pulls/119970
2024-03-27 18:55:46 +01:00
Jonas Holzman 75a9cbed24 UI: Improvements to Revert File Operator Confirmation Popup
Larger, more informative confirmation when reverting the current file
to saved version. Title of "Revert to the Saved File", content of
"Any unsaved changes will be lost." and button text of "Revert".

Pull Request: https://projects.blender.org/blender/blender/pulls/119758
2024-03-27 18:39:09 +01:00
Hans Goudey 10bc136a1a Fix #119935: Attribute set operator support for 2D integer vector lost
Also fix the poll to properly check for the remaining unsupported types.
Don't add back Quaternion support, since that's arguably less useful,
and we might want different ways to set those values compared to
just entering WXYZ.
2024-03-27 13:14:02 -04:00
Brecht Van Lommel 8682ad1908 Fix: Memory leak and race condition with particle effector RNG
Store RNG on per thread data, instead of the effector itself which may
be used by multiple objects evaluated in different threads.

This has been causing the blendfile_versioning test to fail randomly.
Thanks Ray and Aras for helping track this down.

Pull Request: https://projects.blender.org/blender/blender/pulls/119967
2024-03-27 18:06:31 +01:00
Brecht Van Lommel d2b38a475f Fix: Cycles Python error after previous commit 2024-03-27 18:04:19 +01:00
Alaska a0d5d9137b Fix #119937: Outdated tool tip for Automatic denoiser
Pull Request: https://projects.blender.org/blender/blender/pulls/119940
2024-03-27 17:49:58 +01:00
Harley Acheson 1984f08250 Fix #119846: EEVEE-Next: Rendering Infinite Samples
When rendering images, and not in the interactive viewport, do not
use infinite samples. Follow the  behavior of Legacy EEVEE.

Pull Request: https://projects.blender.org/blender/blender/pulls/119893
2024-03-27 16:16:34 +01:00
Weizhen Huang 68253b4937 Fix: Cycles volume light tree using wrong point to compute uncertainty angle
it is not clear from which point the `cos_theta_u` should be computed in
volume segment, so the original implementation was mixing the closest point
and the point where the minimal angle is formed.
Use the closest point on segment as a conservative measure.

Pull Request: https://projects.blender.org/blender/blender/pulls/119965
2024-03-27 15:06:05 +01:00
Germano Cavalcante 3031146097 Fix #119957: Crash when using 'angle constraint' Relative in Knife tool
Most likely caused by 6d491da0be

In that commit, `knife_pos_data_clear` started to clear (set `-1`) the
value of the current object (which is expected).

However, `knife_snap_angle_relative` relies on the current object to
transform the face normal to global space.

This is weak and error prone since the face is obtained from the
function itself.

The code could be optimized and reuse the face identified in
`knife_snap_curr`, but for now just identify the face object.
2024-03-27 10:55:38 -03:00
Weizhen Huang 72780c3769 Fix: Cycles light tree assertion failing on Intel Mac
in the test scene `all_light_types_in_volume.blend`, `theta - theta_o -
theta_u` is slightly above the threshold. Even if we do a strict check
with `acos` on the failing cases, it will go to the other branch and
deliver a result which is also 1.0f. Better to relax the threshold.
2024-03-27 13:46:57 +01:00