diff options
Diffstat (limited to 'source/blender/nodes/composite/nodes/node_composite_common.c')
-rw-r--r-- | source/blender/nodes/composite/nodes/node_composite_common.c | 150 |
1 files changed, 0 insertions, 150 deletions
diff --git a/source/blender/nodes/composite/nodes/node_composite_common.c b/source/blender/nodes/composite/nodes/node_composite_common.c index 2596248d696..10b81cdaaa0 100644 --- a/source/blender/nodes/composite/nodes/node_composite_common.c +++ b/source/blender/nodes/composite/nodes/node_composite_common.c @@ -231,153 +231,3 @@ void register_node_type_cmp_group(bNodeTreeType *ttype) nodeRegisterType(ttype, &ntype); } - -#ifdef WITH_COMPOSITOR_LEGACY - -/**** FOR LOOP ****/ - -#if 0 /* XXX loop nodes don't work nicely with current trees */ -/* Move the results from the previous iteration back to the input sockets. */ -static void loop_iteration_reset(bNodeTree *ngroup, bNodeStack *gstack) -{ - bNodeSocket *gin, *gout; - bNodeStack *nsin, *nsout; - - gin = ngroup->inputs.first; - gout = ngroup->outputs.first; - - while (gin && gout) { - /* skip static (non-looping) sockets */ - while (gin && !(gin->flag & SOCK_DYNAMIC)) - gin=gin->next; - while (gout && !(gout->flag & SOCK_DYNAMIC)) - gout=gout->next; - - if (gin && gout) { - nsin = node_get_socket_stack(gstack, gin); - nsout = node_get_socket_stack(gstack, gout); - - move_stack(nsin, nsout); - - gin=gin->next; - gout=gout->next; - } - } -} - -static void forloop_execute(void *data, int thread, struct bNode *node, void *nodedata, struct bNodeStack **in, struct bNodeStack **out) -{ - bNodeTreeExec *exec= (bNodeTreeExec *)nodedata; - int totiterations= (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; - } - - /* "Iteration" socket */ - sock = exec->nodetree->inputs.first; - ns = node_get_socket_stack(exec->stack, sock); - - group_copy_inputs(node, in, exec->stack); - for (iteration=0; iteration < totiterations; ++iteration) { - /* first input contains current iteration counter */ - ns->vec[0] = (float)iteration; - - if (iteration > 0) - loop_iteration_reset(exec->nodetree, exec->stack); - ntreeExecNodes(exec, data, thread); - group_free_internal(exec); - } - group_move_outputs(node, out, exec->stack); -} - -void register_node_type_cmp_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; - 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; - } - - /* "Condition" socket */ - sock = exec->nodetree->outputs.first; - ns = node_get_socket_stack(exec->stack, sock); - - iteration = 0; - group_copy_inputs(node, in, exec->stack); - while (condition && iteration < node->custom1) { - if (iteration > 0) - loop_iteration_reset(exec->nodetree, exec->stack); - ntreeExecNodes(exec, data, thread); - group_free_internal(exec); - -// PRINT_BUFFERS(exec); - - condition = (ns->vec[0] > 0.0f); - ++iteration; - } - group_move_outputs(node, out, exec->stack); -} - -void register_node_type_cmp_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 - -#endif /* WITH_COMPOSITOR_LEGACY */ |