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>2012-10-24 14:00:28 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2012-10-24 14:00:28 +0400
commitcbae51bc9321a86aaf04bbd324086d09c0eac6cf (patch)
tree3ac3c25ee6041f3ea32046d4e2aa3713ec584ba4 /source/blender/nodes/shader
parentc9e489b53b66d1626ccfded2a3bd0c27a1ba6b19 (diff)
Removed the experimental (and commented-out) code for FOR and WHILE loops in nodes. This was a feature i tested a while back but was only partially supported by Blender Internal renderer and the old compositor. The main idea was to have nodes that automatically mirror input and output sockets to support incremental changes of "internal variables".
It is not a well-supported feature of the primary node systems (shader, compositor, texture) in Blender. If anybody wants to create a node system that has actual use for loops, they can do so much more elegantly with Python nodes, but it does not have to be a core node type in Blender. Removing this should ease node code maintenance a bit.
Diffstat (limited to 'source/blender/nodes/shader')
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_common.c125
1 files changed, 0 insertions, 125 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_common.c b/source/blender/nodes/shader/nodes/node_shader_common.c
index df369482a2e..688d77d8350 100644
--- a/source/blender/nodes/shader/nodes/node_shader_common.c
+++ b/source/blender/nodes/shader/nodes/node_shader_common.c
@@ -204,128 +204,3 @@ void register_node_type_sh_group(bNodeTreeType *ttype)
nodeRegisterType(ttype, &ntype);
}
-
-
-/**** FOR LOOP ****/
-
-#if 0 /* XXX loop nodes don't work nicely with current trees */
-static void forloop_execute(void *data, int thread, struct bNode *node, void *nodedata, struct bNodeStack **in, struct bNodeStack **out)
-{
- bNodeTreeExec *exec= (bNodeTreeExec*)nodedata;
- bNodeThreadStack *nts;
- int iterations= (int)in[0]->vec[0];
- bNodeSocket *sock;
- bNodeStack *ns;
- int iteration;
-
- /* XXX same behavior as trunk: all nodes inside group are executed.
- * it's stupid, but just makes it work. compo redesign will do this better.
- */
- {
- bNode *inode;
- for (inode=exec->nodetree->nodes.first; inode; inode=inode->next)
- inode->need_exec = 1;
- }
-
- nts = ntreeGetThreadStack(exec, thread);
-
- /* "Iteration" socket */
- sock = exec->nodetree->inputs.first;
- ns = node_get_socket_stack(nts->stack, sock);
-
-// group_copy_inputs(node, in, nts->stack);
- for (iteration=0; iteration < iterations; ++iteration) {
- /* first input contains current iteration counter */
- ns->vec[0] = (float)iteration;
- ns->vec[1]=ns->vec[2]=ns->vec[3] = 0.0f;
-
-// if (iteration > 0)
-// loop_init_iteration(exec->nodetree, nts->stack);
-// ntreeExecThreadNodes(exec, nts, data, thread);
- }
-// loop_copy_outputs(node, in, out, exec->stack);
-
- ntreeReleaseThreadStack(nts);
-}
-
-void register_node_type_sh_forloop(bNodeTreeType *ttype)
-{
- static bNodeType ntype;
-
- node_type_base(ttype, &ntype, NODE_FORLOOP, "For", NODE_CLASS_GROUP, NODE_OPTIONS);
- node_type_socket_templates(&ntype, NULL, NULL);
- node_type_size(&ntype, 120, 60, 200);
- node_type_label(&ntype, node_group_label);
- node_type_init(&ntype, node_forloop_init);
- node_type_valid(&ntype, node_group_valid);
- node_type_template(&ntype, node_forloop_template);
- node_type_update(&ntype, NULL, node_group_verify);
- node_type_tree(&ntype, node_forloop_init_tree, node_loop_update_tree);
- node_type_group_edit(&ntype, node_group_edit_get, node_group_edit_set, node_group_edit_clear);
- node_type_exec_new(&ntype, group_initexec, group_freeexec, forloop_execute);
-
- nodeRegisterType(ttype, &ntype);
-}
-#endif
-
-/**** WHILE LOOP ****/
-
-#if 0 /* XXX loop nodes don't work nicely with current trees */
-static void whileloop_execute(void *data, int thread, struct bNode *node, void *nodedata, struct bNodeStack **in, struct bNodeStack **out)
-{
- bNodeTreeExec *exec= (bNodeTreeExec*)nodedata;
- bNodeThreadStack *nts;
- int condition= (in[0]->vec[0] > 0.0f);
- bNodeSocket *sock;
- bNodeStack *ns;
- int iteration;
-
- /* XXX same behavior as trunk: all nodes inside group are executed.
- * it's stupid, but just makes it work. compo redesign will do this better.
- */
- {
- bNode *inode;
- for (inode=exec->nodetree->nodes.first; inode; inode=inode->next)
- inode->need_exec = 1;
- }
-
- nts = ntreeGetThreadStack(exec, thread);
-
- /* "Condition" socket */
- sock = exec->nodetree->outputs.first;
- ns = node_get_socket_stack(nts->stack, sock);
-
- iteration = 0;
-// group_copy_inputs(node, in, nts->stack);
- while (condition && iteration < node->custom1) {
-// if (iteration > 0)
-// loop_init_iteration(exec->nodetree, nts->stack);
-// ntreeExecThreadNodes(exec, nts, data, thread);
-
- condition = (ns->vec[0] > 0.0f);
- ++iteration;
- }
-// loop_copy_outputs(node, in, out, exec->stack);
-
- ntreeReleaseThreadStack(nts);
-}
-
-void register_node_type_sh_whileloop(bNodeTreeType *ttype)
-{
- static bNodeType ntype;
-
- node_type_base(ttype, &ntype, NODE_WHILELOOP, "While", NODE_CLASS_GROUP, NODE_OPTIONS);
- node_type_socket_templates(&ntype, NULL, NULL);
- node_type_size(&ntype, 120, 60, 200);
- node_type_label(&ntype, node_group_label);
- node_type_init(&ntype, node_whileloop_init);
- node_type_valid(&ntype, node_group_valid);
- node_type_template(&ntype, node_whileloop_template);
- node_type_update(&ntype, NULL, node_group_verify);
- node_type_tree(&ntype, node_whileloop_init_tree, node_loop_update_tree);
- node_type_group_edit(&ntype, node_group_edit_get, node_group_edit_set, node_group_edit_clear);
- node_type_exec_new(&ntype, group_initexec, group_freeexec, whileloop_execute);
-
- nodeRegisterType(ttype, &ntype);
-}
-#endif