Not in front of Maya at the moment, but if you're having trouble doing this 
via maya.cmds or OpenMaya you could instead use an intermediate node to 
store your matrix. Any node with a matrix attribute would do, such as 
addMatrix or decomposeMatrix.

To store it, simply connect it to the intermediate node and read its value 
(this is important, otherwise Maya may not take the time to actually write 
any values). Then you can disconnect.

To read it back, simply connect your intermediate node to the target (and 
make sure it reads. either by being visible in the viewport, or via the 
cmds.getAttr() command), then you can disconnect and remove the old node.

That way, you could potentially store your history of transfers with the 
scene itself, without any extra hassle.


On Wednesday, 8 January 2014 14:31:46 UTC, Dilen Shah wrote:
>
> Hey guys,
>
> Need some help with something, I have written a script with UI for parent 
> switching, but I wanted to know if its possible to create a node that takes 
> in values and stores the matrix values of the child and once the parent 
> attribute is changed, its applies the matrix values to the child.
>
> D.
>

-- 
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/a8346342-460d-4a20-b9e1-0fd0e11e5c65%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to