From c0c68ead2e1fbbaa2310c50b027efdfe51693039 Mon Sep 17 00:00:00 2001 From: Gottfried Hofmann Date: Tue, 3 Sep 2024 17:53:19 +0200 Subject: [PATCH] Update addons/io_hubs_addon/components/operators.py At some point in the Blender 4 series linear was separated out into a bunch of different versions, Linear Rec.709 is what we have used when importing HDRs and seems to be the new default. This code should make it work for all Blender versions Co-authored-by: Exairnous --- addons/io_hubs_addon/components/operators.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/io_hubs_addon/components/operators.py b/addons/io_hubs_addon/components/operators.py index 28564cc0..97078f2c 100644 --- a/addons/io_hubs_addon/components/operators.py +++ b/addons/io_hubs_addon/components/operators.py @@ -823,7 +823,10 @@ def setup_moz_lightmap_nodes(self, node_tree): img = bpy.data.images.new('LightMap', self.resolution, self.resolution, alpha=False, float_buffer=True) lightmap_texture_node.image = img - lightmap_texture_node.image.colorspace_settings.name = 'Linear' + if bpy.app.version < (4, 0, 0): + lightmap_texture_node.image.colorspace_settings.name = "Linear" + else: + lightmap_texture_node.image.colorspace_settings.name = "Linear Rec.709" UVmap_node = mat_nodes.new(type="ShaderNodeUVMap") UVmap_node.uv_map = "UV1"