def test_createJoints(self): deleteSceneNodes() Chain.resetCount() self.joints = createSceneJoints() for jnt in self.joints: cmds.setAttr(jnt + ".rx", 20) self.chainName = "newChain" self.chain = Chain(self.joints, name=self.chainName) for index, chainJnt in enumerate(self.chain.getJoints()): name = self.chain.getName() result = "{}_joint_{}".format(name, index) self.assertEqual(chainJnt, result) for jnt, chainJnt in zip(self.joints, self.chain.getJoints()): chainTranslation = cmds.xform(chainJnt, query=True, ws=True, t=True) jntTranslation = cmds.xform(jnt, query=True, ws=True, t=True) for a, b in zip(jntTranslation, chainTranslation): self.assertEqual(round(a, 3), round(b, 3)) chainRotation = cmds.xform(chainJnt, query=True, ws=True, ro=True) jntRotation = cmds.xform(jnt, query=True, ws=True, ro=True) for a, b in zip(chainRotation, jntRotation): self.assertEqual(round(a, 3), round(b, 3))
def setUp(self): deleteSceneNodes() Chain.resetCount() Rigger.resetCount() self.joints = createSceneJoints() self.chainName = "newChain" self.chain = Chain(self.joints, name=self.chainName)
def setUp(self): deleteSceneNodes() parent = cmds.createNode("transform", name="parent") child = cmds.createNode("transform", name="child") cmds.parent(child, parent) cmds.xform(parent, translation=(10, 0, 0)) self.dag = SelectionList.getDagPath(child) self.fnTransform = om.MFnTransform(self.dag)
def tearDown(self): deleteSceneNodes() Chain.resetCount()
def tearDownClass(cls): deleteSceneNodes()
def setUpClass(cls): deleteSceneNodes() cmds.createNode("transform", name="parent") cmds.createNode("transform", name="child")
def tearDown(self): deleteSceneNodes() pass
def setUp(self): deleteSceneNodes() cmds.polyCube(name="box") self.transform = Transform("box")