Skip to content

Commit

Permalink
Update addons/io_hubs_addon/components/operators.py
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
GottfriedHofmann and Exairnous authored Sep 3, 2024
1 parent 6a69cfe commit c0c68ea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion addons/io_hubs_addon/components/operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit c0c68ea

Please sign in to comment.