0

How I add custom icon for add-on button? I have ready a 32x32 size photo for my icon but dob't know how to add itenter image description here

I have copy the code of: How to implement custom icons for my script/addon?

But when I run script, it shown this enter image description here

Besides, I don't know how to write the ID of my photo. I am trying. Please tell me how where could I type my photo ID.

8N Films
  • 163
  • 1
  • 12
  • Please read: https://blender.stackexchange.com/help/how-to-ask – brockmann Mar 05 '21 at 08:24
  • How can I load image with this code? *icons_dict.load("custom_icon", os.path.join(icons_dir, "icon.png"), 'IMAGE')* – 8N Films Mar 05 '21 at 08:25
  • What is my icon ID. How can I figure it out? – 8N Films Mar 05 '21 at 08:28
  • 1
    Take your time and read the answer over there carefully. If that doesn't help for whatever reason, I'd recommend edit your question and explain in detail, what you have tried, why this does not work for you and share your code, see the link above. – brockmann Mar 05 '21 at 08:31
  • I have read that question. but I still don't know why and how I can make a icon. I even copy the code that the answer provide, and it's not work. I wonder how and where can I type the ID of my icon – 8N Films Mar 05 '21 at 08:40
  • Just a register issue for blender 2.8x versions. The error has nothing to do with the actual question... Anyway, updated the code for 2.8+ versions. You're welcome. BTW: If you had read the "answer", you might know that you do not have to set any ID. – brockmann Mar 05 '21 at 08:55
  • @brockmann in hindsight the JJN example is a little poor in that it is using the filepath of the current text in the text editor as the icon file path. Possibly craves a new answer more in line with template examples. Related https://blender.stackexchange.com/questions/62304/custom-icons-script-path-register – batFINGER Mar 05 '21 at 08:56
  • Agree @batFINGER What do you think about replacing that by the actual blend file path? – brockmann Mar 05 '21 at 08:59
  • 1
    Do not agree on re-opening this q. @batFINGER – brockmann Mar 05 '21 at 09:02
  • If you want a mwe, I'd suggest we comment out that line and just add script_path = bpy.data.filepath... What do you think? @batFINGER – brockmann Mar 05 '21 at 09:30

0 Answers0