from maya.cmds import * def mtMatrixViewer(): sel = ls (sl=True) # for each in sel: worldInverseMatrix = getAttr (sel[0] + ".worldInverseMatrix" ) worldMatrix = getAttr (sel[0] + ".worldMatrix" ) inverseMatrix = getAttr (sel[0] + ".inverseMatrix") parentMatrix = getAttr (sel[0] + ".parentMatrix") parentInverseMatrix = getAttr (sel[0] + ".parentInverseMatrix") mtMatrix = getAttr (sel[0] + ".matrix") #if window(newWin, q=True, exists=True): # print newWin # deleteUI(newWin) newWin = window(title= (sel[0] + " viewer")) columnLayout() frameLayout(cll=True, cl=False, label="Matrix") matrixLayout = rowColumnLayout( numberOfColumns=4, columnWidth=[(1,60), (2,60), (3,60), (4,60)] ) aa1 = floatField() aa2 = floatField() aa3 = floatField() aa4 =floatField() ab1 = floatField() ab2 = floatField() ab3 = floatField() ab4 = floatField() ac1 = floatField() ac2 = floatField() ac3 = floatField() ac4 = floatField() ad1 = floatField() ad2 = floatField() ad3 = floatField() ad4 = floatField() setParent('..') setParent('..') frameLayout(cll=True, cl=False, label="Inverse Matrix") inverseLayout = rowColumnLayout( numberOfColumns=4, columnWidth=[(1,60), (2,60), (3,60), (4,60)] ) ba1 = floatField() ba2 = floatField() ba3 = floatField() ba4 = floatField() bb1 = floatField() bb2 = floatField() bb3 = floatField() bb4 = floatField() bc1 = floatField() bc2 = floatField() bc3 = floatField() bc4 = floatField() bd1 = floatField() bd2 = floatField() bd3 = floatField() bd4 = floatField() setParent('..') setParent('..') frameLayout(cll=True, cl=False, label="World Matrix") worldLayout = rowColumnLayout( numberOfColumns=4, columnWidth=[(1,60), (2,60), (3,60), (4,60)] ) ca1 = floatField() ca2 = floatField() ca3 = floatField() ca4 = floatField() cb1 = floatField() cb2 = floatField() cb3 = floatField() cb4 = floatField() cc1 = floatField() cc2 = floatField() cc3 = floatField() cc4 = floatField() cd1 = floatField() cd2 = floatField() cd3 = floatField() cd4 = floatField() setParent('..') setParent('..') frameLayout(cll=True, cl=False, label="World Inverse Matrix") worldInverseLayout = rowColumnLayout( numberOfColumns=4, columnWidth=[(1,60), (2,60), (3,60), (4,60)] ) da1 = floatField() da2 = floatField() da3 = floatField() da4 = floatField() db1 = floatField() db2 = floatField() db3 = floatField() db4 = floatField() dc1 = floatField() dc2 = floatField() dc3 = floatField() dc4 = floatField() dd1 = floatField() dd2 = floatField() dd3 = floatField() dd4 = floatField() setParent('..') setParent('..') frameLayout(cll=True, cl=False, label="Parent Matrix") parentLayout = rowColumnLayout( numberOfColumns=4, columnWidth=[(1,60), (2,60), (3,60), (4,60)] ) ea1 = floatField() ea2 = floatField() ea3 = floatField() ea4 = floatField() eb1 = floatField() eb2 = floatField() eb3 = floatField() eb4 = floatField() ec1 = floatField() ec2 = floatField() ec3 = floatField() ec4 = floatField() ed1 = floatField() ed2 = floatField() ed3 = floatField() ed4 = floatField() setParent('..') setParent('..') frameLayout(cll=True, cl=False, label="Parent Inverse Matrix") parentInverseLayout = rowColumnLayout( numberOfColumns=4, columnWidth=[(1,60), (2,60), (3,60), (4,60)] ) fa1 = floatField() fa2 = floatField() fa3 = floatField() fa4 = floatField() fb1 = floatField() fb2 = floatField() fb3 = floatField() fb4 = floatField() fc1 = floatField() fc2 = floatField() fc3 = floatField() fc4 = floatField() fd1 = floatField() fd2 = floatField() fd3 = floatField() fd4 = floatField() setParent('..') setParent('..') showWindow(newWin) window(newWin, e=True, wh=(255, 715), title= (sel[0] + " viewer")) updateButton = button(l="update", command = "mtMatrixViewer()") counter = 0 matrixChildren = rowColumnLayout (matrixLayout, q=True, ca=True) for num in mtMatrix: floatField(matrixChildren[counter], e=True, value=num) counter = counter + 1 counter = 0 inverseChildren = rowColumnLayout(inverseLayout, q=True, ca=True) for num in inverseMatrix: floatField(inverseChildren[counter], e=True, value = num) counter = counter + 1 counter = 0 worldChildren = rowColumnLayout(worldLayout, q=True, ca=True) for num in worldMatrix: floatField(worldChildren[counter], e=True, value = num) counter = counter + 1 counter = 0 worldInverseChildren = rowColumnLayout(worldInverseLayout, q=True, ca=True) for num in worldInverseMatrix: floatField(worldInverseChildren[counter], e=True, value = num) counter = counter + 1 counter = 0 parentChildren = rowColumnLayout(parentLayout, q=True, ca=True) for num in parentMatrix: floatField(parentChildren[counter], e=True, value = num) counter = counter + 1 counter = 0 parentInverseChildren = rowColumnLayout(parentInverseLayout, q=True, ca=True) for num in parentInverseMatrix: floatField(parentInverseChildren[counter], e=True, value = num) counter = counter + 1 print "test" mtMatrixViewer()