Sybren A. Stüvel
5aae6aa679
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.
28 lines
752 B
Python
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()
|