PointCloudObject color source

Is there any way to tell if a PointCloudItem’s color is black because it had no color when it was added to the document or if when it was added to the point cloud, the color specified was black? From what I can see, when a PointCloudItem is added to a PointCloud with no color information, it gets Black as a default. With this behavior, I cannot determine if the Black color of the Point is explicitly set, or set because no color information was specified. I guess what I was expecting is that the color would be null if no color was specified when the item was added to the PointCloud and that in Rhino it would appear with the color derived from the Layer. Currently a PointCloud with many different colored points will by default have its color source as ColorFromLayer. I can change it to ColorFromObject and will appear exactly the same.

Anyways, all I am trying to do is give the PointCloudItems the appropriate color. If they have no color to begin with, then use the Layer’s color. Because PointCloudItems will be given a color by default, I cannot determine where this color came from.

Nervermind. I had missed PointCloudObject.PointCloudGeometry.ContainsColors

(still, there could be cases where some points are added with colors and others are not.)

Hi Luis,

import rhinoscriptsyntax as rs
import Rhino

def ColorCheck():
    id = rs.GetObject("PointCloud", 2, True, False)
    if not id: return

    cloud = rs.coercegeometry(id)
    print cloud.ContainsColors

if __name__=="__main__":
    ColorCheck()

I guess when when some points have colors assigned and some not, ContainsColors will return true. But i haven`t tried that.

c.

Yes, it returns true.