Fix T63775: Toolbar icons ignore BLENDER_SYSTEM_DATAFILES
The environment variable to locate system data-files was ignored by toolbar icons. Add bpy.utils.system_resource to match Blender's internal data-file access.
This commit is contained in:
@@ -195,11 +195,8 @@ class ToolSelectPanelHelper:
|
||||
assert(type(icon_name) is str)
|
||||
icon_value = _icon_cache.get(icon_name)
|
||||
if icon_value is None:
|
||||
dirname = bpy.utils.resource_path('LOCAL')
|
||||
if not os.path.exists(dirname):
|
||||
# TODO(campbell): use a better way of finding datafiles.
|
||||
dirname = bpy.utils.resource_path('SYSTEM')
|
||||
filename = os.path.join(dirname, "datafiles", "icons", icon_name + ".dat")
|
||||
dirname = bpy.utils.system_resource('DATAFILES', "icons")
|
||||
filename = os.path.join(dirname, icon_name + ".dat")
|
||||
try:
|
||||
icon_value = bpy.app.icons.new_triangles_from_file(filename)
|
||||
except Exception as ex:
|
||||
|
Reference in New Issue
Block a user