diff options
author | Bastien Montagne <bastien@blender.org> | 2021-08-24 13:23:39 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-08-24 13:23:39 +0300 |
commit | 46913bf0a08c7e9ae5525ff95af0c7dc3b2f622f (patch) | |
tree | cb7ba247bd1746e92a749fd66d35ee6475b7ea4a /source/blender/blenkernel/intern/scene.c | |
parent | 4e4ac5a867add13035958479fb1e5bae419b7785 (diff) |
Fix T90840: Can't duplicate or copy (Ctrl-C) object from linked file.
We need to separate the flag telling duplicate code to not handle
remapping to new IDs etc., from the one telling the code that we are
currently duplicating a 'root' ID (i.e. not a dependency of another
duplicated ID).
This whole duplicate code/logic is still fairly unsatisfying, think it
will need further refactor, or maybe even re-design, at some point...
Diffstat (limited to 'source/blender/blenkernel/intern/scene.c')
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index a6190efbf75..5a668746956 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -1984,9 +1984,12 @@ Scene *BKE_scene_duplicate(Main *bmain, Scene *sce, eSceneCopyMethod type) if (type == SCE_COPY_FULL) { /* Scene duplication is always root of duplication currently. */ const bool is_subprocess = false; + const bool is_root_id = true; if (!is_subprocess) { BKE_main_id_newptr_and_tag_clear(bmain); + } + if (is_root_id) { /* In case root duplicated ID is linked, assume we want to get a local copy of it and * duplicate all expected linked data. */ if (ID_IS_LINKED(sce)) { |