On Tue, Mar 24, 2009 at 19:11, Justin Ball <[email protected]> wrote:
>
> I was using the line ls(type='mesh', ap=1)
>
> and yes I get all the meshes... but I need their transform information.
>
> and if I have instanced meshs, I am getting just the translation
> information from the transform node. with is the same for both the
> master and the instance since their transform nodes are the same.
>
> So I was wanting to use the function isInstanced() to tell me if a
> mesh is instanced and could then get the world transform information
> for the transform node and then add that to the transform information.
It's easier (and faster) to do that using the API than with commands like 'ls':
import maya.OpenMaya as om
meshPath = om.MDagPath()
iter = om.MItDag(om.MItDag.kDepthFirst, om.MFn.kMesh)
while not iter.isDone():
iter.getPath(meshPath)
That will step you through every instance of every mesh in the scene
and since 'meshPath' is an MDagPath you can use its inclusiveMatrix()
and exclusiveMatrix() methods to get the full transformation matrix
for that specific instance.
If you still care about whether the mesh is instanced you can either
use iter.isInstanced() or meshPath.isInstanced()
--
-deane
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/python_inside_maya
-~----------~----~----~----~------~----~------~--~---