[Bf-blender-cvs] [99fa874c858] blender2.8: Fix blender_icons_update.py not working after mono icon changes.

Brecht Van Lommel noreply at git.blender.org
Thu Sep 27 18:43:18 CEST 2018


Commit: 99fa874c858dbbe10be70d3be03ad337780c1ec0
Author: Brecht Van Lommel
Date:   Thu Sep 27 18:38:36 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB99fa874c858dbbe10be70d3be03ad337780c1ec0

Fix blender_icons_update.py not working after mono icon changes.

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

M	source/blender/datatoc/datatoc_icon_split.py

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

diff --git a/source/blender/datatoc/datatoc_icon_split.py b/source/blender/datatoc/datatoc_icon_split.py
index 399d7df4d8d..87f3fdae478 100755
--- a/source/blender/datatoc/datatoc_icon_split.py
+++ b/source/blender/datatoc/datatoc_icon_split.py
@@ -128,21 +128,26 @@ def dice_icon_name(
         # Init on demand
         if not _dice_icon_name_cache:
             import re
+            count = 0
 
             # Search for eg: DEF_ICON(BRUSH_NUDGE) --> BRUSH_NUDGE
-            re_icon = re.compile(r'^\s*DEF_ICON\(\s*([A-Za-z0-9_]+)\s*\).*$')
+            re_icon = re.compile(r'^\s*DEF_ICON.*\(\s*([A-Za-z0-9_]+)\s*\).*$')
 
             ui_icons_h = os.path.join(SOURCE_DIR, "source", "blender", "editors", "include", "UI_icons.h")
             with open(ui_icons_h, 'r', encoding="utf-8") as f:
                 for l in f:
                     match = re_icon.search(l)
                     if match:
-                        icon_name = match.group(1).lower()
-                        # print(l.rstrip())
-                        _dice_icon_name_cache[len(_dice_icon_name_cache)] = icon_name
+                        if l.find('DEF_ICON_BLANK') == -1:
+                            icon_name = match.group(1).lower()
+                            _dice_icon_name_cache[count] = icon_name
+                        count += 1
         # ---- Done with icon cache
 
         index = (y * parts_x) + x
+        if index not in _dice_icon_name_cache:
+            return None
+
         icon_name = _dice_icon_name_cache[index]
 
         # for debugging its handy to sort by number
@@ -209,6 +214,9 @@ def dice(
                 parts_x, parts_y,
                 name_style=name_style, prefix=output_prefix
             )
+            if not id_str:
+                continue
+
             filepath = os.path.join(output, id_str)
             if VERBOSE:
                 print("  writing:", filepath)



More information about the Bf-blender-cvs mailing list