Drawing Overrides attributes not working in pymel?

I’ve been trying to find information about this for a while now. The only solution I found was using setAttr, like this:

asd=circle()[0]
setAttr( (asd.getChildren[0].name()+".overrideEnabled"), 1)
setAttr( (asd.getChildren[0].name()+".overrideColor"), 11)

Because this doesn’t work and neither raises any error (Maya 2012, pymel 1.0.3):


asd=circle()
asd[0].drawOverride=True
asd[0].overrideEnabled=1
asd[0].overrideColor= 11
asd[0].getChildren()[0].drawOverride=True
asd[0].getChildren()[0].overrideEnabled=1
asd[0].getChildren()[0].overrideColor= 11
asd[1].drawOverride=True
asd[1].overrideEnabled=1
asd[1].overrideColor= 11


Is drawing overrides the only way to colorize controllers (for animation) on Maya?

color(wada, ud=1) has a limited range of (user defined) colors… (And I wouldn’t want to change user defined colors, I think.)

Try this instead:

import pymel.core as pm
asd, crv = pm.circle()
asd.overrideEnabled.set(True)
asd.overrideColor.set(11)
asd.getShape().overrideEnabled.set(True)
asd.getShape().overrideColor.set(11)

What you’re doing in the code you’ve presented is redeclaring the object’s Attribute objects as different types, so technically you’re not doing something invalid, which is why Maya doesn’t error.

Thanks a lot Seth!!

Didn’t know about .getShape() also, quite handy! :smiley: