diff options
author | Matt Ebb <matt@mke3.net> | 2007-11-14 02:53:58 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2007-11-14 02:53:58 +0300 |
commit | a1c5b3b51d6c32ba055cf25c0e8efb0d2683248c (patch) | |
tree | 8cc0854de684bdb10fb35de5e3fcb635f4feb5ea /source/blender/nodes | |
parent | 07110e83fd46b17e584c912aaa3a082f5f27416b (diff) |
* New feature on compo scale node: "Scene Size %"
This option sets the relative scaling factor to the amount set in the
scene "100%/75%/50%/25%" buttons. It's useful when you've got a fixed
background image, and want to do preview renders at a lesser
percentage, so you don't have to go and change the scale node each
time you change the %.
Also removed unnecessary use of a global from texture node.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/intern/CMP_nodes/CMP_scale.c | 6 | ||||
-rw-r--r-- | source/blender/nodes/intern/CMP_nodes/CMP_texture.c | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_scale.c b/source/blender/nodes/intern/CMP_nodes/CMP_scale.c index a8477f4264e..cc6f9249495 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_scale.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_scale.c @@ -52,6 +52,7 @@ static void node_composit_exec_scale(void *data, bNode *node, bNodeStack **in, b return; if(in[0]->data) { + RenderData *rd= data; CompBuf *stackbuf, *cbuf= typecheck_compbuf(in[0]->data, CB_RGBA); ImBuf *ibuf; int newx, newy; @@ -60,7 +61,10 @@ static void node_composit_exec_scale(void *data, bNode *node, bNodeStack **in, b newx= MAX2((int)(in[1]->vec[0]*cbuf->x), 1); newy= MAX2((int)(in[2]->vec[0]*cbuf->y), 1); } - else { /* CMP_SCALE_ABSOLUTE */ + else if(node->custom1==CMP_SCALE_SCENEPERCENT) { + newx = cbuf->x * (rd->size / 100.0f); + newy = cbuf->y * (rd->size / 100.0f); + } else { /* CMP_SCALE_ABSOLUTE */ newx= (int)in[1]->vec[0]; newy= (int)in[2]->vec[0]; } diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_texture.c b/source/blender/nodes/intern/CMP_nodes/CMP_texture.c index 4ddab661627..31afe74bd11 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_texture.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_texture.c @@ -89,6 +89,7 @@ static void node_composit_exec_texture(void *data, bNode *node, bNodeStack **in, /* outputs: value, color, normal */ if(node->id) { + RenderData *rd= data; RenderResult *rr= RE_GetResult(RE_GetRender(G.scene->id.name)); /* G.scene is WEAK! */ short sizex, sizey; @@ -99,8 +100,8 @@ static void node_composit_exec_texture(void *data, bNode *node, bNodeStack **in, sizex = rr->rectx; sizey = rr->recty; } else { - sizex = G.scene->r.xsch; - sizey = G.scene->r.ysch; + sizex = rd->xsch; + sizey = rd->ysch; } prevbuf->rect_procedural= texture_procedural; |