Hi Kev,
You also need to add the child attribute.
import pymel.core as pm
null = pm.spaceLocator()
null.addAttr('rainbow', usedAsColor=True, attributeType='float3' )
null.addAttr('red', attributeType='float', parent='rainbow' )
null.addAttr('green', attributeType='float', parent='rainbow' )
null.addAttr('blue', attributeType='float', parent='rainbow' )
Greets,
Colas
2014-10-17 13:50 GMT-04:00 <[email protected]>:
> Okay, So i'm just trying to add a color swatch attribute to a locator.
> why does this not work? it's basically taken from the pymel docs
>
> import pymel.core as pm
>
> null = pm.spaceLocator()
> null.addAttr( longName='Color', usedAsColor=True attributeType='float3' )
>
>
> Thanks
> Kev
>
> --
> 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/6ebf6dcc-0e03-479b-b018-ce46dd249788%40googlegroups.com
> .
> 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/CABwp0vP2LvA42yUex-aXXKhqZOO%3DCA0AeoVjuf0xq%3Drep-PLgw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.