From 87c821ff26be9f3049993088042dc74b0c141003 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 24 Nov 2017 10:18:16 +0100 Subject: Depsgraph: Flush flags from base to object as an evaluation step Previously it was done during depsgraph iteration, which is not good at all, since after evaluation nobody should really modify how object was evaluated. --- source/blender/blenkernel/intern/object_update.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel/intern') diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c index 8da3e8136b3..85f207509c2 100644 --- a/source/blender/blenkernel/intern/object_update.c +++ b/source/blender/blenkernel/intern/object_update.c @@ -383,13 +383,16 @@ void BKE_object_eval_uber_data(const EvaluationContext *eval_ctx, ob->recalc &= ~(OB_RECALC_DATA | OB_RECALC_TIME); } -void BKE_object_eval_cloth(const EvaluationContext *UNUSED(eval_ctx), Scene *scene, Object *object) +void BKE_object_eval_cloth(const EvaluationContext *UNUSED(eval_ctx), + Scene *scene, + Object *object) { DEBUG_PRINT("%s on %s (%p)\n", __func__, object->id.name, object); BKE_ptcache_object_reset(scene, object, PTCACHE_RESET_DEPSGRAPH); } -void BKE_object_eval_update_shading(const EvaluationContext *UNUSED(eval_ctx), Object *object) +void BKE_object_eval_update_shading(const EvaluationContext *UNUSED(eval_ctx), + Object *object) { DEBUG_PRINT("%s on %s (%p)\n", __func__, object->id.name, object); if (object->type == OB_MESH) { @@ -418,3 +421,15 @@ void BKE_object_data_select_update(const EvaluationContext *UNUSED(eval_ctx), break; } } + +void BKE_object_eval_flush_base_flags(const EvaluationContext *UNUSED(eval_ctx), + Object *object, Base *base) +{ + /* Make sure we have the base collection settings is already populated. + * This will fail when BKE_layer_eval_layer_collection_pre hasn't run yet + * Which usually means a missing call to DEG_id_tag_update(). */ + BLI_assert(!BLI_listbase_is_empty(&base->collection_properties->data.group)); + /* Copy flags and settings from base. */ + object->base_flag = base->flag; + object->base_collection_properties = base->collection_properties; +} -- cgit v1.2.3