[Bf-blender-cvs] [5ca3fa3bedc] temp-keymap-industry-compat: Use new insert keyframe operator

Campbell Barton noreply at git.blender.org
Wed Apr 10 11:21:58 CEST 2019


Commit: 5ca3fa3bedc2acec229533e5cd624a5a2664c5ac
Author: Campbell Barton
Date:   Wed Apr 10 11:21:43 2019 +0200
Branches: temp-keymap-industry-compat
https://developer.blender.org/rB5ca3fa3bedc2acec229533e5cd624a5a2664c5ac

Use new insert keyframe 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 8e8c793e45c..a766bb4174a 100644
--- a/release/scripts/presets/keyconfig/industry_compatible.py
+++ b/release/scripts/presets/keyconfig/industry_compatible.py
@@ -82,43 +82,12 @@ class IC_KEYMAP_OT_jkl_controls(bpy.types.Operator):
         return {'FINISHED'}
 
 
-# Keyframe
-
-class IC_KEYMAP_OT_insert_key(bpy.types.Operator):
-    bl_idname = "ic_keymap.insert_key"
-    bl_label = "Insert Location Keyframe"
-    bl_options = {'UNDO'}
-
-    mode: bpy.props.EnumProperty(
-        name="Keyframe Mode",
-        items=(
-            ('LOCATION', "Location", "Set location keyframe"),
-            ('ROTATION', "Rotation", "Set rotation keyframe"),
-            ('SCALING', "Scaling", "Set scaling keyframe"),
-            ('LOCROTSCALE', "LocRotScale", "Set location, rotation and scaling keyframes"),
-        ),
-    )
-
-    def execute(self, context):
-        if self.mode == "LOCATION":
-            bpy.ops.anim.keyframe_insert_menu(type='Location')
-        elif self.mode == "ROTATION":
-            bpy.ops.anim.keyframe_insert_menu(type='Rotation')
-        elif self.mode == "SCALING":
-            bpy.ops.anim.keyframe_insert_menu(type='Scaling')
-        elif self.mode == "LOCROTSCALE":
-            bpy.ops.anim.keyframe_insert_menu(type='LocRotScale')
-        return{'FINISHED'}
-
-
 classes = (
     IC_KEYMAP_OT_mesh_select_mode,
-    IC_KEYMAP_OT_insert_key,
     IC_KEYMAP_OT_jkl_controls,
 )
 
 
-
 # ------------------------------------------------------------------------------
 # Keymap
 
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 d9abf5cbd85..b807db011a4 100644
--- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
+++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
@@ -2613,14 +2613,14 @@ def km_pose(params):
         ("pose.select_linked", {"type": 'RIGHT_BRACKET', "value": 'PRESS'}, None),
         ("pose.bone_layers", {"type": 'G', "value": 'PRESS'}, None),
         ("anim.keyframe_insert_menu", {"type": 'S', "value": 'PRESS', "shift": True}, None),
-        ("ic_keymap.insert_key", {"type": 'S', "value": 'PRESS'},
-         {"properties": [("mode", 'LOCROTSCALE')]}),
-        ("ic_keymap.insert_key", {"type": 'W', "value": 'PRESS', "shift": True},
-         {"properties": [("mode", 'LOCATION')]}),
-        ("ic_keymap.insert_key", {"type": 'E', "value": 'PRESS', "shift": True},
-         {"properties": [("mode", 'ROTATION')]}),
-        ("ic_keymap.insert_key", {"type": 'R', "value": 'PRESS', "shift": True},
-         {"properties": [("mode", 'SCALING')]}),
+        ("anim.keyframe_insert_by_name", {"type": 'S', "value": 'PRESS'},
+         {"properties": [("type", 'LocRotScale')]}),
+        ("anim.keyframe_insert_by_name", {"type": 'W', "value": 'PRESS', "shift": True},
+         {"properties": [("type", 'Location')]}),
+        ("anim.keyframe_insert_by_name", {"type": 'E', "value": 'PRESS', "shift": True},
+         {"properties": [("type", 'Rotation')]}),
+        ("anim.keyframe_insert_by_name", {"type": 'R', "value": 'PRESS', "shift": True},
+         {"properties": [("type", 'Scaling')]}),
 
         ("anim.keyframe_delete_v3d", {"type": 'S', "value": 'PRESS', "alt": True}, None),
         ("anim.keying_set_active_set", {"type": 'S', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, None),
@@ -2690,14 +2690,14 @@ def km_object_mode(params):
         ("object.duplicate_move", {"type": 'D', "value": 'PRESS', "ctrl": True}, None),
         # Keyframing
         ("anim.keyframe_insert_menu", {"type": 'S', "value": 'PRESS', "shift": True}, None),
-        ("ic_keymap.insert_key", {"type": 'S', "value": 'PRESS'},
-         {"properties": [("mode", 'LOCROTSCALE')]}),
-        ("ic_keymap.insert_key", {"type": 'W', "value": 'PRESS', "shift": True},
-         {"properties": [("mode", 'LOCATION')]}),
-        ("ic_keymap.insert_key", {"type": 'E', "value": 'PRESS', "shift": True},
-         {"properties": [("mode", 'ROTATION')]}),
-        ("ic_keymap.insert_key", {"type": 'R', "value": 'PRESS', "shift": True},
-         {"properties": [("mode", 'SCALING')]}),
+        ("anim.keyframe_insert_by_name", {"type": 'S', "value": 'PRESS'},
+         {"properties": [("type", 'LocRotScale')]}),
+        ("anim.keyframe_insert_by_name", {"type": 'W', "value": 'PRESS', "shift": True},
+         {"properties": [("type", 'Location')]}),
+        ("anim.keyframe_insert_by_name", {"type": 'E', "value": 'PRESS', "shift": True},
+         {"properties": [("type", 'Rotation')]}),
+        ("anim.keyframe_insert_by_name", {"type": 'R', "value": 'PRESS', "shift": True},
+         {"properties": [("type", 'Scaling')]}),
         ("anim.keyframe_delete_v3d", {"type": 'S', "value": 'PRESS', "alt": True}, None),
         ("anim.keying_set_active_set", {"type": 'S', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, None),
         # JKL



More information about the Bf-blender-cvs mailing list