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-02-03 17:34:56 +0300
committerBastien Montagne <bastien@blender.org>2022-02-03 17:37:05 +0300
commit946c70e6a7892985289bf8dfaead8512d33eba79 (patch)
treec3e6c59a83b659eff13b9d1032fe1f923537fd2e /source/blender/blenkernel/BKE_collection.h
parent3bcbbf8992b0f41f19bef466129ce5b88984ac2b (diff)
Fix (unreported) broken do_version of hidden layers from pre-2.8 files.
`BKE_collection_object_add` ensures given object is added to an editable collection, and not e.g. a linked or override one. However, some processes like do_version manipulate collections also from libraries, i.e. linked collections, in those cases we need a version of the code that unconditionnally adds the given object to the given colleciton.
Diffstat (limited to 'source/blender/blenkernel/BKE_collection.h')
-rw-r--r--source/blender/blenkernel/BKE_collection.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_collection.h b/source/blender/blenkernel/BKE_collection.h
index 402bffea91d..bce15349880 100644
--- a/source/blender/blenkernel/BKE_collection.h
+++ b/source/blender/blenkernel/BKE_collection.h
@@ -123,12 +123,21 @@ struct Collection *BKE_collection_object_find(struct Main *bmain,
bool BKE_collection_is_empty(const struct Collection *collection);
/**
- * Add object to collection
+ * Add object to given collection, ensuring this collection is 'editable' (i.e. local and not a
+ * liboverride), and finding a suitable parent one otherwise.
*/
bool BKE_collection_object_add(struct Main *bmain,
struct Collection *collection,
struct Object *ob);
/**
+ * Same as #BKE_collection_object_add, but uncondionnaly adds the object to the given collection.
+ *
+ * NOTE: required in certain cases, like do-versionning or complex ID management tasks.
+ */
+bool BKE_collection_object_add_notest(struct Main *bmain,
+ struct Collection *collection,
+ struct Object *ob);
+/**
* Add \a ob_dst to all scene collections that reference object \a ob_src is in.
* Used for copying objects.
*