Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2022-10-04 12:05:38 +0300
committerBastien Montagne <bastien@blender.org>2022-10-04 12:05:38 +0300
commit8d97ecde02b4fff5c83fc6802372d14f8cf28a53 (patch)
tree26465079ae33462181adbe0c7154911b6ba23b81 /source
parentfb499916bb8fcacc08097754a61226ae84a516f1 (diff)
Fix T101559: Rain Test Animation demo crashes Blender 3.3
Update to liboverride creation code to add support of keeping active object forgot to consider case when there is no known/given view layer. NOTE: similar fix to rBc3003b4346fd5c5 in master.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/lib_override.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/lib_override.cc b/source/blender/blenkernel/intern/lib_override.cc
index 29f8b26c296..5a2601eac0f 100644
--- a/source/blender/blenkernel/intern/lib_override.cc
+++ b/source/blender/blenkernel/intern/lib_override.cc
@@ -1215,6 +1215,9 @@ static void lib_override_library_create_post_process(Main *bmain,
const Object *old_active_object,
const bool is_resync)
{
+ /* If there is an old active object, there should also always be a given view layer. */
+ BLI_assert(old_active_object == nullptr || view_layer != nullptr);
+
/* NOTE: We only care about local IDs here, if a linked object is not instantiated in any way we
* do not do anything about it. */
@@ -1383,7 +1386,7 @@ bool BKE_lib_override_library_create(Main *bmain,
id_hierarchy_root_reference = id_root_reference;
}
- const Object *old_active_object = OBACT(view_layer);
+ const Object *old_active_object = (view_layer != nullptr) ? OBACT(view_layer) : nullptr;
const bool success = lib_override_library_create_do(bmain,
scene,