Is there a way to change mesh normals as if it would be unwelded without destroying NGon preview?
In the image below, on the right side there is a welded mesh and the moment I unweld the mesh all triangulation appears but the shading is as I want:
I going through each Linq expression, does it mean that per each NGon face you are duplicating the whole mesh to extract a face? If yes it is possible to duplicate only selected faces?
I was trying to do this on extracted mesh but this wont work: Mesh NGonFaceMesh = m.Faces.ExtractFaces(meshFaceList).DuplicateMesh();
Another question why there is a keyword unchecked for casting uint to int array?
private void RunScript(Mesh m, object y, ref object A)
{
Mesh explodedMesh = new Mesh();
IEnumerable<MeshNgon> ngonFaces = m.GetNgonAndFacesEnumerable();
foreach(MeshNgon ngon in ngonFaces) {
int[] meshFaceList = ngon.FaceIndexList().Select(j => unchecked((int) j)).ToArray();
Mesh NGonFaceMesh = m.DuplicateMesh().Faces.ExtractFaces(meshFaceList);
explodedMesh.Append(NGonFaceMesh);
}
explodedMesh.RebuildNormals();
A = explodedMesh;
}