Commit Graph

150077 Commits

Author SHA1 Message Date
Bastien Montagne
9994fbece5 Refactor: VSE: Use new 'PartialWriteContext' class to generate the copy buffer.
This replaces the usage of the old `BKE_blendfile_write_partial` API by
the new `PartialWriteContext` class, in the code generating the 'copy
buffer' blendfile used for copy-pasting video sequences.

This is an interesting example of advanced/complex ID dependencies
handling with the new `PartialWriteContext`, as the 'main. scene storing
VSE data needs to be created (instead of copying the existing scene),
and then the ID dependencies of its sequences need to be filtered based
on their types.

There is no behavioral changes expected here.

Pull Request: https://projects.blender.org/blender/blender/pulls/122118

Pull Request: https://projects.blender.org/blender/blender/pulls/123993
2024-07-01 15:30:17 +02:00
Bastien Montagne
96198e88e1 Refactor: BPY: make 'libraries.write' code use the new PartialWriteContext class.
This makes code behind the `bpy.data.libraries.write()` API use the new
`PartialWriteContext` class, instead of the old
`BKE_blendfile_write_partial` API.

NOTE: This also means that the `blendfile_io` tests using this python
API are now using the new class.

No behavioral changes are expected here.

Pull Request: https://projects.blender.org/blender/blender/pulls/122118
2024-07-01 15:28:15 +02:00
Bastien Montagne
3d5d572db6 Core: Rewrite of 'partial blendfile write' feature.
This commit introduces a new `PartialWriteContext` class, which wraps
around a regular Main struct. It is designed to make writing a set of
IDs easy and safe, and to prepare for future 'asset library editing'
low-level code.

The main goal of this refactor is to provide the same functionalities
(or better ones) than existing partial write code, without the very
bad hacks currently done.

It will replace within the coming weeks all current usages of the
`BKE_blendfile_write_partial` API.

Essentially, it allows to:
* Add (aka copy) IDs from the G_MAIN to the partial write context.
  * This process handles dependencies and libraries automatically.
  * A refined handling of dependencies is possible through an optional
    'filtering' callback.
* Keep track of added IDs, to allow de-duplication in case data is added
  more than once.
* Cleanup the context (i.e. remove unused IDs).
* Write the context to disk as a blendfile.

Since the context keeps information to find matches between its content
and IDs from the G_MAIN, its lifespan is expected to be _very_ short.
Otherwise, changes in G_MAIN (relationships between IDs, their session uid,
etc.) cannot be tracked by the context, leading to inconsistencies.
A partial write context should typically be created, filled, written and
deleted within a same function.

Pull Request: https://projects.blender.org/blender/blender/pulls/122118
2024-07-01 15:27:54 +02:00
Bastien Montagne
b658087710 Core: Add a new util to clear an IDNameLib_Map.
Also make ID pointer parameter passed to `BKE_main_idmap_remove_id`
const.

There is no behavioral changes expected from that commit.

This is a requirement for incoming rewrite of the PartialWrite code
(see #122061 and !122118).

Pull Request: https://projects.blender.org/blender/blender/pulls/122118
2024-07-01 15:27:49 +02:00
Bastien Montagne
f1c2a93623 Refactor: Core: BKE_main: init/clear code.
This commit allows to initialize and clear a Main struct which
allocation is handled separately.

There is no behavioral change expected from this commit.

This is a requirement for incoming rewrite of the PartialWrite code
(see #122061 and !122118).

Pull Request: https://projects.blender.org/blender/blender/pulls/122118
2024-07-01 15:26:58 +02:00
Bastien Montagne
8f8c825196 Core: BKE_lib_id: Make local: Add new option to force making indirect data local.
The new `LIB_ID_MAKELOCAL_INDIRECT` option will force indirectly linked
data to also be made local. Note that this was already the case when a
whole library was made local.

Also some cleanup of options for 'make local', and pass
`IDWALK_IGNORE_MISSING_OWNER_ID` to the ID copying code for ID
management, since typically the owner pointer of embedded IDs at that
point is not yet set to its valid value.

There is no behavioral changes expected from this commit (even though
technically it does affect existing ID copying's behavior, there should
be no change in practice).

This is a requirement for incoming rewrite of the PartialWrite code
(see #122061 and !122118).

Pull Request: https://projects.blender.org/blender/blender/pulls/122118
2024-07-01 15:26:37 +02:00
Bastien Montagne
ce84e5f1a2 Core: Make Library IDs copyable.
There is no behavioral change expected from this commit.

This is a requirement for incoming rewrite of the PartialWrite code
(see #122061 and !122118).

Pull Request: https://projects.blender.org/blender/blender/pulls/122118
2024-07-01 15:26:31 +02:00
Clément Foucault
d4774a219b Fix: EEVEE: Missing light tiles in light probes
This was caused by the light culling system not
allocating enough tiles to cover the sphere lightprobe
render target.

Taking the max size between the lightprobe target and
the film fixes the issue.

Fixes #117444
2024-07-01 15:04:53 +02:00
Campbell Barton
c5dcc4f6c4 Merge branch 'blender-v4.2-release' 2024-07-01 23:00:36 +10:00
Campbell Barton
c2326a1639 Fix #123677: Incompatible extensions can be installed from disk 2024-07-01 22:57:38 +10:00
Hans Goudey
cd134c30d1 Cleanup: Sculpt: Remove redundant PBVH node variable 2024-07-01 08:21:49 -04:00
Hans Goudey
1e3dc838d9 Cleanup: Sculpt: Use accessors for PBVH node vertex indices
Makes it easier to search for where these are used (and whether it's
the unique or shared vertices being accessed).
2024-07-01 08:21:49 -04:00
Hans Goudey
2e36675dec Fix: Sculpt: Incorrect access of shared PBVH node vertices
Tools should generally only process vertices owned by the current
PBVH node rather than vertices owned by other nodes.
2024-07-01 08:21:49 -04:00
Hans Goudey
7c17339749 Refactor: Sculpt: Specialize expand mask update per PBVH type
Part of #118145.
Duplicate the function three times so it can be implemented specifically
for each data structure. The duplication can be reduced in the future by
using the same methods as the sculpt brush refactor.

This also fixes the incorrect usage of `PBVH_ITER_ALL`, which doesn't
just also iterate over hidden vertices like was probably intended, but also
processes vertices shared between different PBVH nodes multiple times,
one for each node they're contained in.
2024-07-01 08:21:49 -04:00
Campbell Barton
483647e1a3 Merge branch 'blender-v4.2-release' 2024-07-01 22:10:47 +10:00
Campbell Barton
649d308407 Merge branch 'blender-v4.2-release' 2024-07-01 22:10:44 +10:00
Campbell Barton
43e57c638a Merge branch 'blender-v4.2-release' 2024-07-01 22:10:41 +10:00
Campbell Barton
7bd846ce0a Fix error including platforms in extensions HTML output 2024-07-01 22:08:34 +10:00
Weizhen Huang
f2215d7564 Fix: safe_normalize() not defined for float2 on Metal 2024-07-01 13:58:30 +02:00
Alexander Brock
1b09654530 Fix and test direction_to_fisheye_lens_polynomial
The function direction_to_fisheye_lens_polynomial computes the inverse of
fisheye_lens_polynomial_to_direction.

Previously the function worked almost correctly if all parameters except k_0
and k_1 were zero (in that case it was correct except for flipping the x-axis).

I replaced the fixed-point iteration (?) by Newton's method and implemented a
test to make sure it works correctly with a wider range of parameter sets.

Pull Request: https://projects.blender.org/blender/blender/pulls/123737
2024-07-01 13:56:35 +02:00
Sybren A. Stüvel
bf3dd9a743 Anim: add type assertion to graph editor function
In `graph_refresh_fcurve_colors()`, add an assertion that the
`bAnimListElem` data is actually an F-Curve before casting it to one.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/123987
2024-07-01 13:44:29 +02:00
Sybren A. Stüvel
dc2fa02f00 Cleanup: Anim, add documentation to Binding::name_without_prefix()
Just some extra documentation that this is also known as the "display name".

No functional changes.
2024-07-01 13:44:28 +02:00
Miguel Pozo
df0ca5382c Merge branch 'blender-v4.2-release' 2024-07-01 13:41:58 +02:00
Miguel Pozo
635db22ca6 Fix: Re-apply versioning made for EEVEE-Next in 4.1
Pull Request: https://projects.blender.org/blender/blender/pulls/123909
2024-07-01 13:37:48 +02:00
Omar Emara
0e1af55247 Merge branch 'blender-v4.2-release' 2024-07-01 13:30:33 +03:00
Omar Emara
e545c814a4 Fix: Scene not rendered even with Cryptomatte node
Blender doesn't render the scene even though a Cryptomatte node exists.
That's because Blender only considers Render Layer nodes, but
Cryptomatte node can reference scenes as well. This patch fixes that by
putting Cryptomatte nodes into consideration.

Pull Request: https://projects.blender.org/blender/blender/pulls/123814
2024-07-01 12:28:24 +02:00
Sybren A. Stüvel
2536b7dee4 Anim: Remove F-Curve modifier type 'Filter'
The 'Filter' F-Curve modifier type was never actually implemented, so
it's now properly removed from the code.

The enum entry `FMODIFIER_TYPE_FILTER` in `DNA_anim_types.h` is kept, so
that it's clear that this once existed (which explains what would
otherwise be a hole in the values of the enum entries).

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/123906
2024-07-01 12:27:13 +02:00
Sybren A. Stüvel
469762fb6b Anim: do not visit every F-Curve in bke::action_foreach_id()
Avoid looping over all F-Curves in `bke::action_foreach_id()`. This was
only necessary to support the possible ID* in custom properties on the
Python F-Curve modifier, but that modifier has been removed in the
preceeding commit.

Even though `BKE_fcurve_foreach_id()` exists, it is only relevant for
drivers, but the F-Curves stored in an Action are always just animation
data, not drivers.

No functional changes intended.

Pull Request: https://projects.blender.org/blender/blender/pulls/123906
2024-07-01 12:27:08 +02:00
Sybren A. Stüvel
6b3a4cbf46 Anim: Remove F-Curve modifier type 'Python'
Remove all traces in the source code of the never-properly-implemented
'Python' F-Curve modifier type. It was introduced in 44e5b7788b.

This modifier was never coded to completion, couldn't be created, didn't
have a GUI, and probably would have caused severe performance issues if
it were ever implemented.

Not only that, but the modifier had space for custom properties
(IDProperties), which means that it could point to any ID. This in turn
means that `bke::action_foreach_id()` would have to loop over every
F-Curve and every F-Curve modifier to handle such relations. By removing
this modifier type, that loop can also be removed from that function.

Note that F-Curves can only refer to other IDs when they are used as a
driver. However, the F-Curves stored in an Action as animation data are
never drivers.

`BKE_fcurve_foreach_id()` is now only relevant when the F-Curve is a
driver, which I've added to its documentation.

The enum entry `FMODIFIER_TYPE_FILTER` in `DNA_anim_types.h` is kept, so
that it's clear that this once existed (which explains what would
otherwise be a hole in the values of the enum entries).

No functional changes should be observable by Blender users, as this
feature doesn't seem to have ever existed in a way that could be used.

Pull Request: https://projects.blender.org/blender/blender/pulls/123906
2024-07-01 12:27:08 +02:00
Sybren A. Stüvel
43c1a8958b Cleanup: Anim, make fmods_init_typeinfo() a bit safer
Instead of using hard-coded array indices that happen to match the
`FMODIFIER_TYPE_...` enum values, actually use the enum items.

Also add some assertions that those indices actually match the type
numbers declared by the `FModifierTypeInfo` structs.

To avoid rewrapping long lines, remove comments that basically repeat
the code anyway.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/123906
2024-07-01 12:27:08 +02:00
Jeroen Bakker
9f53f3b600 OpenGL: Disable Stencil Export when forcing workarounds
When forcing workarounds the stencil export support wasn't disabled.
This PR disables stencil export support when forcing workarounds.

Pull Request: https://projects.blender.org/blender/blender/pulls/123985
2024-07-01 12:19:26 +02:00
Bastien Montagne
c4d8b8604a Merge branch 'blender-v4.2-release' 2024-07-01 12:06:36 +02:00
Bastien Montagne
ec1836f66f I18N: Updated UI translations from git/weblate repository (44224d93ece6077). 2024-07-01 12:06:16 +02:00
Miguel Pozo
fa03b6f3ba Merge branch 'blender-v4.2-release' 2024-07-01 12:04:05 +02:00
Miguel Pozo
f16fdcfc85 Fix #123794: Crash when UDIMs have gray and color tiles
Don't use grayscale data for color UDIM arrays.

Pull Request: https://projects.blender.org/blender/blender/pulls/123905
2024-07-01 12:02:28 +02:00
YimingWu
41da774dd0 Fix #123966: Don't draw orientation for objects displayed as wire
When `object.dt` is OB_BOUNDBOX or OB_WIRE, it's not expected to see
faces so don't show face orientation overlay for them.

Pull Request: https://projects.blender.org/blender/blender/pulls/123978
2024-07-01 10:58:01 +02:00
Omar Emara
862028f4dc Compositor: Refactor GPU Cryptomatte node
Currently, the Render mode of the GPU Cryptomatte mode extracts the
Cryptomatte layers based on information in the RenderResult of the
scene. This means the node will not work if no RenderResult exists,
which is typically the case for the viewport compositor, and especially
after #123378.

To fix this, we simply acquire the passes directly from the appropriate
view layer based on the node's layer name. The render compositor context
implementation will handle the extraction from the RenderResult, while
the viewport compositor will just return the DRW passes.

Pull Request: https://projects.blender.org/blender/blender/pulls/123817
2024-07-01 10:50:05 +02:00
Campbell Barton
38582dc86a Merge branch 'blender-v4.2-release' 2024-07-01 17:26:37 +10:00
Campbell Barton
78330522d2 Fix #123877: exception showing an add-on with an invalid manifest
Extensions with a manifest that can't be parsed caused can exception
in the add-ons UI.

Account for errors loading the manifest, falling back to dummy values
& show a warning that the exceptions manifest could not be parsed.
2024-07-01 17:20:38 +10:00
Campbell Barton
4f61fb38f5 Merge branch 'blender-v4.2-release' 2024-07-01 16:39:37 +10:00
Campbell Barton
75f500ad02 Fix #123923: regression un-installing an extension
Regression in [0] which used an argument only available in Python 3.12.

[0]: 37ae9d5fc4
2024-07-01 16:37:54 +10:00
Campbell Barton
a8402c57d2 Merge branch 'blender-v4.2-release' 2024-07-01 16:10:07 +10:00
Campbell Barton
789b7bba91 Fix #123938: error dragging extension URLs to install an extension
Regression in [0].

[0]: 989de85cf6
2024-07-01 16:06:32 +10:00
Campbell Barton
29ad1145ac Merge branch 'blender-v4.2-release' 2024-07-01 15:59:31 +10:00
Campbell Barton
29cf0e4f8c Merge branch 'blender-v4.2-release' 2024-07-01 15:59:29 +10:00
Campbell Barton
5ca9997dfd Merge branch 'blender-v4.2-release' 2024-07-01 15:59:26 +10:00
Campbell Barton
0c54c347d8 Extensions: correct missing return
Harmless but mypy warns about this.
2024-07-01 15:57:42 +10:00
Campbell Barton
2d7b41c8c2 Extensions: Enforce copyright format "YYYY Name" or "YYYY-YYYY Name"
Based on !123846 with additional checks.

Co-authored-by: Mahid Sheikh <standingpad-animations@noreply.localhost>
2024-07-01 15:54:20 +10:00
Campbell Barton
5629b09ccf Extensions: update makefile for linters 2024-07-01 15:30:34 +10:00
Campbell Barton
14a2e933f4 Merge branch 'blender-v4.2-release' 2024-07-01 15:16:48 +10:00