Page MenuHome

Toolbar icons do not honour BLENDER_SYSTEM_DATAFILES
Open, Confirmed, MediumPublic


System Information
Operating system: FreeBSD-12.0-STABLE-amd64-64bit-ELF 64 Bits
Graphics card: GeForce GT 730/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 390.87

Blender Version
Broken: version: 2.80 (sub 58), branch: master, commit date: 2019-04-20 17:01, hash: rBd11d5403f0a4

Short description of error
The environment variable BLENDER_SYSTEM_DATAFILES can be set to allow placing datafiles in different locations. The toolbar icons fail to follow this path and can only be found using the 2.80/datafiles path construct.

Exact steps for others to reproduce the error
Move the 2.80/datafiles folder to a different location than blender and set BLENDER_SYSTEM_DATAFILES to match. Only the toolbar icons fail to be found.

Also setting BLENDER_USER_DATAFILES does not help. Could/should this also be included in the icon search path?



Event Timeline

first note(s):

  • looks for icon folder in datafiles via bpy.utils.resource_path('LOCAL'), then bpy.utils.resource_path('SYSTEM')
  • under the hood resource_path uses BKE_appdir_folder_id_version (not good -- doesnt check environment variables at all)
  • there is also bpy.utils.user_resource('DATAFILES')
  • under the hood user_resource uses BKE_appdir_folder_id_user_notest (this checks environment variables but could fail -- because it doesnt check for subfolder existance -- see rBfe7c7d2820f8)
  • also above would only work with BLENDER_USER_DATAFILES, not BLENDER_SYSTEM_DATAFILES

to reliably go over all possible directories [including checking if environment variables are set] it would be good to have the equivalent of what init_iconfile_list() does:
icondir = BKE_appdir_folder_id(BLENDER_DATAFILES, "icons")
[In a way, this was done prior to rBfe7c7d2820f8]

Needs a bit more thinking to get it right from bpy, stay tuned...