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:
authorLukas Toenne <lukas.toenne@googlemail.com>2013-03-18 20:34:57 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2013-03-18 20:34:57 +0400
commit4638e5f99a9ba59ad0b8a1fd52b12e876480b9e8 (patch)
tree2444f12b4612440f44cf02835cdf5951b6564e92 /source/blender/nodes/texture/nodes/node_texture_proc.c
parent7bfef29f2f2a1b262d28abdc6e30fcd9c1f1caad (diff)
Merge of the PyNodes branch (aka "custom nodes") into trunk.
PyNodes opens up the node system in Blender to scripters and adds a number of UI-level improvements. === Dynamic node type registration === Node types can now be added at runtime, using the RNA registration mechanism from python. This enables addons such as render engines to create a complete user interface with nodes. Examples of how such nodes can be defined can be found in my personal wiki docs atm [1] and as a script template in release/scripts/templates_py/custom_nodes.py [2]. === Node group improvements === Each node editor now has a tree history of edited node groups, which allows opening and editing nested node groups. The node editor also supports pinning now, so that different spaces can be used to edit different node groups simultaneously. For more ramblings and rationale see (really old) blog post on code.blender.org [3]. The interface of node groups has been overhauled. Sockets of a node group are no longer displayed in columns on either side, but instead special input/output nodes are used to mirror group sockets inside a node tree. This solves the problem of long node lines in groups and allows more adaptable node layout. Internal sockets can be exposed from a group by either connecting to the extension sockets in input/output nodes (shown as empty circle) or by adding sockets from the node property bar in the "Interface" panel. Further details such as the socket name can also be changed there. [1] http://wiki.blender.org/index.php/User:Phonybone/Python_Nodes [2] http://projects.blender.org/scm/viewvc.php/trunk/blender/release/scripts/templates_py/custom_nodes.py?view=markup&root=bf-blender [3] http://code.blender.org/index.php/2012/01/improving-node-group-interface-editing/
Diffstat (limited to 'source/blender/nodes/texture/nodes/node_texture_proc.c')
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_proc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/nodes/texture/nodes/node_texture_proc.c b/source/blender/nodes/texture/nodes/node_texture_proc.c
index de2dac22d81..504e77ebb27 100644
--- a/source/blender/nodes/texture/nodes/node_texture_proc.c
+++ b/source/blender/nodes/texture/nodes/node_texture_proc.c
@@ -129,11 +129,11 @@ static int count_outputs(bNode *node)
{ \
texfn(result, p, node, in, 1, &name##_map_inputs, thread); \
} \
- static void name##_exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) \
+ static void name##_exec(void *data, int UNUSED(thread), bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack **out) \
{ \
int outs = count_outputs(node); \
- if (outs >= 1) tex_output(node, in, out[0], &name##_colorfn, data); \
- if (outs >= 2) tex_output(node, in, out[1], &name##_normalfn, data); \
+ if (outs >= 1) tex_output(node, execdata, in, out[0], &name##_colorfn, data); \
+ if (outs >= 2) tex_output(node, execdata, in, out[1], &name##_normalfn, data); \
}
@@ -281,7 +281,7 @@ ProcDef(stucci)
/* --- */
-static void init(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
+static void init(bNodeTree *UNUSED(ntree), bNode *node)
{
Tex *tex = MEM_callocN(sizeof(Tex), "Tex");
node->storage= tex;
@@ -296,18 +296,18 @@ static void init(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(nt
/* Node type definitions */
#define TexDef(TEXTYPE, outputs, name, Name) \
-void register_node_type_tex_proc_##name(bNodeTreeType *ttype) \
+void register_node_type_tex_proc_##name() \
{ \
static bNodeType ntype; \
\
- node_type_base(ttype, &ntype, TEX_NODE_PROC+TEXTYPE, Name, NODE_CLASS_TEXTURE, NODE_PREVIEW|NODE_OPTIONS); \
+ tex_node_type_base(&ntype, TEX_NODE_PROC+TEXTYPE, Name, NODE_CLASS_TEXTURE, NODE_PREVIEW|NODE_OPTIONS); \
node_type_socket_templates(&ntype, name##_inputs, outputs); \
node_type_size(&ntype, 140, 80, 140); \
node_type_init(&ntype, init); \
node_type_storage(&ntype, "Tex", node_free_standard_storage, node_copy_standard_storage); \
- node_type_exec(&ntype, name##_exec); \
+ node_type_exec(&ntype, NULL, NULL, name##_exec); \
\
- nodeRegisterType(ttype, &ntype); \
+ nodeRegisterType(&ntype); \
}
#define C outputs_color_only