[Bf-blender-cvs] [23d19c2b0dd] master: Fix T63653: Industry Compatible Keymap can't be saved & loaded
Campbell Barton
noreply at git.blender.org
Thu Sep 5 20:48:10 CEST 2019
Commit: 23d19c2b0dd3f47339ef07be39d47c41848be39b
Author: Campbell Barton
Date: Fri Sep 6 04:24:14 2019 +1000
Branches: master
https://developer.blender.org/rB23d19c2b0dd3f47339ef07be39d47c41848be39b
Fix T63653: Industry Compatible Keymap can't be saved & loaded
Replace keymap specific operator.
===================================================================
M release/scripts/presets/keyconfig/industry_compatible.py
M release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
===================================================================
diff --git a/release/scripts/presets/keyconfig/industry_compatible.py b/release/scripts/presets/keyconfig/industry_compatible.py
index 3f9ce98c7e5..b7f069c7418 100644
--- a/release/scripts/presets/keyconfig/industry_compatible.py
+++ b/release/scripts/presets/keyconfig/industry_compatible.py
@@ -1,40 +1,6 @@
import os
import bpy
-# ------------------------------------------------------------------------------
-# Operators needed by this keymap to function
-
-# Selection Modes
-
-class IC_KEYMAP_OT_mesh_select_mode(bpy.types.Operator):
- bl_idname = "ic_keymap.mesh_select_mode"
- bl_label = "Switch to Vertex, Edge or Face Mode from any mode"
- bl_options = {'UNDO'}
-
- type: bpy.props.EnumProperty(
- name="Mode",
- items=(
- ('VERT', "Vertex", "Switcth to Vertex Mode From any Mode"),
- ('EDGE', "Edge", "Switcth to Edge Mode From any Mode"),
- ('FACE', "Face", "Switcth to Face Mode From any Mode"),
- ),
- )
-
- @classmethod
- def poll(cls, context):
- return (context.active_object is not None) and (context.object.type == 'MESH')
-
- def execute(self, context):
- bpy.ops.object.mode_set(mode='EDIT')
- bpy.ops.mesh.select_mode(type=self.type)
-
- return{'FINISHED'}
-
-
-classes = (
- IC_KEYMAP_OT_mesh_select_mode,
-)
-
# ------------------------------------------------------------------------------
# Keymap
@@ -66,8 +32,4 @@ def load():
keyconfig_init_from_data(kc, keyconfig_data)
if __name__ == "__main__":
- # XXX, no way to unregister
- for cls in classes:
- bpy.utils.register_class(cls)
-
load()
diff --git a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
index f9ee7aff935..d1cd27296e1 100644
--- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
+++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
@@ -3385,12 +3385,12 @@ def km_object_non_modal(params):
items.extend([
- ("ic_keymap.mesh_select_mode",{"type": 'ONE', "value": 'PRESS'},
- {"properties": [("type", 'VERT')]}),
- ("ic_keymap.mesh_select_mode",{"type": 'TWO', "value": 'PRESS'},
- {"properties": [("type", 'EDGE')]}),
- ("ic_keymap.mesh_select_mode",{"type": 'THREE', "value": 'PRESS'},
- {"properties": [("type", 'FACE')]}),
+ ("object.mode_set_with_submode",{"type": 'ONE', "value": 'PRESS'},
+ {"properties": [("mode", 'EDIT'), ("mesh_select_mode", {'VERT'})]}),
+ ("object.mode_set_with_submode",{"type": 'TWO', "value": 'PRESS'},
+ {"properties": [("mode", 'EDIT'), ("mesh_select_mode", {'EDGE'})]}),
+ ("object.mode_set_with_submode",{"type": 'THREE', "value": 'PRESS'},
+ {"properties": [("mode", 'EDIT'), ("mesh_select_mode", {'FACE'})]}),
("object.mode_set",{"type": 'ONE', "value": 'PRESS'},
{"properties": [("mode", 'EDIT')]}),
("object.mode_set",{"type": 'FOUR', "value": 'PRESS'},
More information about the Bf-blender-cvs
mailing list