Fix T50634: Hair Primitive as Triangles + Hair shader with a texture = crash

Attributes were not resized after pushing new triangles to the mesh.
This commit is contained in:
Sergey Sharybin 2017-02-27 15:11:51 +01:00
parent 209a64111e
commit f1b21d5960
Notes: blender-bot 2023-02-14 08:42:54 +01:00
Referenced by issue #50634, Hair Primitive as Triangles + Hair shader with a texture = crash
1 changed files with 2 additions and 0 deletions

View File

@ -411,6 +411,7 @@ static void ExportCurveTrianglePlanes(Mesh *mesh, ParticleCurveData *CData,
}
}
mesh->resize_mesh(mesh->verts.size(), mesh->triangles.size());
mesh->attributes.remove(ATTR_STD_VERTEX_NORMAL);
mesh->attributes.remove(ATTR_STD_FACE_NORMAL);
mesh->add_face_normals();
@ -545,6 +546,7 @@ static void ExportCurveTriangleGeometry(Mesh *mesh,
}
}
mesh->resize_mesh(mesh->verts.size(), mesh->triangles.size());
mesh->attributes.remove(ATTR_STD_VERTEX_NORMAL);
mesh->attributes.remove(ATTR_STD_FACE_NORMAL);
mesh->add_face_normals();