Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2012-01-23 21:17:08 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2012-01-23 21:17:08 +0400
commit92aa15805d38810ace8cb5d2210a56abaef32ed0 (patch)
treea5151cdc24c2d619cd51276b30201ea0768f0c88 /source/blender/blenkernel/intern/dynamicpaint.c
parent5cc898ada2fbe11e1847c385b0c0439df3a706df (diff)
BMesh: Fix for previous own fix (re-enable DynamicPaint previews in Object mode).
In fact, we have to add a CD_WEIGHT_MCOL layer (if not yet present) when updating CD_WEIGHT_MLOOPCOL, else with modifiers modifying the topology (like subsurf), it will sigsev. That step should probably be done at tesselation time, though…
Diffstat (limited to 'source/blender/blenkernel/intern/dynamicpaint.c')
-rw-r--r--source/blender/blenkernel/intern/dynamicpaint.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c
index 9e30003f9c7..59b7b654a45 100644
--- a/source/blender/blenkernel/intern/dynamicpaint.c
+++ b/source/blender/blenkernel/intern/dynamicpaint.c
@@ -1608,6 +1608,13 @@ static struct DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData
MPoly *mp = CDDM_get_polys(result);
int totpoly = result->numPolyData;
+ /* XXX We have to create a CD_WEIGHT_MCOL, else it might sigsev
+ * (after a SubSurf mod, eg)... */
+ if(!result->getTessFaceDataArray(result, CD_WEIGHT_MCOL)) {
+ int numFaces = result->getNumTessFaces(result);
+ CustomData_add_layer(&result->faceData, CD_WEIGHT_MCOL, CD_CALLOC, NULL, numFaces);
+ }
+
/* Save preview results to weight layer to be
* able to share same drawing methods */
col = CustomData_get_layer(&result->loopData, CD_WEIGHT_MLOOPCOL);