[Bf-cycles] Crash on higher vertex count with subd

F Escobar materialesescobar at hotmail.es
Fri Mar 2 14:33:40 CET 2018


I've tried to create a super basic subd mesh with this code

mesh->subdivision_type = ccl::Mesh::SUBDIVISION_LINEAR;
int numVertex = 3000;
mesh->verts.resize(numVertex);
printf("resized %i\n", numVertex);
for(int i=0;i<numVertex;i++)
mesh->verts[i] = ccl::make_float3(0, 0, 0);

int indices[3];
indices[0] = 0;
indices[1] = 1;
indices[2] = 2;
mesh->reserve_subd_faces(1, 0, 3);
mesh->add_subd_face(indices, 3, 0, false);

if (!mesh->subd_params) {
mesh->subd_params = new ccl::SubdParams(mesh);
}
ccl::SubdParams& sdparams = *mesh->subd_params;
sdparams.camera = scene->camera;

ccl::Object *object = new ccl::Object();
object->mesh = mesh;
scene->objects.push_back(object);

And yes... it only should generate one triangle, btw it shouldn't be rendered since all the vertex are in the same place (0,0,0) but that is not the question

If I change numVertex  from 3000 to 300 it doesn't crash so it is related to the amount of vertex but anyway 3k is a pretty low amount.

Any idea on this?

Regards, F.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/bf-cycles/attachments/20180302/be24ac21/attachment.html>


More information about the Bf-cycles mailing list