UI: Display indicator in the 3D Viewport when Clipping Region is on

Small addition inspired by [this tweet](https://twitter.com/Vorundor/status/1390645286624763909) of a user in a situation I also saw myself in the past.

Showing "(Clipped)" next to the view name in the `Text Info` overlay fits well since it's a per-viewport setting.

{F10059921, size=full}

While on Local view:
{F10059925, size=full}

Multiple viewports:
{F10059946, size=full}

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D11193
This commit is contained in:
Pablo Vazquez 2021-05-07 16:12:23 +02:00
parent 8f04ddbbc6
commit 9c509a7219
1 changed files with 5 additions and 0 deletions

View File

@ -1288,6 +1288,11 @@ static void draw_viewport_name(ARegion *region, View3D *v3d, int xoffset, int *y
name_array[name_array_len++] = IFACE_(" (Local)");
}
/* Indicate that clipping region is enabled. */
if (rv3d->rflag & RV3D_CLIPPING) {
name_array[name_array_len++] = IFACE_(" (Clipped)");
}
if (name_array_len > 1) {
BLI_string_join_array(tmpstr, sizeof(tmpstr), name_array, name_array_len);
name = tmpstr;