Getting Blender tools icon ID’s

The ID of the tool icons correspond to the names of the files in which they are stored and they can be obtained simply by looking in the appropriate Blender folder. However, icon IDs can also be obtained through the Blender Python API with the help ot the ToolSelectPanelHelper class.

Let’s import it first

Now we can get a pointer to all the tool classes in the area we need. For example, for a 3D viewport area tools:

Now we can get the tool pointer by context.

If the tool is not in a tool group, we can simply get its name and icon ID:

If a tool combines multiple tools – was registered in the API with the group=True option, we will get a pointer to a tuple, each element of which is a separate tool.

We can get their names and icon IDs by looping through the tuple elements:

Full code that will display the name and ID of the icon for all tools in the 3D viewport area:

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comment
Newest
Oldest Most Voted
Inline Feedbacks
View all comments