You also might want to save the actual returned full path name of the float
slider group in a variable and use that, instead of a literal string, when
you look up the values. Those queries basically ask the entire Maya
application for a control named "intensity". So if something else happens
to have created a control named that, you may end up querying the wrong
one. But the name returned from the control is the unique full name.

On Sun, 9 Aug 2015 6:45 AM Will Sharkey <[email protected]> wrote:

> got it, thanks for the help.
>
> On Sat, Aug 8, 2015 at 2:04 PM, damon shelton <[email protected]>
> wrote:
>
>> You need to make your slider group intensity you are just setting the
>> labels. Put intensity without a flag right after the (   when you create
>> the slider grp
>> On Aug 8, 2015 10:59 AM, "Will Sharkey" <[email protected]> wrote:
>>
>>> Hi,  I have some simple code that I'm trying to return the value for a
>>> floatSliderGrp but Im not sure why is failing. Any pointers for what Im
>>> doing wrong?
>>>
>>> import maya.cmds as cmds
>>>
>>> def intensity_value(*args):
>>>     selection = cmds.ls( selection=True )
>>>     intValue = cmds.floatSliderGrp('Intensity', query=True, value=True)
>>>     for sel in selection:
>>>         cmds.setAttr('{0}.intensity'.format(sel),intValue)
>>>
>>> def exposure_value(*args):
>>>     selection = cmds.ls( selection=True )
>>>     expoValue = cmds.floatSliderGrp('Exposure', query=True, value=True)
>>>     for sel in selection:
>>>         cmds.setAttr('{0}.aiExposure'.format(sel),expoValue)
>>>
>>> def myWindow():
>>>     if cmds.window('ws_lightParameter', exists = True):
>>>        cmds.deleteUI('ws_lightParameter')
>>>
>>>     cmds.window('ws_lightParameter')
>>>     cmds.columnLayout()
>>>     cmds.floatSliderGrp(label='Intensity', field=True, maxValue=50.0,
>>> value=0, cc= intensity_value)
>>>     cmds.floatSliderGrp(label='Exposure', field=True, maxValue=50.0,
>>> value=0, cc= exposure_value)
>>>     cmds.showWindow('ws_lightParameter')
>>>
>>> myWindow()
>>>
>>> thanks!
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Python Programming for Autodesk Maya" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/python_inside_maya/73d27d10-bb91-4285-90cb-329ba74571f8%40googlegroups.com
>>> <https://groups.google.com/d/msgid/python_inside_maya/73d27d10-bb91-4285-90cb-329ba74571f8%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Python Programming for Autodesk Maya" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/python_inside_maya/Br1xainAOw8/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>>
> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/python_inside_maya/CAM9RXoJ70Qo7QtY-A_hq%2BW2vbNyxq_%3DvwOw92Gr12eY4rePw0Q%40mail.gmail.com
>> <https://groups.google.com/d/msgid/python_inside_maya/CAM9RXoJ70Qo7QtY-A_hq%2BW2vbNyxq_%3DvwOw92Gr12eY4rePw0Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CAF4oo%2BCnqejs2KVf6MT2AdobyFu0sK6hFL0g_FQkyDGb3%3Dcz4A%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAF4oo%2BCnqejs2KVf6MT2AdobyFu0sK6hFL0g_FQkyDGb3%3Dcz4A%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA32y_swqFnJX-4c4hDPVjEY1L7m2SVqn2eqL3-uFW%2BVYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to