diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2008-02-10 06:40:24 +0300 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2008-02-10 06:40:24 +0300 |
commit | f46fcf7aab30fa2c905840e4ad0d4f1486994285 (patch) | |
tree | 0bce96c6bc3c9faa1814d561f4bc738cdebb23de /source | |
parent | 34ddfb03c1f2f77d09d02793e368cca5abf95e9c (diff) |
== PyNodes ==
1) Including the Add->Dynamic submenu in the Nodes window header. Previously pynodes could only be added via toolbox.
2) Disabling pynodes execution when using more than one thread for rendering. This prevents the crashes while a proper fix isn't implemented.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c | 3 | ||||
-rw-r--r-- | source/blender/src/drawnode.c | 5 | ||||
-rw-r--r-- | source/blender/src/header_node.c | 24 |
3 files changed, 32 insertions, 0 deletions
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c b/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c index c198e73a3bf..9c15877e478 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c @@ -570,6 +570,9 @@ static void node_dynamic_exec_cb(void *data, bNode *node, bNodeStack **in, bNode if (!node->id) return; + if (G.scene->r.threads > 1) + return; + if (BTST2(node->custom1, NODE_DYNAMIC_NEW, NODE_DYNAMIC_REPARSE)) { node_dynamic_setup(node); return; diff --git a/source/blender/src/drawnode.c b/source/blender/src/drawnode.c index d85e3199fb3..54475eb362e 100644 --- a/source/blender/src/drawnode.c +++ b/source/blender/src/drawnode.c @@ -798,6 +798,11 @@ static int node_shader_buts_dynamic(uiBlock *block, bNodeTree *ntree, bNode *nod ui_rasterpos_safe(butr->xmin + xoff, butr->ymin + 5, snode->aspect); snode_drawstring(snode, "Error! Check console...", butr->xmax - butr->xmin); } + else if (G.scene->r.threads > 1) { + BIF_ThemeColor(TH_REDALERT); + ui_rasterpos_safe(butr->xmin + xoff, butr->ymin + 5, snode->aspect); + snode_drawstring(snode, "Set threads to 1", butr->xmax - butr->xmin); + } } } return 20+19; diff --git a/source/blender/src/header_node.c b/source/blender/src/header_node.c index c9313c0edeb..3573f69898a 100644 --- a/source/blender/src/header_node.c +++ b/source/blender/src/header_node.c @@ -273,10 +273,17 @@ static void node_make_addmenu(SpaceNode *snode, int nodeclass, uiBlock *block) } else { bNodeType *type; + int script=0; for(a=0, type= ntree->alltypes.first; type; type=type->next) { if( type->nclass == nodeclass ) { + if(type->type == NODE_DYNAMIC) { + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, type->name, 0, + yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, NODE_DYNAMIC_MENU+script, ""); + script++; + } else { uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, type->name, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, type->type, ""); + } a++; } } @@ -423,6 +430,22 @@ static uiBlock *node_add_groupmenu(void *arg_unused) return block; } +static uiBlock *node_add_dynamicmenu(void *arg_unused) +{ + SpaceNode *snode= curarea->spacedata.first; + uiBlock *block; + + block= uiNewBlock(&curarea->uiblocks, "node_add_dynamicmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); + uiBlockSetButmFunc(block, do_node_addmenu, NULL); + + node_make_addmenu(snode, NODE_CLASS_OP_DYNAMIC, block); + + uiBlockSetDirection(block, UI_RIGHT); + uiTextBoundsBlock(block, 60); + + return block; +} + static uiBlock *node_addmenu(void *arg_unused) { SpaceNode *snode= curarea->spacedata.first; @@ -440,6 +463,7 @@ static uiBlock *node_addmenu(void *arg_unused) uiDefIconTextBlockBut(block, node_add_vectormenu, NULL, ICON_RIGHTARROW_THIN, "Vector", 0, yco-=20, 120, 19, ""); uiDefIconTextBlockBut(block, node_add_convertermenu, NULL, ICON_RIGHTARROW_THIN, "Convertor", 0, yco-=20, 120, 19, ""); uiDefIconTextBlockBut(block, node_add_groupmenu, NULL, ICON_RIGHTARROW_THIN, "Group", 0, yco-=20, 120, 19, ""); + uiDefIconTextBlockBut(block, node_add_dynamicmenu, NULL, ICON_RIGHTARROW_THIN, "Dynamic", 0, yco-=20, 120, 19, ""); } else if(snode->treetype==NTREE_COMPOSIT) { uiDefIconTextBlockBut(block, node_add_inputmenu, NULL, ICON_RIGHTARROW_THIN, "Input", 0, yco-=20, 120, 19, ""); |