Пример #1
0
		def loadBlueprintData(self, modules = None):
			"""
				Loads blueprint data onto blueprinter
			"""
			if modules == None:
				modules = self.getModules()
			
			# open file from path in UI
			self.UI.getFilePath()
			for module in modules:
				# Load transforms
				filePath = (str(self.UI.filePath) + module + "BlueprintData.txt")
				Util.loadTransforms(filePath)
				# Load Attributeibutes
			print ("Blueprint data loaded")
Пример #2
0
		def loadRigData(self):
			"""
				Load registered rig data
			"""
			# open file from path in UI
			self.UI.getFilePath()
			filePath = (str(self.UI.filePath) + "rigData.txt")
			FILE = open(filePath,"rU")
			lineArray = FILE.readlines()
			FILE.close()
			
			fileIndice = 0
			startModuleIndice = 0
			endModuleIndice = 0
			fileSize = len(lineArray)
			
			while fileIndice < fileSize:
				module = lineArray[fileIndice].strip()
				startModuleIndice = fileIndice
				endModuleIndice = Util.readRigNextModule(fileIndice, lineArray)
				connections = Util.readRigConnectionData(startModuleIndice, endModuleIndice , lineArray)
				registeredAttr = Util.readRigRegisteredAttr(startModuleIndice, endModuleIndice , lineArray)
				fileIndice = endModuleIndice
				
				# Load registered Attr data
				for regAttr in registeredAttr:
					if regAttr.split(".")[1] == "regRigShape":
						regShapeFilePath = (str(self.UI.filePath) + module + "RigShapeData.txt")
						Util.loadShapes(regShapeFilePath)
					if regAttr.split(".")[1] == "regRigTransform":
						regTransFilePath = (str(self.UI.filePath) + module + "RigTransData.txt")
						Util.loadTransforms(regTransFilePath)
				
				# Create connections
				for connection in connections:
					print connection
					connectionKey = Util.getValueFromDataString(connection, "connectionKey")
					inputPlug = Util.getValueFromDataString(connection, "input")
					outputPlug = Util.getValueFromDataString(connection, "output")
					type = Util.getValueFromDataString(connection, "type")
					Attribute = Util.getValueFromDataString(connection, "attr")
					
					self.Modules[module].storeConnection(connectionKey, inputPlug, outputPlug , type, Attribute)
					self.createConnection(module, connectionKey)
			
			print ("Loaded blueprint data from : " + filePath)