diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-05-29 19:02:21 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-05-29 19:02:21 +0400 |
commit | 7d04e4c53e5cd4888afd4177a9d70a6fc72c8e36 (patch) | |
tree | 9877850d4e9b86a36f787f2f730668617b42a1b4 /source/blender/editors/space_node | |
parent | ec4f6750557218be262cacea53ef4cb0ccaa0671 (diff) | |
parent | feb3dc926a74b51789b100ac9532dc196a4cd9ae (diff) |
svn merge ^/trunk/blender -r47150:47184
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 103 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_header.c | 19 | ||||
-rw-r--r-- | source/blender/editors/space_node/space_node.c | 5 |
3 files changed, 1 insertions, 126 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 4c5befda8df..2db808e7a59 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -417,37 +417,6 @@ static void node_browse_tex_cb(bContext *C, void *ntree_v, void *node_v) node->menunr = 0; } #endif -static void node_dynamic_update_cb(bContext *C, void *UNUSED(ntree_v), void *node_v) -{ - Main *bmain = CTX_data_main(C); - Material *ma; - bNode *node = (bNode *)node_v; - ID *id = node->id; - int error = 0; - - if (BTST(node->custom1, NODE_DYNAMIC_ERROR)) error = 1; - - /* Users only have to press the "update" button in one pynode - * and we also update all others sharing the same script */ - for (ma = bmain->mat.first; ma; ma = ma->id.next) { - if (ma->nodetree) { - bNode *nd; - for (nd = ma->nodetree->nodes.first; nd; nd = nd->next) { - if ((nd->type == NODE_DYNAMIC) && (nd->id == id)) { - nd->custom1 = 0; - nd->custom1 = BSET(nd->custom1, NODE_DYNAMIC_REPARSE); - nd->menunr = 0; - if (error) - nd->custom1 = BSET(nd->custom1, NODE_DYNAMIC_ERROR); - } - } - } - } - - // allqueue(REDRAWBUTSSHADING, 0); - // allqueue(REDRAWNODE, 0); - // XXX BIF_preview_changed(ID_MA); -} static void node_buts_texture(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { @@ -1107,34 +1076,6 @@ static void node_common_set_butfunc(bNodeType *ntype) } /* ****************** BUTTON CALLBACKS FOR SHADER NODES ***************** */ - -static void node_browse_text_cb(bContext *C, void *ntree_v, void *node_v) -{ - Main *bmain = CTX_data_main(C); - bNodeTree *ntree = ntree_v; - bNode *node = node_v; - /* ID *oldid; */ /* UNUSED */ - - if (node->menunr < 1) return; - - if (node->id) { - node->id->us--; - } - /* oldid= node->id; */ /* UNUSED */ - node->id = BLI_findlink(&bmain->text, node->menunr - 1); - id_us_plus(node->id); - BLI_strncpy(node->name, node->id->name + 2, sizeof(node->name)); - - node->custom1 = BSET(node->custom1, NODE_DYNAMIC_NEW); - - nodeSetActive(ntree, node); - - // allqueue(REDRAWBUTSSHADING, 0); - // allqueue(REDRAWNODE, 0); - - node->menunr = 0; -} - static void node_shader_buts_material(uiLayout *layout, bContext *C, PointerRNA *ptr) { bNode *node = ptr->data; @@ -1254,45 +1195,6 @@ static void node_shader_buts_glossy(uiLayout *layout, bContext *UNUSED(C), Point uiItemR(layout, ptr, "distribution", 0, "", ICON_NONE); } -static void node_shader_buts_dynamic(uiLayout *layout, bContext *C, PointerRNA *ptr) -{ - Main *bmain = CTX_data_main(C); - uiBlock *block = uiLayoutAbsoluteBlock(layout); - bNode *node = ptr->data; - bNodeTree *ntree = ptr->id.data; - rctf *butr = &node->butr; - uiBut *bt; - // XXX SpaceNode *snode= curarea->spacedata.first; - short dy = (short)butr->ymin; - int xoff = 0; - - /* B_NODE_EXEC is handled in butspace.c do_node_buts */ - if (!node->id) { - const char *strp; - IDnames_to_pupstring(&strp, NULL, "", &(bmain->text), NULL, NULL); - node->menunr = 0; - bt = uiDefButS(block, MENU, B_NODE_EXEC /*+node->nr*/, strp, - butr->xmin, dy, 19, 19, - &node->menunr, 0, 0, 0, 0, "Browses existing choices"); - uiButSetFunc(bt, node_browse_text_cb, ntree, node); - xoff = 19; - if (strp) MEM_freeN((void *)strp); - } - else { - bt = uiDefBut(block, BUT, B_NOP, "Update", - butr->xmin + xoff, butr->ymin + 20, 50, 19, - &node->menunr, 0.0, 19.0, 0, 0, "Refresh this node (and all others that use the same script)"); - uiButSetFunc(bt, node_dynamic_update_cb, ntree, node); - - if (BTST(node->custom1, NODE_DYNAMIC_ERROR)) { - // UI_ThemeColor(TH_REDALERT); - // XXX ui_rasterpos_safe(butr->xmin + xoff, butr->ymin + 5, snode->aspect); - // XXX snode_drawstring(snode, "Error! Check console...", butr->xmax - butr->xmin); - ; - } - } -} - /* only once called */ static void node_shader_set_butfunc(bNodeType *ntype) { @@ -1370,9 +1272,6 @@ static void node_shader_set_butfunc(bNodeType *ntype) case SH_NODE_BSDF_GLASS: ntype->uifunc = node_shader_buts_glossy; break; - case NODE_DYNAMIC: - ntype->uifunc = node_shader_buts_dynamic; - break; } } @@ -2414,7 +2313,7 @@ static void node_composit_buts_keyingscreen(uiLayout *layout, bContext *C, Point static void node_composit_buts_keying(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { - bNode *node= ptr->data; + /* bNode *node= ptr->data; */ /* UNUSED */ uiItemR(layout, ptr, "blur_pre", 0, NULL, ICON_NONE); uiItemR(layout, ptr, "despill_factor", 0, NULL, ICON_NONE); diff --git a/source/blender/editors/space_node/node_header.c b/source/blender/editors/space_node/node_header.c index bb52c1570aa..0d03df2298f 100644 --- a/source/blender/editors/space_node/node_header.c +++ b/source/blender/editors/space_node/node_header.c @@ -157,22 +157,6 @@ static void do_node_add_group(bContext *C, void *UNUSED(arg), int event) do_node_add(C, &ntemp); } -#if 0 /* disabled */ -static void do_node_add_dynamic(bContext *C, void *UNUSED(arg), int event) -{ - Main *bmain = CTX_data_main(C); - Scene *scene = CTX_data_scene(C); - bNodeTemplate ntemp; - - ntemp.type = NODE_DYNAMIC; - - ntemp.main = bmain; - ntemp.scene = scene; - - do_node_add(C, &ntemp); -} -#endif - static int node_tree_has_type(int treetype, int nodetype) { bNodeTreeType *ttype= ntreeGetType(treetype); @@ -228,9 +212,6 @@ static void node_add_menu(bContext *C, uiLayout *layout, void *arg_nodeclass) } } } - else if (nodeclass==NODE_DYNAMIC) { - /* disabled */ - } else { bNodeType *ntype; diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index e29f9647a7b..66919935d48 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -226,11 +226,6 @@ static void node_area_listener(ScrArea *sa, wmNotifier *wmn) ED_area_tag_refresh(sa); } break; - case NC_TEXT: - /* pynodes */ - if (wmn->data==ND_SHADING) - ED_area_tag_refresh(sa); - break; case NC_SPACE: if (wmn->data==ND_SPACE_NODE) ED_area_tag_refresh(sa); |