mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-21 21:16:29 +02:00
Import a scene from an .mg file into the current graph
Add an "Import Scene" (Ctrl+Shift+I) option in the File menu that allows to select an existing .mg file and import it in the current graph. The imported scene will automatically be placed below the lowest existing node along the Y axis.
This commit is contained in:
parent
ede24713d0
commit
a33f79e4d7
4 changed files with 159 additions and 3 deletions
|
@ -353,6 +353,19 @@ class UIGraph(QObject):
|
|||
self.setGraph(g)
|
||||
return status
|
||||
|
||||
@Slot(QUrl, result=bool)
|
||||
def importScene(self, filepath):
|
||||
if isinstance(filepath, (QUrl)):
|
||||
# depending how the QUrl has been initialized,
|
||||
# toLocalFile() may return the local path or an empty string
|
||||
localFile = filepath.toLocalFile()
|
||||
if not localFile:
|
||||
localFile = filepath.toString()
|
||||
else:
|
||||
localFile = filepath
|
||||
yOffset = self.layout.gridSpacing + self.layout.nodeHeight
|
||||
return self.push(commands.ImportSceneCommand(self._graph, localFile, yOffset=yOffset))
|
||||
|
||||
@Slot(QUrl)
|
||||
def saveAs(self, url):
|
||||
if isinstance(url, (str)):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue