mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Add a Camera that can be used in PrinterApplication
This commit is contained in:
parent
1414a7e456
commit
3f462cc585
1 changed files with 12 additions and 2 deletions
|
@ -1,5 +1,8 @@
|
|||
from Cura.Qt.QtApplication import QtApplication
|
||||
from Cura.Scene.SceneObject import SceneObject
|
||||
from Cura.Scene.Camera import Camera
|
||||
from Cura.Math.Vector import Vector
|
||||
|
||||
import os.path
|
||||
|
||||
class PrinterApplication(QtApplication):
|
||||
|
@ -11,15 +14,22 @@ class PrinterApplication(QtApplication):
|
|||
self._plugin_registry.loadPlugins({ "type": "StorageDevice" })
|
||||
self._plugin_registry.loadPlugins({ "type": "View" })
|
||||
self._plugin_registry.loadPlugins({ "type": "MeshHandler" })
|
||||
self._plugin_registry.loadPlugins({ "type": "Tool" })
|
||||
|
||||
|
||||
self.getController().setActiveView("MeshView")
|
||||
self.getController().setActiveTool("TransformTool")
|
||||
|
||||
root = self.getController().getScene().getRoot()
|
||||
mesh = SceneObject()
|
||||
mesh = SceneObject(root)
|
||||
mesh.setMeshData(self.getMeshFileHandler().read("plugins/FileHandlers/STLReader/simpleTestCube.stl",self.getStorageDevice('local')))
|
||||
root.addChild(mesh)
|
||||
|
||||
camera = Camera(root)
|
||||
camera.translate(Vector(0, 0, 5))
|
||||
self.getController().getScene().setActiveCamera(camera)
|
||||
|
||||
self.log('i',"Application started")
|
||||
|
||||
self.setMainQml(os.path.dirname(__file__) + "/Printer.qml")
|
||||
self.initializeEngine()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue