From 6d2e6efa13684daa0d6cf1f401161074d4b7c5fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 3 Jan 2019 11:33:19 +0100 Subject: [PATCH] Update users of the material after replacing a HDRi This causes a refresh and immediately shows the new texture in the viewport. --- blender_cloud/texture_browser/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/blender_cloud/texture_browser/__init__.py b/blender_cloud/texture_browser/__init__.py index 800be5a..f7cfe51 100644 --- a/blender_cloud/texture_browser/__init__.py +++ b/blender_cloud/texture_browser/__init__.py @@ -723,6 +723,11 @@ class PILLAR_OT_switch_hdri(pillar.PillarOperatorMixin, current_image['bcloud_file_uuid'] = file_uuid current_image.filepath = file_path # This automatically reloads the image from disk. + # This forces users of the image to update. + for datablocks in bpy.data.user_map({current_image}).values(): + for datablock in datablocks: + datablock.update_tag() + await pillar.download_file_by_uuid(file_uuid, local_path, meta_path,