Hi! @Meliko .
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.
This is the command when you change Background from 3D View in Color Setting.
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()
This is the command when changing Gradient Top from 3D View of Color Setting.
// 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()
This is the command when changing Gradient Bottom from 3D View of Color Setting.
// 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()
You can see that there are commands that are common to each.
- from maya.plugin.evaluator.cache_ui import cache_ui_colour_preferences_update
- cache_ui_colour_preferences_update()
- updateRGBColor
Checking these with the whatIs command is as follows.
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();
}
}
It might be a good idea to ask the same question on the Maya Programming forums.
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.
Best,