Add active collection to stats bar
Only show the collection name when in object mode. It is not relevant in any other mode.
This commit is contained in:
@@ -431,6 +431,7 @@ static void stats_string(ViewLayer *view_layer)
|
|||||||
#define MAX_INFO_MEM_LEN 64
|
#define MAX_INFO_MEM_LEN 64
|
||||||
SceneStats *stats = view_layer->stats;
|
SceneStats *stats = view_layer->stats;
|
||||||
SceneStatsFmt stats_fmt;
|
SceneStatsFmt stats_fmt;
|
||||||
|
LayerCollection *layer_collection = view_layer->active_collection;
|
||||||
Object *ob = OBACT(view_layer);
|
Object *ob = OBACT(view_layer);
|
||||||
Object *obedit = OBEDIT_FROM_OBACT(ob);
|
Object *obedit = OBEDIT_FROM_OBACT(ob);
|
||||||
eObjectMode object_mode = ob ? ob->mode : OB_MODE_OBJECT;
|
eObjectMode object_mode = ob ? ob->mode : OB_MODE_OBJECT;
|
||||||
@@ -503,6 +504,10 @@ static void stats_string(ViewLayer *view_layer)
|
|||||||
s = stats->infostr;
|
s = stats->infostr;
|
||||||
ofs = 0;
|
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) {
|
if (ob) {
|
||||||
ofs += BLI_snprintf(s + ofs, MAX_INFO_LEN - ofs, "%s | ", ob->id.name + 2);
|
ofs += BLI_snprintf(s + ofs, MAX_INFO_LEN - ofs, "%s | ", ob->id.name + 2);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user