@@ -82,8 +82,16 @@ class RightMouseNavigationPreferences(AddonPreferences):
8282 name = "Navigation Mode" ,
8383 description = "Choose how right-click drag navigates the viewport" ,
8484 items = [
85- ("WALK" , "Walk" , "First-person walk navigation (default Blender behavior)" ),
86- ("ORBIT" , "Orbit" , "Orbit around view center (like middle-mouse-button)" ),
85+ (
86+ "WALK" ,
87+ "Walk" ,
88+ "First-person walk navigation (default Blender behavior)" ,
89+ ),
90+ (
91+ "ORBIT" ,
92+ "Orbit" ,
93+ "Orbit around view center (like middle-mouse-button)" ,
94+ ),
8795 ],
8896 default = "WALK" ,
8997 )
@@ -132,7 +140,7 @@ class RightMouseNavigationPreferences(AddonPreferences):
132140
133141 rmb_pan_rotate : BoolProperty (
134142 name = "Switch MMB and RMB Drag Camera Navigation" ,
135- description = "Switches Camera Navigation controls to Right Mouse Button." ,
143+ description = "Switches Camera Navigation controls to Right Mouse Button. Context Menus will be set to Click when these options are toggled. " ,
136144 default = False ,
137145 update = update_rebind_3dview_keymap ,
138146 )
@@ -259,11 +267,7 @@ def rebind_switch_nav_rotate(self, context, isActive):
259267 key .value = "CLICK"
260268 for i in panelmodes :
261269 for key in active_kc .keymaps [i ].keymap_items :
262- if (
263- key .idname == "wm.call_panel"
264- and key .type == "RIGHTMOUSE"
265- and key .active
266- ):
270+ if key .idname == "wm.call_panel" and key .type == "RIGHTMOUSE" and key .active :
267271 key .active = False
268272 key .value = "CLICK"
269273 else :
@@ -291,19 +295,16 @@ def rebind_switch_nav_rotate(self, context, isActive):
291295 def draw (self , context ):
292296 layout = self .layout
293297
298+ # Navigation Mode & Menu / Movement Boxes
294299 row = layout .row ()
295300 box = row .box ()
296- box .label (text = "Navigation" , icon = "ORIENTATION_GIMBAL" )
297- box .prop (self , "navigation_mode" , text = "Mode " )
301+ box .label (text = "Navigation Mode " , icon = "ORIENTATION_GIMBAL" )
302+ box .prop (self , "navigation_mode" , text = "" )
298303 box = row .box ()
299304 box .label (text = "Menu / Movement" , icon = "DRIVER_DISTANCE" )
300305 box .prop (self , "time" )
301306
302- row = layout .row ()
303- box = row .box ()
304- box .label (text = "Node Editor" , icon = "NODETREE" )
305- box .prop (self , "enable_for_node_editors" )
306-
307+ # Cursor & View Boxes
307308 row = layout .row ()
308309 box = row .box ()
309310 box .label (text = "Cursor" , icon = "ORIENTATION_CURSOR" )
@@ -312,37 +313,158 @@ def draw(self, context):
312313 box .label (text = "View" , icon = "VIEW3D" )
313314 box .prop (self , "return_to_ortho_on_exit" )
314315
316+ # Camera Box
315317 row = layout .row ()
316318 box = row .box ()
317319 box .label (text = "Camera" , icon = "CAMERA_DATA" )
318320 row = box .row ()
319321 row .prop (self , "disable_camera_navigation" )
320322 row .prop (self , "show_cam_lock_ui" )
321323
324+ # Node Editor Box
322325 row = layout .row ()
323326 box = row .box ()
324- box .label (text = "Right Mouse Button Pan, Zoom, and Rotate" , icon = "VIEW3D" )
325- box .label (text = "RMB Menus will be set to Click when these options are toggled." )
326- box .prop (self , "rmb_pan_rotate" )
327- if self .rmb_pan_rotate :
328- if not self .rmb_rotate_switch :
329- box .label (text = "Hold RMB then WASD for Navigation Mode" )
330- box .label (text = "Alt + Drag RMB to Rotate 3D View" )
331- box .label (text = "Shift + Drag RMB to Pan 3D View" )
332- box .label (text = "Ctrl + Drag RMB to Zoom 3D View" )
333- box .label (text = "Ctrl + Shift + Drag RMB to Dolly Zoom 3D View" )
334- box .label (text = "Other controls swapped" )
335- box .label (text = "Shift + Click MMB to Set 3D Cursor" )
336- box .label (text = "Shift + Drag MMB to Transform Translate" )
337- box .label (text = "Ctrl + Drag MMB to Lasso Selection" )
338- box .label (text = "Shift + Ctrl + Drag MMB to Lasso Deselection" )
339- if self .rmb_pan_rotate :
340- box .prop (self , "rmb_rotate_switch" )
327+ box .label (text = "Node Editor" , icon = "NODETREE" )
328+ box .prop (self , "enable_for_node_editors" )
329+
330+ # RMB MMB Box
331+ box = layout .box ()
332+
333+ header , panel = box .panel (idname = "panzoom" , default_closed = True )
334+ header .label (text = "Pan, Zoom, Rotate" , icon = "VIEW3D" )
335+
336+ if panel :
337+ row = panel .row ()
338+ row .prop (self , "rmb_pan_rotate" , text = "Swap MMB & RMB Navigation Controls" )
339+ row .prop (self , "rmb_rotate_switch" , text = "Require Alt for Walk/Fly Navigation" )
340+
341+ # Split the layout at 30%
342+ split = panel .split (factor = 0.3 )
343+ split .active = self .rmb_pan_rotate
344+
345+ # One side of split for titles
346+ title = split .column ()
347+ title .alignment = "RIGHT"
348+
349+ row = title .row ()
350+ row .alignment = "LEFT"
351+ row .label (text = "Right Mouse" , icon = "MOUSE_RMB" )
352+
353+ # RMB
354+ title .label (text = "Navigation Mode:" )
355+ title .label (text = "Rotate 3D View:" )
356+ title .label (text = "Pan 3D View:" )
357+ title .label (text = "Zoom 3D View:" )
358+ title .label (text = "Dolly Zoom 3D View:" )
359+
360+ row = title .row ()
361+ row .alignment = "LEFT"
362+ row .label (text = "Middle Mouse" , icon = "MOUSE_MMB" )
363+
364+ # MMB
365+ title .label (text = "Set 3D Cursor:" )
366+ title .label (text = "Transform Translate:" )
367+ title .label (text = "Lasso Selection:" )
368+ title .label (text = "Lasso Deselection:" )
369+
370+ # The other side of the split holds content
371+ content = split .column ()
372+
373+ row = content .row ()
374+ row .label (text = "" )
375+
376+ # RMB
377+ row = content .row (align = True )
378+ row .label (text = "" , icon = "EVENT_W" )
379+ row .label (text = "" , icon = "EVENT_A" )
380+ row .label (text = "" , icon = "EVENT_S" )
381+ row .label (text = "" , icon = "EVENT_D" )
382+ row .label (text = "" , icon = "ADD" )
341383 if self .rmb_rotate_switch :
342- box .label (text = "Drag + RMB will now Rotate 3D View" )
343- box .label (text = "Alt + RMB then WASD for Navigation Mode" )
344- elif not self .rmb_pan_rotate and self .rmb_rotate_switch :
345- self .rmb_rotate_switch = False
384+ row .label (text = "" , icon = "EVENT_ALT" )
385+ row .label (text = "" , icon = "ADD" )
386+ row .label (text = "" , icon = "MOUSE_RMB_DRAG" )
387+ label = row .row ()
388+ label .active = False
389+ text = (
390+ "(WASD + Right Mouse)"
391+ if not self .rmb_rotate_switch
392+ else "(WASD + Alt + Right Mouse)"
393+ )
394+ label .label (text = text )
395+
396+ row = content .row (align = True )
397+ if not self .rmb_rotate_switch :
398+ row .label (text = "" , icon = "EVENT_ALT" )
399+ row .label (text = "" , icon = "ADD" )
400+ row .label (text = "" , icon = "MOUSE_RMB_DRAG" )
401+ label = row .row ()
402+ label .active = False
403+ text = "(Alt + Right Mouse)" if not self .rmb_rotate_switch else "(Right Mouse)"
404+ label .label (text = text )
405+
406+ row = content .row (align = True )
407+ row .label (text = "" , icon = "EVENT_SHIFT" )
408+ row .label (text = "" , icon = "ADD" )
409+ row .label (text = "" , icon = "MOUSE_RMB_DRAG" )
410+ label = row .row ()
411+ label .active = False
412+ label .label (text = "(Shift + Right Mouse)" )
413+
414+ row = content .row (align = True )
415+ row .label (text = "" , icon = "EVENT_CTRL" )
416+ row .label (text = "" , icon = "ADD" )
417+ row .label (text = "" , icon = "MOUSE_RMB_DRAG" )
418+ label = row .row ()
419+ label .active = False
420+ label .label (text = "(Ctrl + Right Mouse)" )
421+
422+ row = content .row (align = True )
423+ row .label (text = "" , icon = "EVENT_CTRL" )
424+ row .label (text = "" , icon = "ADD" )
425+ row .label (text = "" , icon = "EVENT_SHIFT" )
426+ row .label (text = "" , icon = "ADD" )
427+ row .label (text = "" , icon = "MOUSE_RMB_DRAG" )
428+ label = row .row ()
429+ label .active = False
430+ label .label (text = "(Ctrl + Shift + Right Mouse)" )
431+
432+ row = content .row ()
433+ row .label (text = "" )
434+ # MMB
435+ row = content .row (align = True )
436+ row .label (text = "" , icon = "EVENT_SHIFT" )
437+ row .label (text = "" , icon = "ADD" )
438+ row .label (text = "" , icon = "MOUSE_MMB" )
439+ label = row .row ()
440+ label .active = False
441+ label .label (text = "(Shift + Middle Mouse)" )
442+
443+ row = content .row (align = True )
444+ row .label (text = "" , icon = "EVENT_SHIFT" )
445+ row .label (text = "" , icon = "ADD" )
446+ row .label (text = "" , icon = "MOUSE_MMB_DRAG" )
447+ label = row .row ()
448+ label .active = False
449+ label .label (text = "(Shift + Middle Mouse)" )
450+
451+ row = content .row (align = True )
452+ row .label (text = "" , icon = "EVENT_CTRL" )
453+ row .label (text = "" , icon = "ADD" )
454+ row .label (text = "" , icon = "MOUSE_MMB_DRAG" )
455+ label = row .row ()
456+ label .active = False
457+ label .label (text = "(Ctrl + Middle Mouse)" )
458+
459+ row = content .row (align = True )
460+ row .label (text = "" , icon = "EVENT_SHIFT" )
461+ row .label (text = "" , icon = "ADD" )
462+ row .label (text = "" , icon = "EVENT_CTRL" )
463+ row .label (text = "" , icon = "ADD" )
464+ row .label (text = "" , icon = "MOUSE_MMB_DRAG" )
465+ label = row .row ()
466+ label .active = False
467+ label .label (text = "(Shift + Ctrl + Right Mouse)" )
346468
347469 # Keymap Customization
348470 import rna_keymap_ui
@@ -386,6 +508,7 @@ def walk_keymaps(keyconfig):
386508 finally :
387509 walk_keymaps (user_keyconfig )
388510
511+ # Navigation Keymap Box
389512 header , panel = layout .panel (idname = "keymap" , default_closed = True )
390513 header .label (text = "Navigation Keymap" )
391514
0 commit comments