diff options
Diffstat (limited to 'source/blender/depsgraph/intern/nodes/deg_node_component.h')
-rw-r--r-- | source/blender/depsgraph/intern/nodes/deg_node_component.h | 75 |
1 files changed, 29 insertions, 46 deletions
diff --git a/source/blender/depsgraph/intern/nodes/deg_node_component.h b/source/blender/depsgraph/intern/nodes/deg_node_component.h index 4ef7dad3ac6..1c21a71737f 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node_component.h +++ b/source/blender/depsgraph/intern/nodes/deg_node_component.h @@ -74,18 +74,26 @@ struct ComponentDepsNode : public DepsNode { string identifier() const; - /* Find an existing operation, will throw an assert() if it does not exist. */ + /* Find an existing operation, if requested operation does not exist + * NULL will be returned. + */ OperationDepsNode *find_operation(OperationIDKey key) const; OperationDepsNode *find_operation(eDepsOperation_Code opcode, - const char *name, - int name_tag) const; + const char *name, + int name_tag) const; - /* Check operation exists and return it. */ - OperationDepsNode *has_operation(OperationIDKey key) const; - OperationDepsNode *has_operation(eDepsOperation_Code opcode, + /* Find an existing operation, will throw an assert() if it does not exist. */ + OperationDepsNode *get_operation(OperationIDKey key) const; + OperationDepsNode *get_operation(eDepsOperation_Code opcode, const char *name, int name_tag) const; + /* Check operation exists and return it. */ + bool has_operation(OperationIDKey key) const; + bool has_operation(eDepsOperation_Code opcode, + const char *name, + int name_tag) const; + /** * Create a new node for representing an operation and add this to graph * \warning If an existing node is found, it will be modified. This helps @@ -158,33 +166,21 @@ struct ComponentDepsNode : public DepsNode { /* ---------------------------------------- */ -struct ParametersComponentDepsNode : public ComponentDepsNode { - DEG_DEPSNODE_DECLARE; -}; - -struct AnimationComponentDepsNode : public ComponentDepsNode { - DEG_DEPSNODE_DECLARE; -}; - -struct TransformComponentDepsNode : public ComponentDepsNode { - DEG_DEPSNODE_DECLARE; -}; - -struct ProxyComponentDepsNode : public ComponentDepsNode { - DEG_DEPSNODE_DECLARE; -}; - -struct GeometryComponentDepsNode : public ComponentDepsNode { - DEG_DEPSNODE_DECLARE; -}; - -struct SequencerComponentDepsNode : public ComponentDepsNode { - DEG_DEPSNODE_DECLARE; -}; - -struct PoseComponentDepsNode : public ComponentDepsNode { - DEG_DEPSNODE_DECLARE; -}; +#define DEG_COMPONENT_DECLARE_GENERIC(name) \ + struct name ## ComponentDepsNode : public ComponentDepsNode { \ + DEG_DEPSNODE_DECLARE; \ + } + +DEG_COMPONENT_DECLARE_GENERIC(Animation); +DEG_COMPONENT_DECLARE_GENERIC(Cache); +DEG_COMPONENT_DECLARE_GENERIC(Geometry); +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(Transform); /* Bone Component */ struct BoneComponentDepsNode : public ComponentDepsNode { @@ -195,19 +191,6 @@ struct BoneComponentDepsNode : public ComponentDepsNode { DEG_DEPSNODE_DECLARE; }; -struct ParticlesComponentDepsNode : public ComponentDepsNode { - DEG_DEPSNODE_DECLARE; -}; - -struct ShadingComponentDepsNode : public ComponentDepsNode { - DEG_DEPSNODE_DECLARE; -}; - -struct CacheComponentDepsNode : public ComponentDepsNode { - DEG_DEPSNODE_DECLARE; -}; - - void deg_register_component_depsnodes(); } // namespace DEG |