Re: [Maya-Python] Fetching the stylesheet of Maya

2015-03-12 Thread Marcus Ottosson
They are also supposedly a touch slower Actually, disregard my reply to that, that’s beside the point of the original question (and quite frankly, just plain bait, Justin! :))​ ​ -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya"

Re: [Maya-Python] Fetching the stylesheet of Maya

2015-03-12 Thread Marcus Ottosson
But the part about the stylsheets being converted and not stored was definitely not right. What you’re seeing there is merely the last command put into setStyleSheet, it doesn’t actually represent the sum of each individual command. Technically, the string is cached internally, into a private memb

Re: [Maya-Python] Fetching the stylesheet of Maya

2015-03-12 Thread Tony Barbieri
Not adding much to the conversation with details but I have also hit the same limitation in the past. On Tue, Mar 10, 2015 at 3:19 PM, Justin Israel wrote: > Apparently I can’t find an example off-hand of the limitations in wanting > to query parent colors that were applied via a stylesheet, so

Re: [Maya-Python] Fetching the stylesheet of Maya

2015-03-12 Thread Tony Barbieri
Looks like it was from Thorsten Kaufmann's Github that I found the concept: https://github.com/instinct-vfx/QColorscheme/blob/master/src/QColorScheme/QColorScheme.py Wanted to make sure he got the credit for it! All I did was figure out the Maya colors to use. On Tue, Mar 10, 2015 at 2:03 PM, To

Re: [Maya-Python] Fetching the stylesheet of Maya

2015-03-12 Thread Tony Barbieri
I ran across the QPalette concept via google awhile ago. It was originally to mimic Nuke's look and feel. As for the colors, I used screen captures and the color picker in Photoshop. On Tue, Mar 10, 2015 at 1:36 PM, Fredrik Averpil wrote: > That's awesome Tony, thanks! > > I wonder how the per

Re: [Maya-Python] Fetching the stylesheet of Maya

2015-03-12 Thread Marcus Ottosson
There's also this which might provide some more inspiration. http://tech-artists.org/forum/showthread.php?2359-Release-Qt-dark-orange-stylesheet -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this gro

Re: [Maya-Python] Fetching the stylesheet of Maya

2015-03-11 Thread Fredrik Averpil
Thanks everyone, I've reached a satisfactory result by pickling down the Maya QPalette and using that together with some of Tony's code (or Thorsten Kaufmann's code). Cheers! On Wed, Mar 11, 2015 at 1:40 PM Tony Barbieri wrote: > They most likely did customize further than just the QPalette.

Re: [Maya-Python] Fetching the stylesheet of Maya

2015-03-11 Thread Tony Barbieri
They most likely did customize further than just the QPalette. The QPalette should give you a good base to start from. Best, On Wed, Mar 11, 2015 at 4:53 AM, Fredrik Averpil wrote: > Hey guys, > > I see you've been busy with this while I've been asleep ;) > > So, it seems you are totally right

Re: [Maya-Python] Fetching the stylesheet of Maya

2015-03-11 Thread Panupat Chongstitwattana
I based my own style on QDarkStyle. I think it's a very decent and nice looking one with color very similar to VFX software like Clarisse. Buttons are a bit too round and some tree widget and tree view elements still have none-matching colors but over all still great. https://github.com/ColinDu

Re: [Maya-Python] Fetching the stylesheet of Maya

2015-03-11 Thread Fredrik Averpil
Hey guys, I see you've been busy with this while I've been asleep ;) So, it seems you are totally right I cannot fetch the stylesheet, as the UI needs to have been created using the qApp.setStylesheet(), which Autodesk seems not to have done (?). Thanks to Tony's post about QPalette, I started se

Re: [Maya-Python] Fetching the stylesheet of Maya

2015-03-10 Thread Justin Israel
On Wed, Mar 11, 2015 at 10:48 AM Marcus Ottosson wrote: > If you use a stylesheets it takes priority over a palette > > I think you’re right about that; this should otherwise have produced a > yellow background, but it ends up blue. > > window = QtWidgets.QWidget() > window.setFixedSize(800, 600)

Re: [Maya-Python] Fetching the stylesheet of Maya

2015-03-10 Thread Marcus Ottosson
If you use a stylesheets it takes priority over a palette I think you’re right about that; this should otherwise have produced a yellow background, but it ends up blue. window = QtWidgets.QWidget() window.setFixedSize(800, 600) window.show() yellow = QtGui.QColor("yellow") brush = QtGui.QBrush(y

Re: [Maya-Python] Fetching the stylesheet of Maya

2015-03-10 Thread Justin Israel
On Wed, Mar 11, 2015 at 10:07 AM Marcus Ottosson wrote: > But the part about the stylsheets being converted and not stored was > definitely not right. > > What you’re seeing there is merely the last command put into setStyleSheet, > it doesn’t actually represent the sum of each individual command

Re: [Maya-Python] Fetching the stylesheet of Maya

2015-03-10 Thread Justin Israel
Apparently I can’t find an example off-hand of the limitations in wanting to query parent colors that were applied via a stylesheet, so I will have to dig through some of my code. I will also try to find the various posts I have found from others outlining the same limitations. It is related to sit

Re: [Maya-Python] Fetching the stylesheet of Maya

2015-03-10 Thread Marcus Ottosson
and setting a stylesheet doesn’t transform it into a QPalette that you can then access values of.​ Sure it does. :) Here’s an example of sampling the QPalette of a QWindow, setting a stylesheet, and then sampling again. https://gist.github.com/mottosso/9f27229fa75815bf4969 The stylesheet is: QW

Re: [Maya-Python] Fetching the stylesheet of Maya

2015-03-10 Thread Justin Israel
On Wed, 11 Mar 2015 6:56 AM Marcus Ottosson wrote: To be honest, I’m trying to snatch the complete stylesheet from Maya (if at all possible) to use that look in one of my UIs which runs outside of Maya.​ The problem is Maya doesn’t have a stylesheet. Qt supports parsing of CSS-like* styleshee

Re: [Maya-Python] Fetching the stylesheet of Maya

2015-03-10 Thread Marcus Ottosson
To be honest, I’m trying to snatch the complete stylesheet from Maya (if at all possible) to use that look in one of my UIs which runs outside of Maya.​ The problem is Maya doesn’t have a stylesheet. Qt supports parsing of CSS-like* stylesheets that is then converted into commands similar to what

Re: [Maya-Python] Fetching the stylesheet of Maya

2015-03-10 Thread Fredrik Averpil
That's awesome Tony, thanks! I wonder how the person who came up with this extracted the data though. Regards, Fredrik On Tue, Mar 10, 2015 at 6:23 PM Tony Barbieri wrote: > Hey Fredrik, > > I believe Maya is actually using an Application wide QPalette and the > QApplication is using the "P

Re: [Maya-Python] Fetching the stylesheet of Maya

2015-03-10 Thread Tony Barbieri
Hey Fredrik, I believe Maya is actually using an Application wide QPalette and the QApplication is using the "Plastique" style. The following code I took from elsewhere but hopefully you get the general idea. base_palette = QtGui.QPalette() HIGHLIGHT_COLOR = QtGui.QColor(103, 141, 178) BRIGHTNE

Re: [Maya-Python] Fetching the stylesheet of Maya

2015-03-10 Thread Fredrik Averpil
Getting closer ... (?) from PySide.QtGui import QApplication app = QApplicationprint app.style().metaObject().className() >> QadskDarkStyle ​ Hm, I wonder if I can somehow extract the CSS from this. // Fredrik On Tue, Mar 10, 2015 at 5:35 PM Fredrik Averpil wrote: > No, I haven't. > To be h

Re: [Maya-Python] Fetching the stylesheet of Maya

2015-03-10 Thread Fredrik Averpil
No, I haven't. To be honest, I'm trying to snatch the complete stylesheet from Maya (if at all possible) to use that look in one of my UIs which runs outside of Maya. But it seems maybe this is not possible at all. // Fredrik On Tue, Mar 10, 2015 at 5:29 PM Marcus Ottosson wrote: > Fetch the

Re: [Maya-Python] Fetching the stylesheet of Maya

2015-03-10 Thread Marcus Ottosson
Fetch the stylesheet? I don't think there is such a thing. The stylesheet you put into Qt is immediately parsed into native attributes and then discarded. Have you managed this in previous versions of Maya? -- You received this message because you are subscribed to the Google Groups "Python Pro

[Maya-Python] Fetching the stylesheet of Maya

2015-03-10 Thread Fredrik Averpil
Anyone know how to fetch the stylesheet of Maya 2015? I've tried this: from PyQt4 import QtGui, QtCoreimport sipimport maya.OpenMayaUI as mui def get_maya_window(): """Get the maya main window as a QMainWindow instance""" ptr = mui.MQtUtil.mainWindow() return sip.wrapinstance(long(ptr