Search code examples
variablesslidermayamel

MEL assigning the opposite/negative position value to an object


New to MEL. I have created a slider that changes the angle of one of my objects and and it's one the user sets by operating the slide.

 floatSliderGrp -label "size" -field true
            -minValue 10.0 -maxValue 30.0 -value 10
            angles;

I assign it to an object I am animating by typing and this works as desired.

setAttr object.rotateZ `floatSliderGrp -q -value angles`;

Now, if I want to position my second object (object2) to be exactly at the OPPOSITE/negative position of object one, what can I do?

setAttr object2.rotateZ ?????

I can't do -angles, also because the slider is confined to only positive values. Thoughts?


Solution

  • setAttr object2.rotateZ (-(`floatSliderGrp -q -value angles`))