Commit: 4449bfbb18f1d1d4a6a3a824ac9d87a9396efd78 Author: Mai Lavelle Date: Thu Jun 2 20:57:04 2016 -0400 Branches: compositor-2016 https://developer.blender.org/rB4449bfbb18f1d1d4a6a3a824ac9d87a9396efd78
Cycles: Fix regression introduced in c96a4c8 A few places still needed to be updated to use the new Mesh::num_triangles() method; wrong number from triangles.size() was causing crashes. =================================================================== M intern/cycles/bvh/bvh_split.cpp M intern/cycles/render/mesh.cpp M intern/cycles/subd/subd_dice.cpp =================================================================== diff --git a/intern/cycles/bvh/bvh_split.cpp b/intern/cycles/bvh/bvh_split.cpp index 3665fb4..bf68b41 100644 --- a/intern/cycles/bvh/bvh_split.cpp +++ b/intern/cycles/bvh/bvh_split.cpp @@ -404,7 +404,7 @@ void BVHSpatialSplit::split_object_reference(const Object *object, BoundBox& right_bounds) { Mesh *mesh = object->mesh; - for(int tri_idx = 0; tri_idx < mesh->triangles.size(); ++tri_idx) { + for(int tri_idx = 0; tri_idx < mesh->num_triangles(); ++tri_idx) { split_triangle_primitive(mesh, &object->tfm, tri_idx, diff --git a/intern/cycles/render/mesh.cpp b/intern/cycles/render/mesh.cpp index 755b16a..e251556 100644 --- a/intern/cycles/render/mesh.cpp +++ b/intern/cycles/render/mesh.cpp @@ -1485,7 +1485,7 @@ bool Mesh::need_attribute(Scene * /*scene*/, ustring name) void Mesh::tessellate(DiagSplit *split) { - int num_faces = triangles.size(); + int num_faces = num_triangles(); add_face_normals(); add_vertex_normals(); diff --git a/intern/cycles/subd/subd_dice.cpp b/intern/cycles/subd/subd_dice.cpp index 8dba137..7c74f21 100644 --- a/intern/cycles/subd/subd_dice.cpp +++ b/intern/cycles/subd/subd_dice.cpp @@ -46,7 +46,7 @@ void EdgeDice::reserve(int num_verts) Mesh *mesh = params.mesh; vert_offset = mesh->verts.size(); - tri_offset = mesh->triangles.size(); + tri_offset = mesh->num_triangles(); mesh->resize_mesh(vert_offset + num_verts, tri_offset); @@ -84,7 +84,7 @@ void EdgeDice::add_triangle(Patch *patch, int v0, int v1, int v2) /* todo: optimize so we can reserve in advance, this is like push_back_slow() */ if(mesh->triangles.size() == mesh->triangles.capacity()) - mesh->reserve_mesh(mesh->verts.size(), size_t(max(mesh->triangles.size() + 1, 1) * 1.2)); + mesh->reserve_mesh(mesh->verts.size(), size_t(max(mesh->num_triangles() + 1, 1) * 1.2)); mesh->add_triangle(v0, v1, v2, params.shader, params.smooth, false); _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs