コード例 #1
0
ファイル: app.py プロジェクト: myCodeTD/ptAlembic
	def doExportCamera(self) : 
		info = dict()
		logger.debug('def doExportCamera')

		path = setting.cachePathInfo()
		cameraPath = path['cameraPath']
		cameraInfoPath = path['cameraInfoPath']

		# timeline 
		timeRange = hook.getShotRange()
		startFrame = timeRange[0]
		endFrame = timeRange[1]

		# get sequencer to export 
		sequencerShot = self.shot
		logger.debug('   shot name %s' % sequencerShot)

		if hook.objectExists(sequencerShot) : 
			if not os.path.exists(os.path.dirname(cameraPath)) : 
				os.makedirs(os.path.dirname(cameraPath))

			hook.export(sequencerShot, cameraPath)
			self.ui.exportCam_pushButton.setEnabled(False)
			
			info.update({str(sequencerShot): {'startFrame': startFrame, 'endFrame': endFrame}})
			self.writeData(cameraInfoPath, info)
			
			logger.debug('   Export complete')

		else : 
			logger.debug('   Camera not exists')
コード例 #2
0
ファイル: app.py プロジェクト: myCodeTD/ptAlembic
	def doExportNonCache(self) : 
		nonCachePath = self.getCachePathInfo(True)['nonCachePath']

		listWidget = 'nonCache_listWidget'
		if self.ui.exportAll_checkBox.isChecked() : 
			items = self.getAllItems(listWidget)

		else : 
			items = self.getSelectedItems(listWidget)

		if not os.path.exists(nonCachePath) : 
			os.makedirs(nonCachePath)


		if items : 
			for i in range(len(items[0])) : 
				text1 = items[0][i]
				text2 = items[1][i]
				itemWidget = items[2][i]

				exportGrp = text2 
				fileName = text1 

				# if text2 is self.nonCacheAsset, use text1 as an exportGrp 
				if text2 == self.nonCacheAsset : 
					exportGrp = text1 
					fileName = text1.replace(':', '')

				exportFile = '%s/%s.ma' % (nonCachePath, fileName)
				result = hook.export(exportGrp, exportFile)
				itemWidget.setIcon(self.okIcon, self.iconSize)

				logger.debug(result)
				QtGui.QApplication.processEvents()
コード例 #3
0
ファイル: app.py プロジェクト: ChanonVilaiyuk/ptAlembic
    def doExportNonCache(self):
        nonCachePath = self.getCachePathInfo(True)['nonCachePath']

        listWidget = 'nonCache_listWidget'
        if self.ui.exportAll_checkBox.isChecked():
            items = self.getAllItems(listWidget)

        else:
            items = self.getSelectedItems(listWidget)

        if not os.path.exists(nonCachePath):
            os.makedirs(nonCachePath)

        if items:
            for i in range(len(items[0])):
                text1 = items[0][i]
                text2 = items[1][i]
                itemWidget = items[2][i]

                exportGrp = text2
                fileName = text1

                # if text2 is self.nonCacheAsset, use text1 as an exportGrp
                if text2 == self.nonCacheAsset:
                    exportGrp = text1
                    fileName = text1.replace(':', '')

                exportFile = '%s/%s.ma' % (nonCachePath, fileName)
                result = hook.export(exportGrp, exportFile)
                itemWidget.setIcon(self.okIcon, self.iconSize)

                logger.debug(result)
                QtGui.QApplication.processEvents()
コード例 #4
0
ファイル: app.py プロジェクト: ChanonVilaiyuk/ptAlembic
    def doExportCamera(self):
        info = dict()
        logger.debug('def doExportCamera')

        path = setting.cachePathInfo()
        cameraPath = path['cameraPath']
        cameraInfoPath = path['cameraInfoPath']

        # timeline
        timeRange = hook.getShotRange()
        startFrame = timeRange[0]
        endFrame = timeRange[1]

        # get sequencer to export
        sequencerShot = self.shot
        logger.debug('   shot name %s' % sequencerShot)

        if hook.objectExists(sequencerShot):
            if not os.path.exists(os.path.dirname(cameraPath)):
                os.makedirs(os.path.dirname(cameraPath))

            hook.export(sequencerShot, cameraPath)
            self.ui.exportCam_pushButton.setEnabled(False)

            info.update({
                str(sequencerShot): {
                    'startFrame': startFrame,
                    'endFrame': endFrame
                }
            })
            self.writeData(cameraInfoPath, info)

            logger.debug('   Export complete')

        else:
            logger.debug('   Camera not exists')
コード例 #5
0
ファイル: app.py プロジェクト: ChanonVilaiyuk/ptAlembic
    def doExportNonCache(self):
        nonCacheData = dict()
        nonCachePath = self.getCachePathInfo(True)['nonCachePath']
        nonCacheDataPath = self.getCachePathInfo(True)['nonCacheDataPath']

        listWidget = 'nonCache_listWidget'
        if self.ui.exportAll_checkBox.isChecked():
            items = self.getAllItems(listWidget)

        else:
            items = self.getSelectedItems(listWidget)

        if not os.path.exists(nonCachePath):
            os.makedirs(nonCachePath)

        if items:
            for i in range(len(items[0])):
                text1 = items[0][i]
                text2 = items[1][i]
                itemWidget = items[2][i]

                exportGrp = text2
                fileName = text1

                # if text2 is self.nonCacheAsset, use text1 as an exportGrp
                if text2 == self.nonCacheAsset:
                    exportGrp = text1
                    fileName = text1.replace(':', '')

                exportFile = '%s/%s.ma' % (nonCachePath, fileName)
                result = hook.export(exportGrp, exportFile)
                itemWidget.setIcon(self.okIcon, self.iconSize)

                # data
                nonCacheData.update({
                    str(fileName): {
                        'exportGrp': str(exportGrp),
                        'filePath': str(exportFile)
                    }
                })

                logger.debug(result)
                QtGui.QApplication.processEvents()

        # write data
        fileUtils.ymlDumper(nonCacheDataPath, nonCacheData)
        logger.debug('Write noncache data successfully')
コード例 #6
0
ファイル: app.py プロジェクト: myCodeTD/ptAlembic
	def doExportNonCache(self) : 
		nonCacheData = dict()
		nonCachePath = self.getCachePathInfo(True)['nonCachePath']
		nonCacheDataPath = self.getCachePathInfo(True)['nonCacheDataPath']

		listWidget = 'nonCache_listWidget'
		if self.ui.exportAll_checkBox.isChecked() : 
			items = self.getAllItems(listWidget)

		else : 
			items = self.getSelectedItems(listWidget)

		if not os.path.exists(nonCachePath) : 
			os.makedirs(nonCachePath)


		if items : 
			for i in range(len(items[0])) : 
				text1 = items[0][i]
				text2 = items[1][i]
				itemWidget = items[2][i]

				exportGrp = text2 
				fileName = text1 

				# if text2 is self.nonCacheAsset, use text1 as an exportGrp 
				if text2 == self.nonCacheAsset : 
					exportGrp = text1 
					fileName = text1.replace(':', '')

				exportFile = '%s/%s.ma' % (nonCachePath, fileName)
				result = hook.export(exportGrp, exportFile)
				itemWidget.setIcon(self.okIcon, self.iconSize)

				# data 
				nonCacheData.update({str(fileName): {'exportGrp': str(exportGrp), 'filePath': str(exportFile)}})

				logger.debug(result)
				QtGui.QApplication.processEvents()

		# write data
		fileUtils.ymlDumper(nonCacheDataPath, nonCacheData)
		logger.debug('Write noncache data successfully')