Beispiel #1
0
    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))
Beispiel #2
0
 def setUp(self):
     deleteSceneNodes()
     Chain.resetCount()
     Rigger.resetCount()
     self.joints = createSceneJoints()
     self.chainName = "newChain"
     self.chain = Chain(self.joints, name=self.chainName)
Beispiel #3
0
    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)
Beispiel #4
0
 def tearDown(self):
     deleteSceneNodes()
     Chain.resetCount()
Beispiel #5
0
 def tearDownClass(cls):
     deleteSceneNodes()
Beispiel #6
0
 def setUpClass(cls):
     deleteSceneNodes()
     cmds.createNode("transform", name="parent")
     cmds.createNode("transform", name="child")
Beispiel #7
0
 def tearDown(self):
     deleteSceneNodes()
     pass
Beispiel #8
0
 def setUp(self):
     deleteSceneNodes()
     cmds.polyCube(name="box")
     self.transform = Transform("box")