Message 1 of 4
Get body's color

Not applicable
10-12-2015
05:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Good day.
Is there any common way to get the color of the body, independent of the material of the body (for all materials except those with textures)?
Now I use this code:
properties = body.appearance.appearanceProperties if properties: colorprop = properties.itemById('metal_f0') if not colorprop: colorprop = properties.itemById('opaque_albedo') if not colorprop: colorprop = properties.itemById('transparent_color') if not colorprop: colorprop = properties.itemById('concrete_color') if colorprop and colorprop.value: r.text = str(colorprop.value.red) g.text = str(colorprop.value.green) b.text = str(colorprop.value.blue) opacity.text = str(colorprop.value.opacity)
But it is rather strange and doesn't work with some materials ("Paint - Metallic", for example).
Does anywhere exist the list of all the properties which are responsible for the color of the body in the UI?