~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/blender/src/drawnode.c

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2007-05-17 11:47:59 UTC
  • mfrom: (1.2.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20070517114759-yp4ybrnhp2u7pk66
Tags: 2.44-1
* New upstream release.
* Drop debian/patches/01_64bits_stupidity, not needed anymore: as of this
  version blender is 64 bits safe again. Adjust README.Debian accordingly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
#include "BKE_texture.h"
59
59
#include "BKE_utildefines.h"
60
60
 
 
61
#include "CMP_node.h"
 
62
#include "SHD_node.h"
 
63
 
61
64
#include "BIF_gl.h"
62
65
#include "BIF_glutil.h"
63
66
#include "BIF_interface.h"
86
89
#include "mydevice.h"
87
90
 
88
91
 
89
 
 
90
92
static void snode_drawstring(SpaceNode *snode, char *str, int okwidth)
91
93
{
92
94
        char drawstr[NODE_MAXSTR];
617
619
static void node_shader_set_butfunc(bNodeType *ntype)
618
620
{
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
 
                        break;
 
622
                /* case NODE_GROUP:      note, typeinfo for group is generated... see "XXX ugly hack" */
 
623
 
623
624
                case SH_NODE_MATERIAL:
624
625
                        ntype->butfunc= node_shader_buts_material;
625
626
                        break;
810
811
                                dy-= 19;
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");
1150
1151
        if(block) {
1151
1152
                CurveMapping *cumap= node->storage;
1152
1153
                short dx= (butr->xmax-butr->xmin)/2;
 
1154
                rctf *curvebutr;
 
1155
                
 
1156
                memcpy(&curvebutr, &butr, sizeof(rctf));
 
1157
                curvebutr->ymin += 26;
 
1158
                
 
1159
                curvemap_buttons(block, node->storage, 's', B_NODE_EXEC+node->nr, B_REDR, curvebutr);
1153
1160
                
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);
1157
1164
                
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, "");
1161
 
                
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");
1169
1172
                
1170
1173
        }
1509
1512
static void node_composit_set_butfunc(bNodeType *ntype)
1510
1513
{
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;
1514
 
                        break;
 
1515
                /* case NODE_GROUP:      note, typeinfo for group is generated... see "XXX ugly hack" */
 
1516
 
1515
1517
                case CMP_NODE_IMAGE:
1516
1518
                        ntype->butfunc= node_composit_buts_image;
1517
1519
                        break;
1617
1619
 
1618
1620
void init_node_butfuncs(void)
1619
1621
{
1620
 
        bNodeType **typedefs;
 
1622
        bNodeType *ntype;
1621
1623
        
1622
1624
        /* shader nodes */
1623
 
        typedefs= node_all_shaders;             /* BKE_node.h */
1624
 
        while( *typedefs) {
1625
 
                node_shader_set_butfunc(*typedefs);
1626
 
                typedefs++;
 
1625
        ntype= node_all_shaders.first;
 
1626
        while(ntype) {
 
1627
                node_shader_set_butfunc(ntype);
 
1628
                ntype= ntype->next;
1627
1629
        }
1628
1630
        /* composit nodes */
1629
 
        typedefs= node_all_composit;            /* BKE_node.h */
1630
 
        while( *typedefs) {
1631
 
                node_composit_set_butfunc(*typedefs);
1632
 
                typedefs++;
 
1631
        ntype= node_all_composit.first;
 
1632
        while(ntype) {
 
1633
                node_composit_set_butfunc(ntype);
 
1634
                ntype= ntype->next;
1633
1635
        }
1634
1636
}
1635
1637
 
2099
2101
                glDisable(GL_BLEND);
2100
2102
        }
2101
2103
        if(node->type == NODE_GROUP) {
 
2104
                /* XXX ugly hack */
 
2105
                node->typeinfo->butfunc= node_buts_group;
 
2106
                
2102
2107
                iconofs-= 18.0f;
2103
2108
                glEnable(GL_BLEND);
2104
2109
                if(node->id->lib) {
2179
2184
                        block= uiNewBlock(&sa->uiblocks, str, UI_EMBOSS, UI_HELV, sa->win);
2180
2185
                        uiBlockSetFlag(block, UI_BLOCK_NO_HILITE);
2181
2186
                        if(snode->id)
2182
 
                                uiSetButLock(snode->id->lib!=NULL, "Can't edit library data");
 
2187
                                uiSetButLock(snode->id->lib!=NULL, ERROR_LIBDATA_MESSAGE);
2183
2188
                }
2184
2189
        }
2185
2190