UI: add camera passepartout color to theme

Currently the passepartout color is hardcoded to black. While a
sensible default for cinema, it may make less sense for other media,
whether video, print, web, etc. It greatly affects viewing conditions
of the image and should be user selectable, much like painting
programs allow.

Pull Request #104486
This commit is contained in:
Damien Picard 2023-02-13 09:15:34 +01:00 committed by Brecht Van Lommel
parent 918cf6cd77
commit 2e19aa1399
6 changed files with 13 additions and 2 deletions

View File

@ -370,6 +370,7 @@ const bTheme U_theme_default = {
.clipping_border_3d = RGBA(0x3f3f3fff),
.bundle_solid = RGBA(0xc8c8c8ff),
.camera_path = RGBA(0x000000ff),
.camera_passepartout = RGBA(0x000000),
.gp_vertex_size = 3,
.gp_vertex = RGBA(0x000000ff),
.gp_vertex_select = RGBA(0xff8500ff),

View File

@ -236,6 +236,7 @@ typedef enum ThemeColorID {
TH_PATH_KEYFRAME_BEFORE,
TH_PATH_KEYFRAME_AFTER,
TH_CAMERA_PATH,
TH_CAMERA_PASSEPARTOUT,
TH_LOCK_MARKER,
TH_STITCH_PREVIEW_FACE,

View File

@ -803,6 +803,9 @@ const uchar *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
case TH_CAMERA_PATH:
cp = ts->camera_path;
break;
case TH_CAMERA_PASSEPARTOUT:
cp = ts->camera_passepartout;
break;
case TH_LOCK_MARKER:
cp = ts->lock_marker;
break;

View File

@ -585,7 +585,7 @@ static void drawviewborder(Scene *scene, Depsgraph *depsgraph, ARegion *region,
alpha = ca->passepartalpha;
}
immUniformColor4f(0.0f, 0.0f, 0.0f, alpha);
immUniformThemeColorAlpha(TH_CAMERA_PASSEPARTOUT, alpha);
if (x1i > 0.0f) {
immRectf(shdr_pos, 0.0f, winy, x1i, 0.0f);

View File

@ -354,7 +354,8 @@ typedef struct ThemeSpace {
unsigned char path_before[4], path_after[4];
unsigned char path_keyframe_before[4], path_keyframe_after[4];
unsigned char camera_path[4];
unsigned char _pad1[6];
unsigned char camera_passepartout[4];
unsigned char _pad1[2];
unsigned char gp_vertex_size;
unsigned char gp_vertex[4], gp_vertex_select[4];

View File

@ -2345,6 +2345,11 @@ static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Camera Path", "");
RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
prop = RNA_def_property(srna, "camera_passepartout", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Camera Passepartout", "");
RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
prop = RNA_def_property(srna, "skin_root", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Skin Root", "");