def readSimulationDataPath(self, choosenDir): try: tmpProjectName = FluidExplorerUtils.readAttributeFromXmlConfigurationsFile(choosenDir, "ProjectName") tmpProjectPath = FluidExplorerUtils.readAttributeFromXmlConfigurationsFile(choosenDir, "ProjectPath") except: return "" path = tmpProjectPath + "/" + tmpProjectName return path
def checkIfFluidNodeExistsInScene(self, choosenFile): tmpFluidNodeName = FluidExplorerUtils.readAttributeFromXmlConfigurationsFile(choosenFile, "FluidBoxName") self.lgr.info("Fluid container name from the settings file: %s", tmpFluidNodeName) if cmds.objExists(tmpFluidNodeName): return [True, ""] else: return [ False, "Cannot find the specified Fluid Container in the opened project!\n" "Please check if the the node '" + tmpFluidNodeName + "' exists.", ]
def checkPrjRoot(self, choosenDir, currentScene): isSameScene = True isNumberOk = True canReadConfigFile = True try: tmpSimulationName = FluidExplorerUtils.readAttributeFromXmlConfigurationsFile(choosenDir, "ProjectName") tmpPath = FluidExplorerUtils.readAttributeFromXmlConfigurationsFile(choosenDir, "MayaFilePath") self.lgr.info("Path of the maya file to load: %s", tmpSimulationName) except: canReadConfigFile = False errorText = "An error occured while loading the project configuration file!" return [canReadConfigFile, isNumberOk, isSameScene, errorText] if tmpSimulationName == "" or tmpSimulationName == None: canReadConfigFile = False errorText = "An error occured while loading the project configuration file!\nProperty: 'MayaFilePath'" return [canReadConfigFile, isNumberOk, isSameScene, errorText] # Check if same scene opened tmpSimulationName_low = tmpSimulationName.lower() # currentScene_low = currentScene.lower() currentScene_low = self.getPrpjectNameFromString(currentScene).lower() if tmpSimulationName_low != currentScene_low: isSameScene = False errorTxt = ( "Please load the correct maya scene file first!\nProject name: " + tmpSimulationName + "\nProject path: " + tmpPath ) return [canReadConfigFile, isNumberOk, isSameScene, errorTxt] return [canReadConfigFile, isNumberOk, isSameScene, ""]