Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuho Vepsalainen <bebraw@gmail.com>2007-09-04 21:42:33 +0400
committerJuho Vepsalainen <bebraw@gmail.com>2007-09-04 21:42:33 +0400
commit5b55a89bac9081cd7c8d9757c104b0c9c6d38ad9 (patch)
treef94927925d5bf88421d9e1e7a4ef9bfd9770d560 /source/blender/src
parente20e3e94ffdc9e7dbd846ed24bffdc1851cd5f41 (diff)
Fix for bug [#7135] Compositor crash when adding a time node:
This commit replaces the old function used to draw time node user interface with new one. This should fix the issue. The function can later be reused time node for material node system.
Diffstat (limited to 'source/blender/src')
-rw-r--r--source/blender/src/drawnode.c56
1 files changed, 26 insertions, 30 deletions
diff --git a/source/blender/src/drawnode.c b/source/blender/src/drawnode.c
index d903d74681b..8402e8e92e4 100644
--- a/source/blender/src/drawnode.c
+++ b/source/blender/src/drawnode.c
@@ -337,6 +337,31 @@ static int node_buts_mix_rgb(uiBlock *block, bNodeTree *ntree, bNode *node, rctf
return 20;
}
+static int node_buts_time(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
+{
+ if(block) {
+ CurveMapping *cumap= node->storage;
+ short dx= (short)((butr->xmax-butr->xmin)/2);
+ butr->ymin += 26;
+
+ curvemap_buttons(block, node->storage, 's', B_NODE_EXEC+node->nr, B_REDR, butr);
+
+ if(cumap) cumap->flag |= CUMA_DRAW_CFRA;
+ if(node->custom1<node->custom2)
+ cumap->black[0]= (float)(CFRA - node->custom1)/(float)(node->custom2-node->custom1);
+
+ uiBlockBeginAlign(block);
+ uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "Sta:",
+ butr->xmin, butr->ymin-22, dx, 19,
+ &node->custom1, 1.0, 20000.0, 0, 0, "Start frame");
+ uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "End:",
+ butr->xmin+dx, butr->ymin-22, dx, 19,
+ &node->custom2, 1.0, 20000.0, 0, 0, "End frame");
+ }
+
+ return node->width-NODE_DY;
+}
+
static int node_buts_valtorgb(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
{
if(block) {
@@ -1202,35 +1227,6 @@ static int node_composit_buts_map_value(uiBlock *block, bNodeTree *ntree, bNode
return 80;
}
-static int node_composit_buts_time(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
-{
- if(block) {
- CurveMapping *cumap= node->storage;
- short dx= (butr->xmax-butr->xmin)/2;
- rctf *curvebutr;
-
- memcpy(&curvebutr, &butr, sizeof(rctf));
- curvebutr->ymin += 26;
-
- curvemap_buttons(block, node->storage, 's', B_NODE_EXEC+node->nr, B_REDR, curvebutr);
-
- cumap->flag |= CUMA_DRAW_CFRA;
- if(node->custom1<node->custom2)
- cumap->black[0]= (float)(CFRA - node->custom1)/(float)(node->custom2-node->custom1);
-
- uiBlockBeginAlign(block);
- uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "Sta:",
- butr->xmin, butr->ymin-22, dx, 19,
- &node->custom1, 1.0, 20000.0, 0, 0, "Start frame");
- uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "End:",
- butr->xmin+dx, butr->ymin-22, dx, 19,
- &node->custom2, 1.0, 20000.0, 0, 0, "End frame");
-
- }
-
- return node->width-NODE_DY;
-}
-
static int node_composit_buts_alphaover(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr)
{
if(block) {
@@ -1635,7 +1631,7 @@ static void node_composit_set_butfunc(bNodeType *ntype)
ntype->butfunc= node_composit_buts_map_value;
break;
case CMP_NODE_TIME:
- ntype->butfunc= node_composit_buts_time;
+ ntype->butfunc= node_buts_time;
break;
case CMP_NODE_ALPHAOVER:
ntype->butfunc= node_composit_buts_alphaover;