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:
authorCampbell Barton <ideasman42@gmail.com>2011-11-29 06:58:38 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-11-29 06:58:38 +0400
commit9e39a66c938cd8cc3be8e054fdacf2ab9e8b7aa8 (patch)
tree5ac81576f22d7d97549412fd63691df95fcdde7f /source/blender/makesrna/intern/rna_mesh.c
parentb25f2386d0adfc33d5d7ea3398e10a791a9a6798 (diff)
fix for duplifaces with quads/ngons, bmesh was using triangulated faces so each quad would result in 2 duplis.
Diffstat (limited to 'source/blender/makesrna/intern/rna_mesh.c')
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index d25a2e0cc61..d08e3f71625 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -220,30 +220,8 @@ static float rna_MeshPolygon_area_get(PointerRNA *ptr)
{
Mesh *me = (Mesh*)ptr->id.data;
MPoly *mp = (MPoly*)ptr->data;
- MVert *mv;
- MLoop *ml;
- int i, j;
- float area, polynorm[3], (*vertexcos)[3] = NULL;
- BLI_array_staticdeclare(vertexcos, 10);
-
- BLI_array_growitems(vertexcos, mp->totloop);
-
- /* pack vertex cos into an array for area_poly_v3 */
- for (i = mp->loopstart, j = 0; j < mp->totloop; i++, j++) {
- ml = &me->mloop[i];
- mv = &me->mvert[ml->v];
- copy_v3_v3(vertexcos[j], mv->co);
- }
-
- /* need normal for area_poly_v3 as well */
- rna_MeshPolygon_normal_get(ptr, polynorm);
-
- /* finally calculate the area */
- area = area_poly_v3(mp->totloop, vertexcos, polynorm);
-
- BLI_array_free(vertexcos);
- return area;
+ return mesh_calc_poly_area(mp, me->mloop+mp->loopstart, me->mvert, NULL);
}
static void rna_MeshFace_normal_get(PointerRNA *ptr, float *values)