diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2018-10-14 19:59:27 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2018-10-14 20:48:39 +0300 |
commit | cd48d4576bab3bf8d78c686433975cfee944f292 (patch) | |
tree | 5f8e443721807efdecb0c975ff7428864881cacd /source/blender/depsgraph/intern/depsgraph_build.cc | |
parent | 9a38a91f411b721eb8f61401fdc86521933aec87 (diff) |
Depsgraph: Add proper API functions for CustomDataMask dependencies.
There were a few copies of the same few lines in depsgraph build code,
so it seems to be logical to introduce a function for it, and make it
accessible from C code for completeness.
As an example, register the mask needs of the Data Transfer modifier.
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph_build.cc')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_build.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc index 1425c1bc453..957ca1a4275 100644 --- a/source/blender/depsgraph/intern/depsgraph_build.cc +++ b/source/blender/depsgraph/intern/depsgraph_build.cc @@ -131,6 +131,23 @@ void DEG_add_object_relation(DepsNodeHandle *handle, description); } +void DEG_add_object_customdata_relation(DepsNodeHandle *handle, + Object *object, + eDepsObjectComponentType component, + uint64_t customdata_mask, + const char *description) +{ + DEG::eDepsNode_Type type = deg_build_object_component_type(component); + DEG::ComponentKey comp_key(&object->id, type); + DEG::DepsNodeHandle *deg_handle = get_handle(handle); + deg_handle->builder->add_node_handle_relation(comp_key, + deg_handle, + description); + if (object->type == OB_MESH) { + deg_handle->builder->add_customdata_mask(comp_key, customdata_mask); + } +} + void DEG_add_object_cache_relation(DepsNodeHandle *handle, CacheFile *cache_file, eDepsObjectComponentType component, |