Skip to content

Commit

Permalink
Merge pull request #1521 from alicevision/fix/batch
Browse files Browse the repository at this point in the history
Fix meshroom_batch
  • Loading branch information
fabiencastan authored Sep 13, 2021
2 parents 1a9692d + 5301104 commit 2a6bca3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
4 changes: 3 additions & 1 deletion meshroom/core/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,9 @@ def findNode(self, nodeExpr):
return candidates[0]

def findNodes(self, nodesExpr):
return [self.findNode(nodeName) for nodeName in nodesExpr]
if isinstance(nodesExpr, list):
return [self.findNode(nodeName) for nodeName in nodesExpr]
return [self.findNode(nodesExpr)]

def edge(self, dstAttributeName):
return self._edges.get(dstAttributeName)
Expand Down
10 changes: 5 additions & 5 deletions meshroom/core/taskManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def checkNodesDependencies(self, graph, toNodes, context):
raise ValueError("Argument 'context' must be: 'COMPUTATION' or 'SUBMITTING'")

if len(ready) + len(computed) != len(toNodes):
toNodes.clear()
del toNodes[:] # for python 2 compatibility, else use: toNodes.clear()
toNodes.extend(ready)
return False

Expand All @@ -367,7 +367,7 @@ def raiseImpossibleProcess(self, context):
raise RuntimeError("[{}] Impossible Process:\n"
"There is no node able to be processed.".format(context))

def submit(self, graph=None, submitter=None, toNodes=None):
def submit(self, graph, submitter=None, toNodes=None):
"""
Nodes are send to the renderfarm
:param graph:
Expand Down Expand Up @@ -395,6 +395,7 @@ def submit(self, graph=None, submitter=None, toNodes=None):

# Update task manager's lists
self.updateNodes()
graph.update()

# Check dependencies of toNodes
if not toNodes:
Expand Down Expand Up @@ -440,8 +441,7 @@ def submitFromFile(self, graphFile, submitter, toNode=None):
Submit the given graph via the given submitter.
"""
graph = meshroom.core.graph.loadGraph(graphFile)
toNodes = graph.findNodes([toNode]) if toNode else None
self.submit(graph, submitter, toNodes)
self.submit(graph, submitter, toNode)

def getAlreadySubmittedChunks(self, nodes):
"""
Expand All @@ -458,4 +458,4 @@ def getAlreadySubmittedChunks(self, nodes):
return out

nodes = Property(BaseObject, lambda self: self._nodes, constant=True)
restartRequested = Signal()
restartRequested = Signal()
2 changes: 1 addition & 1 deletion meshroom/nodes/aliceVision/CameraInit.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def createViewpointsFile(self, node, additionalViews=()):
"featureFolder": "",
"matchingFolder": "",
}
node.viewpointsFile = (node.nodeDesc.internalFolder + '/viewpoints.sfm').format(**node._cmdVars)
node.viewpointsFile = os.path.join(node.nodeDesc.internalFolder, 'viewpoints.sfm').format(**node._cmdVars)
with open(node.viewpointsFile, 'w') as f:
json.dump(sfmData, f, indent=4)

Expand Down
5 changes: 0 additions & 5 deletions meshroom/ui/qml/ImageGallery/ImageGallery.qml
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,6 @@ Panel {
sortedModel.filterValue = value
grid.updateCurrentIndexFromSelectionViewId()
grid.updateSelectedViewFromGrid = true
}
onFilterRoleChanged: {
grid.makeCurrentItemVisible()
}
onFilterValueChanged: {
grid.makeCurrentItemVisible()
}

Expand Down

0 comments on commit 2a6bca3

Please sign in to comment.