forked from bartvdbraak/blender
makeScreenshot - adding frame number to the filename
This commit is contained in:
parent
cf4646b95f
commit
f1a65a9fab
@ -67,6 +67,7 @@ m_frame_rect(rect)
|
||||
// area boundaries needed for mouse coordinates in Letterbox framing mode
|
||||
m_area_left = ar->winrct.xmin;
|
||||
m_area_top = ar->winrct.ymax;
|
||||
m_frame = 1;
|
||||
|
||||
glGetIntegerv(GL_VIEWPORT, (GLint *)m_viewport);
|
||||
}
|
||||
@ -350,6 +351,8 @@ void KX_BlenderCanvas::MakeScreenShot(const char *filename)
|
||||
char path[FILE_MAX];
|
||||
BLI_strncpy(path, filename, sizeof(path));
|
||||
BLI_path_abs(path, G.main->name);
|
||||
BLI_path_frame(path, m_frame, 0);
|
||||
m_frame++;
|
||||
BKE_image_path_ensure_ext_from_imtype(path, im_format.imtype);
|
||||
|
||||
/* create and save imbuf */
|
||||
|
@ -210,6 +210,7 @@ private:
|
||||
RAS_Rect m_area_rect;
|
||||
int m_area_left;
|
||||
int m_area_top;
|
||||
int m_frame;
|
||||
|
||||
|
||||
#ifdef WITH_CXX_GUARDEDALLOC
|
||||
|
@ -69,6 +69,7 @@ GPC_Canvas::GPC_Canvas(
|
||||
m_displayarea.m_y1 = 0;
|
||||
m_displayarea.m_x2 = width;
|
||||
m_displayarea.m_y2 = height;
|
||||
m_frame = 1;
|
||||
|
||||
glGetIntegerv(GL_VIEWPORT, (GLint*)m_viewport);
|
||||
}
|
||||
@ -180,6 +181,8 @@ MakeScreenShot(
|
||||
char path[FILE_MAX];
|
||||
BLI_strncpy(path, filename, sizeof(path));
|
||||
BLI_path_abs(path, G.main->name);
|
||||
BLI_path_frame(path, m_frame, 0);
|
||||
m_frame++;
|
||||
BKE_image_path_ensure_ext_from_imtype(path, im_format.imtype);
|
||||
|
||||
// create and save imbuf
|
||||
|
@ -56,6 +56,8 @@ protected:
|
||||
/** Rect that defines the area used for rendering,
|
||||
* relative to the context */
|
||||
RAS_Rect m_displayarea;
|
||||
/** Frame counter for screenshots */
|
||||
int m_frame;
|
||||
|
||||
int m_viewport[4];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user