diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_collection.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/collection.c | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_collection.h b/source/blender/blenkernel/BKE_collection.h index a9539b3a3c4..d78133499ce 100644 --- a/source/blender/blenkernel/BKE_collection.h +++ b/source/blender/blenkernel/BKE_collection.h @@ -103,6 +103,7 @@ struct Base *BKE_collection_or_layer_objects(const struct ViewLayer *view_layer, struct Collection *BKE_collection_from_index(struct Scene *scene, const int index); void BKE_collection_new_name_get(struct Collection *collection_parent, char *rname); +const char *BKE_collection_ui_name_get(struct Collection *collection); bool BKE_collection_objects_select(struct ViewLayer *view_layer, struct Collection *collection, bool deselect); /* Collection children */ diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c index 9cec20a8f2b..47fb3622c66 100644 --- a/source/blender/blenkernel/intern/collection.c +++ b/source/blender/blenkernel/intern/collection.c @@ -298,6 +298,19 @@ void BKE_collection_new_name_get(Collection *collection_parent, char *rname) MEM_freeN(name); } +/** + * The name to show in the interface. + */ +const char *BKE_collection_ui_name_get(struct Collection *collection) +{ + if (collection->flag & COLLECTION_IS_MASTER) { + return IFACE_("Scene Collection"); + } + else { + return collection->id.name + 2; + } +} + /* **************** Object List Cache *******************/ static void collection_object_cache_fill(ListBase *lb, Collection *collection, int parent_restrict) |