Adjust maximum zoom to printer size

Previously the maximum distance you could zoom out was 2000. Now it's variable depending on how large your printer is. I've put it to 5 so that it works out to be approximately the same maximum zoom level for normal sized printers (like 25 cube build volume approximately).

This should make it possible to zoom out completely for large sized printers.
This commit is contained in:
Ghostkeeper 2018-08-09 12:02:28 +02:00
parent 9239e82b1f
commit aab0cded0e
No known key found for this signature in database
GPG Key ID: 5252B696FB5E7C7A

View File

@ -3,6 +3,7 @@
from cura.Scene.CuraSceneNode import CuraSceneNode
from cura.Settings.ExtruderManager import ExtruderManager
from UM.Application import Application #To modify the maximum zoom level.
from UM.i18n import i18nCatalog
from UM.Scene.Platform import Platform
from UM.Scene.Iterator.BreadthFirstIterator import BreadthFirstIterator
@ -552,6 +553,11 @@ class BuildVolume(SceneNode):
if self._engine_ready:
self.rebuild()
diagonal_size = math.sqrt(self._width * self._width + self._height * self._height + self._depth * self._depth)
camera = Application.getInstance().getController().getCameraTool()
if camera:
camera.setZoomRange(min = 1, max = diagonal_size * 5) #You can zoom out up to 5 times the diagonal across your screen (to see models bigger than your volume).
def _onEngineCreated(self):
self._engine_ready = True
self.rebuild()