Skip to content

Commit af031a1

Browse files
Merge pull request #34 from roguesleipnir/ortho_toggle
Added Preference for Resetting to Orthographic on Exit (default True).
2 parents 6869bc6 + 0483bc4 commit af031a1

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Preferences.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ class RightMouseNavigationPreferences(AddonPreferences):
3737
default=False,
3838
)
3939

40+
return_to_ortho_on_exit: BoolProperty(
41+
name="Return to Orthographic on Exit",
42+
description="After exiting navigation, this determines if the Viewport "
43+
"returns to Orthographic view (if checked) or remains in Perspective view (if unchecked)",
44+
default=True,
45+
)
46+
4047
enable_for_node_editors: BoolProperty(
4148
name="Enable for Node Editors",
4249
description="Right Mouse will pan the view / open the Node Add/Search Menu",
@@ -58,3 +65,8 @@ def draw(self, context):
5865
box = row.box()
5966
box.label(text="Node Editor", icon="NODETREE")
6067
box.prop(self, "enable_for_node_editors")
68+
69+
row = layout.row()
70+
box = row.box()
71+
box.label(text="View", icon="VIEW3D")
72+
box.prop(self, "return_to_ortho_on_exit")

RightMouseNavigation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def modal(self, context, event):
4444
if bpy.context.region_data.is_perspective:
4545
self._ortho = False
4646
else:
47-
self._back_to_ortho = True
47+
self._back_to_ortho = addon_prefs.return_to_ortho_on_exit
4848

4949
# The _finished Boolean acts as a flag to exit the modal loop,
5050
# it is not made True until after the cancel function is called

0 commit comments

Comments
 (0)