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
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2022-05-19 17:48:45 +0300
committerBastien Montagne <bastien@blender.org>2022-05-19 17:51:24 +0300
commit2d5b91d6a0f7470dd475721ea038c061513090d7 (patch)
treefee6e0827014017ebad2b1fb81a1c56110d25dad /source/blender/blenkernel
parentf8ebb0e1d556244d8e79c2efa105df9df909e3f8 (diff)
Fix (studio-reported) more possibilities to edit content of linked/override collections.
Existing code for the `Move` operator, and some `Collections` panel operations (Object properties) was absolutely not override-safe, and sometimes not even linked-data safe.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/collection.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c
index 0edc16e822c..76c6dc1d5e7 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -1172,14 +1172,21 @@ static bool scene_collections_object_remove(
{
bool removed = false;
+ /* If given object is removed from all collections in given scene, then it can also be safely
+ * removed from rigidbody world for given scene. */
if (collection_skip == NULL) {
BKE_scene_remove_rigidbody_object(bmain, scene, ob, free_us);
}
FOREACH_SCENE_COLLECTION_BEGIN (scene, collection) {
- if (collection != collection_skip) {
- removed |= collection_object_remove(bmain, collection, ob, free_us);
+ if (ID_IS_LINKED(collection) || ID_IS_OVERRIDE_LIBRARY(collection)) {
+ continue;
+ }
+ if (collection == collection_skip) {
+ continue;
}
+
+ removed |= collection_object_remove(bmain, collection, ob, free_us);
}
FOREACH_SCENE_COLLECTION_END;