Set the camera and selection tools for PrinterApplication

This commit is contained in:
Arjen Hiemstra 2014-12-18 12:08:56 +01:00
parent b2cced2772
commit 3786ced279

View file

@ -22,16 +22,20 @@ class PrinterApplication(QtApplication):
self._plugin_registry.loadPlugins({ "type": "MeshHandler" }) self._plugin_registry.loadPlugins({ "type": "MeshHandler" })
self._plugin_registry.loadPlugins({ "type": "Tool" }) self._plugin_registry.loadPlugins({ "type": "Tool" })
self.getController().setActiveView("MeshView") controller = self.getController()
root = self.getController().getScene().getRoot() controller.setActiveView("MeshView")
platform = Platform(root) controller.setCameraTool("CameraTool")
controller.setSelectionTool("SelectionTool")
try: try:
self.getMachineSettings().loadValuesFromFile(Resources.getPath(Resources.SettingsLocation, 'ultimaker2.cfg')) self.getMachineSettings().loadValuesFromFile(Resources.getPath(Resources.SettingsLocation, 'ultimaker2.cfg'))
except FileNotFoundError: except FileNotFoundError:
pass pass
root = controller.getScene().getRoot()
platform = Platform(root)
self.getRenderer().setLightPosition(Vector(0, 150, 150)) self.getRenderer().setLightPosition(Vector(0, 150, 150))
camera = Camera('3d', root) camera = Camera('3d', root)
@ -66,7 +70,7 @@ class PrinterApplication(QtApplication):
camera.lookAt(Vector(0, 50, 0), Vector(0, 1, 0)) camera.lookAt(Vector(0, 50, 0), Vector(0, 1, 0))
camera.setLocked(True) camera.setLocked(True)
self.getController().getScene().setActiveCamera('3d') controller.getScene().setActiveCamera('3d')
self.setMainQml(os.path.dirname(__file__) + "/Printer.qml") self.setMainQml(os.path.dirname(__file__) + "/Printer.qml")
self.initializeEngine() self.initializeEngine()