bug [#26329] Project Paint not working
we cant ensure that a requested buffer can be allocated so report opengl errors when failing to allocate the buffer (rather then printing to console). this is common enough and generic error isn't too helpful to users.
This commit is contained in:
@@ -322,7 +322,7 @@ struct Sequence *sequencer_add_sound_strip(struct bContext *C, ListBase *seqbase
|
||||
struct Sequence *sequencer_add_movie_strip(struct bContext *C, ListBase *seqbasep, struct SeqLoadInfo *seq_load);
|
||||
|
||||
/* view3d draw callback, run when not in background view */
|
||||
typedef struct ImBuf *(*SequencerDrawView)(struct Scene *, int, int, unsigned int, int);
|
||||
typedef struct ImBuf *(*SequencerDrawView)(struct Scene *, int, int, unsigned int, int, char[256]);
|
||||
extern SequencerDrawView sequencer_view3d_cb;
|
||||
|
||||
/* copy/paste */
|
||||
|
||||
@@ -1906,13 +1906,17 @@ static ImBuf * seq_render_scene_strip_impl(
|
||||
#endif
|
||||
|
||||
if(sequencer_view3d_cb && BLI_thread_is_main() && doseq_gl && (seq->scene == context.scene || have_seq==0) && seq->scene->camera) {
|
||||
char err_out[256]= "unknown";
|
||||
/* for old scened this can be uninitialized, should probably be added to do_versions at some point if the functionality stays */
|
||||
if(context.scene->r.seq_prev_type==0)
|
||||
context.scene->r.seq_prev_type = 3 /* ==OB_SOLID */;
|
||||
|
||||
/* opengl offscreen render */
|
||||
scene_update_for_newframe(context.bmain, seq->scene, seq->scene->lay);
|
||||
ibuf= sequencer_view3d_cb(seq->scene, context.rectx, context.recty, IB_rect, context.scene->r.seq_prev_type);
|
||||
ibuf= sequencer_view3d_cb(seq->scene, context.rectx, context.recty, IB_rect, context.scene->r.seq_prev_type, err_out);
|
||||
if(ibuf == NULL) {
|
||||
fprintf(stderr, "seq_render_scene_strip_impl failed to get opengl buffer: %s\n", err_out);
|
||||
}
|
||||
}
|
||||
else {
|
||||
Render *re = RE_GetRender(sce->id.name);
|
||||
|
||||
@@ -171,8 +171,8 @@ int ED_view3d_context_activate(struct bContext *C);
|
||||
void ED_view3d_draw_offscreen(struct Scene *scene, struct View3D *v3d, struct ARegion *ar,
|
||||
int winx, int winy, float viewmat[][4], float winmat[][4]);
|
||||
|
||||
struct ImBuf *ED_view3d_draw_offscreen_imbuf(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, int sizex, int sizey, unsigned int flag);
|
||||
struct ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, int width, int height, unsigned int flag, int drawtype);
|
||||
struct ImBuf *ED_view3d_draw_offscreen_imbuf(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, int sizex, int sizey, unsigned int flag, char err_out[256]);
|
||||
struct ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, int width, int height, unsigned int flag, int drawtype, char err_out[256]);
|
||||
|
||||
|
||||
Base *ED_view3d_give_base_under_cursor(struct bContext *C, short *mval);
|
||||
|
||||
@@ -188,9 +188,17 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
|
||||
GPU_offscreen_unbind(oglrender->ofs); /* unbind */
|
||||
}
|
||||
else {
|
||||
ImBuf *ibuf_view= ED_view3d_draw_offscreen_imbuf_simple(scene, oglrender->sizex, oglrender->sizey, IB_rectfloat, OB_SOLID);
|
||||
memcpy(rr->rectf, ibuf_view->rect_float, sizeof(float) * 4 * oglrender->sizex * oglrender->sizey);
|
||||
IMB_freeImBuf(ibuf_view);
|
||||
/* shouldnt suddenly give errors mid-render but possible */
|
||||
char err_out[256]= "unknown";
|
||||
ImBuf *ibuf_view= ED_view3d_draw_offscreen_imbuf_simple(scene, oglrender->sizex, oglrender->sizey, IB_rectfloat, OB_SOLID, err_out);
|
||||
|
||||
if(ibuf_view) {
|
||||
memcpy(rr->rectf, ibuf_view->rect_float, sizeof(float) * 4 * oglrender->sizex * oglrender->sizey);
|
||||
IMB_freeImBuf(ibuf_view);
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "screen_opengl_render_apply: failed to get buffer, %s\n", err_out);
|
||||
}
|
||||
}
|
||||
|
||||
/* rr->rectf is now filled with image data */
|
||||
@@ -230,6 +238,7 @@ static int screen_opengl_render_init(bContext *C, wmOperator *op)
|
||||
short is_view_context= RNA_boolean_get(op->ptr, "view_context");
|
||||
const short is_animation= RNA_boolean_get(op->ptr, "animation");
|
||||
const short is_write_still= RNA_boolean_get(op->ptr, "write_still");
|
||||
char err_out[256]= "unknown";
|
||||
|
||||
/* ensure we have a 3d view */
|
||||
|
||||
@@ -263,10 +272,10 @@ static int screen_opengl_render_init(bContext *C, wmOperator *op)
|
||||
sizey= (scene->r.size*scene->r.ysch)/100;
|
||||
|
||||
/* corrects render size with actual size, not every card supports non-power-of-two dimensions */
|
||||
ofs= GPU_offscreen_create(&sizex, &sizey);
|
||||
ofs= GPU_offscreen_create(&sizex, &sizey, err_out);
|
||||
|
||||
if(!ofs) {
|
||||
BKE_report(op->reports, RPT_ERROR, "Failed to create OpenGL offscreen buffer.");
|
||||
BKE_reportf(op->reports, RPT_ERROR, "Failed to create OpenGL offscreen buffer, %s", err_out);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -5587,6 +5587,7 @@ static int texture_paint_image_from_view_exec(bContext *C, wmOperator *op)
|
||||
int w= settings->imapaint.screen_grab_size[0];
|
||||
int h= settings->imapaint.screen_grab_size[1];
|
||||
int maxsize;
|
||||
char err_out[256]= "unknown";
|
||||
|
||||
RNA_string_get(op->ptr, "filepath", filename);
|
||||
|
||||
@@ -5595,11 +5596,11 @@ static int texture_paint_image_from_view_exec(bContext *C, wmOperator *op)
|
||||
if(w > maxsize) w= maxsize;
|
||||
if(h > maxsize) h= maxsize;
|
||||
|
||||
ibuf= ED_view3d_draw_offscreen_imbuf(CTX_data_scene(C), CTX_wm_view3d(C), CTX_wm_region(C), w, h, IB_rect);
|
||||
ibuf= ED_view3d_draw_offscreen_imbuf(CTX_data_scene(C), CTX_wm_view3d(C), CTX_wm_region(C), w, h, IB_rect, err_out);
|
||||
if(!ibuf) {
|
||||
/* Mostly happens when OpenGL offscreen buffer was failed to create, */
|
||||
/* but could be other reasons. Should be handled in the future. nazgul */
|
||||
BKE_report(op->reports, RPT_ERROR, "Failed to create OpenGL offscreen buffer.");
|
||||
BKE_reportf(op->reports, RPT_ERROR, "Failed to create OpenGL offscreen buffer: %s", err_out);
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
|
||||
@@ -2150,7 +2150,7 @@ void ED_view3d_draw_offscreen(Scene *scene, View3D *v3d, ARegion *ar, int winx,
|
||||
}
|
||||
|
||||
/* utility func for ED_view3d_draw_offscreen */
|
||||
ImBuf *ED_view3d_draw_offscreen_imbuf(Scene *scene, View3D *v3d, ARegion *ar, int sizex, int sizey, unsigned int flag)
|
||||
ImBuf *ED_view3d_draw_offscreen_imbuf(Scene *scene, View3D *v3d, ARegion *ar, int sizex, int sizey, unsigned int flag, char err_out[256])
|
||||
{
|
||||
RegionView3D *rv3d= ar->regiondata;
|
||||
ImBuf *ibuf;
|
||||
@@ -2160,7 +2160,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(Scene *scene, View3D *v3d, ARegion *ar, in
|
||||
glPushAttrib(GL_LIGHTING_BIT);
|
||||
|
||||
/* bind */
|
||||
ofs= GPU_offscreen_create(&sizex, &sizey);
|
||||
ofs= GPU_offscreen_create(&sizex, &sizey, err_out);
|
||||
if(ofs == NULL)
|
||||
return NULL;
|
||||
|
||||
@@ -2204,7 +2204,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(Scene *scene, View3D *v3d, ARegion *ar, in
|
||||
}
|
||||
|
||||
/* creates own 3d views, used by the sequencer */
|
||||
ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, int width, int height, unsigned int flag, int drawtype)
|
||||
ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, int width, int height, unsigned int flag, int drawtype, char err_out[256])
|
||||
{
|
||||
View3D v3d= {NULL};
|
||||
ARegion ar= {NULL};
|
||||
@@ -2235,7 +2235,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, int width, int height
|
||||
mul_m4_m4m4(rv3d.persmat, rv3d.viewmat, rv3d.winmat);
|
||||
invert_m4_m4(rv3d.persinv, rv3d.viewinv);
|
||||
|
||||
return ED_view3d_draw_offscreen_imbuf(scene, &v3d, &ar, width, height, flag);
|
||||
return ED_view3d_draw_offscreen_imbuf(scene, &v3d, &ar, width, height, flag, err_out);
|
||||
|
||||
// seq_view3d_cb(scene, cfra, render_size, seqrectx, seqrecty);
|
||||
}
|
||||
|
||||
@@ -108,10 +108,10 @@ int GPU_type_matches(GPUDeviceType device, GPUOSType os, GPUDriverType driver);
|
||||
- if created with from_blender, will not free the texture
|
||||
*/
|
||||
|
||||
GPUTexture *GPU_texture_create_1D(int w, float *pixels);
|
||||
GPUTexture *GPU_texture_create_2D(int w, int h, float *pixels);
|
||||
GPUTexture *GPU_texture_create_1D(int w, float *pixels, char err_out[256]);
|
||||
GPUTexture *GPU_texture_create_2D(int w, int h, float *pixels, char err_out[256]);
|
||||
GPUTexture *GPU_texture_create_3D(int w, int h, int depth, float *fpixels);
|
||||
GPUTexture *GPU_texture_create_depth(int w, int h);
|
||||
GPUTexture *GPU_texture_create_depth(int w, int h, char err_out[256]);
|
||||
GPUTexture *GPU_texture_from_blender(struct Image *ima,
|
||||
struct ImageUser *iuser, double time, int mipmap);
|
||||
void GPU_texture_free(GPUTexture *tex);
|
||||
@@ -135,7 +135,7 @@ int GPU_texture_opengl_height(GPUTexture *tex);
|
||||
be called before rendering to the window framebuffer again */
|
||||
|
||||
GPUFrameBuffer *GPU_framebuffer_create(void);
|
||||
int GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex);
|
||||
int GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex, char err_out[256]);
|
||||
void GPU_framebuffer_texture_detach(GPUFrameBuffer *fb, GPUTexture *tex);
|
||||
void GPU_framebuffer_texture_bind(GPUFrameBuffer *fb, GPUTexture *tex);
|
||||
void GPU_framebuffer_texture_unbind(GPUFrameBuffer *fb, GPUTexture *tex);
|
||||
@@ -147,7 +147,7 @@ void GPU_framebuffer_restore(void);
|
||||
- wrapper around framebuffer and texture for simple offscreen drawing
|
||||
- changes size if graphics card can't support it */
|
||||
|
||||
GPUOffScreen *GPU_offscreen_create(int *width, int *height);
|
||||
GPUOffScreen *GPU_offscreen_create(int *width, int *height, char err_out[256]);
|
||||
void GPU_offscreen_free(GPUOffScreen *ofs);
|
||||
void GPU_offscreen_bind(GPUOffScreen *ofs);
|
||||
void GPU_offscreen_unbind(GPUOffScreen *ofs);
|
||||
|
||||
@@ -983,11 +983,11 @@ static void gpu_node_input_link(GPUNode *node, GPUNodeLink *link, int type)
|
||||
input->textype = type;
|
||||
|
||||
if (type == GPU_TEX1D) {
|
||||
input->tex = GPU_texture_create_1D(link->texturesize, link->ptr1);
|
||||
input->tex = GPU_texture_create_1D(link->texturesize, link->ptr1, NULL);
|
||||
input->textarget = GL_TEXTURE_1D;
|
||||
}
|
||||
else {
|
||||
input->tex = GPU_texture_create_2D(link->texturesize, link->texturesize, link->ptr2);
|
||||
input->tex = GPU_texture_create_2D(link->texturesize, link->texturesize, link->ptr2, NULL);
|
||||
input->textarget = GL_TEXTURE_2D;
|
||||
}
|
||||
|
||||
|
||||
@@ -225,39 +225,47 @@ int GPU_print_error(const char *str)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void GPU_print_framebuffer_error(GLenum status)
|
||||
static void GPU_print_framebuffer_error(GLenum status, char err_out[256])
|
||||
{
|
||||
fprintf(stderr, "GPUFrameBuffer: framebuffer incomplete error %d\n",
|
||||
(int)status);
|
||||
const char *err= "unknown";
|
||||
|
||||
switch(status) {
|
||||
case GL_FRAMEBUFFER_COMPLETE_EXT:
|
||||
break;
|
||||
case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT:
|
||||
fprintf(stderr, "Incomplete attachment.\n");
|
||||
err= "Incomplete attachment";
|
||||
break;
|
||||
case GL_FRAMEBUFFER_UNSUPPORTED_EXT:
|
||||
fprintf(stderr, "Unsupported framebuffer format.\n");
|
||||
err= "Unsupported framebuffer format";
|
||||
break;
|
||||
case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT:
|
||||
fprintf(stderr, "Missing attachment.\n");
|
||||
err= "Missing attachment";
|
||||
break;
|
||||
case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT:
|
||||
fprintf(stderr, "Attached images must have same dimensions.\n");
|
||||
err= "Attached images must have same dimensions";
|
||||
break;
|
||||
case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT:
|
||||
fprintf(stderr, "Attached images must have same format.\n");
|
||||
err= "Attached images must have same format";
|
||||
break;
|
||||
case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT:
|
||||
fprintf(stderr, "Missing draw buffer.\n");
|
||||
err= "Missing draw buffer";
|
||||
break;
|
||||
case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT:
|
||||
fprintf(stderr, "Missing read buffer.\n");
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "Unknown.\n");
|
||||
err= "Missing read buffer";
|
||||
break;
|
||||
}
|
||||
|
||||
if(err_out) {
|
||||
snprintf(err_out, 256, "GPUFrameBuffer: framebuffer incomplete error %d '%s'",
|
||||
(int)status,
|
||||
err);
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "GPUFrameBuffer: framebuffer incomplete error %d '%s'\n",
|
||||
(int)status,
|
||||
err);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* GPUTexture */
|
||||
@@ -318,7 +326,7 @@ static void GPU_glTexSubImageEmpty(GLenum target, GLenum format, int x, int y, i
|
||||
MEM_freeN(pixels);
|
||||
}
|
||||
|
||||
static GPUTexture *GPU_texture_create_nD(int w, int h, int n, float *fpixels, int depth)
|
||||
static GPUTexture *GPU_texture_create_nD(int w, int h, int n, float *fpixels, int depth, char err_out[256])
|
||||
{
|
||||
GPUTexture *tex;
|
||||
GLenum type, format, internalformat;
|
||||
@@ -338,8 +346,14 @@ static GPUTexture *GPU_texture_create_nD(int w, int h, int n, float *fpixels, in
|
||||
glGenTextures(1, &tex->bindcode);
|
||||
|
||||
if (!tex->bindcode) {
|
||||
fprintf(stderr, "GPUTexture: texture create failed: %d\n",
|
||||
(int)glGetError());
|
||||
if(err_out) {
|
||||
snprintf(err_out, 256, "GPUTexture: texture create failed: %d",
|
||||
(int)glGetError());
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "GPUTexture: texture create failed: %d\n",
|
||||
(int)glGetError());
|
||||
}
|
||||
GPU_texture_free(tex);
|
||||
return NULL;
|
||||
}
|
||||
@@ -555,9 +569,9 @@ GPUTexture *GPU_texture_from_blender(Image *ima, ImageUser *iuser, double time,
|
||||
return tex;
|
||||
}
|
||||
|
||||
GPUTexture *GPU_texture_create_1D(int w, float *fpixels)
|
||||
GPUTexture *GPU_texture_create_1D(int w, float *fpixels, char err_out[256])
|
||||
{
|
||||
GPUTexture *tex = GPU_texture_create_nD(w, 1, 1, fpixels, 0);
|
||||
GPUTexture *tex = GPU_texture_create_nD(w, 1, 1, fpixels, 0, err_out);
|
||||
|
||||
if (tex)
|
||||
GPU_texture_unbind(tex);
|
||||
@@ -565,9 +579,9 @@ GPUTexture *GPU_texture_create_1D(int w, float *fpixels)
|
||||
return tex;
|
||||
}
|
||||
|
||||
GPUTexture *GPU_texture_create_2D(int w, int h, float *fpixels)
|
||||
GPUTexture *GPU_texture_create_2D(int w, int h, float *fpixels, char err_out[256])
|
||||
{
|
||||
GPUTexture *tex = GPU_texture_create_nD(w, h, 2, fpixels, 0);
|
||||
GPUTexture *tex = GPU_texture_create_nD(w, h, 2, fpixels, 0, err_out);
|
||||
|
||||
if (tex)
|
||||
GPU_texture_unbind(tex);
|
||||
@@ -575,9 +589,9 @@ GPUTexture *GPU_texture_create_2D(int w, int h, float *fpixels)
|
||||
return tex;
|
||||
}
|
||||
|
||||
GPUTexture *GPU_texture_create_depth(int w, int h)
|
||||
GPUTexture *GPU_texture_create_depth(int w, int h, char err_out[256])
|
||||
{
|
||||
GPUTexture *tex = GPU_texture_create_nD(w, h, 2, NULL, 1);
|
||||
GPUTexture *tex = GPU_texture_create_nD(w, h, 2, NULL, 1, err_out);
|
||||
|
||||
if (tex)
|
||||
GPU_texture_unbind(tex);
|
||||
@@ -705,7 +719,7 @@ GPUFrameBuffer *GPU_framebuffer_create(void)
|
||||
return fb;
|
||||
}
|
||||
|
||||
int GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex)
|
||||
int GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex, char err_out[256])
|
||||
{
|
||||
GLenum status;
|
||||
GLenum attachment;
|
||||
@@ -734,7 +748,7 @@ int GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex)
|
||||
|
||||
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
|
||||
GPU_framebuffer_restore();
|
||||
GPU_print_framebuffer_error(status);
|
||||
GPU_print_framebuffer_error(status, err_out);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -846,7 +860,7 @@ struct GPUOffScreen {
|
||||
GPUTexture *depth;
|
||||
};
|
||||
|
||||
GPUOffScreen *GPU_offscreen_create(int *width, int *height)
|
||||
GPUOffScreen *GPU_offscreen_create(int *width, int *height, char err_out[256])
|
||||
{
|
||||
GPUOffScreen *ofs;
|
||||
|
||||
@@ -858,7 +872,7 @@ GPUOffScreen *GPU_offscreen_create(int *width, int *height)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ofs->depth = GPU_texture_create_depth(*width, *height);
|
||||
ofs->depth = GPU_texture_create_depth(*width, *height, err_out);
|
||||
if(!ofs->depth) {
|
||||
GPU_offscreen_free(ofs);
|
||||
return NULL;
|
||||
@@ -870,18 +884,18 @@ GPUOffScreen *GPU_offscreen_create(int *width, int *height)
|
||||
printf("Offscreen size differs from given size!\n");
|
||||
}
|
||||
|
||||
if(!GPU_framebuffer_texture_attach(ofs->fb, ofs->depth)) {
|
||||
if(!GPU_framebuffer_texture_attach(ofs->fb, ofs->depth, err_out)) {
|
||||
GPU_offscreen_free(ofs);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ofs->color = GPU_texture_create_2D(*width, *height, NULL);
|
||||
ofs->color = GPU_texture_create_2D(*width, *height, NULL, err_out);
|
||||
if(!ofs->color) {
|
||||
GPU_offscreen_free(ofs);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(!GPU_framebuffer_texture_attach(ofs->fb, ofs->color)) {
|
||||
if(!GPU_framebuffer_texture_attach(ofs->fb, ofs->color, err_out)) {
|
||||
GPU_offscreen_free(ofs);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1553,13 +1553,13 @@ GPULamp *GPU_lamp_from_blender(Scene *scene, Object *ob, Object *par)
|
||||
return lamp;
|
||||
}
|
||||
|
||||
lamp->tex = GPU_texture_create_depth(lamp->size, lamp->size);
|
||||
lamp->tex = GPU_texture_create_depth(lamp->size, lamp->size, NULL);
|
||||
if(!lamp->tex) {
|
||||
gpu_lamp_shadow_free(lamp);
|
||||
return lamp;
|
||||
}
|
||||
|
||||
if(!GPU_framebuffer_texture_attach(lamp->fb, lamp->tex)) {
|
||||
if(!GPU_framebuffer_texture_attach(lamp->fb, lamp->tex, NULL)) {
|
||||
gpu_lamp_shadow_free(lamp);
|
||||
return lamp;
|
||||
}
|
||||
|
||||
@@ -569,6 +569,7 @@ static ImBuf *blend_file_thumb(Scene *scene, int **thumb_pt)
|
||||
/* will be scaled down, but gives some nice oversampling */
|
||||
ImBuf *ibuf;
|
||||
int *thumb;
|
||||
char err_out[256]= "unknown";
|
||||
|
||||
*thumb_pt= NULL;
|
||||
|
||||
@@ -576,7 +577,7 @@ static ImBuf *blend_file_thumb(Scene *scene, int **thumb_pt)
|
||||
return NULL;
|
||||
|
||||
/* gets scaled to BLEN_THUMB_SIZE */
|
||||
ibuf= ED_view3d_draw_offscreen_imbuf_simple(scene, BLEN_THUMB_SIZE * 2, BLEN_THUMB_SIZE * 2, IB_rect, OB_SOLID);
|
||||
ibuf= ED_view3d_draw_offscreen_imbuf_simple(scene, BLEN_THUMB_SIZE * 2, BLEN_THUMB_SIZE * 2, IB_rect, OB_SOLID, err_out);
|
||||
|
||||
if(ibuf) {
|
||||
float aspect= (scene->r.xsch*scene->r.xasp) / (scene->r.ysch*scene->r.yasp);
|
||||
@@ -597,6 +598,7 @@ static ImBuf *blend_file_thumb(Scene *scene, int **thumb_pt)
|
||||
}
|
||||
else {
|
||||
/* '*thumb_pt' needs to stay NULL to prevent a bad thumbnail from being handled */
|
||||
fprintf(stderr, "blend_file_thumb failed to create thumbnail: %s\n", err_out);
|
||||
thumb= NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user