From 728687c571e72e942cdcfbdd241de494161a36a4 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Wed, 3 Sep 2014 12:14:09 +0200 Subject: Texture painting: Free draw objects instead of tagging object update and doing recalculation of derived meshes. The reason is that if user deletes all slots and tries to paint, the system will invalidate the cached in projection painting derivedmesh. This will promptly crash. Invalidating the draw objects only is also much cheaper. --- source/blender/makesrna/intern/rna_sculpt_paint.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source/blender/makesrna/intern/rna_sculpt_paint.c') diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index c4b5461dece..d48d8589f96 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -76,11 +76,14 @@ EnumPropertyItem symmetrize_direction_items[] = { #include "MEM_guardedalloc.h" #include "BKE_context.h" +#include "BKE_DerivedMesh.h" #include "BKE_pointcache.h" #include "BKE_particle.h" #include "BKE_depsgraph.h" #include "BKE_pbvh.h" +#include "GPU_buffers.h" + #include "ED_particle.h" static EnumPropertyItem particle_edit_disconnected_hair_brush_items[] = { @@ -304,8 +307,8 @@ static void rna_ImaPaint_mode_update(Main *UNUSED(bmain), Scene *scene, PointerR /* of course we need to invalidate here */ BKE_texpaint_slots_refresh_object(scene, ob); - /* we assume that changing the current mode will invalidate the uv layers so we need to tag an update */ - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + /* we assume that changing the current mode will invalidate the uv layers so we need to refresh display */ + GPU_drawobject_free(ob->derivedFinal); WM_main_add_notifier(NC_GEOM | ND_DATA, &ob->id); } -- cgit v1.2.3