[Bf-blender-cvs] [3fa6b6ed4c7] blender2.8: Depsgraph: Add function to iterate over all original IDs

Sergey Sharybin noreply at git.blender.org
Wed May 2 17:11:01 CEST 2018


Commit: 3fa6b6ed4c7ad98d0002032e9ef77fa4024f28a5
Author: Sergey Sharybin
Date:   Wed May 2 16:31:05 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB3fa6b6ed4c7ad98d0002032e9ef77fa4024f28a5

Depsgraph: Add function to iterate over all original IDs

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

M	source/blender/depsgraph/DEG_depsgraph_query.h
M	source/blender/depsgraph/intern/depsgraph_query_foreach.cc

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

diff --git a/source/blender/depsgraph/DEG_depsgraph_query.h b/source/blender/depsgraph/DEG_depsgraph_query.h
index 508714db218..6d21c143877 100644
--- a/source/blender/depsgraph/DEG_depsgraph_query.h
+++ b/source/blender/depsgraph/DEG_depsgraph_query.h
@@ -188,6 +188,9 @@ void DEG_foreach_dependent_ID(const Depsgraph *depsgraph,
                               const ID *id,
                               DEGForeachIDCallback callback, void *user_data);
 
+void DEG_foreach_ID(const Depsgraph *depsgraph,
+                    DEGForeachIDCallback callback, void *user_data);
+
 
 #ifdef __cplusplus
 } /* extern "C" */
diff --git a/source/blender/depsgraph/intern/depsgraph_query_foreach.cc b/source/blender/depsgraph/intern/depsgraph_query_foreach.cc
index e6692cf49b3..b5ed3e38f09 100644
--- a/source/blender/depsgraph/intern/depsgraph_query_foreach.cc
+++ b/source/blender/depsgraph/intern/depsgraph_query_foreach.cc
@@ -136,6 +136,14 @@ static void deg_foreach_dependent_ID(const Depsgraph *graph,
 	}
 }
 
+static void deg_foreach_id(const Depsgraph *depsgraph,
+                           DEGForeachIDCallback callback, void *user_data)
+{
+	foreach (const IDDepsNode *id_node, depsgraph->id_nodes) {
+		callback(id_node->id_orig, user_data);
+	}
+}
+
 }  // namespace DEG
 
 void DEG_foreach_dependent_ID(const Depsgraph *depsgraph,
@@ -146,3 +154,9 @@ void DEG_foreach_dependent_ID(const Depsgraph *depsgraph,
 	                              id,
 	                              callback, user_data);
 }
+
+void DEG_foreach_ID(const Depsgraph *depsgraph,
+                    DEGForeachIDCallback callback, void *user_data)
+{
+	DEG::deg_foreach_id((const DEG::Depsgraph *)depsgraph, callback, user_data);
+}



More information about the Bf-blender-cvs mailing list