diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index f88864be7b0..af17ebcfc25 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -455,6 +455,7 @@ void *add_camera() cam->drawsize= 0.5f; cam->ortho_scale= 6.0; cam->flag |= CAM_SHOWTITLESAFE; + cam->passepartalpha = 0.2f; return cam; } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 2d1030ff67e..c974187fffc 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5049,6 +5049,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main) if (!(cam->flag & CAM_SHOWTITLESAFE)) cam->flag |= CAM_SHOWTITLESAFE; */ + + /* set an appropriate camera passepartout alpha */ + if (!(cam->passepartalpha)) cam->passepartalpha = 0.2f; + cam= cam->id.next; } sce= sce->id.next; diff --git a/source/blender/makesdna/DNA_camera_types.h b/source/blender/makesdna/DNA_camera_types.h index cc7ec27f815..6ccc48f217e 100644 --- a/source/blender/makesdna/DNA_camera_types.h +++ b/source/blender/makesdna/DNA_camera_types.h @@ -47,6 +47,7 @@ typedef struct Camera { ID id; short type, flag; + float passepartalpha, pad1; float clipsta, clipend; float lens, ortho_scale, drawsize; diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index c8d22a63692..d8b8e921863 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -364,7 +364,7 @@ typedef struct Scene { /* scemode */ #define R_DOSEQ 0x0001 #define R_BG_RENDER 0x0002 -#define R_PASSEPARTOUT 0x0004 +#define R_PASSEPARTOUT 0x0004 /* keep this for backward compatibility */ #define R_EXTENSION 0x0010 #define R_OGL 0x0020 diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index e670970461f..1eeb7e7793f 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -2316,27 +2316,34 @@ if(cam->type==CAM_ORTHO) { uiDefButF(block, NUM,REDRAWVIEW3D, "End:", 0, 50, 150, 20, &cam->clipend, 1.0, 5000.0*grid, 100, 0, "Specify the endvalue of the the field of view"); uiBlockEndAlign(block); + + uiDefButF(block, NUM,REDRAWVIEW3D, "Size:", + 0, 25, 150, 20, &cam->drawsize, 0.1*grid, 10.0, 10, 0, "The size that the camera is displayed in the 3D View (different to the object's scale)"); uiDefBut(block, LABEL, 0, "Show:", 160, 155, 150, 20, 0, 0.0, 0.0, 0, 0, ""); uiBlockBeginAlign(block); - uiDefButS(block, TOG|BIT|0,REDRAWVIEW3D, "Limits", + uiDefButS(block, TOG|BIT|0, REDRAWVIEW3D, "Limits", 160, 135, 150, 20, &cam->flag, 0, 0, 0, 0, "Draw the field of view"); - uiDefButS(block, TOG|BIT|1,REDRAWVIEW3D, "Mist", + uiDefButS(block, TOG|BIT|1, REDRAWVIEW3D, "Mist", 160, 115, 150, 20, &cam->flag, 0, 0, 0, 0, "Draw a line that indicates the mist area"); uiBlockEndAlign(block); uiBlockBeginAlign(block); - uiDefButS(block, TOG|BIT|2,REDRAWVIEW3D, "Passepartout", - 160, 90, 150, 20, &cam->flag, 0, 0, 0, 0, "Draw a darkened passepartout over the off-screen area in camera view"); - uiDefButS(block, TOG|BIT|3,REDRAWVIEW3D, "Title Safe", + uiDefButS(block, TOG|BIT|4, REDRAWVIEW3D, "Name", + 160, 90, 150, 20, &cam->flag, 0, 0, 0, 0, "Draw the active camera's name in camera view"); + uiDefButS(block, TOG|BIT|3, REDRAWVIEW3D, "Title Safe", 160, 70, 150, 20, &cam->flag, 0, 0, 0, 0, "Draw a the title safe zone in camera view"); - uiDefButS(block, TOG|BIT|4,REDRAWVIEW3D, "Name", - 160, 50, 150, 20, &cam->flag, 0, 0, 0, 0, "Draw the active camera's name in camera view"); uiBlockEndAlign(block); - uiDefButF(block, NUM,REDRAWVIEW3D, "Size:", - 160, 25, 150, 20, &cam->drawsize, 0.1*grid, 10.0, 10, 0, "Specify the drawsize of the camera"); + uiBlockBeginAlign(block); + uiDefButS(block, TOG|BIT|2, REDRAWVIEW3D, "Passepartout", + 160, 45, 150, 20, &cam->flag, 0, 0, 0, 0, "Draw a darkened passepartout over the off-screen area in camera view"); + uiDefButF(block, NUMSLI, REDRAWVIEW3D, "Alpha: ", + 160, 25, 150, 20, &cam->passepartalpha, 0.0, 1.0, 0, 0, "The opacity (darkness) of the passepartout"); + uiBlockEndAlign(block); + + } /* yafray: extra camera panel to set Depth-of-Field parameters */ diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index 0fb5f85427d..dfe0144c74d 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -920,11 +920,11 @@ static void drawviewborder(void) x2= viewborder.xmax; y2= viewborder.ymax; - /* passepartout, in color of backdrop minus 50 */ + /* passepartout, specified in camera edit buttons */ if (ca->flag & CAM_SHOWPASSEPARTOUT) { glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); glEnable(GL_BLEND); - glColor4ub(0, 0, 0, 50); + glColor4f(0, 0, 0, ca->passepartalpha); if (x1 > 0.0) { glRectf(0.0, (float)curarea->winy, x1, 0.0);