MNMesh, Custom Normals and Topology modifications

MNMesh, Custom Normals and Topology modifications

Anonymous
Not applicable
243 Views
0 Replies
Message 1 of 1

MNMesh, Custom Normals and Topology modifications

Anonymous
Not applicable
Hello,

I'm working on a plugin that modifies the topology of MNMeshes. Everthing goes well, except in the case of custom normals (defined using the edit normal plugin which I then collapsed to work on a editable poly only).

In this case, when I update the normals to reflect the new topology, then I get crashes in various places of the MNMath lib. It seems to me that the MNMesh updates itself each time I add/delete a normal from the MNNormalSpec structure, and that this causes the whole thing to crash.

The only way I've found to get this to work is to call the MNMesh::Init() method, and reconstruct the new mesh from scratch.

This is very unefficient, and it loosens the memory handling: could someone let me know what is the "best practice" of handling vertices, faces, texture mapping and normals in the case of a topology modification ? Should I update the vertices before the normals ? or should the normals map be deleted first and then reattached to the mesh ? I've tried various combinations, but they all failed....

Any insight would be most apppreciated !

Cheers,

Etienne
PS: in this particular case of an edit normal modified collapsed on top of an editable poly, and if I call the method MNMesh::CheckAllData() at the very beginning of the modify method of my plugin (i.e. I check the mesh that is given to me by max), then I get a crash too...
0 Likes
244 Views
0 Replies
Replies (0)