]> git.tdb.fi Git - libs/gl.git/blobdiff - blender/io_mspgl/material.py
Export texture sampling settings as sampler objects
[libs/gl.git] / blender / io_mspgl / material.py
index b275caa37f54a92a2a459df8ca9d66d7d12d90d0..ce31317418042f1d92d2d69e7f12432d47740cf2 100644 (file)
@@ -87,6 +87,15 @@ class Material:
 
                self.properties = (self.base_color, self.metalness, self.roughness, self.normal, self.emission)
 
+               sampler_settings = None
+               for p in self.properties:
+                       if p.texture:
+                               settings = (p.texture.default_filter, p.texture.interpolation, p.texture.use_mipmap, p.texture.max_anisotropy)
+                               if sampler_settings is None:
+                                       sampler_settings = settings
+                               elif settings!=sampler_settings:
+                                       raise Exception("Conflicting sampler settings in material textures")
+
 
 class MaterialMap:
        def __init__(self, materials):