Hi,
I've been picking up python recently and while doing a mundane task in
Maya, I decided to quickly write a script for practice. Then I got really
into it and looked up how to make a basic menu!!
I noticed a snag in my script. I'm simply changing the .overrideColor on
the shape, but I noticed my script doesnt work it the shapes are not named
the same, its not a big deal but I'd love to know the answer.:
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 )
So the name 'curveShape' is hardcoded, which isnt good. How would one look
up the shape name of the object and add it to the '.overrideEnabled'?
Thanks in advance
--
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/3a701563-f870-40b6-b039-058ce61c6fd2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.