0
$\begingroup$

I've been developing a Decimate macro plugin for Blender and so far I have all the pieces together fairly well. However, I've been unable to set a hotkey for it using Python. I followed this tutorial but I can't input the idname of the pie menu directly into Blender settings, instead, I have to do it manually. The only thing that goes straight to the 3D View (Global) menu is the wm.call_menu_pie idname:

enter image description here

Is there any function I can use to input it directly into Blender options using Python?

$\endgroup$
2
  • $\begingroup$ Does this answer your question? Keybinding for a python script $\endgroup$
    – Harry McKenzie
    Commented Dec 31, 2022 at 22:20
  • $\begingroup$ Actually, this didn't work. I tried different variations changing the class names but none of this worked directly and I still have to input the Name manually in the preferences window to make it work. I tried using VIEW3D_MT_PIE_decimator.bl_idname, changing the bl_idname for "wm.call_menu_pie", didn't work. Tried the other way around and still didn't work. $\endgroup$
    – thevoyager
    Commented Dec 31, 2022 at 23:19

1 Answer 1

0
$\begingroup$

I found a solution for this after reading this post: Custom pie menu not working with keyboard shortcut anymore

since my addon consists in a pie menu, I found out that adding the following property to the shortcut is the solution:

kmi.properties.name = "VIEW3D_MT_PIE_decimator"

in which "VIEW3D_MT_PIE_decimator" is the class name of the Pie Menu.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .