Transparency (Alpha channel) not available/not reported correctly via object attributes

If you apply some transparency to a an object in the Rhino document, then look in ObjectAttributes.ObjectColor for that object, it ignores the object color’s actual A value - the color returned is the fully opaque RGB color, the transparency (A) is always set to 255. To test, set an object semi-transparent via Properties, then run:

import rhinoscriptsyntax as rs
import scriptcontext as sc

obj_id=rs.GetObject(preselect=True)
rhobj=sc.doc.Objects.Find(obj_id)
color=rhobj.Attributes.ObjectColor
print color.A,color.R,color.G,color.B

It seems to be already possible to apply transparency to an object via script, but without the above working, I don’t see how to get an object’s existing transparency level.

Thanks Mitch.

https://mcneel.myjetbrains.com/youtrack/issue/RH-63298

– Dale

Hi Dale,

Thanks! Note this also applies to layer colors… same problem. Can apply them but not get them from existing layers.

1 Like