diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-09-27 19:38:36 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-09-27 19:39:50 +0300 |
commit | 99fa874c858dbbe10be70d3be03ad337780c1ec0 (patch) | |
tree | 916f545e098b9607c06bf2b9a855a34928364776 /source/blender/datatoc | |
parent | 37d88fdb8681afab6ff347b91df232d179ab7885 (diff) |
Fix blender_icons_update.py not working after mono icon changes.
Diffstat (limited to 'source/blender/datatoc')
-rwxr-xr-x | source/blender/datatoc/datatoc_icon_split.py | 16 |
1 files changed, 12 insertions, 4 deletions
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) |