def processXMLElementByGeometry(geometryOutput, xmlElement): "Process the xml element by geometryOutput." if geometryOutput == None: return geometryOutput = evaluate.getVector3ListsRecursively(geometryOutput) if 'target' in xmlElement.attributeDictionary and not evaluate.getEvaluatedBooleanDefault( False, 'copy', xmlElement): target = evaluate.getEvaluatedLinkValue( str(xmlElement.attributeDictionary['target']).strip(), xmlElement) if target.__class__.__name__ == 'XMLElement': target.removeChildrenFromIDNameParent() xmlElement = target if xmlElement.object != None: if xmlElement.parent.object != None: if xmlElement.object in xmlElement.parent.object.archivableObjects: xmlElement.parent.object.archivableObjects.remove( xmlElement.object) firstElement = None if len(geometryOutput) > 0: firstElement = geometryOutput[0] if firstElement.__class__ == list: if len(firstElement) > 1: path.convertXMLElementRenameByPaths(geometryOutput, xmlElement) else: path.convertXMLElementRename(firstElement, xmlElement) else: path.convertXMLElementRename(geometryOutput, xmlElement) path.processXMLElement(xmlElement)
def processXMLElementByGeometry(geometryOutput, xmlElement): "Process the xml element by geometryOutput." if geometryOutput == None: return geometryOutput = evaluate.getVector3ListsRecursively(geometryOutput) if 'target' in xmlElement.attributeDictionary and not evaluate.getEvaluatedBooleanDefault(False, 'copy', xmlElement): target = evaluate.getEvaluatedLinkValue(str(xmlElement.attributeDictionary['target']).strip(), xmlElement) if target.__class__.__name__ == 'XMLElement': target.removeChildrenFromIDNameParent() xmlElement = target if xmlElement.object != None: if xmlElement.parent.object != None: if xmlElement.object in xmlElement.parent.object.archivableObjects: xmlElement.parent.object.archivableObjects.remove(xmlElement.object) firstElement = None if len(geometryOutput) > 0: firstElement = geometryOutput[0] if firstElement.__class__ == list: if len(firstElement) > 1: path.convertXMLElementRenameByPaths(geometryOutput, xmlElement) else: path.convertXMLElementRename(firstElement, xmlElement) else: path.convertXMLElementRename(geometryOutput, xmlElement) path.processXMLElement(xmlElement)
def convertXMLElementRenameByPaths( geometryOutput, xmlElement, xmlProcessor ): "Convert the xml element to a group xml element and add paths." xmlElement.className = 'group' for geometryOutputChild in geometryOutput: pathElement = xml_simple_reader.XMLElement() pathElement.setParentAddToChildren(xmlElement) path.convertXMLElementRename( geometryOutputChild, pathElement, xmlProcessor )
def convertXMLElementRenameByPaths(geometryOutput, xmlElement, xmlProcessor): "Convert the xml element to a group xml element and add paths." xmlElement.className = 'group' for geometryOutputChild in geometryOutput: pathElement = xml_simple_parser.XMLElement().getByParent(xmlElement) path.convertXMLElementRename(geometryOutputChild, pathElement, xmlProcessor)
def processXMLElementByGeometry( geometryOutput, xmlElement, xmlProcessor ): "Process the xml element by geometryOutput." firstElement = None if len( geometryOutput ) > 0: firstElement = geometryOutput[ 0 ] if firstElement.__class__ == list: if len( firstElement ) > 1: group.convertXMLElementRenameByPaths( geometryOutput, xmlElement, xmlProcessor ) else: path.convertXMLElementRename( firstElement, xmlElement, xmlProcessor ) else: path.convertXMLElementRename( geometryOutput, xmlElement, xmlProcessor ) xmlProcessor.processXMLElement( xmlElement )