diff options
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph.h')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph.h | 61 |
1 files changed, 54 insertions, 7 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph.h b/source/blender/depsgraph/intern/depsgraph.h index dda4da7bc13..a27af42e7b9 100644 --- a/source/blender/depsgraph/intern/depsgraph.h +++ b/source/blender/depsgraph/intern/depsgraph.h @@ -36,15 +36,26 @@ #pragma once +#include <stdlib.h> + +#include "DNA_ID.h" /* for ID_Type */ + +#include "BKE_library.h" /* for MAX_LIBARRAY */ + #include "BLI_threads.h" /* for SpinLock */ +#include "DEG_depsgraph.h" + #include "intern/depsgraph_types.h" struct ID; struct GHash; +struct Main; struct GSet; struct PointerRNA; struct PropertyRNA; +struct Scene; +struct ViewLayer; namespace DEG { @@ -96,14 +107,17 @@ struct Depsgraph { typedef vector<OperationDepsNode *> OperationNodes; typedef vector<IDDepsNode *> IDDepsNodes; - Depsgraph(); + Depsgraph(Scene *scene, + ViewLayer *view_layer, + eEvaluationMode mode); ~Depsgraph(); /** * Convenience wrapper to find node given just pointer + property. * * \param ptr: pointer to the data that node will represent - * \param prop: optional property affected - providing this effectively results in inner nodes being returned + * \param prop: optional property affected - providing this effectively + * results in inner nodes being returned * * \return A node matching the required characteristics if it exists * or NULL if no such node exists in the graph @@ -114,8 +128,9 @@ struct Depsgraph { TimeSourceDepsNode *find_time_source() const; IDDepsNode *find_id_node(const ID *id) const; - IDDepsNode *add_id_node(ID *id, const char *name = ""); + IDDepsNode *add_id_node(ID *id, ID *id_cow_hint = NULL); void clear_id_nodes(); + void clear_id_nodes_conditional(const std::function <bool (ID_Type id_type)>& filter); /* Add new relationship between two nodes. */ DepsRelation *add_new_relation(OperationDepsNode *from, @@ -142,6 +157,11 @@ struct Depsgraph { /* Clear storage used by all nodes. */ void clear_all_nodes(); + /* Copy-on-Write Functionality ........ */ + + /* For given original ID get ID which is created by CoW system. */ + ID *get_cow_id(const ID *id_orig) const; + /* Core Graph Functionality ........... */ /* <ID : IDDepsNode> mapping from ID blocks to nodes representing these @@ -161,6 +181,9 @@ struct Depsgraph { /* Indicates whether relations needs to be updated. */ bool need_update; + /* Indicates which ID types were updated. */ + char id_type_updated[MAX_LIBARRAY]; + /* Quick-Access Temp Data ............. */ /* Nodes which have been tagged as "directly modified". */ @@ -177,12 +200,36 @@ struct Depsgraph { */ SpinLock lock; - /* Layers Visibility .................. */ + /* Scene, layer, mode this dependency graph is built for. */ + Scene *scene; + ViewLayer *view_layer; + eEvaluationMode mode; + + /* Time at which dependency graph is being or was last evaluated. */ + float ctime; + + /* Evaluated version of datablocks we access a lot. + * Stored here to save us form doing hash lookup. + */ + Scene *scene_cow; + + /* Active dependency graph is a dependency graph which is used by the + * currently active window. When dependency graph is active, it is allowed + * for evaluation functions to write animation f-curve result, drivers + * result and other selective things (object matrix?) to original object. + * + * This way we simplify operators, which don't need to worry about where + * to read stuff from. + */ + bool is_active; - /* Visible layers bitfield, used for skipping invisible objects updates. */ - unsigned int layers; + /* NITE: Corresponds to G_DEBUG_DEPSGRAPH_* flags. */ + int debug_flags; + string debug_name; - // XXX: additional stuff like eval contexts, mempools for allocating nodes from, etc. + /* Cached list of effectors for collections and the scene created + * along with relations, for fast lookup during evaluation. */ + GHash *effector_relations; }; } // namespace DEG |