Added a slider to control camera passepartout darkness in camera edit buttons.
This commit is contained in:
@@ -455,6 +455,7 @@ void *add_camera()
|
|||||||
cam->drawsize= 0.5f;
|
cam->drawsize= 0.5f;
|
||||||
cam->ortho_scale= 6.0;
|
cam->ortho_scale= 6.0;
|
||||||
cam->flag |= CAM_SHOWTITLESAFE;
|
cam->flag |= CAM_SHOWTITLESAFE;
|
||||||
|
cam->passepartalpha = 0.2f;
|
||||||
|
|
||||||
return cam;
|
return cam;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5049,6 +5049,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
|||||||
if (!(cam->flag & CAM_SHOWTITLESAFE))
|
if (!(cam->flag & CAM_SHOWTITLESAFE))
|
||||||
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;
|
cam= cam->id.next;
|
||||||
}
|
}
|
||||||
sce= sce->id.next;
|
sce= sce->id.next;
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ typedef struct Camera {
|
|||||||
ID id;
|
ID id;
|
||||||
|
|
||||||
short type, flag;
|
short type, flag;
|
||||||
|
float passepartalpha, pad1;
|
||||||
float clipsta, clipend;
|
float clipsta, clipend;
|
||||||
float lens, ortho_scale, drawsize;
|
float lens, ortho_scale, drawsize;
|
||||||
|
|
||||||
|
|||||||
@@ -364,7 +364,7 @@ typedef struct Scene {
|
|||||||
/* scemode */
|
/* scemode */
|
||||||
#define R_DOSEQ 0x0001
|
#define R_DOSEQ 0x0001
|
||||||
#define R_BG_RENDER 0x0002
|
#define R_BG_RENDER 0x0002
|
||||||
#define R_PASSEPARTOUT 0x0004
|
#define R_PASSEPARTOUT 0x0004 /* keep this for backward compatibility */
|
||||||
|
|
||||||
#define R_EXTENSION 0x0010
|
#define R_EXTENSION 0x0010
|
||||||
#define R_OGL 0x0020
|
#define R_OGL 0x0020
|
||||||
|
|||||||
@@ -2316,27 +2316,34 @@ if(cam->type==CAM_ORTHO) {
|
|||||||
uiDefButF(block, NUM,REDRAWVIEW3D, "End:",
|
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");
|
0, 50, 150, 20, &cam->clipend, 1.0, 5000.0*grid, 100, 0, "Specify the endvalue of the the field of view");
|
||||||
uiBlockEndAlign(block);
|
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, "");
|
uiDefBut(block, LABEL, 0, "Show:", 160, 155, 150, 20, 0, 0.0, 0.0, 0, 0, "");
|
||||||
|
|
||||||
uiBlockBeginAlign(block);
|
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");
|
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");
|
160, 115, 150, 20, &cam->flag, 0, 0, 0, 0, "Draw a line that indicates the mist area");
|
||||||
uiBlockEndAlign(block);
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
uiDefButS(block, TOG|BIT|2,REDRAWVIEW3D, "Passepartout",
|
uiDefButS(block, TOG|BIT|4, REDRAWVIEW3D, "Name",
|
||||||
160, 90, 150, 20, &cam->flag, 0, 0, 0, 0, "Draw a darkened passepartout over the off-screen area in camera view");
|
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",
|
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");
|
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);
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
uiDefButF(block, NUM,REDRAWVIEW3D, "Size:",
|
uiBlockBeginAlign(block);
|
||||||
160, 25, 150, 20, &cam->drawsize, 0.1*grid, 10.0, 10, 0, "Specify the drawsize of the camera");
|
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 */
|
/* yafray: extra camera panel to set Depth-of-Field parameters */
|
||||||
|
|||||||
@@ -920,11 +920,11 @@ static void drawviewborder(void)
|
|||||||
x2= viewborder.xmax;
|
x2= viewborder.xmax;
|
||||||
y2= viewborder.ymax;
|
y2= viewborder.ymax;
|
||||||
|
|
||||||
/* passepartout, in color of backdrop minus 50 */
|
/* passepartout, specified in camera edit buttons */
|
||||||
if (ca->flag & CAM_SHOWPASSEPARTOUT) {
|
if (ca->flag & CAM_SHOWPASSEPARTOUT) {
|
||||||
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
|
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
glColor4ub(0, 0, 0, 50);
|
glColor4f(0, 0, 0, ca->passepartalpha);
|
||||||
|
|
||||||
if (x1 > 0.0) {
|
if (x1 > 0.0) {
|
||||||
glRectf(0.0, (float)curarea->winy, x1, 0.0);
|
glRectf(0.0, (float)curarea->winy, x1, 0.0);
|
||||||
|
|||||||
Reference in New Issue
Block a user