From 2c70ceb48959cdd1ea282068cd69b1fd130c7633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 30 Aug 2016 16:33:09 +0200 Subject: [PATCH] Solved issue T48992 --- blender_cloud/texture_browser.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/blender_cloud/texture_browser.py b/blender_cloud/texture_browser.py index 6e02309..ef1cc1a 100644 --- a/blender_cloud/texture_browser.py +++ b/blender_cloud/texture_browser.py @@ -968,6 +968,11 @@ def _hdri_download_panel(self, current_image): props.file_uuid = current_image.hdri_variation +# Storage for variation labels, as the strings in EnumProperty items +# MUST be kept in Python memory. +variation_label_storage = {} + + def hdri_variation_choices(self, context): if context.area.type == 'IMAGE_EDITOR': image = context.edit_image @@ -979,8 +984,11 @@ def hdri_variation_choices(self, context): if 'bcloud_node' not in image: return [] - choices = [(file_doc['file'], file_doc['resolution'], '') - for file_doc in image['bcloud_node']['properties']['files']] + choices = [] + for file_doc in image['bcloud_node']['properties']['files']: + label = file_doc['resolution'] + variation_label_storage[label] = label + choices.append((file_doc['file'], label, '')) return choices