From 45897f12f8c35a455d5a33dbb9a8c0589d04e8b9 Mon Sep 17 00:00:00 2001 From: Luca Rood Date: Mon, 10 Jul 2017 14:43:57 +0200 Subject: Fix T51931: VBO not updating when UVs are added to shader node tree UVs need specific data in the VBO, which is not computed unless the shaders assigned to the mesh actually use UVs. When adding UVs to the shader, the VBOs were not being recomputed to include the required data. This adds a DEG relation between the shader and the mesh, and recomputes the required data if the shader changed. Thanks Sergey, for all the DEG stuff... --- source/blender/blenkernel/intern/object_update.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender/blenkernel/intern/object_update.c') diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c index 70e1f434388..50502115edc 100644 --- a/source/blender/blenkernel/intern/object_update.c +++ b/source/blender/blenkernel/intern/object_update.c @@ -401,3 +401,11 @@ void BKE_object_eval_cloth(EvaluationContext *UNUSED(eval_ctx), Scene *scene, Ob DEBUG_PRINT("%s on %s\n", __func__, object->id.name); BKE_ptcache_object_reset(scene, object, PTCACHE_RESET_DEPSGRAPH); } + +void BKE_object_eval_update_shading(EvaluationContext *UNUSED(eval_ctx), Object *object) +{ + DEBUG_PRINT("%s on %s\n", __func__, object->id.name); + if (object->type == OB_MESH) { + BKE_mesh_batch_cache_dirty(object->data, BKE_MESH_BATCH_DIRTY_SHADING); + } +} -- cgit v1.2.3