diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-06-06 13:21:36 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-06-06 13:27:25 +0300 |
commit | 7a76223f1f12b6bb049df1864e5d0cda70060a8f (patch) | |
tree | b292e6d96317aed2fc086bfdf1e3caad3ca0a668 /source/blender/blenkernel | |
parent | 8a0e6a31430fbf8ab322e953f6649d14cd147a7b (diff) |
Ensure BKE_mesh_new_nomain_from_template() always has valid mxxx pointers
When the source mesh doesn't have the primary layers (CD_VERT for vdata,
etc.) the returned mesh also didn't have those layers, even when non-zero
elements were requested (for example requesting 4 vertices would still
result in mvert = NULL).
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index f2a5f3b5d5f..b325d8d02d9 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -670,6 +670,9 @@ static Mesh *mesh_new_nomain_from_template_ex( mesh_tessface_clear_intern(me_dst, false); } + /* The destination mesh should at least have valid primary CD layers, + * even in cases where the source mesh does not. */ + mesh_ensure_cdlayers_primary(me_dst, do_tessface); mesh_ensure_cdlayers_origindex(me_dst, false); BKE_mesh_update_customdata_pointers(me_dst, false); |