11
$\begingroup$

It has always bugged me that Blender add-ons (in this case the Sapling add-on for generating trees) have a wall socket as their icon in the Add menu, instead of something more custom. I would like to be able to set this icon for these add-ons and for the scripts that I write.

Is it possible to change this icon, either through a custom build of Blender, or by modifying the Python script in any way?

enter image description here

$\endgroup$
8
$\begingroup$

For existing addons you'll have to find its code and change the code where operators are added to menus.

When you write your own add-on, you can choose a different icon by specifying the icon parameter to the operator function with which you register your operator in a function.

From the Mesh Add operator template in the Blender text editor the snippet:

def menu_func(self, context):
    self.layout.operator(AddBox.bl_idname, icon='MESH_CUBE')

For a list of icons to choose from see the blender documention. There are many places where you can define an icon, but there is only one list. For instance for the menu function of a layout. It takes an icon, the list is the same.

Icons outside these are not (yet) supported. You can replace the entire icon set though by specifying an icon file at the bottom of the User Interface section of the theme editing in User Preferences

$\endgroup$
  • $\begingroup$ is there a reason the icon path dialog is gone in 2.68a? Or has it just moved someplace else? $\endgroup$ – Haunt_House Aug 14 '13 at 21:07
  • 1
    $\begingroup$ That looks like a bug. $\endgroup$ – jesterKing Aug 16 '13 at 22:14
  • $\begingroup$ Bug report is filed and closed. The Icon thing isn't working yet so the hiding of the field is intentional. $\endgroup$ – Haunt_House Aug 17 '13 at 19:53
8
$\begingroup$

In addition to the things already mentioned by jesterKing:

Icons already in Blender
To see all the available icons embedded in Blender (and therefore accessible to any addon) you can use the Icon Enumerator Addon.

Often I turn to this post on BlenderArtists by HansPKG, who assembled an image of most icons and their reference names

Adding your own icons
The blender wiki page Dev:2.5/Doc/How to/Add an icon has a thorough description of how to add icons of your own, this is currently possible only when you do your own Blender builds.

$\endgroup$
  • $\begingroup$ Nice add about building Blender. Didn't really think of that (as Q was about addons). $\endgroup$ – jesterKing Jun 28 '13 at 17:00
  • 4
    $\begingroup$ would be neat to be able to load a small raster image as custom icons, it's one of the few areas in Blender that isn't easily customizable. $\endgroup$ – zeffii Jun 28 '13 at 17:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.