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

Mohamed Sakr 3dsakr at gmail.com
Fri Mar 2 19:09:50 CET 2018


use Mesh::add_vertex and Mesh::add_subd_face

On Fri, Mar 2, 2018 at 3:33 PM, F Escobar <materialesescobar at hotmail.es>
wrote:

> 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.
>
>
> _______________________________________________
> Bf-cycles mailing list
> Bf-cycles at blender.org
> https://lists.blender.org/mailman/listinfo/bf-cycles
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/bf-cycles/attachments/20180302/4076dee0/attachment.html>


More information about the Bf-cycles mailing list