Is there an API attribute for granular control over the 'Object Selected' color?

Hoping to apply special colors to some objects in a selection. Meaning there might be a few objects highlighted with orange, a few with red, and a few with blue. There’s a related setting in Blender’s preferences (pictured) for default settings. Haven’t been able to find an equivalent it in the docs, particularly for more granular, object by object control. Anyone know if that sort of functionality has been extended to the API?

AFAIK, there’s no access to anything like that, since it’s a property of the theme and is intended to be general. It should work in any scene. Granular control wouldn’t be portable. It might be hard to add a feature like that, since the outline color isn’t something Blender ever expects to change.

It IS possible to affect an object’s color in the viewport shading, however.

1 Like

I’m trying to find it now, but there was an addon for 2.7x that changed UI colors randomly, so I know at least before 2.80 that you could access the theme. This was under the user_preferences.themes object, but that doesn’t exist in 2.80. I’m not sure if it’s been replaced or removed.

If that is still there, you can have a routine running in the background that changes the theme color when a certain object is selected, but that is pretty hacky.

1 Like

It’s there, I use it for preselection and it is indeed hacky- but if you’re careful and cache the values before you change them, you can put things back the way they were without breaking anything.