mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-05 04:12:15 +02:00
[ui] GraphEditor: select pipelines imported through the node menu
Add all the nodes from a pipeline imported through the node menu to the node selection. This involves changing the return value of ImportProjectCommand from a boolean to a list of imported nodes.
This commit is contained in:
parent
9d88ad91d5
commit
6a36da61cf
3 changed files with 6 additions and 4 deletions
|
@ -245,7 +245,7 @@ class ImportProjectCommand(GraphCommand):
|
||||||
else:
|
else:
|
||||||
self.graph.node(node.name).position = Position(node.x, node.y + lowestY + self.yOffset)
|
self.graph.node(node.name).position = Position(node.x, node.y + lowestY + self.yOffset)
|
||||||
|
|
||||||
return status
|
return importedNodes
|
||||||
|
|
||||||
def undoImpl(self):
|
def undoImpl(self):
|
||||||
for nodeName in self.importedNames:
|
for nodeName in self.importedNames:
|
||||||
|
|
|
@ -353,8 +353,8 @@ class UIGraph(QObject):
|
||||||
self.setGraph(g)
|
self.setGraph(g)
|
||||||
return status
|
return status
|
||||||
|
|
||||||
@Slot(QUrl, result=bool)
|
@Slot(QUrl, result="QVariantList")
|
||||||
@Slot(QUrl, QPoint, result=bool)
|
@Slot(QUrl, QPoint, result="QVariantList")
|
||||||
def importProject(self, filepath, position=None):
|
def importProject(self, filepath, position=None):
|
||||||
if isinstance(filepath, (QUrl)):
|
if isinstance(filepath, (QUrl)):
|
||||||
# depending how the QUrl has been initialized,
|
# depending how the QUrl has been initialized,
|
||||||
|
|
|
@ -234,7 +234,9 @@ Item {
|
||||||
{
|
{
|
||||||
if (MeshroomApp.pipelineTemplateNames.includes(pipeline)) {
|
if (MeshroomApp.pipelineTemplateNames.includes(pipeline)) {
|
||||||
var url = MeshroomApp.pipelineTemplateFiles[MeshroomApp.pipelineTemplateNames.indexOf(pipeline)]["path"]
|
var url = MeshroomApp.pipelineTemplateFiles[MeshroomApp.pipelineTemplateNames.indexOf(pipeline)]["path"]
|
||||||
uigraph.importProject(Filepath.stringToUrl(url), spawnPosition)
|
var nodes = uigraph.importProject(Filepath.stringToUrl(url), spawnPosition)
|
||||||
|
uigraph.selectedNode = nodes[0]
|
||||||
|
uigraph.selectNodes(nodes)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue