Core: Add proper support to add or copy IDs into libraries. #108328

Merged
Bastien Montagne merged 2 commits from mont29/blender:F-idcopy-linkeddata into main 2024-03-06 17:05:21 +01:00

2 Commits

Author SHA1 Message Date
Bastien Montagne bcdb3f1f99 LibOverride: Use new `BKE_id_copy_in_lib` to create ID in libraries.
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
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.
2024-03-06 15:59:06 +01:00
Bastien Montagne 412b87702a 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 15:59:06 +01:00