diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-07-04 15:43:54 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-07-05 17:06:12 +0300 |
commit | ea05edceaa3347e7b847e47862effdab9b42498a (patch) | |
tree | 3d79625cb6b7d2f0426663aaecd58cc5bbd41504 /source/blender/depsgraph/intern/depsgraph_build.cc | |
parent | 609e16339f13252a2dcaa2a5db4cf45c5e49e80b (diff) |
Depsgraph: Make object component conversion more accessible
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph_build.cc')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_build.cc | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc index 279c5e7839a..dd2d7f70ed5 100644 --- a/source/blender/depsgraph/intern/depsgraph_build.cc +++ b/source/blender/depsgraph/intern/depsgraph_build.cc @@ -77,31 +77,6 @@ static DEG::NodeType deg_build_scene_component_type(eDepsSceneComponentType comp return DEG::NodeType::UNDEFINED; } -static DEG::NodeType deg_build_object_component_type(eDepsObjectComponentType component) -{ - switch (component) { - case DEG_OB_COMP_PARAMETERS: - return DEG::NodeType::PARAMETERS; - case DEG_OB_COMP_PROXY: - return DEG::NodeType::PROXY; - case DEG_OB_COMP_ANIMATION: - return DEG::NodeType::ANIMATION; - case DEG_OB_COMP_TRANSFORM: - return DEG::NodeType::TRANSFORM; - case DEG_OB_COMP_GEOMETRY: - return DEG::NodeType::GEOMETRY; - case DEG_OB_COMP_EVAL_POSE: - return DEG::NodeType::EVAL_POSE; - case DEG_OB_COMP_BONE: - return DEG::NodeType::BONE; - case DEG_OB_COMP_SHADING: - return DEG::NodeType::SHADING; - case DEG_OB_COMP_CACHE: - return DEG::NodeType::CACHE; - } - return DEG::NodeType::UNDEFINED; -} - static DEG::DepsNodeHandle *get_node_handle(DepsNodeHandle *node_handle) { return reinterpret_cast<DEG::DepsNodeHandle *>(node_handle); @@ -123,7 +98,7 @@ void DEG_add_object_relation(DepsNodeHandle *node_handle, eDepsObjectComponentType component, const char *description) { - DEG::NodeType type = deg_build_object_component_type(component); + DEG::NodeType type = DEG::nodeTypeFromObjectComponent(component); DEG::ComponentKey comp_key(&object->id, type); DEG::DepsNodeHandle *deg_node_handle = get_node_handle(node_handle); deg_node_handle->builder->add_node_handle_relation(comp_key, deg_node_handle, description); @@ -134,7 +109,7 @@ void DEG_add_object_cache_relation(DepsNodeHandle *node_handle, eDepsObjectComponentType component, const char *description) { - DEG::NodeType type = deg_build_object_component_type(component); + DEG::NodeType type = DEG::nodeTypeFromObjectComponent(component); DEG::ComponentKey comp_key(&cache_file->id, type); DEG::DepsNodeHandle *deg_node_handle = get_node_handle(node_handle); deg_node_handle->builder->add_node_handle_relation(comp_key, deg_node_handle, description); @@ -146,7 +121,7 @@ void DEG_add_bone_relation(DepsNodeHandle *node_handle, eDepsObjectComponentType component, const char *description) { - DEG::NodeType type = deg_build_object_component_type(component); + DEG::NodeType type = DEG::nodeTypeFromObjectComponent(component); DEG::ComponentKey comp_key(&object->id, type, bone_name); DEG::DepsNodeHandle *deg_node_handle = get_node_handle(node_handle); deg_node_handle->builder->add_node_handle_relation(comp_key, deg_node_handle, description); @@ -157,7 +132,7 @@ void DEG_add_object_pointcache_relation(struct DepsNodeHandle *node_handle, eDepsObjectComponentType component, const char *description) { - DEG::NodeType type = deg_build_object_component_type(component); + DEG::NodeType type = DEG::nodeTypeFromObjectComponent(component); DEG::ComponentKey comp_key(&object->id, type); DEG::DepsNodeHandle *deg_node_handle = get_node_handle(node_handle); DEG::DepsgraphRelationBuilder *relation_builder = deg_node_handle->builder; |