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/blenkernel/intern/depsgraph.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel/intern/depsgraph.c') diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index eecc04c1e72..eeda9b0f90f 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -62,6 +62,7 @@ #include "BKE_anim.h" #include "BKE_animsys.h" #include "BKE_action.h" +#include "BKE_DerivedMesh.h" #include "BKE_effect.h" #include "BKE_fcurve.h" #include "BKE_global.h" @@ -80,6 +81,8 @@ #include "BKE_screen.h" #include "BKE_tracking.h" +#include "GPU_buffers.h" + #include "atomic_ops.h" #include "depsgraph_private.h" @@ -2499,9 +2502,8 @@ static void dag_id_flush_update(Main *bmain, Scene *sce, ID *id) if (ELEM(idtype, ID_MA, ID_TE)) { obt = sce->basact ? sce->basact->object : NULL; if (obt && obt->mode & OB_MODE_TEXTURE_PAINT) { - obt->recalc |= OB_RECALC_DATA; BKE_texpaint_slots_refresh_object(sce, obt); - lib_id_recalc_data_tag(bmain, &obt->id); + GPU_drawobject_free(obt->derivedFinal); } } -- cgit v1.2.3