示例#1
0
 def changeNodeProperty(self, number, property, value):
     print "change node %s %s to %s" % (number, property, value)
     tree = RS.read_xml(xml_file)
     root = tree.getroot()
     allNodes = RS.find_nodes(root)
     currentNode = RS.get_node_by_keyvalue(allNodes,
                                           {"number": "%s" % number})
     RS.change_node_properties(currentNode, {"%s" % property: "%s" % value})
     RS.write_xml(tree, xml_file)
示例#2
0
def getFilePath(n):
    tree = RS.read_xml(xml_file)
    root = tree.getroot()
    allNodes = RS.find_nodes(root)
    currentNode = None
    for node in allNodes:
        if node.get("number") == str(n):
            currentNode = node
    if currentNode != None:
        fileName = currentNode.get("fileName")
        filePath = os.path.split(fileName)[0]
        return filePath
示例#3
0
def getAllFrames(n):
    tree = RS.read_xml(xml_file)
    root = tree.getroot()
    allNodes = RS.find_nodes(root)
    currentNode = None
    for node in allNodes:
        if node.get("number") == str(n):
            currentNode = node
    if currentNode != None:
        inout = [
            str(i) for i in range(int(currentNode.get("frameIn")),
                                  int(currentNode.get("frameOut")) +
                                  1, int(currentNode.get("frameInterval")))
        ]
        #print inout
        return inout
示例#4
0
def createCMDFromXml(n):
    tree = RS.read_xml(xml_file)
    root = tree.getroot()
    allNodes = RS.find_nodes(root)
    setting = RS.find_setting(root)
    currentNode = None
    for node in allNodes:
        if node.get("number") == str(n):
            currentNode = node
    if currentNode != None:
        cmdList = createCMDList(setting.get("executePath"),
                                setting.get("threads"),
                                currentNode.get("name"),
                                currentNode.get("nkPath"),
                                currentNode.get("frameIn"),
                                currentNode.get("frameOut"),
                                currentNode.get("frameInterval"),
                                currentNode.get("fileName"),
                                setting.get("multiRenderNum"))
        return cmdList
示例#5
0
 def loadNodesFromXml(self):
     tree = RS.read_xml(xml_file)
     root = tree.getroot()
     allNodes = RS.find_nodes(root)
     #print allNodes
     self.newList = []
     self.nodeList = []
     for node in allNodes:
         renderNode = RenderNode()
         renderNode.changeRenderProperty("number", node.get("number"))
         renderNode.changeRenderProperty("name", node.get("name"))
         renderNode.changeRenderProperty("nkPath", node.get("nkPath"))
         renderNode.changeRenderProperty("fileName", node.get("fileName"))
         renderNode.changeRenderProperty("frameIn", node.get("frameIn"))
         renderNode.changeRenderProperty("frameOut", node.get("frameOut"))
         renderNode.changeRenderProperty("frameInterval",
                                         node.get("frameInterval"))
         self.newList.append(renderNode.number)
         self.nodeList.append(renderNode)
     #print self.nodeList
     self.updateRenderInfo()