mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Handle finished signal for the ReadMeshJob started from command line args
This puts the actual mesh into the scene rather than just loading it and discarding it afterwards. Now file arguments supplied to the application actually work. Fixes "Open With" on Windows and the related Asana issue.
This commit is contained in:
parent
f57d2693fe
commit
a53e56e282
1 changed files with 13 additions and 0 deletions
|
@ -162,6 +162,7 @@ class CuraApplication(QtApplication):
|
|||
|
||||
for file in self.getCommandLineOption("file", []):
|
||||
job = ReadMeshJob(os.path.abspath(file))
|
||||
job.finished.connect(self._onFileLoaded)
|
||||
job.start()
|
||||
|
||||
self.exec_()
|
||||
|
@ -447,3 +448,15 @@ class CuraApplication(QtApplication):
|
|||
def _onMessageActionTriggered(self, message, action):
|
||||
if action == "eject":
|
||||
self.getStorageDevice("LocalFileStorage").ejectRemovableDrive(message._sdcard)
|
||||
|
||||
def _onFileLoaded(self, job):
|
||||
mesh = job.getResult()
|
||||
if mesh != None:
|
||||
node = SceneNode()
|
||||
|
||||
node.setSelectable(True)
|
||||
node.setMeshData(mesh)
|
||||
node.setName(os.path.basename(job.getFileName()))
|
||||
|
||||
op = AddSceneNodeOperation(node, self.getController().getScene().getRoot())
|
||||
op.push()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue