Commit Graph

133827 Commits

Author SHA1 Message Date
Bastien Montagne
ea73438e8a LibOverride: Use new BKE_id_copy_in_lib to create ID in libraries.
This replaces the somewhat hackish and usafe code used previously.

Also fixes a potential bug, where the newly created `local_id` was
dereferenced before checking for it to be non-null.

Pull Request: https://projects.blender.org/blender/blender/pulls/108328
2024-03-06 17:05:13 +01:00
Bastien Montagne
a681f5d896 Core: Add proper support to add or copy IDs into libraries.
Seems to work OK in basic cases, but needs more work when copying
outside of Main at least.

Note: There is no behavioral changes expected from this commit.

Note that there are at least two known usecases for this change:
* Liboverrides, as with recursive resync and proxies conversion it
  often ends up creating 'virtual' linked data that does not actually
  exists in the library blend files.
* Complex versionning code (`do_versions_after_setup`) when it needs
  to create new IDs (currently handling linked data that way is just not
  supported!).

Implements #107847.
2024-03-06 17:05:10 +01:00
Brecht Van Lommel
b3d55b37bc Merge branch 'blender-v4.1-release' 2024-03-06 16:52:54 +01:00
Sergey Sharybin
c63b36e6b2 Fix upper-case package root CMake warning
CMake 3.27 introduced the new policy CMP0144 which makes it so the
find_Package() functions use the upper-case <package>_ROOT variable
when set. It is off by default, but it does check for the possible
interference and warns about it. The warning happens when the upper
case package root variable is set, and a find_package() is called
with a lower case package name.

In practice this leads to issue with CMake on macOS where the
TIFF_ROOT is set to an expected variable, and find_package is used
to find TIFF. THe CMake's FindTIFF.cmake attempts to find CMake
configuration of the tiff library using find_package(tiff CONFIG)
which triggers the policy warning.

This change makes it so the policy is set to NEW, silencing the
warning and bringing us to a more desired/expected behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/119120
2024-03-06 16:51:06 +01:00
Brecht Van Lommel
216637ab56 Build: Upgrade OSL to 1.13.7, OIDN to 2.2.1
Fix #118020: Crash with OptiX OSL on Windows
Maybe help with #119035: Memory leaks with OIDN GPU

Ref #113157

Pull Request: https://projects.blender.org/blender/blender/pulls/119095
2024-03-06 16:34:27 +01:00
Hans Goudey
0106514669 Fix #107232: Creating builtin attributes in edit mode can cause crash
For example, creating the "position" attribute with the wrong name or type
could crash Blender when exiting edit mode. This is because some data isn't
stored as attributes in Blender, and the attribute API doesn't work very well
with BMesh.

Two parts to the solution:
- Remove builtin attributes with incorrect domains or names when
  converting from BMesh to Mesh.
- Add error messages when creating builtin attributes in edit mode. It's still
  possible to create name-convention attributes, because Blender should be
  able to handle different types and domains for them.

Pull Request: https://projects.blender.org/blender/blender/pulls/119110
2024-03-06 16:16:43 +01:00
Anthony Roberts
445fd42c61 Windows: Add ARM64 support
* Only works on machines with a Qualcomm Snapdragon 8cx Gen3 or above.
  Older generation devices are not and will not be supported due to
  some driver issues
* Requires VS2022 for building.
* Uses new MSVC preprocessor for sse2neon compatibility.
* SIMD is not enabled, waiting on conversion of blenlib to C++.

Ref #119126

Pull Request: https://projects.blender.org/blender/blender/pulls/117036
2024-03-06 16:14:34 +01:00
Anthony Roberts
3d5fa7698f Cycles: Add Windows ARM64 support
Ref #119126

Pull Request: https://projects.blender.org/blender/blender/pulls/117036
2024-03-06 16:14:34 +01:00
Anthony Roberts
7e3b83b146 Build: Add Windows ARM64 support for library dependencies
* VS2022 is required.
* Only OpenPGL and DPCPP are disabled, other libraries are supported.
* Embree is built with LLVM and VS2019 tools, and for that reason has
  its own cmake file as it is quite different.
* TBB and USD patches should become obsolete once these are upstreamed
  and Blender upgrades to the latest versions.

Ref #119126

Pull Request: https://projects.blender.org/blender/blender/pulls/117036
2024-03-06 16:14:33 +01:00
Lukas Tönne
8c2cf0f218 Fix: GPv3: Memory leaks from Grease Pencil undo steps
The `StepObject` stores customdata but relies on C++ object destruction.
CustomData is a C struct and doesn't get freed automatically, the
StepObject needs a destructor that takes care of the owned custom data.

Pull Request: https://projects.blender.org/blender/blender/pulls/119125
2024-03-06 15:42:25 +01:00
Hoshinova
bbb14b95bb Fix: Crash when creating Noise Texture node with link-drag-search
Fix crash when creating a Noise Texture through dragging and releasing
another output and connecting it to the "Gain" or "Offset" sockets.

Pull Request: https://projects.blender.org/blender/blender/pulls/119097
2024-03-06 15:42:22 +01:00
Sergey Sharybin
d88686fb2b Cycles: Add debug logging to the OIDN GPU checks
No functional changes, just something that could help troubleshooting
cases when option to use GPU for denoising is grayed out.

Pull Request: https://projects.blender.org/blender/blender/pulls/119123
2024-03-06 14:54:19 +01:00
Falk David
bab3e5c442 Fix: GPv3: Frames map not saved
The copy constructor of the Layer class didn't do a copy
of the frames storage (DNA) and only a copy of the frames map (runtime).
This is fine, but we need to make sure to tag the frames storage,
because it is out of sync otherwise.
During edit mode undo, the layers were copied (but the frames storage not tagged) which meant that after undoing and then saving the file,
the frames would be gone after reloading.

The fix makes sure we tag the frames storage, so that it is properly synced.
2024-03-06 13:56:27 +01:00
Miguel Pozo
500a891ac9 Fix: EEVEE-Next: Use the correct shadow radius
Typo/mistake from #118860.
2024-03-06 13:21:39 +01:00
Lukas Tönne
e3c0f64154 GPv3: Fix outline modifier unstable end cap direction
The angle of the outline modifier caps was computed in a [-pi, +pi)
interval, but this creates an unstable situation for angles close to
180. Small variation can lead the angle to flip from +180 to -180 and
change the direction of the semi-circle. Instead generate arcs always
in counter-clockwise direction and use angles in the [0, 2pi) intverval.
This creates stable directions for end caps and also allows larger
arcs where necessary.

Pull Request: https://projects.blender.org/blender/blender/pulls/119122
2024-03-06 12:40:46 +01:00
Lukas Tönne
f51e93bec7 GPv3: Shrinkwrap modifier
Port of shrinkwrap modifier from GPv2.

Adds a new API function in `BKE_shrinkwrap.hh` for the modifier.

Pull Request: https://projects.blender.org/blender/blender/pulls/119118
2024-03-06 12:05:00 +01:00
Bastien Montagne
8178bffd64 Merge branch 'blender-v4.1-release' 2024-03-06 11:16:00 +01:00
Bastien Montagne
9bfa17e030 Cleanup: make format. 2024-03-06 11:15:27 +01:00
Bastien Montagne
7daedd3e02 Merge branch 'blender-v4.1-release' 2024-03-06 11:02:42 +01:00
Bastien Montagne
253a6e36de Core: Library Linking: Add basic tests that linked animation works.
The new test merely ensures basic Object animation (both through action
and driver) still works as expected with linked data.
2024-03-06 10:59:10 +01:00
Bastien Montagne
23ce5b6567 Merge branch 'blender-v4.1-release' 2024-03-06 10:06:08 +01:00
Bastien Montagne
bb00621965 Fix recent regression preventing animation on any linked data.
Regression in 427eed292d.

Root of the issue was that animation system was using a single same
check to decide if an F-Curve/driver was valid to use to animate some
data, and whether user can create/edit animation for that data.

Both cases are actually different, since e.g. linked data is not
user-editable, but it can still be animated (either by related linked
Actions, drivers defined in the linked data, or some more hackish
changes like py API/RNA scripting).

This commit now defines two checks:
 * `RNA_property_animateable`: whether a RNA pointer & propoerty is
   animateable, based on their types and definition.
 * `RNA_property_anim_editable`: whether a specific data referenced by
   the RNA pointer and property is effectively user-editable.

The new `driveable` check added by 427eed292d is also renamed to
`RNA_property_driver_editable` (since the basic type-based
`RNA_property_animateable` is also valid for drivers currently).

Pull Request: https://projects.blender.org/blender/blender/pulls/119089
2024-03-06 10:02:53 +01:00
Omar Emara
d31ff88af7 Merge branch 'blender-v4.1-release' 2024-03-06 08:28:04 +02:00
Omar Emara
bfec649bd9 Fix #119043: Compositor crashes with intricate setup
The Realtime Compositor crashes with intricate node setups. That's
due to hardware limitations where shaders can't have as many output
images as needed by the compositor shader operations. To fix this, we
recursively split shader operations until their output count fits the
hardware limitation.

Pull Request: https://projects.blender.org/blender/blender/pulls/119075
2024-03-06 07:25:05 +01:00
Sean Kim
3f57081346 Cleanup: Remove unnecessary property for new hide operators
This PR removes the mistakenly added `WM_operator_properties_border` RNA properties for the new `PAINT_OT_hide_show_masked` and `PAINT_OT_hide_show_all` operators. Neither of these is a box gesture operator so they do not need them.

Pull Request: https://projects.blender.org/blender/blender/pulls/119113
2024-03-06 06:25:41 +01:00
Sean Kim
2b3d93295e Cleanup: Convert eShapeType to enum class
This PR converts the other `gesture` `enum` to an `enum class` and does minor renaming of its members.

Pull Request: https://projects.blender.org/blender/blender/pulls/119111
2024-03-06 06:24:46 +01:00
Campbell Barton
f1eecd6425 Cleanup: quiet missing-declarations warning, format 2024-03-06 15:45:37 +11:00
Sean Kim
705964d7bb Sculpt: Migrate Box Hide to common gesture code
This PR migrates the existing `PAINT_OT_hide_show` operator to the
previously extracted `gesture` namespace performed in #118881

The current operator has support for choosing whether the hide / show
action is performed on every vertex inside or outside the selection
area. This has been added to the common gesture functionality too,
but no common operator property has been exposed for it for the other
Lasso / Box tools to use.

Other modes of the current "hide_show" operator have been split
into separate operators: `PAINT_OT_hide_show_all` and
`PAINT_OT_hide_show_masked`.

Prerequisite for #80390

Pull Request: https://projects.blender.org/blender/blender/pulls/119040
2024-03-06 05:25:43 +01:00
Campbell Barton
c4a74ff2de Fix #119102: GLSL was the default formatter without a file extension
Regression in [0] which registered the GLSL formatter before Python.
Resolve and note that the registration order matters in code-comments.

[0]: 462c144f41
2024-03-06 15:12:00 +11:00
Campbell Barton
d686699316 Cleanup: various non-functional C++ changes 2024-03-06 14:47:29 +11:00
Campbell Barton
aba193ad30 Cleanup: disable unused code 2024-03-06 14:43:15 +11:00
Campbell Barton
95273b0c23 License headers: add SPDX headers 2024-03-06 14:43:14 +11:00
Germano Cavalcante
d37328840a Fix #119107: assert triggered when snapping with constraint in UV editor
This assertion is incorrect regardless.
2024-03-05 23:36:28 -03:00
Sean Kim
1fe82d536d Cleanup: Add missing license and copyright headers
This PR adds the standard license header that was missed when the file was originally created.

Pull Request: https://projects.blender.org/blender/blender/pulls/119105
2024-03-06 02:20:17 +01:00
Hans Goudey
38208ed153 Fix #119099: Distribute points in volume node missing in add menu
Mistake in 860f3ed794
2024-03-05 16:11:09 -05:00
Harley Acheson
77e84cb528 Merge branch 'blender-v4.1-release' 2024-03-05 12:18:09 -08:00
Harley Acheson
49c723e117 Fix #118765: Show Startup Popup Warning on Main Window
During startup, popup block warnings should be displayed on the main
window, not a child window even if it is active.

Pull Request: https://projects.blender.org/blender/blender/pulls/119096
2024-03-05 21:16:35 +01:00
Miguel Pozo
bdba57e095 Fix: EEVEE-Next: PCF on perpendicular surfaces 2024-03-05 20:39:06 +01:00
Hans Goudey
8d26692912 Merge branch 'blender-v4.1-release' 2024-03-05 14:26:04 -05:00
Hans Goudey
90fb838416 Fix: Geometry Nodes Sort Elements node crash with nested instances
Typically nodes that edit instances only change the top level of
instances. As an oversight, that wasn't done in the sort elements node.
This causes problems as the top level of instances are reordered and
nested instances are edited. As the top-level is replaced, its
contained geometry sets (the nested instances) are deleted.

To fix, only reoder the top-level instances in this node.
2024-03-05 14:18:29 -05:00
Miguel Pozo
71ff93bb32 Fix: EEVEE-Next: PCF Overshadowing
Avoid overshadowing caused by shadow filtering.

Pull Request: https://projects.blender.org/blender/blender/pulls/118910
2024-03-05 20:02:47 +01:00
Brecht Van Lommel
44d418143e Merge branch 'blender-v4.1-release' 2024-03-05 19:55:07 +01:00
Sahar A. Kashi
3e09fbf062 Fix #112983: Cycles HIP-RT crash on deleting all objects
Pull Request: https://projects.blender.org/blender/blender/pulls/118944
2024-03-05 19:52:58 +01:00
Sahar A. Kashi
e65de74aa5 Cycles: HIP search for ROCm 6 driver
This should be backwards compatible, and is more future proof
for future driver releases.

Pull Request: https://projects.blender.org/blender/blender/pulls/118944
2024-03-05 19:52:43 +01:00
Miguel Pozo
c0f23e79e3 EEVEE-Next: More conservative shadow LOD selection
Ensure shadow-maps at non-zero LODs cover <1 screen texel.
This still doesn't solve projective aliasing, though.
2024-03-05 19:06:51 +01:00
Miguel Pozo
fe93664cef EEVEE-Next: Avoid shadowmap padding on 0 radius punctual lights
Use the original Light radius to compute the shadowmap projection.
Avoid unnecessary padding in shadowmaps, increasing the perceived
shadow resolution when the shadow softness is not 0.

Pull Request: https://projects.blender.org/blender/blender/pulls/118860
2024-03-05 18:59:44 +01:00
Harley Acheson
615edb3f3c UI: Props Dialog Default Properties
Allow activating numerical buttons upon opening of props dialogs. Set
defaults for some dialogs where appropriate.

Pull Request: https://projects.blender.org/blender/blender/pulls/119007
2024-03-05 18:54:50 +01:00
Falk David
a11335d19a Cleanup: Move BKE_fcurve.h to C++
No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/119094
2024-03-05 18:39:08 +01:00
Jörg Müller
43307b667d Audaspace: porting changes from upstream.
Developed in Blender, see: #107607
2024-03-05 18:22:17 +01:00
Hans Goudey
25ad66cb4c Merge branch 'blender-v4.1-release' 2024-03-05 11:58:23 -05:00