Fix part of T60735: invalid CD_ORIGINDEX data in some modifier stack evaluations.

BKE_mesh_new_nomain automatically added a CD_ORIGINDEX layer initialized to 0,
which was never filled in correctly. In 2.7 the equivalent function used to
modify the source derivedmesh and add valid original indices to it, but this
is no longer possible in the new design and was quite unpredictable anyway.

Now instead rely on mesh_calc_modifiers and the depsgraph to determine when
CD_ORIGINDEX should be added.
This commit is contained in:
2019-03-28 15:05:04 +01:00
parent 0680525147
commit a016ad2ea8
3 changed files with 5 additions and 20 deletions

View File

@@ -176,7 +176,6 @@ typedef struct GenerateOceanGeometryData {
MVert *mverts;
MPoly *mpolys;
MLoop *mloops;
int *origindex;
MLoopUV *mloopuvs;
int res_x, res_y;
@@ -230,9 +229,6 @@ static void generate_ocean_geometry_polygons(
mp->totloop = 4;
mp->flag |= ME_SMOOTH;
/* generated geometry does not map to original faces */
gogd->origindex[fi] = ORIGINDEX_NONE;
}
}
@@ -299,8 +295,6 @@ static Mesh *generate_ocean_geometry(OceanModifierData *omd)
gogd.mpolys = result->mpoly;
gogd.mloops = result->mloop;
gogd.origindex = CustomData_get_layer(&result->pdata, CD_ORIGINDEX);
ParallelRangeSettings settings;
BLI_parallel_range_settings_defaults(&settings);
settings.use_threading = use_threading;