diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-05-24 10:04:25 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-05-24 10:08:36 +0300 |
commit | 5df8a6eb9447a42cf6817e89543c5055e9aab225 (patch) | |
tree | 21d38833320a09ae2167bc17f683337f1f89e4b2 /source/blender/blenkernel/intern | |
parent | 153c7746aba64696f58b52e6e4c7935b0e89eb43 (diff) |
Correct fix for view center
The view layers active object was not being copied.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/layer.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index 648d5f02d4d..c6795ce8278 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -382,7 +382,15 @@ void BKE_view_layer_copy_data( view_layer_dst->object_bases_hash = NULL; /* Copy layer collections and object bases. */ - BLI_duplicatelist(&view_layer_dst->object_bases, &view_layer_src->object_bases); + /* Inline 'BLI_duplicatelist' and update the active base. */ + for (Base *base_src = view_layer_src->object_bases.first; base_src; base_src = base_src->next) { + Base *base_dst = MEM_dupallocN(base_src); + BLI_addtail(&view_layer_dst->object_bases, base_dst); + if (view_layer_src->basact == base_src) { + view_layer_dst->basact = base_dst; + } + } + layer_collections_copy_data(&view_layer_dst->layer_collections, &view_layer_src->layer_collections); // TODO: not always safe to free BKE_layer_collection_sync(scene_dst, view_layer_dst); |