diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2011-12-19 12:26:53 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2011-12-19 12:26:53 +0400 |
commit | 90ef435145416313596cafa6f8c4c6c6aebe4e44 (patch) | |
tree | a4fb3a2027baee153227365f65a3795529b99a31 /source/blender/modifiers/intern/MOD_uvproject.c | |
parent | 53f88b231a3cd492ba45914a1813a633b1189218 (diff) |
Fix a bug in CustomData_duplicate_referenced_layer(_named) functions: MEM_dupallocN does not work with complex layers like CD_MDEFORMVERT ones, so rather use copy func when available.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_uvproject.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_uvproject.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c index acf65a56561..3146d1c9d5d 100644 --- a/source/blender/modifiers/intern/MOD_uvproject.c +++ b/source/blender/modifiers/intern/MOD_uvproject.c @@ -259,11 +259,12 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd, mul_mat3_m4_v3(projectors[i].ob->obmat, projectors[i].normal); } + numFaces = dm->getNumFaces(dm); + /* make sure we are not modifying the original UV map */ tface = CustomData_duplicate_referenced_layer_named(&dm->faceData, - CD_MTFACE, uvname); + CD_MTFACE, uvname, numFaces); - numVerts = dm->getNumVerts(dm); coords = MEM_callocN(sizeof(*coords) * numVerts, @@ -280,7 +281,6 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd, mul_project_m4_v3(projectors[0].projmat, *co); mface = dm->getFaceArray(dm); - numFaces = dm->getNumFaces(dm); /* apply coords as UVs, and apply image if tfaces are new */ for(i = 0, mf = mface; i < numFaces; ++i, ++mf, ++tface) { |