This commit essentially touches to post-processing of collections and
objects after resync itself has been done, to ensure their proper
instantiation in the scene:
- Remove a lot of the process in resync case (resynced data are assumed
to be already instantiated in the scene, unlike override creation
case).
- For auto-resync, only do post-processing once after all overrides
have been resynced (doing it after each individual resynced was
causing a lot of instantiation glitches, with a lot of unwanted
extra objects and collections being added to the master collection).
It also deals in a much more reliable way with detection of objects
missing from the scene, by using the new `BKE_scene_objects_as_gset`
utils.
As a bonus this makes auto-resync process slightly faster (only by a few
percents, but that's always good to get).
This is functionality that isn't accessible via the user interface. The
API allows the creation and modification of an override template that
holds rules that needs to be checked when overriding the asset.
The API is setup that it cannot be changed after creation. Later on when
the system is more mature we will allow changing overrides operations.
NOTE: This is an experimental feature and should not be used in productions.
Reviewed By: mont29, sebbas
Differential Revision: https://developer.blender.org/D10792
Instead of storing those in scne's master collection, which is fairly
annoying, we now add them to a (hidden) specific collection. Easy to
ignore, or check and cleanup.
Attempt to work around some full-corruption cases created at the studio.
Not clear how those were created, so not really fixing anything here,
just detecting and 'solving' as best as possible some high corruption of
local overrides.
This is good to have in general anyway, might help prevent further
corruption to happen too.
This is basically done by ignoring override operations from old override
affecting ID pointer properties, when the new (destination) one is not
NULL.
Fix T86501: New object added to overridden collection doesn't show up in linking file on Resync.
This is more of a work-around actually, since there is no real way to
fix the issue in a fully automated and consistent way, it is caused by
older blender files being saved with 'broken' overrides.
WARNING: This cannot ensure that some purposedly edited/overridden ID
pointer properties won't be lost in the process.
`BKE_lib_override_library_main_resync` uses
`LIB_TAG_LIB_OVERRIDE_NEED_RESYNC` tags set by RNA override apply code,
and perform detection for the remaining cases (those were new overrides
need to be created for data that was not present before in the library).
And then it actually resync all needed local overrides.
Part of T83811 & D10649.
First step towards a better handling of relationships between IDs in
override context, especially when a resync is needed.
First, introduce a new flag to override operations,
`IDOVERRIDE_LIBRARY_FLAG_IDPOINTER_MATCH_REFERENCE`, for ID pointers.
It keeps track of whether an RNA ID pointer has been kept to its
'natural overriden ID' (in override hierarchy context), or has actually
been re-assigned to some other data-block.
Second, refactor how we deal with relationships between IDs in override
hierarchy code, especially in resync case. This will fixe several cases
listed in T83811, especially the case where an ID pointer to an existing
override needs to be updated to a new one due to a matching change in
linked data.
Having a centeral place to find a list of all library overrides should be
useful for managing production scenes where library overrides are used a lot.
This change adds the individually overridden properties of a data-block under
the data-block itself. Just how we show modifiers, constraints or pose channels
there. This way we can also expose library override operations/options better
in future.
There's also a filter option for the library overrides now, so they can be
hidden. It is only available in the View Layer display mode though, like the
other filter options.
One internal change this has to do is adding more informative return values to
undo pushes and the library override functions called by it. That way we can
send a notifier when library overrides change for the Outliner to know when to
rebuild the tree.
Differential Revision: https://developer.blender.org/D7631
Reviewed by: Andy Goralczyk, Bastien Montagne, William Reynish
We do not generate overrides for missing data-blocks (aka placeholder
ones) anymore, and properly delete the remaining old overrides of those
during the resync process.
This should prevent constant 'missing data-blocks' messages when opening
blend files with overrides whose libraries have beed edited.
Issue reported by @andy from Blender studio, thanks.
In the end the process is surpringly simple, we only need to manually
convert the proxy itself into an override (which is trivial), and then
run common code with the default 'make override' operation.
Fix T81059: Add operator to convert proxies to library overrides.
This will re-link all usages of a library override data-block
(including all of its override dependencies) to its reference linked
IDs, and delete those liboverrides.
As usual, it is available in the ID sub-menu of the outliner context
right-click menu.
Part of T76555.
Available from the usual ID submenu in the Outliner context menu.
The goal of this operator is to re-create the override from the linked
data, while preserving existing defined overrides.
This allows to update local opverrides when relations between datablocks
are changed in source library linked data.
Part of T76555.
This replaces header include guards with `#pragma once`.
A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`),
because they are used in other places.
This patch has been generated by P1561 followed by `make format`.
Differential Revision: https://developer.blender.org/D8466
This means that we delete all override properties except for those over
ID pointers *if* the assigned pointer matches the linked data hierarchy.
Then we reload affected datablocks.
This commit enables basic copy of overrides on generic ID level, as well
as from (deep) copy operators for objects and collections.
So e.g. if your linked overridden caracter is in a collection, you can
now (from the outliner) Duplicate that override collection to get a new
overriding copy of the character.
We still need operators (new or modifying existing ones) to handle that
from 3DView e.g.
Note that deep copy code for objects/collections (and incidently
animdata) had to be modified to avoid duplicating/making local IDs that
remain linked ones being used by overrides ones.