From ffb6a51090945c2efaa6cd154363bf0a66d4717f Mon Sep 17 00:00:00 2001 From: passivestar <60579014+passivestar@users.noreply.github.com> Date: Mon, 28 Nov 2022 11:26:51 +0400 Subject: [PATCH] Add ToggleAutoKeyingOperator --- __init__.py | 13 +++++++++++-- config.json | 7 +++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/__init__.py b/__init__.py index eea04e0..37339d9 100644 --- a/__init__.py +++ b/__init__.py @@ -6,7 +6,7 @@ bl_info = { 'name': 'QuickMenu', - 'version': (2, 4, 6), + 'version': (2, 4, 7), 'author': 'passivestar', 'blender': (3, 3, 0), 'location': 'Press the bound hotkey in 3D View', @@ -1637,6 +1637,15 @@ def execute(self, context): bpy.ops.mesh.select_all(action='DESELECT') return {'FINISHED'} +class ToggleAutoKeyingOperator(bpy.types.Operator): + """Toggle Auto Keying""" + bl_idname, bl_label, bl_options = 'qm.toggle_auto_keying', 'Toggle Auto Keying', {'REGISTER', 'UNDO'} + + def execute(self, context): + context.scene.tool_settings.use_keyframe_insert_auto = not context.scene.tool_settings.use_keyframe_insert_auto + self.report({'INFO'}, f'Auto Keying: {context.scene.tool_settings.use_keyframe_insert_auto}') + return {'FINISHED'} + class ParentToNewEmptyOperator(bpy.types.Operator): """Parent To New Empty""" bl_idname, bl_label, bl_options = 'qm.parent_to_new_empty', 'Parent To New Empty', {'REGISTER', 'UNDO'} @@ -1927,7 +1936,7 @@ class QuickMenuProperties(bpy.types.PropertyGroup): SimpleDeformOperator, ClearModifiersOperator, DeleteBackFacingOperator, SeparateByLoosePartsOperator, StraightenUVsOperator, UVProjectModifierOperator, MarkSeamOperator, MarkSeamsSharpOperator, MarkSeamsFromIslandsOperator, TransformUVsOperator, SetVertexColorOperator, SelectByVertexColorOperator, BakeIDMapOperator, EditAlbedoMapOperator, - BooleanOperator, WeldEdgesIntoFacesOperator, ParentToNewEmptyOperator, ClearDriversOperator, SetUseSelfDriversOperator, + BooleanOperator, WeldEdgesIntoFacesOperator, ToggleAutoKeyingOperator, ParentToNewEmptyOperator, ClearDriversOperator, SetUseSelfDriversOperator, PlaneIntersectOperator, KnifeIntersectOperator, IntersectOperator, TransformOrientationOperator, TransformPivotOperator, SetSnapOperator, ModeOperator, ToolOperator, SaveAndReloadOperator, ReimportTexturesOperator, UnpackAllDataToFilesOperator, ExportOperator, ViewOperator, diff --git a/config.json b/config.json index 9339247..626e2ce 100644 --- a/config.json +++ b/config.json @@ -531,6 +531,13 @@ { "path": "(R) Animation/[Separator]" }, + { + "path": "(R) Animation/(Q) Toggle Auto Keying", + "operator": "qm.toggle_auto_keying" + }, + { + "path": "(R) Animation/[Separator]" + }, { "path": "(R) Animation/(Z) Clear Drivers", "operator": "qm.clear_drivers"