Пример #1
0
	def addAssetLog(self, namespace, cacheGrp) : 
		path = setting.cachePathInfo()
		assetLogPath = path['assetLogPath']
		assetPath = str(hook.getReferencePath(cacheGrp))
		timeInfo = hook.getShotRange()
		startFrame = timeInfo[0]
		endFrame = timeInfo[1]
		namespace = str(namespace)

		data = dict()
		assetData = dict() 

		if os.path.exists(assetLogPath) : 
			data = fileUtils.ymlLoader(assetLogPath)

		if 'asset' in data.keys() : 
			if namespace in data['asset'].keys() : 
				data['asset'][namespace] = assetPath

			else : 
				data['asset'].update({namespace: assetPath})

		else : 
			data.update({'asset': {namespace: assetPath}})

		if 'duration' in data.keys() : 
			data['duration'].update({'startFrame': startFrame, 'endFrame': endFrame})

		else : 
			data.update({'duration': {'startFrame': startFrame, 'endFrame': endFrame}})

		self.writeData(assetLogPath, data)
Пример #2
0
	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')
Пример #3
0
    def addAssetLog(self, namespace, cacheGrp):
        path = setting.cachePathInfo()
        assetLogPath = path['assetLogPath']
        assetPath = str(hook.getReferencePath(cacheGrp))
        timeInfo = hook.getShotRange()
        startFrame = timeInfo[0]
        endFrame = timeInfo[1]
        namespace = str(namespace)

        data = dict()
        assetData = dict()

        if os.path.exists(assetLogPath):
            data = fileUtils.ymlLoader(assetLogPath)

        if 'asset' in data.keys():
            if namespace in data['asset'].keys():
                data['asset'][namespace] = assetPath

            else:
                data['asset'].update({namespace: assetPath})

        else:
            data.update({'asset': {namespace: assetPath}})

        if 'duration' in data.keys():
            data['duration'].update({
                'startFrame': startFrame,
                'endFrame': endFrame
            })

        else:
            data.update(
                {'duration': {
                    'startFrame': startFrame,
                    'endFrame': endFrame
                }})

        self.writeData(assetLogPath, data)
Пример #4
0
    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')