diff options
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/intern/CMP_nodes/CMP_texture.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_texture.c b/source/blender/nodes/intern/CMP_nodes/CMP_texture.c index 9bf9777ebe0..4ddab661627 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_texture.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_texture.c @@ -89,9 +89,20 @@ static void node_composit_exec_texture(void *data, bNode *node, bNodeStack **in, /* outputs: value, color, normal */ if(node->id) { + RenderResult *rr= RE_GetResult(RE_GetRender(G.scene->id.name)); /* G.scene is WEAK! */ + short sizex, sizey; + /* first make the preview image */ CompBuf *prevbuf= alloc_compbuf(140, 140, CB_RGBA, 1); /* alloc */ + if (rr) { + sizex = rr->rectx; + sizey = rr->recty; + } else { + sizex = G.scene->r.xsch; + sizey = G.scene->r.ysch; + } + prevbuf->rect_procedural= texture_procedural; prevbuf->node= node; composit1_pixel_processor(node, prevbuf, prevbuf, out[0]->vec, do_copy_rgba, CB_RGBA); @@ -99,15 +110,15 @@ static void node_composit_exec_texture(void *data, bNode *node, bNodeStack **in, free_compbuf(prevbuf); if(out[0]->hasoutput) { - CompBuf *stackbuf= alloc_compbuf(140, 140, CB_VAL, 1); /* alloc */ + CompBuf *stackbuf= alloc_compbuf(sizex, sizey, CB_VAL, 1); /* alloc */ stackbuf->rect_procedural= texture_procedural; stackbuf->node= node; - out[0]->data= stackbuf; + out[0]->data= stackbuf; } if(out[1]->hasoutput) { - CompBuf *stackbuf= alloc_compbuf(140, 140, CB_RGBA, 1); /* alloc */ + CompBuf *stackbuf= alloc_compbuf(sizex, sizey, CB_RGBA, 1); /* alloc */ stackbuf->rect_procedural= texture_procedural; stackbuf->node= node; |