quick update in case someone else has the problem..
I just realized I was missing MArrayDataBuilder.addArrayElement() with the 
api2.0 not because it's been replaced by something else, but just because it's 
not implemented yet in 2017. Supposed to be available in 2018 (according to the 
documentation), but in fact, it's not... so I'm back to old api1.. again ^^



Le mercredi 21 février 2018 23:05:25 UTC-5, vince touache a écrit :
> 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)

-- 
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 python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/2e9f8566-86e6-4240-9887-37a85ede521b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to