Merge branch 'master' into blender2.8
[blender.git] / source / blender / depsgraph / intern / builder / deg_builder_relations_impl.h
index 485586e844f754a2da77a1b576d90eb05b095160..894d4172c0041f9006c6e8201987a1ecc1d6d5c8 100644 (file)
@@ -46,17 +46,17 @@ OperationDepsNode *DepsgraphRelationBuilder::find_operation_node(const KeyType&
 }
 
 template <typename KeyFrom, typename KeyTo>
-void DepsgraphRelationBuilder::add_relation(const KeyFrom &key_from,
-                                            const KeyTo &key_to,
-                                            const char *description,
-                                            bool check_unique)
+DepsRelation *DepsgraphRelationBuilder::add_relation(const KeyFrom &key_from,
+                                                     const KeyTo &key_to,
+                                                     const char *description,
+                                                     bool check_unique)
 {
        DepsNode *node_from = get_node(key_from);
        DepsNode *node_to = get_node(key_to);
        OperationDepsNode *op_from = node_from ? node_from->get_exit_operation() : NULL;
        OperationDepsNode *op_to = node_to ? node_to->get_entry_operation() : NULL;
        if (op_from && op_to) {
-               add_operation_relation(op_from, op_to, description, check_unique);
+               return add_operation_relation(op_from, op_to, description, check_unique);
        }
        else {
                if (!op_from) {
@@ -78,24 +78,27 @@ void DepsgraphRelationBuilder::add_relation(const KeyFrom &key_from,
                                description, key_to.identifier().c_str());
                }
        }
+       return NULL;
 }
 
 template <typename KeyTo>
-void DepsgraphRelationBuilder::add_relation(const TimeSourceKey &key_from,
-                                            const KeyTo &key_to,
-                                            const char *description,
-                                            bool check_unique)
+DepsRelation *DepsgraphRelationBuilder::add_relation(
+        const TimeSourceKey &key_from,
+        const KeyTo &key_to,
+        const char *description,
+        bool check_unique)
 {
        TimeSourceDepsNode *time_from = get_node(key_from);
        DepsNode *node_to = get_node(key_to);
        OperationDepsNode *op_to = node_to ? node_to->get_entry_operation() : NULL;
        if (time_from != NULL && op_to != NULL) {
-               add_time_relation(time_from, op_to, description, check_unique);
+               return add_time_relation(time_from, op_to, description, check_unique);
        }
+       return NULL;
 }
 
 template <typename KeyType>
-void DepsgraphRelationBuilder::add_node_handle_relation(
+DepsRelation *DepsgraphRelationBuilder::add_node_handle_relation(
         const KeyType &key_from,
         const DepsNodeHandle *handle,
         const char *description,
@@ -105,7 +108,7 @@ void DepsgraphRelationBuilder::add_node_handle_relation(
        OperationDepsNode *op_from = node_from ? node_from->get_exit_operation() : NULL;
        OperationDepsNode *op_to = handle->node->get_entry_operation();
        if (op_from != NULL && op_to != NULL) {
-               add_operation_relation(op_from, op_to, description, check_unique);
+               return add_operation_relation(op_from, op_to, description, check_unique);
        }
        else {
                if (!op_from) {
@@ -117,6 +120,7 @@ void DepsgraphRelationBuilder::add_node_handle_relation(
                                description, key_from.identifier().c_str());
                }
        }
+       return NULL;
 }
 
 template <typename KeyType>