mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 23:19:01 +08:00
Add a Camera that can be used in PrinterApplication
This commit is contained in:
parent
1414a7e456
commit
3f462cc585
@ -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…
x
Reference in New Issue
Block a user