[Bf-blender-cvs] [ca66112b296] blender2.8: Fix missing icons in non-portable local builds.

Antony Riakiotakis noreply at git.blender.org
Fri Apr 27 16:10:53 CEST 2018


Commit: ca66112b2967164a38103fb1a6885f44fe86a45a
Author: Antony Riakiotakis
Date:   Fri Apr 27 17:10:28 2018 +0300
Branches: blender2.8
https://developer.blender.org/rBca66112b2967164a38103fb1a6885f44fe86a45a

Fix missing icons in non-portable local builds.

The problem is that some local path is always returned by
bpy_resource_path. The function does not enforce a check for existence
of the path in the low level code.

Since client code may indeed not care about existence of the directory,
I leave bpy_resource_path alone and patch the python code to check for
existence. An  extra argument that enforces the check might be a better
solution, but I will be leaving this to the UI team.

===================================================================

M	release/scripts/startup/bl_ui/space_toolsystem_common.py

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_toolsystem_common.py b/release/scripts/startup/bl_ui/space_toolsystem_common.py
index 0a59b163b29..a4b306193c0 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_common.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_common.py
@@ -118,7 +118,7 @@ class ToolSelectPanelHelper:
             icon_value = _icon_cache.get(icon_name)
             if icon_value is None:
                 dirname = bpy.utils.resource_path('LOCAL')
-                if not dirname:
+                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")



More information about the Bf-blender-cvs mailing list