import maya.cmds as mc
def redWireColour(): selection = mc.ls( selection=True )
for i in range (len (selection)): mc.setAttr( selection[i] + '|curveShape.overrideEnabled', 1 ) mc.setAttr( selection[i] + '|curveShape.overrideColor', 4 )
def redWireColour():
selection = mc.ls( selection=True )
for i in selection:
selShape = getShape(i)
mc.setAttr( selShape + '.overrideEnabled', 1 )
mc.setAttr( selShape + '.overrideColor', 4 )--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/3a701563-f870-40b6-b039-058ce61c6fd2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
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()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
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/73d27d10-bb91-4285-90cb-329ba74571f8%40googlegroups.com.
--
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 python_inside_m...@googlegroups.com.
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.
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAF4oo%2BCnqejs2KVf6MT2AdobyFu0sK6hFL0g_FQkyDGb3%3Dcz4A%40mail.gmail.com.
import maya.cmds as cmds
def intensity_value(colour_control): selection = cmds.ls( selection=True ) for sel in selection: cmds.setAttr('{0}.intensity'.format(sel),colour_control)
def exposure_value(exposure_control): selection = cmds.ls( selection=True ) for sel in selection: cmds.setAttr('{0}.aiExposure'.format(sel),exposure_control)
def sample_value(sample_control): selection = cmds.ls( selection=True ) for sel in selection: cmds.setAttr('{0}.aiSamples'.format(sel),sample_control)
def myWindow(): if cmds.window('ws_lightParameter', exists = True): cmds.deleteUI('ws_lightParameter') cmds.window('ws_lightParameter') cmds.columnLayout() colour_control = cmds.floatSliderGrp(label='Intensity', field=True, maxValue=50.0, value=1, cc= intensity_value) exposure_control = cmds.floatSliderGrp(label='Exposure', field=True, maxValue=50.0, value=0, cc= exposure_value) sample_control = cmds.intSliderGrp(label='Samples', field=True, minValue=1, maxValue=50.0, value=1, cc= sample_value) cmds.showWindow('ws_lightParameter')
myWindow()
If this were a class, you would save those full path values from creating your controls, as member attributes, so that you could reference them again when you want to use the "edit" mode on the control commands to set a value.
In your case, you would have to use the "global" keyword to save them to global scope variables.
For following selection, that would require either a ScripJob, or directly through the Maya API callback messages. You would also have to handle the case of ambiguous values when you select 2 or more lights, if they have different values.
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/1b9135b6-f842-4dc2-81dd-1cce6a329396%40googlegroups.com.
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3z92a3_Jvig-yrhG-qxmxJ1fE6AJ6__Q-OxyJoabo58w%40mail.gmail.com.
On Wed, 26 Aug 2015 3:24 AM Will Sharkey <willjs...@gmail.com> wrote:
i just realised that you are in fact the author of these tutorials!
Well played :D
:-)
Thanks for snagging them.
On Tuesday, August 25, 2015 at 10:03:42 AM UTC-4, Will Sharkey wrote:
So, I know a couple of phrases in python, but I don't know how to string sentences. I just purchased a couple of tutorial bundles, I'll check back when I have a better structure for learning.
thanks for the help :)
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/667bc6a4-293c-4d64-8469-cc464a4ee150%40googlegroups.com.