]> git.tdb.fi Git - libs/gl.git/commitdiff
Force the usage of normalmap as RGB data
authorMikko Rasa <tdb@tdb.fi>
Mon, 12 Apr 2021 22:27:00 +0000 (01:27 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 12 Apr 2021 22:27:00 +0000 (01:27 +0300)
blender/io_mspgl/material.py

index 93f177908b4b6ede25de2a24b2e1f7d8fc1d5246..e69cab844e3f2aa7cb4649eca55e2291e3da922f 100644 (file)
@@ -30,8 +30,10 @@ class MaterialProperty:
                        from_node, _ = get_linked_node_and_socket(node_tree, input_socket)
                        alpha_from = None
                        if from_node:
+                               usage = None
                                if from_node.type=='NORMAL_MAP':
                                        from_node, _ = get_linked_node_and_socket(node_tree, from_node.inputs["Color"])
+                                       usage = 'RGB'
                                elif from_node.type=='RGBTOBW':
                                        from_node, _ = get_linked_node_and_socket(node_tree, from_node.inputs["Color"])
 
@@ -42,7 +44,9 @@ class MaterialProperty:
 
                                if from_node.type=='TEX_IMAGE':
                                        self.texture = from_node
-                                       if alpha_from:
+                                       if usage:
+                                               self.tex_usage = usage
+                                       elif alpha_from:
                                                self.tex_usage = 'RGBA'
                                        elif type(self.value)==tuple:
                                                self.tex_usage = 'RGB'