-class WM_OT_appconfig_default(Operator):
- bl_idname = "wm.appconfig_default"
- bl_label = "Default Application Configuration"
-
- def execute(self, context):
- import os
-
- context.window_manager.keyconfigs.active = context.window_manager.keyconfigs.default
-
- filepath = os.path.join(bpy.utils.preset_paths("interaction")[0], "blender.py")
-
- if os.path.exists(filepath):
- bpy.ops.script.execute_preset(
- filepath=filepath,
- menu_idname="USERPREF_MT_interaction_presets",
- )
-
- return {'FINISHED'}
-
-
-class WM_OT_appconfig_activate(Operator):
- bl_idname = "wm.appconfig_activate"
- bl_label = "Activate Application Configuration"
-
- filepath: StringProperty(
- subtype='FILE_PATH',
- )
-
- def execute(self, context):
- import os
- filepath = self.filepath
- bpy.utils.keyconfig_set(filepath)
- dirname, filename = os.path.split(filepath)
- filepath = os.path.normpath(os.path.join(dirname, os.pardir, "interaction", filename))
- if os.path.exists(filepath):
- bpy.ops.script.execute_preset(
- filepath=filepath,
- menu_idname="USERPREF_MT_interaction_presets",
- )
-
- return {'FINISHED'}
-
-