Merge branch 'master' into blender2.8
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 18 Dec 2017 15:50:21 +0000 (16:50 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 18 Dec 2017 15:51:05 +0000 (16:51 +0100)
source/blender/depsgraph/intern/depsgraph_intern.h
source/blender/depsgraph/intern/nodes/deg_node.cc
source/blender/depsgraph/intern/nodes/deg_node.h
source/blender/depsgraph/intern/nodes/deg_node_component.cc
source/blender/depsgraph/intern/nodes/deg_node_component.h
source/blender/makesdna/DNA_ID.h

index 4484d4ed94fce2d5544a35e53627a36048a54bfa..ba984f1c13b10f80d2322dc5ed2d6fd7b864e968 100644 (file)
@@ -62,6 +62,7 @@ struct DepsNodeFactory {
        virtual eDepsNode_Type type() const = 0;
        virtual eDepsNode_Class tclass() const = 0;
        virtual const char *tname() const = 0;
+       virtual int id_recalc_tag() const = 0;
 
        virtual DepsNode *create_node(const ID *id,
                                      const char *subdata,
@@ -73,6 +74,7 @@ struct DepsNodeFactoryImpl : public DepsNodeFactory {
        eDepsNode_Type type() const { return NodeType::typeinfo.type; }
        eDepsNode_Class tclass() const { return NodeType::typeinfo.tclass; }
        const char *tname() const { return NodeType::typeinfo.tname; }
+       int id_recalc_tag() const { return NodeType::typeinfo.id_recalc_tag; }
 
        DepsNode *create_node(const ID *id, const char *subdata, const char *name) const
        {
index 3f70f8e128103f886cece5ee19ba01735da0ef3f..de340907114d5bccb111d197c399fa294f759af7 100644 (file)
@@ -61,16 +61,19 @@ namespace DEG {
 
 /* Add ------------------------------------------------ */
 
-DepsNode::TypeInfo::TypeInfo(eDepsNode_Type type, const char *tname)
+DepsNode::TypeInfo::TypeInfo(eDepsNode_Type type,
+                             const char *tname,
+                             int id_recalc_tag)
+        : type(type),
+          tname(tname),
+          id_recalc_tag(id_recalc_tag)
 {
-       this->type = type;
        if (type == DEG_NODE_TYPE_OPERATION)
                this->tclass = DEG_NODE_CLASS_OPERATION;
        else if (type < DEG_NODE_TYPE_PARAMETERS)
                this->tclass = DEG_NODE_CLASS_GENERIC;
        else
                this->tclass = DEG_NODE_CLASS_COMPONENT;
-       this->tname = tname;
 }
 
 DepsNode::DepsNode()
index fd3ed694c9ce5df6a5c5295791b9c4294caf0af4..c699de67eda2224490f596e18bc917ee3f4fe2b7 100644 (file)
@@ -51,11 +51,13 @@ struct OperationDepsNode;
 struct DepsNode {
        /* Helper class for static typeinfo in subclasses. */
        struct TypeInfo {
-               TypeInfo(eDepsNode_Type type, const char *tname);
+               TypeInfo(eDepsNode_Type type, const char *tname, int id_recalc_tag = 0);
 
                eDepsNode_Type type;
                eDepsNode_Class tclass;
                const char *tname;
+
+               int id_recalc_tag;
        };
 
        /* Identifier - mainly for debugging purposes. */
index f4530ecebdb27497402c237fcfa7da169d92ba34..d3405118f573225e41ee5cafebd21692798fa081 100644 (file)
@@ -355,30 +355,6 @@ void ComponentDepsNode::finalize_build(Depsgraph * /*graph*/)
        operations_map = NULL;
 }
 
-/* Register all components. =============================== */
-
-#define DEG_COMPONENT_DEFINE(name, NAME)                             \
-  DEG_DEPSNODE_DEFINE(name ## ComponentDepsNode,                     \
-                      DEG_NODE_TYPE_ ## NAME,                        \
-                      #name  " Component");                          \
-static DepsNodeFactoryImpl<name ## ComponentDepsNode> DNTI_ ## NAME
-
-
-DEG_COMPONENT_DEFINE(Animation, ANIMATION);
-DEG_COMPONENT_DEFINE(BatchCache, BATCH_CACHE);
-DEG_COMPONENT_DEFINE(Cache, CACHE);
-DEG_COMPONENT_DEFINE(CopyOnWrite, COPY_ON_WRITE);
-DEG_COMPONENT_DEFINE(Geometry, GEOMETRY);
-DEG_COMPONENT_DEFINE(LayerCollections, LAYER_COLLECTIONS);
-DEG_COMPONENT_DEFINE(Parameters, PARAMETERS);
-DEG_COMPONENT_DEFINE(Particles, EVAL_PARTICLES);
-DEG_COMPONENT_DEFINE(Proxy, PROXY);
-DEG_COMPONENT_DEFINE(Pose, EVAL_POSE);
-DEG_COMPONENT_DEFINE(Sequencer, SEQUENCER);
-DEG_COMPONENT_DEFINE(Shading, SHADING);
-DEG_COMPONENT_DEFINE(ShadingParameters, SHADING_PARAMETERS);
-DEG_COMPONENT_DEFINE(Transform, TRANSFORM);
-
 /* Bone Component ========================================= */
 
 /* Initialize 'bone component' node - from pointer data given */
@@ -398,7 +374,23 @@ void BoneComponentDepsNode::init(const ID *id, const char *subdata)
        this->pchan = BKE_pose_channel_find_name(object->pose, subdata);
 }
 
-DEG_COMPONENT_DEFINE(Bone, BONE);
+/* Register all components. =============================== */
+
+DEG_COMPONENT_NODE_DEFINE(Animation,         ANIMATION,          ID_RECALC_NONE);
+DEG_COMPONENT_NODE_DEFINE(BatchCache,        BATCH_CACHE,        ID_RECALC_NONE);
+DEG_COMPONENT_NODE_DEFINE(Bone,              BONE,               ID_RECALC_NONE);
+DEG_COMPONENT_NODE_DEFINE(Cache,             CACHE,              ID_RECALC_NONE);
+DEG_COMPONENT_NODE_DEFINE(CopyOnWrite,       COPY_ON_WRITE,      ID_RECALC_NONE);
+DEG_COMPONENT_NODE_DEFINE(Geometry,          GEOMETRY,           ID_RECALC_NONE);
+DEG_COMPONENT_NODE_DEFINE(LayerCollections,  LAYER_COLLECTIONS,  ID_RECALC_NONE);
+DEG_COMPONENT_NODE_DEFINE(Parameters,        PARAMETERS,         ID_RECALC_NONE);
+DEG_COMPONENT_NODE_DEFINE(Particles,         EVAL_PARTICLES,     ID_RECALC_NONE);
+DEG_COMPONENT_NODE_DEFINE(Proxy,             PROXY,              ID_RECALC_NONE);
+DEG_COMPONENT_NODE_DEFINE(Pose,              EVAL_POSE,          ID_RECALC_NONE);
+DEG_COMPONENT_NODE_DEFINE(Sequencer,         SEQUENCER,          ID_RECALC_NONE);
+DEG_COMPONENT_NODE_DEFINE(Shading,           SHADING,            ID_RECALC_NONE);
+DEG_COMPONENT_NODE_DEFINE(ShadingParameters, SHADING_PARAMETERS, ID_RECALC_NONE);
+DEG_COMPONENT_NODE_DEFINE(Transform,         TRANSFORM,          ID_RECALC_NONE);
 
 /* Node Types Register =================================== */
 
index ba4f8551fea0f7254f978726aca1c2f9eb431e87..882a16adf8222102053bb56263c36be4eecd4aab 100644 (file)
@@ -164,25 +164,38 @@ struct ComponentDepsNode : public DepsNode {
 
 /* ---------------------------------------- */
 
-#define DEG_COMPONENT_DECLARE_GENERIC(name)                        \
+#define DEG_COMPONENT_NODE_DEFINE_TYPEINFO(NodeType, type_, tname_, id_recalc_tag) \
+    const DepsNode::TypeInfo NodeType::typeinfo = \
+        DepsNode::TypeInfo(type_, tname_, id_recalc_tag)
+
+#define DEG_COMPONENT_NODE_DECLARE DEG_DEPSNODE_DECLARE
+
+#define DEG_COMPONENT_NODE_DEFINE(name, NAME, id_recalc_tag)            \
+    DEG_COMPONENT_NODE_DEFINE_TYPEINFO(name ## ComponentDepsNode,       \
+                                       DEG_NODE_TYPE_ ## NAME,          \
+                                       #name  " Component",             \
+                                       id_recalc_tag) ;                 \
+    static DepsNodeFactoryImpl<name ## ComponentDepsNode> DNTI_ ## NAME
+
+#define DEG_COMPONENT_NODE_DECLARE_GENERIC(name)                   \
        struct name ## ComponentDepsNode : public ComponentDepsNode {  \
-               DEG_DEPSNODE_DECLARE;                                      \
+               DEG_COMPONENT_NODE_DECLARE;                                \
        }
 
-DEG_COMPONENT_DECLARE_GENERIC(Animation);
-DEG_COMPONENT_DECLARE_GENERIC(BatchCache);
-DEG_COMPONENT_DECLARE_GENERIC(Cache);
-DEG_COMPONENT_DECLARE_GENERIC(CopyOnWrite);
-DEG_COMPONENT_DECLARE_GENERIC(Geometry);
-DEG_COMPONENT_DECLARE_GENERIC(LayerCollections);
-DEG_COMPONENT_DECLARE_GENERIC(Parameters);
-DEG_COMPONENT_DECLARE_GENERIC(Particles);
-DEG_COMPONENT_DECLARE_GENERIC(Proxy);
-DEG_COMPONENT_DECLARE_GENERIC(Pose);
-DEG_COMPONENT_DECLARE_GENERIC(Sequencer);
-DEG_COMPONENT_DECLARE_GENERIC(Shading);
-DEG_COMPONENT_DECLARE_GENERIC(ShadingParameters);
-DEG_COMPONENT_DECLARE_GENERIC(Transform);
+DEG_COMPONENT_NODE_DECLARE_GENERIC(Animation);
+DEG_COMPONENT_NODE_DECLARE_GENERIC(BatchCache);
+DEG_COMPONENT_NODE_DECLARE_GENERIC(Cache);
+DEG_COMPONENT_NODE_DECLARE_GENERIC(CopyOnWrite);
+DEG_COMPONENT_NODE_DECLARE_GENERIC(Geometry);
+DEG_COMPONENT_NODE_DECLARE_GENERIC(LayerCollections);
+DEG_COMPONENT_NODE_DECLARE_GENERIC(Parameters);
+DEG_COMPONENT_NODE_DECLARE_GENERIC(Particles);
+DEG_COMPONENT_NODE_DECLARE_GENERIC(Proxy);
+DEG_COMPONENT_NODE_DECLARE_GENERIC(Pose);
+DEG_COMPONENT_NODE_DECLARE_GENERIC(Sequencer);
+DEG_COMPONENT_NODE_DECLARE_GENERIC(Shading);
+DEG_COMPONENT_NODE_DECLARE_GENERIC(ShadingParameters);
+DEG_COMPONENT_NODE_DECLARE_GENERIC(Transform);
 
 /* Bone Component */
 struct BoneComponentDepsNode : public ComponentDepsNode {
@@ -190,7 +203,7 @@ struct BoneComponentDepsNode : public ComponentDepsNode {
 
        struct bPoseChannel *pchan;     /* the bone that this component represents */
 
-       DEG_DEPSNODE_DECLARE;
+       DEG_COMPONENT_NODE_DECLARE;
 };
 
 void deg_register_component_depsnodes();
index 0b8778674b343c6048bc527a7a6f57a04c3eb3d2..ae908b1aabc1f9da4cea95908bf280ee4d3b4c58 100644 (file)
@@ -458,6 +458,7 @@ enum {
 
 enum {
        /* RESET_AFTER_USE, used by update code (depsgraph). */
+       ID_RECALC_NONE  = 0,
        ID_RECALC       = 1 << 0,
        ID_RECALC_ALL   = ID_RECALC,
 };