def testStaticLocatorRW(self):

        name = createLocator()

        # write to file
        self.__files.append(util.expandFileName('testStaticLocatorRW.abc'))
        MayaCmds.AbcExport(j='-root %s -file %s' % (name[0], self.__files[-1]))

        # read from file
        MayaCmds.AbcImport(self.__files[-1], mode='import')
        locatorList = MayaCmds.ls(type='locator')
        self.failUnless(util.compareLocator(locatorList[0], locatorList[1]))
Exemplo n.º 2
0
    def testStaticLocatorRW(self):

        name = createLocator()

        # write to file
        self.__files.append(util.expandFileName('testStaticLocatorRW.abc'))
        MayaCmds.AbcExport(j='-root %s -file %s' % (name[0], self.__files[-1]))

        # read from file
        MayaCmds.AbcImport(self.__files[-1], mode='import')
        locatorList = MayaCmds.ls(type='locator')
        self.failUnless(util.compareLocator(locatorList[0], locatorList[1]))
Exemplo n.º 3
0
    def testAnimLocatorRW(self):

        name = createLocator()

        MayaCmds.currentTime(1, update=True)
        MayaCmds.setKeyframe(name[1], attribute='localPositionX')
        MayaCmds.setKeyframe(name[1], attribute='localPositionY')
        MayaCmds.setKeyframe(name[1], attribute='localPositionZ')
        MayaCmds.setKeyframe(name[1], attribute='localScaleX')
        MayaCmds.setKeyframe(name[1], attribute='localScaleY')
        MayaCmds.setKeyframe(name[1], attribute='localScaleZ')
        MayaCmds.currentTime(24, update=True)
        MayaCmds.setKeyframe(name[1], attribute='localPositionX', value=0.0)
        MayaCmds.setKeyframe(name[1], attribute='localPositionY', value=0.0)
        MayaCmds.setKeyframe(name[1], attribute='localPositionZ', value=0.0)
        MayaCmds.setKeyframe(name[1], attribute='localScaleX', value=1.0)
        MayaCmds.setKeyframe(name[1], attribute='localScaleY', value=1.0)
        MayaCmds.setKeyframe(name[1], attribute='localScaleZ', value=1.0)

        self.__files.append(util.expandFileName('testAnimLocatorRW.abc'))
        self.__files.append(util.expandFileName('testAnimLocatorRW01_14.abc'))
        self.__files.append(util.expandFileName('testAnimLocatorRW15-24.abc'))

        # write to files
        MayaCmds.AbcExport(j='-fr 1 14 -root %s -file %s' %
                           (name[0], self.__files[-2]))
        MayaCmds.AbcExport(j='-fr 15 24 -root %s -file %s' %
                           (name[0], self.__files[-1]))

        subprocess.call(self.__abcStitcher + self.__files[-3:])

        # read from file
        MayaCmds.AbcImport(self.__files[-3], mode='import')
        locatorList = MayaCmds.ls(type='locator')

        for t in range(1, 25):
            MayaCmds.currentTime(t, update=True)
            if not util.compareLocator(locatorList[0], locatorList[1]):
                self.fail('%s and %s are not the same at frame %d' %
                          (locatorList[0], locatorList[1], t))
    def testAnimLocatorRW(self):

        name = createLocator()

        MayaCmds.currentTime(1, update=True)
        MayaCmds.setKeyframe(name[1], attribute='localPositionX')
        MayaCmds.setKeyframe(name[1], attribute='localPositionY')
        MayaCmds.setKeyframe(name[1], attribute='localPositionZ')
        MayaCmds.setKeyframe(name[1], attribute='localScaleX')
        MayaCmds.setKeyframe(name[1], attribute='localScaleY')
        MayaCmds.setKeyframe(name[1], attribute='localScaleZ')
        MayaCmds.currentTime(24, update=True)
        MayaCmds.setKeyframe(name[1], attribute='localPositionX', value=0.0)
        MayaCmds.setKeyframe(name[1], attribute='localPositionY', value=0.0)
        MayaCmds.setKeyframe(name[1], attribute='localPositionZ', value=0.0)
        MayaCmds.setKeyframe(name[1], attribute='localScaleX', value=1.0)
        MayaCmds.setKeyframe(name[1], attribute='localScaleY', value=1.0)
        MayaCmds.setKeyframe(name[1], attribute='localScaleZ', value=1.0)

        self.__files.append(util.expandFileName('testAnimLocatorRW.abc'))
        self.__files.append(util.expandFileName('testAnimLocatorRW01_14.abc'))
        self.__files.append(util.expandFileName('testAnimLocatorRW15-24.abc'))

        # write to files
        MayaCmds.AbcExport(j='-fr 1 14 -root %s -file %s' % (name[0], self.__files[-2]))
        MayaCmds.AbcExport(j='-fr 15 24 -root %s -file %s' % (name[0], self.__files[-1]))

        subprocess.call(self.__abcStitcher + self.__files[-3:])

        # read from file
        MayaCmds.AbcImport(self.__files[-3], mode='import')
        locatorList = MayaCmds.ls(type='locator')

        for t in range(1, 25):
            MayaCmds.currentTime(t, update=True)
            if not util.compareLocator(locatorList[0], locatorList[1]):
                self.fail('%s and %s are not the same at frame %d' %
                    (locatorList[0], locatorList[1], t))