I am currently registering the ColorPreferencesWindow to the shelf.
How do I register the color of the viewport on the shelf?
For example, a white or light blue flat.
I know that the viewport color can be set in the ColorPreferencesWindow;.
I know that I can set it with Background and change it with Alt+B.
Please teach me.
Solved! Go to Solution.
Solved by alec.andersenLP8AU. Go to Solution.
Hi @amaterasu-qbb,
By running "Echo all commands" in the script editor, you can see actions and their direct code. These code lines can be pasted into a shelf button (A new button can be made by right-clicking the desired shelf).
This can be used for almost any function within Maya. For this one however, an extra step is needed.
For example, for the background slider we find "updateRGBcolor background;". We'd expect to see color information, so that tells us that the color is not being imparted through Mel. In cases like this, the command echoed will have a page usually detailing it's functions, known as flags.
Searching RGBcolor background finds this script page displayRGBColor command, which discusses the flags the command is capable of receiving.
We can then use this information to put it all together in a button:
// Set the background colour to red displayRGBColor background 1 0 0;
I'm too dumb to understand the programming.
I know how to access Help, but I don't know what it is explaining. I don't know the process in that order either.
I can't make an example of what I need to do.
Is this RGB, 0 to 1.0?RGB, 0 to 255?HSV?
ah. I see. I get it.
First, create the color you want with RGB, 0 to 255, and then look at it later with RGB, 0 to 1.0. If you enter the RGB, 0 to 1.0 values in RGB order and separate them with commas, you can save them in mel.
Save it to the shelf as well.
Thank you very much.
Can't find what you're looking for? Ask the community or share your knowledge.