示例#1
0
    def writeData(self, id, assetName, user, assetPath, matteIdDict):
        # data structure
        '''
		dictInfo = {0: {'assetName': 'defaultAsset', 'assetPath': assetPath, matteId': {
					1: {'vrayMtl': 'vrayMtl1', 'color': 'red', 'multiMatte': 'Matte01'}, 
					2: {'vrayMtl': 'vrayMtl2', 'color': 'red', 'multiMatte': 'Matte02'}}}}
		'''

        # assign current data
        writeBackData = self.readDatabase()

        writeBackData.update({
            id: {
                'assetName': assetName,
                'assetPath': assetPath,
                'user': user,
                'matteId': matteIdDict
            }
        })

        dbPath = self.getDbPath()

        result = fileUtils.ymlDumper(dbPath, writeBackData)

        return result
示例#2
0
    def createDefaultDatabase(self, dbPath):
        dictInfo = {
            0: {
                'assetName': 'defaultAsset',
                'user': '******',
                'assetPath': '-',
                'matteId': {
                    1: {
                        'vrayMtl': 'vrayMtl1',
                        'color': 'red',
                        'multiMatte': 'Matte01'
                    },
                    2: {
                        'vrayMtl': 'vrayMtl2',
                        'color': 'red',
                        'multiMatte': 'Matte02'
                    }
                }
            }
        }
        dirname = os.path.dirname(dbPath)

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

        result = fileUtils.ymlDumper(dbPath, dictInfo)

        return result
示例#3
0
    def removeData(self, id):
        currentData = self.readDatabase()
        dbPath = self.getDbPath()

        if id in currentData.keys():
            del currentData[id]

            result = fileUtils.ymlDumper(dbPath, currentData)

            return result
示例#4
0
    def removeData(self, id):
        currentData = self.readDatabase()
        dbPath = self.getDbPath()

        if id in currentData.keys():
            del currentData[id]

            result = fileUtils.ymlDumper(dbPath, currentData)

            return result
示例#5
0
	def createDefaultDatabase(self, dbPath) : 
		dictInfo = {0: {'assetName': 'defaultAsset', 'user': '******', 'assetPath': '-', 
					'matteId': {
							1: {'vrayMtl': 'vrayMtl1', 'color': 'red', 'multiMatte': 'Matte01'}, 
							2: {'vrayMtl': 'vrayMtl2', 'color': 'red', 'multiMatte': 'Matte02'}
								}
						
						}
					}
		dirname = os.path.dirname(dbPath)

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

		result = fileUtils.ymlDumper(dbPath, dictInfo)

		return result
示例#6
0
    def writeData(self, id, assetName, user, assetPath):
        # data structure
        """
		dictInfo = {0: {'assetName': 'defaultAsset', 'assetPath': assetPath, matteId': {
					1: {'vrayMtl': 'vrayMtl1', 'color': 'red', 'multiMatte': 'Matte01'}, 
					2: {'vrayMtl': 'vrayMtl2', 'color': 'red', 'multiMatte': 'Matte02'}}}}
		"""

        # assign current data
        writeBackData = self.readDatabase()

        writeBackData.update({id: {"assetName": assetName, "assetPath": assetPath, "user": user}})

        dbPath = self.getDbPath()

        result = fileUtils.ymlDumper(dbPath, writeBackData)

        return result
示例#7
0
    def createDefaultDatabase(self, dbPath):
        dictInfo = {
            0: {
                "assetName": "defaultAsset",
                "user": "******",
                "assetPath": "-",
                "matteId": {
                    1: {"vrayMtl": "vrayMtl1", "color": "red", "multiMatte": "Matte01"},
                    2: {"vrayMtl": "vrayMtl2", "color": "red", "multiMatte": "Matte02"},
                },
            }
        }
        dirname = os.path.dirname(dbPath)

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

        result = fileUtils.ymlDumper(dbPath, dictInfo)

        return result