[Bf-blender-cvs] [5f09348] master: Fix crash texpainting on subsurfed meshes.

Antony Riakiotakis noreply at git.blender.org
Fri Jul 17 14:46:14 CEST 2015


Commit: 5f09348fe8fdbd9397be1e0181014edb71bf657f
Author: Antony Riakiotakis
Date:   Fri Jul 17 14:46:05 2015 +0200
Branches: master
https://developer.blender.org/rB5f09348fe8fdbd9397be1e0181014edb71bf657f

Fix crash texpainting on subsurfed meshes.

Unfortunately, loops and polys are generated, therefore we need to keep
copies. Still not painting after this commit but at least no crash now.

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

M	source/blender/editors/sculpt_paint/paint_image_proj.c

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

diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 8f84e96..b64aefc 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -3003,6 +3003,8 @@ static void proj_paint_state_non_cddm_init(ProjPaintState *ps)
 {
 	if (ps->dm->type != DM_TYPE_CDDM) {
 		ps->dm_mvert = MEM_dupallocN(ps->dm_mvert);
+		ps->dm_mpoly = MEM_dupallocN(ps->dm_mpoly);
+		ps->dm_mloop = MEM_dupallocN(ps->dm_mloop);
 		/* looks like these are ok for now.*/
 #if 0
 		ps->dm_mloopuv = MEM_dupallocN(ps->dm_mloopuv);
@@ -3890,6 +3892,8 @@ static void project_paint_end(ProjPaintState *ps)
 		/* copy for subsurf/multires, so throw away */
 		if (ps->dm->type != DM_TYPE_CDDM) {
 			if (ps->dm_mvert) MEM_freeN((void *)ps->dm_mvert);
+			if (ps->dm_mpoly) MEM_freeN((void *)ps->dm_mpoly);
+			if (ps->dm_mloop) MEM_freeN((void *)ps->dm_mloop);
 			/* looks like these don't need copying */
 #if 0
 			if (ps->dm_mloopuv) MEM_freeN(ps->dm_mloopuv);




More information about the Bf-blender-cvs mailing list