diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2019-04-12 15:00:57 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2019-04-12 15:10:10 +0300 |
commit | f3fc8271b81f7c23ba42356a95bbe487e1e339ae (patch) | |
tree | 22b84dbd8993c37929a0b05641f617bafe401579 /release/scripts/templates_py | |
parent | a96d42b2e890160cf5d0f8d3921a575d2ba13768 (diff) |
Fix T63504: Python Template 'ui_previews_dynamic_enum' error
thx @nacioss for the fix
Diffstat (limited to 'release/scripts/templates_py')
-rw-r--r-- | release/scripts/templates_py/ui_previews_dynamic_enum.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/release/scripts/templates_py/ui_previews_dynamic_enum.py b/release/scripts/templates_py/ui_previews_dynamic_enum.py index 39a3750bfee..37ee28bd8cf 100644 --- a/release/scripts/templates_py/ui_previews_dynamic_enum.py +++ b/release/scripts/templates_py/ui_previews_dynamic_enum.py @@ -51,7 +51,11 @@ def enum_previews_from_directory_items(self, context): for i, name in enumerate(image_paths): # generates a thumbnail preview for a file. filepath = os.path.join(directory, name) - thumb = pcoll.load(filepath, filepath, 'IMAGE') + icon = pcoll.get(name) + if not icon: + thumb = pcoll.load(name, filepath, 'IMAGE') + else: + thumb = pcoll[name] enum_items.append((name, name, "", thumb.icon_id, i)) pcoll.my_previews = enum_items |