diff options
author | Yiming Wu <xp8110@outlook.com> | 2022-06-02 16:27:09 +0300 |
---|---|---|
committer | Yiming Wu <xp8110@outlook.com> | 2022-06-02 16:27:28 +0300 |
commit | 04f67fb2dbf38e05d9c4855d2b214d545913c850 (patch) | |
tree | c7875a5a8ee51a8448210498363ed8e8ac5b4b68 /source/blender/blenkernel/BKE_collection.h | |
parent | e3363451667299b1cbc85b04bcec3f106e5dc216 (diff) | |
parent | 432c4c74ebe6f66b83e06ff7fca70c96d0526d6a (diff) |
Merge remote-tracking branch 'origin/master' into temp-lineart-containedtemp-lineart-contained
Diffstat (limited to 'source/blender/blenkernel/BKE_collection.h')
-rw-r--r-- | source/blender/blenkernel/BKE_collection.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_collection.h b/source/blender/blenkernel/BKE_collection.h index a3bbcc8687a..41d369ae9b2 100644 --- a/source/blender/blenkernel/BKE_collection.h +++ b/source/blender/blenkernel/BKE_collection.h @@ -115,6 +115,18 @@ bool BKE_collection_is_empty(const struct Collection *collection); bool BKE_collection_object_add(struct Main *bmain, struct Collection *collection, struct Object *ob); + +/** + * Add object to given collection, similar to #BKE_collection_object_add. + * + * However, it additionnally ensures that the selected collection is also part of the given + * `view_layer`, if non-NULL. Otherwise, the object is not added to any collection. + */ +bool BKE_collection_viewlayer_object_add(struct Main *bmain, + const struct ViewLayer *view_layer, + struct Collection *collection, + struct Object *ob); + /** * Same as #BKE_collection_object_add, but unconditionally adds the object to the given collection. * |