Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Letwory <nathan@letworyinteractive.com>2008-02-10 02:17:15 +0300
committerNathan Letwory <nathan@letworyinteractive.com>2008-02-10 02:17:15 +0300
commit16514e3ddb8500242931650c93f1397147442eba (patch)
treec66895704889f7a42219fbcdf1b59d81e6858529 /source/blender/src/toolbox.c
parenta37d9470a7f4e042efb6ce873ee05308e9aec535 (diff)
* Merge of PyNodes to trunk. Finally!
See http://wiki.blender.org/index.php/BlenderDev/PyNodes and http://wiki.blender.org/index.php/BlenderDev/PyNodes/API For current documentation. Very very big thanks go to William Germano for fixing the memory issues left and for improving on the code. In the coming time documentation will be finalised and further stabilising of PyNodes is to be expected.
Diffstat (limited to 'source/blender/src/toolbox.c')
-rw-r--r--source/blender/src/toolbox.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/source/blender/src/toolbox.c b/source/blender/src/toolbox.c
index 671628bf5c7..1ad355b5e81 100644
--- a/source/blender/src/toolbox.c
+++ b/source/blender/src/toolbox.c
@@ -1570,6 +1570,7 @@ static TBitem tb_node_addsh[]= {
{ 0, "Vector", 4, NULL},
{ 0, "Convertor", 5, NULL},
{ 0, "Group", 6, NULL},
+ { 0, "Dynamic", 7, NULL},
{ -1, "", 0, NULL}};
static TBitem tb_node_addcomp[]= {
@@ -1582,6 +1583,7 @@ static TBitem tb_node_addcomp[]= {
{ 0, "Matte", 7, NULL},
{ 0, "Distort", 8, NULL},
{ 0, "Group", 9, NULL},
+ { 0, "Dynamic", 10, NULL},
{ -1, "", 0, NULL}};
/* do_node_addmenu() in header_node.c, prototype in BSE_headerbuttons.h */
@@ -1630,11 +1632,21 @@ static TBitem *node_add_sublevel(ListBase *storage, bNodeTree *ntree, int nodecl
}
}
else {
- bNodeType *ntype= ntree->alltypes.first;
- for(a=0; ntype; ntype= ntype->next) {
- if( ntype->nclass == nodeclass ) {
- addmenu[a].name= ntype->name;
- addmenu[a].retval= ntype->type;
+ bNodeType *type= ntree->alltypes.first;
+ int script=0;
+ for(a=0; type; type= type->next) {
+ if( type->nclass == nodeclass ) {
+ if(type->type == NODE_DYNAMIC) {
+ if(type->id)
+ addmenu[a].name= type->id->name+2;
+ else
+ addmenu[a].name= type->name;
+ addmenu[a].retval= NODE_DYNAMIC_MENU+script;
+ script++;
+ } else {
+ addmenu[a].name= type->name;
+ addmenu[a].retval= type->type;
+ }
a++;
}
}
@@ -2130,6 +2142,7 @@ void toolbox_n(void)
menu1[3].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OP_VECTOR);
menu1[4].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_CONVERTOR);
menu1[5].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_GROUP);
+ menu1[6].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OP_DYNAMIC);
}
else if(snode->treetype==NTREE_COMPOSIT) {
menu1[0].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_INPUT);
@@ -2141,6 +2154,7 @@ void toolbox_n(void)
menu1[6].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_MATTE);
menu1[7].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_DISTORT);
menu1[8].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_GROUP);
+ menu1[9].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OP_DYNAMIC);
}