fruit...@gmail.com
unread,Feb 21, 2018, 11:05:25 PM2/21/18Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Python Programming for Autodesk Maya
hi !
I'm writing a node with compound attributes, and, as always, I'm struggling with syntax !
I want my attributes to have this hierarchy :
element
|__element[0]
|__ element[0].position
|__element[0].positionX
|__element[0].positionY
|__element[0].positionZ
|__ element[0].rotation
|__ ...
|_ element[1]
|__ etc...
(Position is an MFnNumericAttribute.createPoint() and orientation is an array, and my attributes are outputs)
So the declaration is done correctly, but when I need to write them with the databuilder, it's getting a bit more tricky :
hElement = data.outputArrayValue(Node.aElement)
bElement = hElement.builder()
and finally
for i in xrange(num_elements):
bElement.addElement(i).setFloatVector(0, 1, 0)
Obviously, I'm doing something wrong, because my node always returns 0,0,0.
I think I'm actually pointing to the parent, but don't know how to access to the child, from there.
Any idea ?
Thanks
(I'm using the python api2.0 for this one)