seven6ty
11-11-2005, 10:11 PM
Ok, so I'm trying to create something in MEL that is like the colorAttrSlider thing, and what is in the attribute editor.
Basically, I need a color swatch, with a slider next to it to control the value (of an HSV color type) that controls the lightness to darkness of this. These two need to be linked.
Then, when you click the color swatch, I need to have it bring up the colorEditor, and have that tied into the color swatch (and value slider), so that when you change the colors in the colorEditor, the color swatch on the gui updates as well. Got me? Here's what I have so far:
{
if (`window -exists colors`)
deleteUI colors;
window -title "Colors" -widthHeight 180 100 colors;
rowLayout -numberOfColumns 2 -columnWidth2 30 150 color1Row1;
canvas -width 25 -height 25
-pressCommand "colorEditor" colorCanvas1;
if (`colorEditor -query -result`) {
float $values[] = `colorEditor -query -hsv`;
print `colorEditor -query -hsv`;
};
floatSlider
-min 0.0 -max 1.0
-width 145
-value 1.0
-step .05
-changeCommand "$color1BW = `intSlider -query -value`;" color1Slider;
showWindow colors;
window -e -widthHeight 180 50 colors;
};
However, these three values (slider, swatch and colorEditor) are not all connected yet, anyone have some help to offer on this one?
Basically, I need a color swatch, with a slider next to it to control the value (of an HSV color type) that controls the lightness to darkness of this. These two need to be linked.
Then, when you click the color swatch, I need to have it bring up the colorEditor, and have that tied into the color swatch (and value slider), so that when you change the colors in the colorEditor, the color swatch on the gui updates as well. Got me? Here's what I have so far:
{
if (`window -exists colors`)
deleteUI colors;
window -title "Colors" -widthHeight 180 100 colors;
rowLayout -numberOfColumns 2 -columnWidth2 30 150 color1Row1;
canvas -width 25 -height 25
-pressCommand "colorEditor" colorCanvas1;
if (`colorEditor -query -result`) {
float $values[] = `colorEditor -query -hsv`;
print `colorEditor -query -hsv`;
};
floatSlider
-min 0.0 -max 1.0
-width 145
-value 1.0
-step .05
-changeCommand "$color1BW = `intSlider -query -value`;" color1Slider;
showWindow colors;
window -e -widthHeight 180 50 colors;
};
However, these three values (slider, swatch and colorEditor) are not all connected yet, anyone have some help to offer on this one?
