617
619
static void node_shader_set_butfunc(bNodeType *ntype)
619
621
switch(ntype->type) {
620
case NODE_GROUP: /* note, generic type, but put here because we call this function anyway */
621
ntype->butfunc= node_buts_group;
622
/* case NODE_GROUP: note, typeinfo for group is generated... see "XXX ugly hack" */
623
624
case SH_NODE_MATERIAL:
624
625
ntype->butfunc= node_shader_buts_material;
811
812
uiDefButI(block, NUM, B_NODE_EXEC+node->nr, "Offs:",
812
813
xmin, dy, width, 19,
813
&iuser->offset, 0.0, 10000.0, 0, 0, "Offsets the number of the frame to use in the animation");
814
&iuser->offset, -10000.0, 10000.0, 0, 0, "Offsets the number of the frame to use in the animation");
814
815
uiDefButS(block, TOG, B_NODE_EXEC+node->nr, "Cycl",
815
816
xmin+width, dy, width-20, 19,
816
817
&iuser->cycl, 0.0, 0.0, 0, 0, "Make animation go cyclic");
1151
1152
CurveMapping *cumap= node->storage;
1152
1153
short dx= (butr->xmax-butr->xmin)/2;
1156
memcpy(&curvebutr, &butr, sizeof(rctf));
1157
curvebutr->ymin += 26;
1159
curvemap_buttons(block, node->storage, 's', B_NODE_EXEC+node->nr, B_REDR, curvebutr);
1154
1161
cumap->flag |= CUMA_DRAW_CFRA;
1155
1162
if(node->custom1<node->custom2)
1156
1163
cumap->black[0]= (float)(CFRA - node->custom1)/(float)(node->custom2-node->custom1);
1158
uiDefBut(block, BUT_CURVE, B_NODE_EXEC+node->nr, "",
1159
butr->xmin, butr->ymin+24, butr->xmax-butr->xmin, butr->ymax-butr->ymin-24,
1160
node->storage, 0.0f, 1.0f, 0, 0, "");
1162
1165
uiBlockBeginAlign(block);
1163
1166
uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "Sta:",
1164
butr->xmin, butr->ymin, dx, 19,
1167
butr->xmin, butr->ymin-22, dx, 19,
1165
1168
&node->custom1, 1.0, 20000.0, 0, 0, "Start frame");
1166
1169
uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "End:",
1167
butr->xmin+dx, butr->ymin, dx, 19,
1170
butr->xmin+dx, butr->ymin-22, dx, 19,
1168
1171
&node->custom2, 1.0, 20000.0, 0, 0, "End frame");
1509
1512
static void node_composit_set_butfunc(bNodeType *ntype)
1511
1514
switch(ntype->type) {
1512
case NODE_GROUP: /* note, generic type, but put here because we call this function anyway */
1513
ntype->butfunc= node_buts_group;
1515
/* case NODE_GROUP: note, typeinfo for group is generated... see "XXX ugly hack" */
1515
1517
case CMP_NODE_IMAGE:
1516
1518
ntype->butfunc= node_composit_buts_image;
1618
1620
void init_node_butfuncs(void)
1620
bNodeType **typedefs;
1622
1624
/* shader nodes */
1623
typedefs= node_all_shaders; /* BKE_node.h */
1625
node_shader_set_butfunc(*typedefs);
1625
ntype= node_all_shaders.first;
1627
node_shader_set_butfunc(ntype);
1628
1630
/* composit nodes */
1629
typedefs= node_all_composit; /* BKE_node.h */
1631
node_composit_set_butfunc(*typedefs);
1631
ntype= node_all_composit.first;
1633
node_composit_set_butfunc(ntype);
2179
2184
block= uiNewBlock(&sa->uiblocks, str, UI_EMBOSS, UI_HELV, sa->win);
2180
2185
uiBlockSetFlag(block, UI_BLOCK_NO_HILITE);
2182
uiSetButLock(snode->id->lib!=NULL, "Can't edit library data");
2187
uiSetButLock(snode->id->lib!=NULL, ERROR_LIBDATA_MESSAGE);