mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 00:05:59 +08:00
Merge branch 'feature_home_camera' of https://github.com/fieldOfView/Cura
This commit is contained in:
commit
5d4b23e72a
@ -36,6 +36,15 @@ class CuraActions(QObject):
|
|||||||
event = CallFunctionEvent(self._openUrl, [QUrl("http://github.com/Ultimaker/Cura/issues")], {})
|
event = CallFunctionEvent(self._openUrl, [QUrl("http://github.com/Ultimaker/Cura/issues")], {})
|
||||||
Application.getInstance().functionEvent(event)
|
Application.getInstance().functionEvent(event)
|
||||||
|
|
||||||
|
## Reset camera position and direction to default
|
||||||
|
@pyqtSlot()
|
||||||
|
def homeCamera(self) -> None:
|
||||||
|
scene = Application.getInstance().getController().getScene()
|
||||||
|
camera = scene.getActiveCamera()
|
||||||
|
camera.setPosition(Vector(-80, 250, 700))
|
||||||
|
camera.setPerspective(True)
|
||||||
|
camera.lookAt(Vector(0, 0, 0))
|
||||||
|
|
||||||
## Center all objects in the selection
|
## Center all objects in the selection
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def centerSelection(self) -> None:
|
def centerSelection(self) -> None:
|
||||||
|
@ -17,6 +17,8 @@ Item
|
|||||||
property alias undo: undoAction;
|
property alias undo: undoAction;
|
||||||
property alias redo: redoAction;
|
property alias redo: redoAction;
|
||||||
|
|
||||||
|
property alias homeCamera: homeCameraAction;
|
||||||
|
|
||||||
property alias deleteSelection: deleteSelectionAction;
|
property alias deleteSelection: deleteSelectionAction;
|
||||||
property alias centerSelection: centerSelectionAction;
|
property alias centerSelection: centerSelectionAction;
|
||||||
property alias multiplySelection: multiplySelectionAction;
|
property alias multiplySelection: multiplySelectionAction;
|
||||||
@ -96,6 +98,13 @@ Item
|
|||||||
shortcut: StandardKey.Quit;
|
shortcut: StandardKey.Quit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Action
|
||||||
|
{
|
||||||
|
id: homeCameraAction;
|
||||||
|
text: catalog.i18nc("@action:inmenu menubar:view","&Reset camera position");
|
||||||
|
onTriggered: CuraActions.homeCamera();
|
||||||
|
}
|
||||||
|
|
||||||
Action
|
Action
|
||||||
{
|
{
|
||||||
id: preferencesAction;
|
id: preferencesAction;
|
||||||
|
@ -27,4 +27,7 @@ Menu
|
|||||||
onObjectRemoved: menu.removeItem(object)
|
onObjectRemoved: menu.removeItem(object)
|
||||||
}
|
}
|
||||||
ExclusiveGroup { id: group; }
|
ExclusiveGroup { id: group; }
|
||||||
|
|
||||||
|
MenuSeparator {}
|
||||||
|
MenuItem { action: Cura.Actions.homeCamera; }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user