thanks you so much, works like a charm. there was just a small problem with the "tMatrix.getScale(ptr)" taking 3 arguments instead of 2 but apart from that.
thanks again :) On Mar 29, 7:42 pm, Chad Vernon <[email protected]> wrote: > Use MTransformationMatrix. I didn't test MScriptUtil but it's something > along these lines > > matrix = data.inputValue(odeRigidBody.objWorldMatrix).asMatrix() > tMatrix = om.MTransformationMatrix(matrix) > > # Scale > util = om.MScriptUtil() > util.createFromList([0, 0, 0], 3) > ptr = util.asDouble3Ptr() > tMatrix.getScale(ptr) > om.MScriptUtil.getDouble3ArrayItem(ptr, 0) > om.MScriptUtil.getDouble3ArrayItem(ptr, 1) > om.MScriptUtil.getDouble3ArrayItem(ptr, 2) > > # rotation > tMatrix.eulerRotation() > > On Mon, Mar 29, 2010 at 11:21 AM, matthew evans <[email protected] > > > wrote: > > > On Mar 29, 5:38 pm, Chad Dombrova <[email protected]> wrote: > > > > On 29 March 2010 16:14, matthew evans <[email protected]> > > > > wrote: > > > > what is the best way to plug in the world marix of a object and then > > > > query individual elemants of it? > > > > query in what context? from within an MPxNode? from maya.cmds? as a > > > single plug connection to another float attribute? > > > this is the matrix attribute i created in my node: > > > import maya.OpenMaya as om > > mAttr=om.MFnMatrixAttribute() > > > odeRigidBody.objWorldMatrix=mAttr.create("objWorldMatrix","worldMat",om.MFnMatrixAttribute.kFloat) > > > no i can connect the worldMatrix of say a polyCube and can see the > > matrix in the attribute editor. so how would i query the scale potion > > of matrix or the rotation > > > -- > >http://groups.google.com/group/python_inside_maya > > > To unsubscribe from this group, send email to python_inside_maya+ > > unsubscribegooglegroups.com or reply to this email with the words "REMOVE > > ME" as the subject. > > -- http://groups.google.com/group/python_inside_maya To unsubscribe from this group, send email to python_inside_maya+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
