Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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