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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-11-04 23:23:48 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-11-04 23:23:48 +0300
commitb90d8ec0f454dfdd12f1284aabaff12b4cc93481 (patch)
tree109d3c237f3fa5a98c23bf632c709cab0705d7a5 /source/blender/editors/sculpt_paint
parent4bdfa8a7d71c7b982a1f13191cfc4ee07502d473 (diff)
Sculpt: derivedmesh no longer created CD_ORIGINDEX layer when there
is no modifier, saving some memory.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_utils.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c
index 15104068350..210d6e0ff95 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -96,7 +96,7 @@ void imapaint_pick_uv(Scene *scene, Object *ob, Mesh *mesh, unsigned int faceind
DerivedMesh *dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH);
int *index = dm->getFaceDataArray(dm, CD_ORIGINDEX);
MTFace *tface = dm->getFaceDataArray(dm, CD_MTFACE), *tf;
- int numfaces = dm->getNumFaces(dm), a;
+ int numfaces = dm->getNumFaces(dm), a, findex;
float p[2], w[3], absw, minabsw;
MFace mf;
MVert mv[4];
@@ -106,7 +106,9 @@ void imapaint_pick_uv(Scene *scene, Object *ob, Mesh *mesh, unsigned int faceind
/* test all faces in the derivedmesh with the original index of the picked face */
for(a = 0; a < numfaces; a++) {
- if(index[a] == faceindex) {
+ findex= (index)? index[a]: a;
+
+ if(findex == faceindex) {
dm->getFace(dm, a, &mf);
dm->getVert(dm, mf.v1, &mv[0]);