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:
authorDalai Felinto <dfelinto@gmail.com>2018-11-13 23:13:56 +0300
committerDalai Felinto <dfelinto@gmail.com>2018-11-13 23:34:38 +0300
commit51a14b64d86a97694272979c1c952930d35c96df (patch)
tree6164e3d26df1e992c5b37c84034db4429b502c0c /source/blender/editors/space_info
parent42fbb8af8342e916b8f4e8d4591ad49574a88fe4 (diff)
Add active collection to stats bar
Only show the collection name when in object mode. It is not relevant in any other mode.
Diffstat (limited to 'source/blender/editors/space_info')
-rw-r--r--source/blender/editors/space_info/info_stats.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c
index 2bdb21633d9..a6e94e0875d 100644
--- a/source/blender/editors/space_info/info_stats.c
+++ b/source/blender/editors/space_info/info_stats.c
@@ -431,6 +431,7 @@ static void stats_string(ViewLayer *view_layer)
#define MAX_INFO_MEM_LEN 64
SceneStats *stats = view_layer->stats;
SceneStatsFmt stats_fmt;
+ LayerCollection *layer_collection = view_layer->active_collection;
Object *ob = OBACT(view_layer);
Object *obedit = OBEDIT_FROM_OBACT(ob);
eObjectMode object_mode = ob ? ob->mode : OB_MODE_OBJECT;
@@ -503,6 +504,10 @@ static void stats_string(ViewLayer *view_layer)
s = stats->infostr;
ofs = 0;
+ if (object_mode == OB_MODE_OBJECT) {
+ ofs += BLI_snprintf(s + ofs, MAX_INFO_LEN - ofs, "%s | ", BKE_collection_ui_name_get(layer_collection->collection));
+ }
+
if (ob) {
ofs += BLI_snprintf(s + ofs, MAX_INFO_LEN - ofs, "%s | ", ob->id.name + 2);
}