Using Custom Icon Button for Addons

Hi,
Is it possible to load/insert custom icons w/Python into my own addon without having to recompile Blender?

I am preferably looking for the quickest and easiest way to do this.

I don’t think so, there is no mention in the API of this…

Well, then how do addon developers do it. Hard-Ops and BoxCutter all have custom icons in their add-ons?

Of course this is possible. Here is the api: https://docs.blender.org/api/2.82a/bpy.utils.previews.html

And you even have the ui_previews_custom_icon.py template example bundled with blender.

1 Like

Thanks,
But that link is just for previewing images.
What about hooking it up to an operator in a button?

No this is for operator too where you can use your custom icon.
layout.operator(“scene.my_op”, icon_value=my_icon.icon_id)

Okay… I will try it out.