<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I save custom viewport gradient color themes for easy shelf button switching? (MEL script needed) in Maya Forum</title>
    <link>https://forums.autodesk.com/t5/maya-forum/how-do-i-save-custom-viewport-gradient-color-themes-for-easy/m-p/11911906#M4376</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6298760"&gt;@amaterasu-qbb&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Wow. Thanks very much for getting this code!&lt;BR /&gt;&lt;BR /&gt;I echoed commands in script editor but there was nothing when I changed colors in the Color Settings pref panel.&amp;nbsp; How did you get this code?&lt;BR /&gt;&lt;BR /&gt;I will play around with this and see if I can affect the gradient colors but since I'm not a coder, I don't have high hopes.&amp;nbsp; Your suggestion to ask in the programmers forum is a good one.&lt;BR /&gt;&lt;BR /&gt;Thanks for taking the time to dive into this.&amp;nbsp; Much appreciated!&lt;/P&gt;</description>
    <pubDate>Fri, 21 Apr 2023 06:45:18 GMT</pubDate>
    <dc:creator>Meliko</dc:creator>
    <dc:date>2023-04-21T06:45:18Z</dc:date>
    <item>
      <title>How do I save custom viewport gradient color themes for easy shelf button switching? (MEL script needed)</title>
      <link>https://forums.autodesk.com/t5/maya-forum/how-do-i-save-custom-viewport-gradient-color-themes-for-easy/m-p/11908369#M4372</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I want to create preset color gradients for my Maya Viewport that I can click and change from my shelf instead of going into Windows/Settings-Preferences/ColorSettings every time I want to change the viewport gradient colors.&lt;BR /&gt;&lt;BR /&gt;The closest I found after searching was this post in the forum that had an awesome MEL script that allowed for solid color viewport presets as shelf buttons.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://forums.autodesk.com/t5/maya-forum/how-do-i-register-the-color-of-the-viewport-in-the-shelf/td-p/9633897" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;How do I register the color of the viewport in the shelf?&lt;/STRONG&gt;&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;But I need the MEL script that would allow me to input the RGB 0-10 values for TOP and BOTTOM Gradient colors and keep them as shelf button presets?&lt;BR /&gt;&lt;BR /&gt;Any help would be greatly appreciated!&lt;BR /&gt;&lt;BR /&gt;Mel&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 23:06:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-forum/how-do-i-save-custom-viewport-gradient-color-themes-for-easy/m-p/11908369#M4372</guid>
      <dc:creator>Meliko</dc:creator>
      <dc:date>2023-04-19T23:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do I save custom viewport gradient color themes for easy shelf button switching? (MEL script needed)</title>
      <link>https://forums.autodesk.com/t5/maya-forum/how-do-i-save-custom-viewport-gradient-color-themes-for-easy/m-p/11908961#M4373</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Hi!&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5064954"&gt;@Meliko&lt;/a&gt;&amp;nbsp;.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;I thought this was closer to your question so I'm suggesting it. I hope it will be useful for you.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;A href="https://forums.autodesk.com/t5/maya-forum/how-do-i-register-the-color-of-the-viewport-in-the-shelf/td-p/9633897" target="_blank"&gt;https://forums.autodesk.com/t5/maya-forum/how-do-i-register-the-color-of-the-viewport-in-the-shelf/td-p/9633897&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Also, I'm proposing an idea to make it possible to change this in real time, so please vote if you'd like.&lt;/DIV&gt;&lt;DIV&gt;&lt;A href="https://forums.autodesk.com/t5/maya-ideas/change-viewport-background-color-real-time/idc-p/9853867#M3396" target="_blank"&gt;https://forums.autodesk.com/t5/maya-ideas/change-viewport-background-color-real-time/idc-p/9853867#M3396&lt;/A&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;Best,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 20 Apr 2023 06:33:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-forum/how-do-i-save-custom-viewport-gradient-color-themes-for-easy/m-p/11908961#M4373</guid>
      <dc:creator>amaterasu-qbb</dc:creator>
      <dc:date>2023-04-20T06:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I save custom viewport gradient color themes for easy shelf button switching? (MEL script needed)</title>
      <link>https://forums.autodesk.com/t5/maya-forum/how-do-i-save-custom-viewport-gradient-color-themes-for-easy/m-p/11910482#M4374</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6298760"&gt;@amaterasu-qbb&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;Thanks for the reply.&amp;nbsp; In my post, I actually linked to your post about BG colors as shelf buttons.&amp;nbsp; It's a good solution that I'll use for quickly changing BG colors with shelf buttons.&amp;nbsp; I'm hoping there's a way to save Gradient BG themes as shelf buttons also.&lt;BR /&gt;&lt;BR /&gt;I like your idea of real time color changes in viewport like Blender.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 17:17:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-forum/how-do-i-save-custom-viewport-gradient-color-themes-for-easy/m-p/11910482#M4374</guid>
      <dc:creator>Meliko</dc:creator>
      <dc:date>2023-04-20T17:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I save custom viewport gradient color themes for easy shelf button switching? (MEL script needed)</title>
      <link>https://forums.autodesk.com/t5/maya-forum/how-do-i-save-custom-viewport-gradient-color-themes-for-easy/m-p/11911883#M4375</link>
      <description>&lt;P&gt;Hi! &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5064954"&gt;@Meliko&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;I just saw that you put the link to my question in your original post. I apologize for that. Unfortunately, I can't solve this problem, but I've summarized everything I've researched.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the command when you change Background from 3D View in Color Setting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;updateRGBColor background;
updateColorPrefUI;
from maya.plugin.evaluator.cache_ui import cache_ui_colour_preferences_update
cache_ui_colour_preferences_update()

// I tried both with different colors and the same command returned.

updateRGBColor background;
updateColorPrefUI;
from maya.plugin.evaluator.cache_ui import cache_ui_colour_preferences_update
cache_ui_colour_preferences_update()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the command when changing Gradient Top from 3D View of Color Setting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;// Result: scriptEditorPanel1Window|scriptEditorPanel1|formLayout112|formLayout114|paneLayout2|cmdScrollFieldReporter1
updateRGBColor backgroundTop;
updateColorPrefUI;
from maya.plugin.evaluator.cache_ui import cache_ui_colour_preferences_update
cache_ui_colour_preferences_update()

// I tried both with different colors and the same command returned.

// Result: scriptEditorPanel1Window|scriptEditorPanel1|formLayout112|formLayout114|paneLayout2|cmdScrollFieldReporter1
updateRGBColor backgroundTop;
updateColorPrefUI;
from maya.plugin.evaluator.cache_ui import cache_ui_colour_preferences_update
cache_ui_colour_preferences_update()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the command when changing Gradient Bottom from 3D View of Color Setting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;// Result: scriptEditorPanel1Window|scriptEditorPanel1|formLayout112|formLayout114|paneLayout2|cmdScrollFieldReporter1
updateRGBColor backgroundBottom;
updateColorPrefUI;
from maya.plugin.evaluator.cache_ui import cache_ui_colour_preferences_update
cache_ui_colour_preferences_update()

// I tried both with different colors and the same command returned.

// Result: scriptEditorPanel1Window|scriptEditorPanel1|formLayout112|formLayout114|paneLayout2|cmdScrollFieldReporter1
updateRGBColor backgroundBottom;
updateColorPrefUI;
from maya.plugin.evaluator.cache_ui import cache_ui_colour_preferences_update
cache_ui_colour_preferences_update()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can see that there are commands that are common to each.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;from maya.plugin.evaluator.cache_ui import cache_ui_colour_preferences_update&lt;/LI&gt;&lt;LI&gt;cache_ui_colour_preferences_update()&lt;/LI&gt;&lt;LI&gt;updateRGBColor&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Checking these with the whatIs command is as follows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;from maya.plugin.evaluator.cache_ui import cache_ui_colour_preferences_update
// Result: Unknown
cache_ui_colour_preferences_update()
// Result: Unknown
updateRGBColor
// Result: Mel procedure found in: C:/Program Files/Autodesk/Maya2023/scripts/others/colorPrefWnd.mel
// updateRGBColor command
global proc updateRGBColor (string $colorName) {
	string $widgetName = rgbSliderWidget($colorName);
	float $col[];
	$col=`colorSliderGrp -q -rgb $widgetName`;
	float $alpha[]=`colorSliderGrp -q -alphaValue $widgetName`;
	displayRGBColor $colorName $col[0] $col[1] $col[2] $alpha[0];
		
	// If the User Defined Color Palette window is up, update it
	// We don't check what colour is being updated here because
	// the checking is slower than actually doing the work
	//
	global string $gObjColorPalette;
	if (`palettePort -exists $gObjColorPalette`) {
		initObjColorPalette();
	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It might be a good idea to ask the same question on the Maya Programming forums.&lt;/P&gt;&lt;P&gt;Also, I think this will involve using an API that does more complex processing than MEL, so it may be difficult to get an answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 06:37:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-forum/how-do-i-save-custom-viewport-gradient-color-themes-for-easy/m-p/11911883#M4375</guid>
      <dc:creator>amaterasu-qbb</dc:creator>
      <dc:date>2023-04-21T06:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I save custom viewport gradient color themes for easy shelf button switching? (MEL script needed)</title>
      <link>https://forums.autodesk.com/t5/maya-forum/how-do-i-save-custom-viewport-gradient-color-themes-for-easy/m-p/11911906#M4376</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6298760"&gt;@amaterasu-qbb&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Wow. Thanks very much for getting this code!&lt;BR /&gt;&lt;BR /&gt;I echoed commands in script editor but there was nothing when I changed colors in the Color Settings pref panel.&amp;nbsp; How did you get this code?&lt;BR /&gt;&lt;BR /&gt;I will play around with this and see if I can affect the gradient colors but since I'm not a coder, I don't have high hopes.&amp;nbsp; Your suggestion to ask in the programmers forum is a good one.&lt;BR /&gt;&lt;BR /&gt;Thanks for taking the time to dive into this.&amp;nbsp; Much appreciated!&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 06:45:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-forum/how-do-i-save-custom-viewport-gradient-color-themes-for-easy/m-p/11911906#M4376</guid>
      <dc:creator>Meliko</dc:creator>
      <dc:date>2023-04-21T06:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do I save custom viewport gradient color themes for easy shelf button switching? (MEL script needed)</title>
      <link>https://forums.autodesk.com/t5/maya-forum/how-do-i-save-custom-viewport-gradient-color-themes-for-easy/m-p/11913094#M4377</link>
      <description>&lt;P&gt;Hi Meliko,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I understand correctly you want want to change the viewport background colour using shelf buttons?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are 4 little MEL scripts snippets that I think may help:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;// Solid 1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;displayPref -displayGradient false;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;displayRGBColor "background" 0.7 0.7 0.6;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;// Solid 2&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;displayPref -displayGradient false;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;displayRGBColor "background" 0.6 0.7 0.7;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;// Gradient 1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;displayPref -displayGradient true;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;displayRGBColor "backgroundTop" 0.4 0.4 0.5;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;displayRGBColor "backgroundBottom" 0.7 0.8 0.7;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;// Gradient 2&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;displayPref -displayGradient true;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;displayRGBColor "backgroundTop" 0.5 0.3 0.6;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;displayRGBColor "backgroundBottom" 0.5 0.8 0.6;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Paste everything into the Script Editor then select each snippet one at a time. Drag each selection to your shelf.&lt;/P&gt;
&lt;P&gt;You should wind up with 4 buttons on your shelf which will change the viewport background.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;-Brian&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 15:59:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-forum/how-do-i-save-custom-viewport-gradient-color-themes-for-easy/m-p/11913094#M4377</guid>
      <dc:creator>brian.kramer</dc:creator>
      <dc:date>2023-04-21T15:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I save custom viewport gradient color themes for easy shelf button switching? (MEL script needed)</title>
      <link>https://forums.autodesk.com/t5/maya-forum/how-do-i-save-custom-viewport-gradient-color-themes-for-easy/m-p/11913115#M4378</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10239521"&gt;@brian.kramer&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;THANK YOU!!&amp;nbsp; This was exactly what I wanted and it's working flawlessly now.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Much appreciated!&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 16:11:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-forum/how-do-i-save-custom-viewport-gradient-color-themes-for-easy/m-p/11913115#M4378</guid>
      <dc:creator>Meliko</dc:creator>
      <dc:date>2023-04-21T16:11:05Z</dc:date>
    </item>
  </channel>
</rss>

