]> git.tdb.fi Git - libs/gl.git/commitdiff
Fix for material export with certain unusual emission configurations
authorMikko Rasa <tdb@tdb.fi>
Wed, 31 Jul 2024 21:50:02 +0000 (00:50 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 31 Jul 2024 21:50:02 +0000 (00:50 +0300)
If the color and strength inputs are both unconnected, it's fine for them
to have arbitrary values.

blender/io_mspgl/material.py

index a20d77182db5d3a75843a7a6e9deaf52f6c888cc..a9c349d08cd3a5926e96b07905ea0b00753effe5 100644 (file)
@@ -211,9 +211,9 @@ class MaterialProperty:
                        from_node, from_sock = get_linked_node_and_socket(node_tree, input_socket)
                        if strength_socket:
                                if not from_node:
-                                       if input_socket.default_value[:3]!=(1.0, 1.0, 1.0):
-                                               raise Exception("Unsupported material property scale {}".format(input_socket.default_value))
                                        from_node, from_sock = get_linked_node_and_socket(node_tree, strength_socket)
+                                       if from_node and input_socket.default_value[:3]!=(1.0, 1.0, 1.0):
+                                               raise Exception("Unsupported material property scale {}".format(tuple(input_socket.default_value)))
                                elif strength_socket.is_linked:
                                        raise Exception("Separate inputs for value and strength are not supported")
                                elif strength_socket.default_value!=1.0: