Exemplo n.º 1
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)