Page MenuHome

WorkSpaceTool bl_icon trouble
Confirmed, NormalPublicTO DO


System Information
Operating system: Windows-10-10.0.18362 64 Bits
Graphics card: GeForce GTX 1050 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 388.13

Blender Version
Broken: version: 2.80 (sub 75), branch: master, commit date: 2019-07-29 14:47, hash: rBf6cb5f54494e
Worked: (optional)

Short description of error
So. I create WorkSpaceTool class with my custom icon and register it. If I install the addon with this tool from zip file, icon moved to addon directory (C:\Users\Username\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\MyAddonName\icons\ops.generic.toolname.dat). But in the toolbar I have "None" icon. Ok, before calling


I use next lines:

frpath = os.path.join(os.path.abspath(os.path.dirname(os.path.dirname(__file__))),
                      "PathTool", "icons", "ops.generic.toolname.dat")
path = os.path.split([0]
pathto = os.path.join(path, "2.80", "datafiles", "icons", "ops.generic.toolname.dat")

if os.path.isfile(frpath) and (not os.path.isfile(pathto)):
        copyfile(frpath, pathto)
        print("Icon file not copied!")

to move icon to C:\Program Files\Blender Foundation\Blender\2.80\datafiles\icons. This operation can be done only if start Blender as administrator.
But why I can't search icon directly in the adon directory? Why user whu install my addon need to move one file by hands?

Related Objects

Event Timeline

Ivan (vanyOk) updated the task description. (Show Details)
Ivan (vanyOk) added a project: Add-ons.
Ivan (vanyOk) edited a custom field.
Philipp Oeser (lichtwerk) lowered the priority of this task from 90 to 50.

This is true, since the toolsystem always uses bpy.utils.system_resource('DATAFILES', "icons"), see _icon_value_from_icon_handle.

Since you already changed this from bug to TODO, I would kindly ask @Campbell Barton (campbellbarton) about the design of this: how are addons supposed to provide their tool icons bundled? I think we can confirm this [I expect lots of addons wanting to do this]?
Should this be put on

Ok, thank you for feedback. I'm waiting