コード例 #1
0
    def test_create_heirarchy(self):
        # Test on object with parent
        jnts = []
        jnts.append(pm.joint(p=(1, 1, 1)))
        jnts.append(pm.joint(p=(2, 2, 2)))
        crv = pm.circle()[0]
        pm.delete(pm.parentConstraint(jnts[-1], crv, mo=0))
        pm.parent(crv, jnts[-1])

        grps = control.create_heirarchy('temp', crv, 5)

        count = 0
        for g in grps:
            self.assertTrue(
                transforms.assertLocationsMatch(g, crv))
            self.assertTrue(
                transforms.assertDefaultScale(g))
            if count > 0:
                self.assertTrue(
                    transforms.assertAllZero(g))
                self.assertTrue(
                    transforms.assertParentIs(g, grps[count-1]))
            count += 1

        self.assertEqual(grps[0].name(), 'temp_top_node')
        self.assertEqual(grps[-1].name(), 'temp_btm_node')
        self.assertTrue(transforms.assertParentIs(crv,
                                                  grps[-1]))
        self.assertTrue(transforms.assertParentIs(grps[0],
                                                  jnts[-1]))
        self.assertTrue(transforms.assertAllZero(crv))
        self.assertTrue(transforms.assertDefaultScale(crv))
コード例 #2
0
 def test_assertDefaultScale(self):
     self.assertTrue(transforms.assertDefaultScale(self.joints[0]))
     self.joints[0].sx.set(2)
     self.assertFalse(transforms.assertDefaultScale(self.joints[0]))
     self.joints[0].sx.set(1)
     self.joints[0].sy.set(2)
     self.assertFalse(transforms.assertDefaultScale(self.joints[0]))
     self.joints[0].sy.set(1)
     self.joints[0].sz.set(2)
     self.assertFalse(transforms.assertDefaultScale(self.joints[0]))
コード例 #3
0
 def test_assertDefaultScale(self):
     self.assertTrue(transforms.assertDefaultScale(self.joints[0]))
     self.joints[0].sx.set(2)
     self.assertFalse(transforms.assertDefaultScale(self.joints[0]))
     self.joints[0].sx.set(1)
     self.joints[0].sy.set(2)
     self.assertFalse(transforms.assertDefaultScale(self.joints[0]))
     self.joints[0].sy.set(1)
     self.joints[0].sz.set(2)
     self.assertFalse(transforms.assertDefaultScale(self.joints[0]))