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.
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.
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.
Did you finally make it work?
Check out T78630 and T64628, they contain an example that can help you.
And of course, why not just see how this is done in the above mentioned Hard-Ops and BoxCutter.
Is this a reply to my question? If yes, what is T78630 and T64628? Thank you for your time!
https://developer.blender.org/T78630
https://developer.blender.org/T64628
Not to you personally, but the answer to the topic.
Oh okay excuse me, I though you answered to me.
But if your question is “how to use custom icon button for addons” then these links can help you.
Or if you have an answer, please post it for others for the future.
Basically yes, I am looking for how to use custom icons for my addons, but I can’t see how those two links can help me. They both talk about custom icons that don’t greyout. I haven’t reach that level yet!!!
I first need to know how I can make them show up…
There are zip archives with code samples, I think this is just what you need.
Perhaps here is a detailed explanation:
https://blender.stackexchange.com/questions/32335/
I didn’t notice those zip files!!! Well I did like “icon_brightness.blend” script but I get this error:
AttributeError: '_RestrictData' object has no attribute 'filepath'
. Any idea?
No, it works for me without errors.
But googling this error gives a lot of results…
Can I show you my code?
I don’t think I can do anything else, I don’t understand Python.
Try asking here
Okay!!! Thank you for the links and for your time!!!