Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/presets/keyconfig/Blender.py
| Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | spacebar_action: EnumProperty( | ||||
| 2), | 2), | ||||
| ), | ), | ||||
| description=( | description=( | ||||
| "Action when 'Space' is pressed" | "Action when 'Space' is pressed" | ||||
| ), | ), | ||||
| default='PLAY', | default='PLAY', | ||||
| update=update_fn, | update=update_fn, | ||||
| ) | ) | ||||
| rmb_action: EnumProperty( | |||||
| name="Right Mouse Select Action", | |||||
| items=( | |||||
| ('TWEAK', "Select & Tweak", | |||||
| "Right mouse always tweaks"), | |||||
| ('FALLBACK_TOOL', "Selection Tool", | |||||
| "Right mouse uses the selection tool"), | |||||
| ), | |||||
| description=( | |||||
| "Default action for the right mouse button" | |||||
| ), | |||||
| update=update_fn, | |||||
| ) | |||||
| use_alt_click_leader: BoolProperty( | use_alt_click_leader: BoolProperty( | ||||
| name="Alt Click Tool Prompt", | name="Alt Click Tool Prompt", | ||||
| description=( | description=( | ||||
| "Tapping Alt (without pressing any other keys) shows a prompt in the status-bar\n" | "Tapping Alt (without pressing any other keys) shows a prompt in the status-bar\n" | ||||
| "prompting a second keystroke to activate the tool" | "prompting a second keystroke to activate the tool" | ||||
| ), | ), | ||||
| default=False, | default=False, | ||||
| update=update_fn, | update=update_fn, | ||||
| ▲ Show 20 Lines • Show All 109 Lines • ▼ Show 20 Lines | def draw(self, layout): | ||||
| # General settings. | # General settings. | ||||
| col = layout.column() | col = layout.column() | ||||
| col.row().prop(self, "select_mouse", text="Select with Mouse Button", expand=True) | col.row().prop(self, "select_mouse", text="Select with Mouse Button", expand=True) | ||||
| col.row().prop(self, "spacebar_action", text="Spacebar Action", expand=True) | col.row().prop(self, "spacebar_action", text="Spacebar Action", expand=True) | ||||
| if is_select_left: | if is_select_left: | ||||
| col.row().prop(self, "gizmo_action", text="Activate Gizmo Event", expand=True) | col.row().prop(self, "gizmo_action", text="Activate Gizmo Event", expand=True) | ||||
| else: | |||||
| col.row().prop(self, "rmb_action", text="Right Mouse Select Action", expand=True) | |||||
| # Checkboxes sub-layout. | # Checkboxes sub-layout. | ||||
| col = layout.column() | col = layout.column() | ||||
| sub = col.column(align=True) | sub = col.column(align=True) | ||||
| row = sub.row() | row = sub.row() | ||||
| row.prop(self, "use_select_all_toggle") | row.prop(self, "use_select_all_toggle") | ||||
| row.prop(self, "use_alt_click_leader") | row.prop(self, "use_alt_click_leader") | ||||
| Show All 37 Lines | keyconfig_data = blender_default.generate_keymaps( | ||||
| v3d_alt_mmb_drag_action=kc_prefs.v3d_alt_mmb_drag_action, | v3d_alt_mmb_drag_action=kc_prefs.v3d_alt_mmb_drag_action, | ||||
| use_select_all_toggle=kc_prefs.use_select_all_toggle, | use_select_all_toggle=kc_prefs.use_select_all_toggle, | ||||
| use_v3d_tab_menu=kc_prefs.use_v3d_tab_menu, | use_v3d_tab_menu=kc_prefs.use_v3d_tab_menu, | ||||
| use_v3d_shade_ex_pie=kc_prefs.use_v3d_shade_ex_pie, | use_v3d_shade_ex_pie=kc_prefs.use_v3d_shade_ex_pie, | ||||
| use_gizmo_drag=( | use_gizmo_drag=( | ||||
| kc_prefs.select_mouse == 'LEFT' and | kc_prefs.select_mouse == 'LEFT' and | ||||
| kc_prefs.gizmo_action == 'DRAG' | kc_prefs.gizmo_action == 'DRAG' | ||||
| ), | ), | ||||
| use_fallback_tool=(True if (kc_prefs.select_mouse == 'LEFT') else (kc_prefs.rmb_action == 'FALLBACK_TOOL')), | |||||
| use_alt_click_leader=kc_prefs.use_alt_click_leader, | use_alt_click_leader=kc_prefs.use_alt_click_leader, | ||||
| use_pie_click_drag=kc_prefs.use_pie_click_drag, | use_pie_click_drag=kc_prefs.use_pie_click_drag, | ||||
| ), | ), | ||||
| ) | ) | ||||
| if platform == 'darwin': | if platform == 'darwin': | ||||
| from bl_keymap_utils.platform_helpers import keyconfig_data_oskey_from_ctrl_for_macos | from bl_keymap_utils.platform_helpers import keyconfig_data_oskey_from_ctrl_for_macos | ||||
| keyconfig_data = keyconfig_data_oskey_from_ctrl_for_macos(keyconfig_data) | keyconfig_data = keyconfig_data_oskey_from_ctrl_for_macos(keyconfig_data) | ||||
| keyconfig_init_from_data(kc, keyconfig_data) | keyconfig_init_from_data(kc, keyconfig_data) | ||||
| if __name__ == "__main__": | if __name__ == "__main__": | ||||
| bpy.utils.register_class(Prefs) | bpy.utils.register_class(Prefs) | ||||
| load() | load() | ||||