From: Mikko Rasa Date: Sun, 25 Sep 2022 16:13:43 +0000 (+0300) Subject: Refactor handling of texture storage properties in the Blender exporter X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=6fbc3217471932e1e46a694e4c4376673010f814;p=libs%2Fgl.git Refactor handling of texture storage properties in the Blender exporter --- diff --git a/blender/io_mspgl/__init__.py b/blender/io_mspgl/__init__.py index 4b6e2ff4..c23b60f1 100644 --- a/blender/io_mspgl/__init__.py +++ b/blender/io_mspgl/__init__.py @@ -10,7 +10,7 @@ files = ("animation", "armature", "context", "datafile", "export", "export_animation", "export_armature", "export_camera", "export_light", "export_material", "export_mesh", "export_object", "export_scene", "export_texture", "material", "mesh", "operators", "properties", "scene", - "util") + "texture", "util") if "bpy" in locals(): import imp diff --git a/blender/io_mspgl/export_texture.py b/blender/io_mspgl/export_texture.py index 8e107a71..2269e27a 100644 --- a/blender/io_mspgl/export_texture.py +++ b/blender/io_mspgl/export_texture.py @@ -38,9 +38,8 @@ class TextureExporter: if tex_node.use_mipmap: tex_res.statements.append(Statement("generate_mipmap", True)) - colorspace = image.colorspace_settings.name - if len(channels)==1 and colorspace=='sRGB': - raise Exception("Unsupported configuration on texture {}: Grayscale with sRGB".format(image.name)) + from .texture import Texture + texture = Texture(tex_node, channels) invert_mask = sum(1<