[Bf-blender-cvs] [728687c] master: Texture painting:

Antony Riakiotakis noreply at git.blender.org
Wed Sep 3 12:17:18 CEST 2014


Commit: 728687c571e72e942cdcfbdd241de494161a36a4
Author: Antony Riakiotakis
Date:   Wed Sep 3 12:14:09 2014 +0200
Branches: master
https://developer.blender.org/rB728687c571e72e942cdcfbdd241de494161a36a4

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.

===================================================================

M	source/blender/blenkernel/intern/depsgraph.c
M	source/blender/makesrna/intern/rna_sculpt_paint.c

===================================================================

diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index eecc04c..eeda9b0 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);
 			}
 		}
 
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index c4b5461..d48d858 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);
 }




More information about the Bf-blender-cvs mailing list