Esempio n. 1
0
	def setCameraList(self) : 
		sequencerName = self.shot
		cameraName = '%s_cam' % self.shot 

		if hook.objectExists(sequencerName) and hook.objectExists(cameraName) : 
			self.ui.camera_lineEdit.setText(sequencerName)
			self.ui.camera_lineEdit.setEnabled(False)
			self.ui.exportCam_pushButton.setEnabled(True)

		else : 
			self.ui.camera_lineEdit.setText('Error!! No camera or shot sequencer found')
			self.ui.exportCam_pushButton.setEnabled(False)
			self.ui.camera_lineEdit.setStyleSheet("color: rgb(255, 0, 0);")
Esempio n. 2
0
    def setCameraList(self):
        sequencerName = self.shot
        cameraName = '%s_cam' % self.shot

        if hook.objectExists(sequencerName) and hook.objectExists(cameraName):
            self.ui.camera_lineEdit.setText(sequencerName)
            self.ui.camera_lineEdit.setEnabled(False)
            self.ui.exportCam_pushButton.setEnabled(True)

        else:
            self.ui.camera_lineEdit.setText(
                'Error!! No camera or shot sequencer found')
            self.ui.exportCam_pushButton.setEnabled(False)
            self.ui.camera_lineEdit.setStyleSheet("color: rgb(255, 0, 0);")
Esempio n. 3
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')
Esempio n. 4
0
	def setAssetInfo(self) : 
		logger.debug('Collecting asset ...')

		# get all reference assets 
		assets = pipelineTools.getAllAssets()

		# get data path 
		increment = self.ui.increment_checkBox.isChecked()

		# increment True = version up, increment Fase = latest version
		cachePathInfo = self.getCachePathInfo(increment)

		if cachePathInfo : 
			# this data store user custom cache and noncache list, then override default list.
			dataPath = cachePathInfo['dataPath']
			data = self.loadData(dataPath)

			if assets : 
				for each in assets : 
					namespace = each.split(':')[0]
					exportGrp = '%s:%s' % (namespace, self.cacheGrp)

					# get asset's attribute
					attrInfo = pipelineTools.getAssetAttr(each)
					status = ''

					logger.debug(each)

					if attrInfo : 
						assetType = attrInfo['assetType']

						if data : 
							if each in data.keys() : 
								status = data[each]['status']

						# if type in type list, put in cahce list 
						if assetType in self.cacheAssetTypeList : 
							if not status : 
								status = 'cache'

						# else, put in nonCache list 
						else : 
							if not status : 
								status = 'nonCache'

					
					# check if asset really exists
					if hook.objectExists(exportGrp) : 
						if not each in self.assetInfo.keys() : 
							self.assetInfo[each] = {'namespace': namespace, 'cacheGrp': exportGrp, 'rigGrp': each, 'attr': attrInfo, 'status': status, 'type': self.normalAsset}

						else : 
							self.assetInfo.update({each: {'namespace': namespace, 'cacheGrp': exportGrp, 'rigGrp': each, 'attr': attrInfo, 'status': status, 'type': self.normalAsset}})

					else : 
						logger.warning('%s not found!!' % exportGrp)
Esempio n. 5
0
	def setNoncacheList(self) : 
		if self.getCachePathInfo(True) : 
			nonCacheFile = self.getCachePathInfo(True)['nonCacheDataPath']
			bgColor = [0, 20, 60]
			text3 = ''

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

				if 'nonCache' in data.keys() : 
					for each in data['nonCache'] : 
						if not hook.objectExists(each) : 
							bgColor = [100, 20, 20]
							text3 = 'not exists'

						self.addNonCacheListWidget(each, self.nonCacheAsset, text3, bgColor, self.rdyIcon, self.iconSize)
Esempio n. 6
0
    def setNoncacheList(self):
        if self.getCachePathInfo(True):
            nonCacheFile = self.getCachePathInfo(True)['nonCacheDataPath']
            bgColor = [0, 20, 60]
            text3 = ''

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

                if 'nonCache' in data.keys():
                    for each in data['nonCache']:
                        if not hook.objectExists(each):
                            bgColor = [100, 20, 20]
                            text3 = 'not exists'

                        self.addNonCacheListWidget(each, self.nonCacheAsset,
                                                   text3, bgColor,
                                                   self.rdyIcon, self.iconSize)
Esempio n. 7
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')
Esempio n. 8
0
    def setAssetInfo(self):
        logger.debug('Collecting asset ...')

        # get all reference assets
        assets = pipelineTools.getAllAssets()

        # get data path
        increment = self.ui.increment_checkBox.isChecked()

        # increment True = version up, increment Fase = latest version
        cachePathInfo = self.getCachePathInfo(increment)

        if cachePathInfo:
            # this data store user custom cache and noncache list, then override default list.
            dataPath = cachePathInfo['dataPath']
            data = self.loadData(dataPath)

            if assets:
                for each in sorted(assets):
                    namespace = each.split(':')[0]
                    exportGrp = '%s:%s' % (namespace, self.cacheGrp)

                    # get asset's attribute
                    attrInfo = pipelineTools.getAssetAttr(each)
                    status = ''

                    logger.debug(each)

                    if attrInfo:
                        assetType = attrInfo['assetType']

                        if data:
                            if each in data.keys():
                                status = data[each]['status']

                        # if type in type list, put in cahce list
                        if assetType in self.cacheAssetTypeList:
                            if not status:
                                status = 'cache'

                        # else, put in nonCache list
                        else:
                            if not status:
                                status = 'nonCache'

                    # check if asset really exists
                    if hook.objectExists(exportGrp):
                        if not each in self.assetInfo.keys():
                            self.assetInfo[each] = {
                                'namespace': namespace,
                                'cacheGrp': exportGrp,
                                'rigGrp': each,
                                'attr': attrInfo,
                                'status': status,
                                'type': self.normalAsset
                            }

                        else:
                            self.assetInfo.update({
                                each: {
                                    'namespace': namespace,
                                    'cacheGrp': exportGrp,
                                    'rigGrp': each,
                                    'attr': attrInfo,
                                    'status': status,
                                    'type': self.normalAsset
                                }
                            })

                    else:
                        logger.warning('%s not found!!' % exportGrp)