Merge branch 'master' into blender2.8
[blender.git] / source / blender / depsgraph / intern / nodes / deg_node_component.cc
index bba16316288905e1bdfd8ba5d8c05248e44ec4bd..c22e74f4577cfc8d276f711e32c52c477b540d48 100644 (file)
@@ -176,34 +176,45 @@ OperationDepsNode *ComponentDepsNode::find_operation(OperationIDKey key) const
                        }
                }
        }
+       return node;
+}
 
-       if (node != NULL) {
-               return node;
-       }
-       else {
+OperationDepsNode *ComponentDepsNode::find_operation(eDepsOperation_Code opcode,
+                                                    const char *name,
+                                                    int name_tag) const
+{
+       OperationIDKey key(opcode, name, name_tag);
+       return find_operation(key);
+}
+
+OperationDepsNode *ComponentDepsNode::get_operation(OperationIDKey key) const
+{
+       OperationDepsNode *node = find_operation(key);
+       if (node == NULL) {
                fprintf(stderr, "%s: find_operation(%s) failed\n",
                        this->identifier().c_str(), key.identifier().c_str());
                BLI_assert(!"Request for non-existing operation, should not happen");
                return NULL;
        }
+       return node;
 }
 
-OperationDepsNode *ComponentDepsNode::find_operation(eDepsOperation_Code opcode,
-                                                     const char *name,
-                                                     int name_tag) const
+OperationDepsNode *ComponentDepsNode::get_operation(eDepsOperation_Code opcode,
+                                                    const char *name,
+                                                    int name_tag) const
 {
        OperationIDKey key(opcode, name, name_tag);
-       return find_operation(key);
+       return get_operation(key);
 }
 
-OperationDepsNode *ComponentDepsNode::has_operation(OperationIDKey key) const
+bool ComponentDepsNode::has_operation(OperationIDKey key) const
 {
-       return reinterpret_cast<OperationDepsNode *>(BLI_ghash_lookup(operations_map, &key));
+       return find_operation(key) != NULL;
 }
 
-OperationDepsNode *ComponentDepsNode::has_operation(eDepsOperation_Code opcode,
-                                                    const char *name,
-                                                    int name_tag) const
+bool ComponentDepsNode::has_operation(eDepsOperation_Code opcode,
+                                      const char *name,
+                                      int name_tag) const
 {
        OperationIDKey key(opcode, name, name_tag);
        return has_operation(key);
@@ -214,7 +225,7 @@ OperationDepsNode *ComponentDepsNode::add_operation(const DepsEvalOperationCb& o
                                                     const char *name,
                                                     int name_tag)
 {
-       OperationDepsNode *op_node = has_operation(opcode, name, name_tag);
+       OperationDepsNode *op_node = find_operation(opcode, name, name_tag);
        if (!op_node) {
                DepsNodeFactory *factory = deg_get_node_factory(DEG_NODE_TYPE_OPERATION);
                op_node = (OperationDepsNode *)factory->create_node(this->owner->id_orig, "", name);