Merge pull request #1675 from MoritzBrueckner/value-node

Fix value node when used with material params
This commit is contained in:
Lubos Lenco 2020-04-24 16:02:19 +02:00 committed by GitHub
commit 5575ea5f12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1559,7 +1559,7 @@ def write_result(link: bpy.types.NodeLink) -> Optional[str]:
res = parse_value(link.from_node, link.from_socket)
if res is None:
return None
if link.from_node.type == "VALUE":
if link.from_node.type == "VALUE" and not link.from_node.arm_material_param:
curshader.add_const('float', res_var, res)
else:
curshader.write('float {0} = {1};'.format(res_var, res))