Merge pull request #1871 from MoritzBrueckner/fix-shader-socket

Fix export for sockets with no default value
This commit is contained in:
Lubos Lenco 2020-09-16 22:27:42 +02:00 committed by GitHub
commit 730dbbaccb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -256,7 +256,10 @@ def build_default_node(inp: bpy.types.NodeSocket):
default_value = '"{:s}"'.format(default_value.replace('"', '\\"') )
inp_type = inp.arm_socket_type # any custom socket's `type` is "VALUE". might as well have valuable type information for custom nodes as well.
else:
default_value = inp.default_value
if hasattr(inp, 'default_value'):
default_value = inp.default_value
else:
default_value = None
if isinstance(default_value, str):
default_value = '"{:s}"'.format(default_value.replace('"', '\\"') )
inp_type = inp.type