diff options
author | Matt Ebb <matt@mke3.net> | 2007-09-24 06:18:00 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2007-09-24 06:18:00 +0400 |
commit | 091d1e15a91d73b4ec369a3becec61d21bb21570 (patch) | |
tree | b4373df3131faa39cf6b876f9685dd9ecd8d98d8 /source/blender/nodes | |
parent | 0b24ca19ff30175f74185da412e3d05bd73ee36e (diff) |
* Change/fix to texture comp node
Previously if the texture node was not connected directly as the
second input to a node like Mix, the size of the generated image
was initialised to 140x140, which is not that useful. It now is
initialised to the size of the render result if it exists, and if
not, the size of the scene render sizeX/sizeY.
This alleviates bug #7068, which is caused by the displace node
trying to get pixels from a texture node, where the texture node
doesn't contain pixels to cover the entire image (only 140x140)
but it's not really a bulletproof solution...
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; |