Returns or modifies the color source of an object. The color used to display objects is specified in one of four ways:
Color from layer. The object's layer determines the object's color.
Color from object. The object's color is set by the object itself.
Color from material. The object's diffuse material color determines the object's color.
Color from parent. For objects with parents, like objects in block instances, use parent's color source. If no parent, treats as color from layer.
rhinoscriptsyntax.ObjectColorSource(object_ids, source=None)
rhinoscript.object.ObjectColorSource(object_ids, source=None)
object_ids |
Required. String, Guid, or List of Guids. The identifier(s) of the object(s). |
||||||||||
source |
Optional. Number. The new color source. If omitted, the current color source is returned. Note, if objects_ids is a list, source is required.
|
Number |
If a color source is not specified, the current color source if successful. |
Number |
If a color source is specified, the previous color source if successful. |
Number |
If object_ids is a list, then the number of objects modified if successful. |
import rhinoscriptsyntax as rs
objs = rs.GetObjects("Select objects to reset color source")
if objs:
for obj In objs: rs.ObjectColorSource(obj, 0)