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.
This commit is contained in:
2018-10-14 19:59:27 +03:00
parent 9a38a91f41
commit cd48d4576b
7 changed files with 46 additions and 19 deletions

View File

@@ -129,7 +129,9 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte
{
DataTransferModifierData *dtmd = (DataTransferModifierData *) md;
if (dtmd->ob_source != NULL) {
DEG_add_object_relation(ctx->node, dtmd->ob_source, DEG_OB_COMP_GEOMETRY, "DataTransfer Modifier");
CustomDataMask mask = BKE_object_data_transfer_dttypes_to_cdmask(dtmd->data_types);
DEG_add_object_customdata_relation(ctx->node, dtmd->ob_source, DEG_OB_COMP_GEOMETRY, mask, "DataTransfer Modifier");
}
}