Index: source/blender/blenkernel/BKE_node.h =================================================================== --- source/blender/blenkernel/BKE_node.h (revision 11262) +++ source/blender/blenkernel/BKE_node.h (working copy) @@ -46,6 +46,7 @@ struct ListBase; struct RenderData; struct Scene; +struct FileData; #define SOCK_IN 1 #define SOCK_OUT 2 @@ -84,6 +85,7 @@ void (*initfunc)(struct bNode *); void (*freestoragefunc)(struct bNode *); void (*copystoragefunc)(struct bNode *, struct bNode *); + void (*linkstoragefunc)( struct FileData *, struct bNode * ); /* for use with dynamic typedefs */ ID *id; @@ -206,8 +208,8 @@ #define SH_NODE_SQUEEZE 117 #define SH_NODE_MATERIAL_EXT 118 #define SH_NODE_INVERT 119 +#define SH_NODE_EXPR 303 - /* custom defines options for Material node */ #define SH_NODE_MAT_DIFF 1 #define SH_NODE_MAT_SPEC 2 Index: source/blender/blenkernel/intern/node.c =================================================================== --- source/blender/blenkernel/intern/node.c (revision 11262) +++ source/blender/blenkernel/intern/node.c (working copy) @@ -2389,6 +2389,7 @@ nodeRegisterType(ntypelist, &sh_node_rgb); nodeRegisterType(ntypelist, &sh_node_texture); nodeRegisterType(ntypelist, &sh_node_invert); + nodeRegisterType(ntypelist, &sh_node_expr); } void init_nodesystem(void) Index: source/blender/makesdna/DNA_node_types.h =================================================================== --- source/blender/makesdna/DNA_node_types.h (revision 11262) +++ source/blender/makesdna/DNA_node_types.h (working copy) @@ -223,6 +223,27 @@ char name[32]; } NodeVertexCol; +typedef struct NodeExprComponent{ + char fx[256]; + char fy[256]; + char fz[256]; + char fw[256]; + void *cx; + void *cy; + void *cz; + void *cw; + void *dict; +} NodeExprTemp; + +typedef struct NodeExpr { + char fx[256]; + char fy[256]; + char fz[256]; + char fw[256]; + NodeExprTemp *temp; +} NodeExpr; + + /* qdn: Defocus blur node */ typedef struct NodeDefocus { char bktype, rotation, preview, gamco; Index: source/blender/src/drawnode.c =================================================================== --- source/blender/src/drawnode.c (revision 11262) +++ source/blender/src/drawnode.c (working copy) @@ -615,6 +615,20 @@ return 40; } +static int node_shader_buts_expr(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) +{ + if(block) { + NodeExpr *nexpr= (NodeExpr*)node->storage; + + uiDefBut(block, TEX, B_NODE_EXEC+node->nr, "fx:", butr->xmin, butr->ymin+60, butr->xmax-butr->xmin, 20, nexpr->fx, 0, 255, 0, 0, "fx(x,y,z,w), Must evaluate to a Float"); + uiDefBut(block, TEX, B_NODE_EXEC+node->nr, "fy:", butr->xmin, butr->ymin+40, butr->xmax-butr->xmin, 20, nexpr->fy, 0, 255, 0, 0, "fy(x,y,z,w), Must evaluate to a Float"); + uiDefBut(block, TEX, B_NODE_EXEC+node->nr, "fz:", butr->xmin, butr->ymin+20, butr->xmax-butr->xmin, 20, nexpr->fz, 0, 255, 0, 0, "fz(x,y,z,w), Must evaluate to a Float"); + uiDefBut(block, TEX, B_NODE_EXEC+node->nr, "fw:", butr->xmin, butr->ymin , butr->xmax-butr->xmin, 20, nexpr->fw, 0, 255, 0, 0, "fw(x,y,z,w), Must evaluate to a Float"); + } + + return 80; +} + /* only once called */ static void node_shader_set_butfunc(bNodeType *ntype) { @@ -661,6 +675,9 @@ case SH_NODE_GEOMETRY: ntype->butfunc= node_shader_buts_geometry; break; + case SH_NODE_EXPR: + ntype->butfunc= node_shader_buts_expr; + break; default: ntype->butfunc= NULL; } Index: source/blender/blenloader/intern/readfile.c =================================================================== --- source/blender/blenloader/intern/readfile.c (revision 11262) +++ source/blender/blenloader/intern/readfile.c (working copy) @@ -1487,6 +1487,10 @@ node->storage= newdataadr(fd, node->storage); if(node->storage) { + if ( node->typeinfo->linkstoragefunc ){ + node->typeinfo->linkstoragefunc( fd, node ); + } + /* could be handlerized at some point */ if(ntree->type==NTREE_SHADER && (node->type==SH_NODE_CURVE_VEC || node->type==SH_NODE_CURVE_RGB)) direct_link_curvemapping(fd, node->storage); Index: source/blender/nodes/intern/SHD_nodes/Makefile =================================================================== --- source/blender/nodes/intern/SHD_nodes/Makefile (revision 11262) +++ source/blender/nodes/intern/SHD_nodes/Makefile (working copy) @@ -49,3 +49,4 @@ CPPFLAGS += -I../../../include CPPFLAGS += -I../../../imbuf CPPFLAGS += -I../../../render/extern/include +CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION) Index: source/blender/nodes/SHD_node.h =================================================================== --- source/blender/nodes/SHD_node.h (revision 11262) +++ source/blender/nodes/SHD_node.h (working copy) @@ -32,7 +32,6 @@ #ifndef SHD_NODE_H #define SHD_NODE_H - #include "BKE_node.h" @@ -58,6 +57,7 @@ extern bNodeType sh_node_squeeze; extern bNodeType sh_node_material_ext; extern bNodeType sh_node_invert; +extern bNodeType sh_node_expr; #endif Index: source/blender/nodes/CMakeLists.txt =================================================================== --- source/blender/nodes/CMakeLists.txt (revision 11262) +++ source/blender/nodes/CMakeLists.txt (working copy) @@ -34,6 +34,7 @@ ../imbuf ../avi ../../../intern/elbeem/extern ../../../intern/iksolver/extern ../blenloader ../quicktime ../blenkernel + ${PYTHON_INC} ${SDL_INC} ${ZLIB_INC} ) @@ -68,4 +69,3 @@ IF(WITH_INTERNATIONAL) ADD_DEFINITIONS(-DWITH_FREETYPE2) ENDIF(WITH_INTERNATIONAL) -