def switchMatchSpace(index, *args):
#get the obj and attr
obj = cmds.textFieldGrp(widgets["objTFG"], q=True, tx=True)
#print("switchMatch obj val :%s"%obj)
attr = "%s.follow"%obj
#get the space value that was selected? why?
#get the existing ws xform values of obj
ws1Pos = cmds.xform(obj, q=True, ws=True, t=True)
ws1Rot = cmds.xform(obj, q=True, ws=True, ro=True)
#(maybe also key it a frame before at previous value?)
#set and key the switch
cmds.setAttr("%s.follow"%obj, index)
#-------------setKey here?
#set the old ws xform of obj
ws2Pos = cmds.xform(obj, ws=True, t=ws1Pos)
ws2Rot = cmds.xform(obj, ws=True, ro=ws1Rot)
print("changed space of %s to index %s"%(obj,index))
#set and key the space
pass
评论列表
文章目录