Hi people.
I’m trying to make my custom “sculpt pie menu” but I’m having problem to call the icon.dat for some of the tools such as the mask tools.
The code is this one (partially copied from the default sculpt pie menu addon included in Blender):
brush_icons = {}
def create_icons():
global brush_icons
icons_directory = bpy.utils.system_resource('DATAFILES', path="icons")
brushes = (
"ops.sculpt.border_mask"
)
for brush in brushes:
filename = os.path.join(icons_directory, f"{brush}.dat")
icon_value = bpy.app.icons.new_triangles_from_file(filename)
brush_icons[brush] = icon_value
def release_icons():
global brush_icons
for value in brush_icons.values():
bpy.app.icons.release(value)
I’m able to call most all the other “brush” icons but when it comes to lasso, box and line selection I got this error:
ValueError: Unable to load from file
Even the file is there, I checked with my own eyes!
Any suggestion is highly appreciated.
Thanks!