There is also the decomposeMatrix node, and the worldMatrix slot of
transforms.
my_transform, my_shape = cmds.polyCube()
decompose = cmds.createNode('decomposeMatrix')
cmds.connectAttr(my_transform + ".worldMatrix", decompose + ".inputMatrix")
cmds.getAttr(decompose + ".outputScale")
This will give you the worldspace equivalent of all transform channels in
real-time.
cmds.getAttr(decompose + ".outputTranslate")
cmds.getAttr(decompose + ".outputRotate")
cmds.getAttr(decompose + ".outputShear")
...
On 20 August 2014 04:59, <[email protected]> wrote:
> Hi Geordie, Thanks for the help. I think I'm confused now. What is the
> difference in returns between using getMatrix() and getTransformation()?
> They both say they return a transformation matrix, is it correct?
>
> Anyhow, I basically just want to return the scale of an object/locator as
> if you unparented it, and got that value in scale. Which I believe your
> functions does for me. Thank you. I'm a little surprised maya doesn't give
> you access to 'global scale', but does for all other components of a
> transform.
>
> I think this will work great for my need though. Cheers!
>
> --
> 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/9788952a-59f0-4ed7-9311-408ebc12cf4f%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
*Marcus Ottosson*
[email protected]
--
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/CAFRtmOAK85fYnyNmvDh%3DhCXwRnqiHZ%3DPYw0Vxw4_bzPkUyRFrA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.