File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -131,16 +131,20 @@ def execute(self, context):
131131 addon_prefs = preferences .addons [__package__ ].preferences
132132 enable_nodes = addon_prefs .enable_for_node_editors
133133 disable_camera = addon_prefs .disable_camera_navigation
134+ navigation_mode = addon_prefs .navigation_mode
134135
135136 space_type = context .space_data .type
136137
137138 # Execute is the first thing called in our operator, so we start by
138- # calling Blender's built-in Walk Navigation
139+ # calling the appropriate navigation based on user preference
139140 if space_type == "VIEW_3D" :
140141 view = context .space_data .region_3d .view_perspective
141142 if not (view == "CAMERA" and disable_camera ):
142143 try :
143- bpy .ops .view3d .walk ("INVOKE_DEFAULT" )
144+ if navigation_mode == "ORBIT" :
145+ bpy .ops .view3d .rotate ("INVOKE_DEFAULT" )
146+ else :
147+ bpy .ops .view3d .walk ("INVOKE_DEFAULT" )
144148 # Adding the timer and starting the loop
145149 wm = context .window_manager
146150 self ._timer = wm .event_timer_add (0.1 , window = context .window )
Original file line number Diff line number Diff line change 11import bpy
22from bpy .props import (
33 BoolProperty ,
4+ EnumProperty ,
45 FloatProperty ,
56)
67from bpy .types import AddonPreferences
@@ -51,6 +52,16 @@ def update_node_keymap(self, context):
5152class RightMouseNavigationPreferences (AddonPreferences ):
5253 bl_idname = __package__
5354
55+ navigation_mode : EnumProperty (
56+ name = "Navigation Mode" ,
57+ description = "Choose how right-click drag navigates the viewport" ,
58+ items = [
59+ ("WALK" , "Walk" , "First-person walk navigation (default Blender behavior)" ),
60+ ("ORBIT" , "Orbit" , "Orbit around view center (like middle-mouse-button)" ),
61+ ],
62+ default = "WALK" ,
63+ )
64+
5465 time : FloatProperty (
5566 name = "Time Threshold" ,
5667 description = "How long you have hold right mouse to open menu" ,
@@ -98,8 +109,13 @@ def draw(self, context):
98109
99110 row = layout .row ()
100111 box = row .box ()
112+ box .label (text = "Navigation" , icon = "ORIENTATION_GIMBAL" )
113+ box .prop (self , "navigation_mode" )
114+ box = row .box ()
101115 box .label (text = "Menu / Movement" , icon = "DRIVER_DISTANCE" )
102116 box .prop (self , "time" )
117+
118+ row = layout .row ()
103119 box = row .box ()
104120 box .label (text = "Node Editor" , icon = "NODETREE" )
105121 box .prop (self , "enable_for_node_editors" )
You can’t perform that action at this time.
0 commit comments