Can't take color off this mesh object

Greetings, Rhino friends,

The attached mesh object of a tree is partially black and partially white. For some strange reason I can’t delete the black.It had a bark texture which I deleted, Color tree.3dm (1.1 MB)
and made sure that it’s property was By layer - and it still is coming out partially black and partially white.

Any thoughts?

Hi Cosmas - the thing has vertex colors, not a texture in this case - RebuildMesh will clear those.

-Pascal

Awesome, Pascal. Thank you.

Hi Pascal,

Thinking about this, should there not be a command RemoveVertexColors and RebuildMesh should maintain the colors?

-Willem

Hi Willem - in V6, RebuildMesh has some options, so I guess it can be used as a vertex color remover - that may be sufficient, I think - it is probably rarely enough needed that a separate command is not needed (?)

V6:

Select meshes to rebuild ( PreserveTextureCoordinates=Yes  PreserveVertexColors=Yes ):

-Pascal

1 Like

The topic is a bit long in the tooth, but I didn’t like the workaround so I made a simple script that works faster on larger meshes:

### Discard VertexColors
### By Holo 2024

import rhinoscriptsyntax as rs
import Rhino
import scriptcontext as sc

mesh_id = rs.GetObject("Select mesh to remove vertex colors",rs.filter.mesh, preselect=True)
if mesh_id:
    mesh = rs.coercemesh(mesh_id)
    mesh.VertexColors.Clear()
    sc.doc.Objects.Replace(mesh_id,mesh)
1 Like