Commit: c2556d90d25a89f2b646568cf1463fb388e5457f
Author: Joshua Leung
Date:   Tue Dec 30 14:09:53 2014 +1300
Branches: depsgraph_refactor
https://developer.blender.org/rBc2556d90d25a89f2b646568cf1463fb388e5457f

Entry/Exit operations for components now get set when creating those operation 
nodes

===================================================================

M       source/blender/depsgraph/intern/depsgraph_build.cpp
M       source/blender/depsgraph/intern/depsnode_component.cpp

===================================================================

diff --git a/source/blender/depsgraph/intern/depsgraph_build.cpp 
b/source/blender/depsgraph/intern/depsgraph_build.cpp
index c99ea5a..4674fcf 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_build.cpp
@@ -233,8 +233,6 @@ OperationDepsNode 
*DepsgraphNodeBuilder::add_operation_node(ID *id, eDepsNode_Ty
        OperationDepsNode *op_node = comp_node->add_operation(optype, op, 
opcode, description);
        m_graph->operations.push_back(op_node);
        
-       // TODO: mark as entry/exit if appropriate
-       
        return op_node;
 }
 
diff --git a/source/blender/depsgraph/intern/depsnode_component.cpp 
b/source/blender/depsgraph/intern/depsnode_component.cpp
index 2b39e45..54a25dd 100644
--- a/source/blender/depsgraph/intern/depsnode_component.cpp
+++ b/source/blender/depsgraph/intern/depsnode_component.cpp
@@ -124,12 +124,29 @@ OperationDepsNode 
*ComponentDepsNode::add_operation(eDepsOperation_Type optype,
                DepsNodeFactory *factory = 
DEG_get_node_factory(DEPSNODE_TYPE_OPERATION);
                op_node = (OperationDepsNode 
*)factory->create_node(this->owner->id, "", name);
                
-               /* register */
+               /* register opnode in this component's operation set */
                OperationIDKey key(opcode, name);
                this->operations[key] = op_node;
                
+               /* set as entry/exit node of component (if appropriate) */
+               if (optype == DEPSOP_TYPE_INIT) {
+                       BLI_assert(this->entry_operation == NULL);
+                       this->entry_operation = op_node;
+               }
+               else if (optype == DEPSOP_TYPE_POST) {
+                       // XXX: review whether DEPSOP_TYPE_OUT is better than 
DEPSOP_TYPE_POST, or maybe have both?
+                       BLI_assert(this->exit_operation == NULL);
+                       this->exit_operation = op_node;
+               }
+               
+               /* set backlink */
                op_node->owner = this;
        }
+       else {
+               /* we have a duplicate node! */
+               fprintf(stderr, "add_operation: Operation already exists - %s 
has %s at %p\n",
+                       this->identifier().c_str(), 
op_node->identifier().c_str(), op_node);
+       }
        
        /* attach extra data */
        op_node->evaluate = op;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to