Closed GoogleCodeExporter closed 9 years ago
Hi!
What is the "newAttribute" command? Never used that one.
Maybe try the standard Maya addAttr via pymel?
node.addAttr(<insert definition here>).set(0, f=1)
Even if newAttribute was a cmd you are not supplying the definition of the new
attribute. No name, or type seems to be defined.
Cheers.
Original comment by amor...@gmail.com
on 11 Jul 2011 at 3:16
Yes... you have to first create the attribute with addAttr before you can
access it with the property syntax. (ie, call node.addAttr('newAttribute')
before you can call node.newAttribute).
To use setAttr with the force flag, you would have to explicitly call the
setAttr command, not the Attribute.set method:
setAttr('myNode.newAttribute', False, f=1)
Original comment by elron...@gmail.com
on 11 Jul 2011 at 3:31
It's in the docs as a modification:
Added ‘force’ kwarg, which causes the attribute to be added if it does not
exist.
http://pymel.googlecode.com/svn/docs/generated/classes/pymel.core.nodetypes/pyme
l.core.nodetypes.Attribute.html?highlight=attribute#pymel.Attribute
Original comment by noahmizr...@gmail.com
on 12 Jul 2011 at 7:17
I should also mention Ofer Koren implemented this at Image Movers. Why is it in
the docs as a modification but not as part of the current release? I hope you
guys will consider it, it's one of the key points of pymel I demonstrate to
python or mel users.
Original comment by noahmizr...@gmail.com
on 12 Jul 2011 at 7:21
Original issue reported on code.google.com by
noahmizr...@gmail.com
on 11 Jul 2011 at 5:50