blender-addons/pose_library/keymaps.py
Sybren A. Stüvel 5aae6aa679 Pose library: remove the poselib_flipped property from the window manager
Remove the custom property `WindowManager.poselib_flipped`, as the
checkbox for it was removed in rBAc164c5d86655 already.

This also removes the `poselib.apply_pose_asset_for_keymap` and
`poselib.blend_pose_asset_for_keymap` operators, as they are no longer
necessary.
2023-01-03 14:51:45 +01:00

28 lines
752 B
Python

# SPDX-License-Identifier: GPL-2.0-or-later
from typing import List, Tuple
import bpy
addon_keymaps: List[Tuple[bpy.types.KeyMap, bpy.types.KeyMapItem]] = []
def register() -> None:
wm = bpy.context.window_manager
if wm.keyconfigs.addon is None:
# This happens when Blender is running in the background.
return
km = wm.keyconfigs.addon.keymaps.new(name="File Browser Main", space_type="FILE_BROWSER")
# DblClick to apply pose.
kmi = km.keymap_items.new("poselib.apply_pose_asset", "LEFTMOUSE", "DOUBLE_CLICK")
addon_keymaps.append((km, kmi))
def unregister() -> None:
# Clear shortcuts from the keymap.
for km, kmi in addon_keymaps:
km.keymap_items.remove(kmi)
addon_keymaps.clear()