Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2018-08-22 16:24:48 +0300
committerJoshua Leung <aligorith@gmail.com>2018-08-23 08:07:37 +0300
commitbe77eeae46e17c1b6ffb0e4d4834a1bd28aedf64 (patch)
treeb9792ffd5d95879635f6ce03352a73f8263cf4f2 /source/blender/depsgraph/DEG_depsgraph_query.h
parent9e4770908968903537eff32df8d7a2f6b6641a8e (diff)
Depsgraph: First draft of graph filtering API implementation
When this works correctly, we should be able to feed in an existing depsgraph instance, and get out a "filtered" copy of it that contains only the subset of nodes needed to evaluate what we're interested in. The current implementation only filters on ID blocks/nodes, and starts by building a full new depsgraph instance first. I'd originally intended to do it per operation instead, copying over individual nodes as appropriate to have the smallest and least memory intensive graph possible. However, I ended up running into into problems with function binding + COW arguments, hence the current slow solution.
Diffstat (limited to 'source/blender/depsgraph/DEG_depsgraph_query.h')
-rw-r--r--source/blender/depsgraph/DEG_depsgraph_query.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/source/blender/depsgraph/DEG_depsgraph_query.h b/source/blender/depsgraph/DEG_depsgraph_query.h
index 41650769fcf..b7ecd0544e4 100644
--- a/source/blender/depsgraph/DEG_depsgraph_query.h
+++ b/source/blender/depsgraph/DEG_depsgraph_query.h
@@ -34,6 +34,7 @@
#define __DEG_DEPSGRAPH_QUERY_H__
#include "DEG_depsgraph.h"
+#include "DEG_depsgraph_build.h"
struct ID;
@@ -207,6 +208,34 @@ void DEG_foreach_dependent_ID(const Depsgraph *depsgraph,
void DEG_foreach_ID(const Depsgraph *depsgraph,
DEGForeachIDCallback callback, void *user_data);
+/* ********************* DEG graph filtering ****************** */
+
+/* ComponentKey for nodes we want to be able to evaluate in the filtered graph */
+typedef struct DEG_FilterTarget {
+ struct DEG_FilterTarget *next, *prev;
+
+ struct ID *id;
+ /* TODO: component identifiers - Component Type, Subdata/Component Name */
+} DEG_FilterTarget;
+
+typedef enum eDEG_FilterQuery_Granularity {
+ DEG_FILTER_NODES_ALL = 0,
+ DEG_FILTER_NODES_NO_OPS = 1,
+ DEG_FILTER_NODES_ID_ONLY = 2,
+} eDEG_FilterQuery_Granularity;
+
+
+typedef struct DEG_FilterQuery {
+ /* List of DEG_FilterTarget's */
+ struct ListBase targets;
+
+ /* Level of detail in the resulting graph */
+ eDEG_FilterQuery_Granularity detail_level;
+} DEG_FilterQuery;
+
+/* Obtain a new graph instance that only contains the subset of desired nodes */
+Depsgraph *DEG_graph_filter(const Depsgraph *depsgraph, struct Main *bmain, DEG_FilterQuery *query);
+
#ifdef __cplusplus
} /* extern "C" */