diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2011-11-21 15:46:05 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2011-11-21 15:46:05 +0400 |
commit | d4f27b7bf03171799b81ef541112ac25f936615a (patch) | |
tree | 0f50e1e49653c8ce520e5ea8128d4a42b32741b9 /source/blender/modifiers/intern/MOD_ocean.c | |
parent | 4ab1dadf72a821b344a714fff59aed11d15ecb14 (diff) |
Yet another fix for crashes when drawing empty base mesh with constructive modifier. This crashed with ocean modifier (#29241). The previous fix was to avoid drawing mapped faces altogether for empty edit mesh, but that also disables the actual derived mesh display (#29346).
The real reason for this crash is that ocean modifier (in generative setting) does not properly set the derived mesh face ORIGINDEX data to ORIGINDEX_NONE. With this the previous fixes are not necessary.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_ocean.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_ocean.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/modifiers/intern/MOD_ocean.c b/source/blender/modifiers/intern/MOD_ocean.c index 3ba49f26449..db98c223416 100644 --- a/source/blender/modifiers/intern/MOD_ocean.c +++ b/source/blender/modifiers/intern/MOD_ocean.c @@ -277,6 +277,7 @@ static DerivedMesh *generate_ocean_geometry(OceanModifierData *omd) MVert *mv; MFace *mf; MTFace *tf; + int *origindex; int cdlayer; @@ -305,6 +306,7 @@ static DerivedMesh *generate_ocean_geometry(OceanModifierData *omd) mv = CDDM_get_verts(result); mf = CDDM_get_faces(result); + origindex= result->getFaceDataArray(result, CD_ORIGINDEX); /* create vertices */ #pragma omp parallel for private(x, y) if (rx > OMP_MIN_RES) @@ -329,6 +331,9 @@ static DerivedMesh *generate_ocean_geometry(OceanModifierData *omd) mf[fi].v4 = vi + res_x+1; mf[fi].flag |= ME_SMOOTH; + + /* generated geometry does not map to original faces */ + origindex[fi] = ORIGINDEX_NONE; } } |