prefs = Application.Preferences
bgcol = prefs.Categories("Scene Colors").backgroundcol
current = bgcol.Value
# 0 is black, -1 is pure white, 2139062271 is 50% grey.
actionTable = {
2139062271:0, # If grey, set it BLACK
0:-1, # If black, set it WHITE
-1:2139062271 # If white, set it GREY
}
if current in actionTable.keys():
bgcol.Value = actionTable[current]
else:
bgcol.Value = 2139062271 # If another color, set to grey.
Application.RestoreDefaultPreference("Scenecolors")
From: Jason Brynford-Jones
Sent: Tuesday, July 19, 2011 3:46 PM
To: soft...@listproc.autodesk.com
Subject: RE: python: change viewport background color?
Look under scenecolors in the prefs.
Application.SetValue("preferences.Scenecolors.backgroundcol", "1361231465", "")
From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Andy Moorer
Sent: Tuesday, July 19, 2011 3:38 PM
To: soft...@listproc.autodesk.com
Subject: python: change viewport background color?
Remarkable! :D
Potentially dumb question here......
Where does the 1361231465 come from? i.e. its not Hex or RGB etc
magic, cheers
From:
softimag...@listproc.autodesk.com
[mailto:softimag...@listproc.autodesk.com] On Behalf Of Stephen Blair
Sent: 29 September 2011 14:13
To:
soft...@listproc.autodesk.com
Subject: RE: python: change
viewport background color?