How can I determine, programmatically, the shelf background color?

How can I determine, programmatically, the shelf background color?

Anonymous
Not applicable
536 Views
1 Reply
Message 1 of 2

How can I determine, programmatically, the shelf background color?

Anonymous
Not applicable

There does not appear to be any setting or preference within Maya for the background color used in shelves. Does anyone know of a way that I can determine that from within a Maya plugin or script?

0 Likes
537 Views
1 Reply
Reply (1)
Message 2 of 2

cheng_xi_li
Autodesk Support
Autodesk Support

Hi,

 

It should be available through QT, e.g.

 

import maya.OpenMayaUI as omui
from PySide2.QtCore import * 
from PySide2.QtGui import * 
from PySide2.QtWidgets import *
from PySide2 import __version__
from shiboken2 import wrapInstance 

widget = omui.MQtUtil.findControl("Shelf")
qwidget = wrapInstance(long(widget), QWidget)

print qwidget.palette().color(QPalette.Background)

Yours,

Li