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>2012-10-30 23:20:17 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-10-30 23:20:17 +0400
commit00acdb629254b680992f1863a1d62cd2985198af (patch)
treee29b23a247a6111dc47f508cab01e2a5d955b983 /source/blender/render/intern
parent6bd18e357563f6b28f7cfdf6da8a032bab947172 (diff)
remove CD_POLYINDEX customdata layer:
reported as [#29376] BMESH_TODO: remove tessface CD_ORIGINDEX layer for a single mesh there could be 3 origindex mappings stored, one on the polygons and 2 on the tessfaces. (CD_POLYINDEX and CD_ORIGINDEX). as Andrew suggests, now tessfaces (which are really a cache of polygons), using origindex to point to polygons on the same derived mesh, and polygons only store the original index values.
Diffstat (limited to 'source/blender/render/intern')
-rw-r--r--source/blender/render/intern/source/convertblender.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c
index bcd5b27aa6f..bcb6df134e8 100644
--- a/source/blender/render/intern/source/convertblender.c
+++ b/source/blender/render/intern/source/convertblender.c
@@ -1525,9 +1525,12 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
int i, a, k, max_k=0, totpart, do_simplify = FALSE, do_surfacecache = FALSE, use_duplimat = FALSE;
int totchild=0;
int seed, path_nbr=0, orco1=0, num;
- int totface, *origindex = 0;
+ int totface;
char **uv_name=0;
+ const int *index_mf_to_mpoly = NULL;
+ const int *index_mp_to_orig = NULL;
+
/* 1. check that everything is ok & updated */
if (psys==NULL)
return 0;
@@ -1697,9 +1700,13 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
do_surfacecache = TRUE;
totface= psmd->dm->getNumTessFaces(psmd->dm);
- origindex= psmd->dm->getTessFaceDataArray(psmd->dm, CD_ORIGINDEX);
+ index_mf_to_mpoly = psmd->dm->getTessFaceDataArray(psmd->dm, CD_ORIGINDEX);
+ index_mp_to_orig = psmd->dm->getPolyDataArray(psmd->dm, CD_ORIGINDEX);
+ if ((index_mf_to_mpoly && index_mp_to_orig) == FALSE) {
+ index_mf_to_mpoly = index_mp_to_orig = NULL;
+ }
for (a=0; a<totface; a++)
- strandbuf->totbound= MAX2(strandbuf->totbound, (origindex)? origindex[a]: a);
+ strandbuf->totbound = max_ii(strandbuf->totbound, (index_mf_to_mpoly) ? DM_origindex_mface_mpoly(index_mf_to_mpoly, index_mp_to_orig, a): a);
strandbuf->totbound++;
strandbuf->bound= MEM_callocN(sizeof(StrandBound)*strandbuf->totbound, "StrandBound");
@@ -1810,7 +1817,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
do_simplify = psys_render_simplify_params(psys, cpa, simplify);
if (strandbuf) {
- int orignum= (origindex)? origindex[cpa->num]: cpa->num;
+ int orignum = (index_mf_to_mpoly) ? DM_origindex_mface_mpoly(index_mf_to_mpoly, index_mp_to_orig, cpa->num) : cpa->num;
if (orignum > sbound - strandbuf->bound) {
sbound= strandbuf->bound + orignum;