diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-01-26 05:10:02 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-02-15 07:49:02 +0300 |
commit | d1281bf99343293d35de8baf4558561c4dacc743 (patch) | |
tree | 3e256c9913e0a68adc3f90a74d5302e3a281bf38 | |
parent | c40e9a1ad204ded71c7da3b34a334fc5fb11119f (diff) |
Fix navmesh creation w/ multiple objects
D2976 by @dertom
-rw-r--r-- | source/blender/editors/mesh/mesh_navmesh.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/mesh/mesh_navmesh.c b/source/blender/editors/mesh/mesh_navmesh.c index b95921964eb..740d18951dc 100644 --- a/source/blender/editors/mesh/mesh_navmesh.c +++ b/source/blender/editors/mesh/mesh_navmesh.c @@ -72,7 +72,7 @@ static void createVertsTrisData(bContext *C, LinkNode *obs, LinkNode *oblink, *dmlink; DerivedMesh *dm; Scene *scene = CTX_data_scene(C); - LinkNode *dms = NULL; + LinkNodePair dms_pair = {NULL,NULL}; int nverts, ntris, *tris; float *verts; @@ -85,7 +85,7 @@ static void createVertsTrisData(bContext *C, LinkNode *obs, ob = (Object *) oblink->link; dm = mesh_create_derived_no_virtual(scene, ob, NULL, CD_MASK_MESH); DM_ensure_tessface(dm); - BLI_linklist_prepend(&dms, dm); + BLI_linklist_append(&dms_pair, dm); nverts += dm->getNumVerts(dm); nfaces = dm->getNumTessFaces(dm); @@ -101,6 +101,7 @@ static void createVertsTrisData(bContext *C, LinkNode *obs, *r_lay |= ob->lay; } + LinkNode *dms = dms_pair.list; /* create data */ verts = MEM_mallocN(sizeof(float) * 3 * nverts, "createVertsTrisData verts"); |