Fix: Grease Pencil stats in status bar when in edit mode

When in edit mode, wrong stats info is shown for grease pencil. Move the
GP condition above so it is processed before `OB_MODE_EDIT`

Pull Request: https://projects.blender.org/blender/blender/pulls/137194
This commit is contained in:
Pratik Borhade
2025-04-09 11:46:12 +02:00
committed by Pratik Borhade
parent 8674ac339b
commit ff85c97278

View File

@@ -561,6 +561,18 @@ static void get_stats_string(char *info,
*ofs += BLI_snprintf_rlen(info + *ofs, len - *ofs, "%s | ", ob->id.name + 2);
}
if ((ob) && (ob->type == OB_GREASE_PENCIL)) {
*ofs += BLI_snprintf_rlen(info + *ofs,
len - *ofs,
IFACE_("Layers:%s | Frames:%s | Strokes:%s | Points:%s"),
stats_fmt->totgplayer,
stats_fmt->totgpframe,
stats_fmt->totgpstroke,
stats_fmt->totgppoint);
return;
}
if (ob && ob->mode == OB_MODE_EDIT) {
if (BKE_keyblock_from_object(ob)) {
*ofs += BLI_strncpy_rlen(info + *ofs, IFACE_("(Key) "), len - *ofs);
@@ -601,16 +613,6 @@ static void get_stats_string(char *info,
*ofs += BLI_snprintf_rlen(
info + *ofs, len - *ofs, IFACE_("Bones:%s/%s"), stats_fmt->totbonesel, stats_fmt->totbone);
}
else if ((ob) && (ob->type == OB_GREASE_PENCIL)) {
*ofs += BLI_snprintf_rlen(info + *ofs,
len - *ofs,
IFACE_("Layers:%s | Frames:%s | Strokes:%s | Points:%s"),
stats_fmt->totgplayer,
stats_fmt->totgpframe,
stats_fmt->totgpstroke,
stats_fmt->totgppoint);
}
else if (ob && (object_mode & OB_MODE_SCULPT)) {
if (stats_is_object_dynamic_topology_sculpt(ob)) {
*ofs += BLI_snprintf_rlen(info + *ofs,