How do I set VertexColors for a Mesh?

When I create a rhino3dm.Mesh() and check its VertexColors it is an empty list. How do I set VertexColors for a Mesh? There is a lack of documentation for this class on your ReadTheDoc.

Kind Regards,
Mauro

Hi @deluca,

What Rhino3dm are you using (e.g. .NET, Python, or JavaScript)?

Thanks,

– Dale

Hi

Here are the 2 pages you need:

https://developer.rhino3d.com/api/RhinoCommon/html/P_Rhino_Geometry_Mesh_VertexColors.htm

https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_Collections_MeshVertexColorList_SetColors.htm

does that help?
-Willem

I’m using Rhino3dm v0.11.0 for Python 2.7.

Regards,
Mauro

Hi @deluca,

The MeshVertexColorList object, returned by Mesh.VertexColors, provides access to an existing mesh that may have vertex colors. There are no provisions for adding your own colors to a new mesh. I’ve created an issue to address this.

https://mcneel.myjetbrains.com/youtrack/issue/RH3DM-104

– Dale

I just published rhino3dm 0.12.0 to pypi.org. This version contains functions for adding and setting vertex colors. I have not updated the docs yet

1 Like