Commit: 90b485845caf5ea9177be50cdd6d7117153f844e
Author: Campbell Barton
Date:   Wed Sep 22 17:47:52 2021 +1000
Branches: master
https://developer.blender.org/rB90b485845caf5ea9177be50cdd6d7117153f844e

Keymap: set the default filepath exporting keymaps

Use the key-config name for the file name.

===================================================================

M       release/scripts/startup/bl_operators/userpref.py

===================================================================

diff --git a/release/scripts/startup/bl_operators/userpref.py 
b/release/scripts/startup/bl_operators/userpref.py
index 623bf583a74..67a02f6e1f4 100644
--- a/release/scripts/startup/bl_operators/userpref.py
+++ b/release/scripts/startup/bl_operators/userpref.py
@@ -268,7 +268,7 @@ class PREFERENCES_OT_keyconfig_export(Operator):
     )
     filepath: StringProperty(
         subtype='FILE_PATH',
-        default="keymap.py",
+        default="",
     )
     filter_folder: BoolProperty(
         name="Filter folders",
@@ -307,7 +307,13 @@ class PREFERENCES_OT_keyconfig_export(Operator):
         return {'FINISHED'}
 
     def invoke(self, context, _event):
+        import os
         wm = context.window_manager
+        if not self.filepath:
+            self.filepath = os.path.join(
+                os.path.expanduser("~"),
+                bpy.path.display_name_to_filepath(wm.keyconfigs.active.name) + 
".py",
+            )
         wm.fileselect_add(self)
         return {'RUNNING_MODAL'}

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to