From bb16167fd8727a330a97f591398ac0981c76a562 Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Mon, 3 Dec 2018 18:09:45 +0300 Subject: Depsgraph: completely move customdata_mask to the ID node. Move all mask-related fields from Object and OperationDepsNode to Object_Runtime and IDDepsNode. Auto-apply DEG_TAG_GEOMETRY if the mask changes after DEG rebuild. Update DEG API and all code that uses it. This fixes "source mesh data is not ready" errors from Data Transfer modifier when parameters are changed in the UI after the recent mesh_get_eval_final fix. Reviewers: sergey Differential Revision: https://developer.blender.org/D4025 --- source/blender/modifiers/intern/MOD_datatransfer.c | 3 ++- source/blender/modifiers/intern/MOD_shrinkwrap.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'source/blender/modifiers/intern') diff --git a/source/blender/modifiers/intern/MOD_datatransfer.c b/source/blender/modifiers/intern/MOD_datatransfer.c index b2cb82d6be3..71e2c7c3e09 100644 --- a/source/blender/modifiers/intern/MOD_datatransfer.c +++ b/source/blender/modifiers/intern/MOD_datatransfer.c @@ -131,7 +131,8 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte if (dtmd->ob_source != NULL) { CustomDataMask mask = BKE_object_data_transfer_dttypes_to_cdmask(dtmd->data_types); - DEG_add_object_relation_with_customdata(ctx->node, dtmd->ob_source, DEG_OB_COMP_GEOMETRY, mask, "DataTransfer Modifier"); + DEG_add_object_relation(ctx->node, dtmd->ob_source, DEG_OB_COMP_GEOMETRY, "DataTransfer Modifier"); + DEG_add_customdata_mask(ctx->node, dtmd->ob_source, mask); if (dtmd->flags & MOD_DATATRANSFER_OBSRC_TRANSFORM) { DEG_add_object_relation(ctx->node, dtmd->ob_source, DEG_OB_COMP_TRANSFORM, "DataTransfer Modifier"); diff --git a/source/blender/modifiers/intern/MOD_shrinkwrap.c b/source/blender/modifiers/intern/MOD_shrinkwrap.c index dd4530b066f..cff5853b66e 100644 --- a/source/blender/modifiers/intern/MOD_shrinkwrap.c +++ b/source/blender/modifiers/intern/MOD_shrinkwrap.c @@ -156,14 +156,16 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte if (smd->target != NULL) { DEG_add_object_relation(ctx->node, smd->target, DEG_OB_COMP_TRANSFORM, "Shrinkwrap Modifier"); - DEG_add_object_relation_with_customdata(ctx->node, smd->target, DEG_OB_COMP_GEOMETRY, mask, "Shrinkwrap Modifier"); + DEG_add_object_relation(ctx->node, smd->target, DEG_OB_COMP_GEOMETRY, "Shrinkwrap Modifier"); + DEG_add_customdata_mask(ctx->node, smd->target, mask); if (smd->shrinkType == MOD_SHRINKWRAP_TARGET_PROJECT) { DEG_add_special_eval_flag(ctx->node, &smd->target->id, DAG_EVAL_NEED_SHRINKWRAP_BOUNDARY); } } if (smd->auxTarget != NULL) { DEG_add_object_relation(ctx->node, smd->auxTarget, DEG_OB_COMP_TRANSFORM, "Shrinkwrap Modifier"); - DEG_add_object_relation_with_customdata(ctx->node, smd->auxTarget, DEG_OB_COMP_GEOMETRY, mask, "Shrinkwrap Modifier"); + DEG_add_object_relation(ctx->node, smd->auxTarget, DEG_OB_COMP_GEOMETRY, "Shrinkwrap Modifier"); + DEG_add_customdata_mask(ctx->node, smd->auxTarget, mask); if (smd->shrinkType == MOD_SHRINKWRAP_TARGET_PROJECT) { DEG_add_special_eval_flag(ctx->node, &smd->auxTarget->id, DAG_EVAL_NEED_SHRINKWRAP_BOUNDARY); } -- cgit v1.2.3