Get Rhino Render TextureCoordinates c# v6

I have a mesh from 3d scanning.
I can not get TextureCoordinates of this mesh, Does it not have TextureCoordinates?
But if I set a material to it and change to rende model, it display is ok.
How can I get the TextureCoordinates of the mesh?

            Rhino.DocObjects.ObjRef objref;
            Result rc = Rhino.Input.RhinoGet.GetOneObject("Select mesh", false, ObjectType.Mesh, out objref);
            if (rc != Result.Success)
                return rc;
            if (null == objref)
                return Result.Failure;

            Rhino.Geometry.Mesh mesh = objref.Mesh();
            if (null == mesh)
                return Result.Failure;

            RhinoApp.WriteLine(mesh.TextureCoordinates.Count.ToString());// will print 0


            return Result.Success;

TheMesh.3dm (1.6 MB)

Hi @suc_kiet, no it doesn’t have mesh texture coordinates.

This is just the reflection of the environment applied to the material which works even when the mesh has no texture coordinates.

Only after you have created texture coordinates. You can create a mapping and then set it to the mesh.


Thank you @clement.