forked from LeenkxTeam/LNXSDK
Update leenkx/blender/lnx/material/cycles_nodes/nodes_shader.py
This commit is contained in:
parent
e562b626cb
commit
1f52eed66c
@ -192,6 +192,12 @@ if bpy.app.version < (4, 1, 0):
|
|||||||
c.write_normal(node.inputs[2])
|
c.write_normal(node.inputs[2])
|
||||||
state.out_basecol = c.parse_vector_input(node.inputs[0])
|
state.out_basecol = c.parse_vector_input(node.inputs[0])
|
||||||
state.out_roughness = c.parse_value_input(node.inputs[1])
|
state.out_roughness = c.parse_value_input(node.inputs[1])
|
||||||
|
# Prevent black material when metal = 1.0 and roughness = 0.0
|
||||||
|
try:
|
||||||
|
if float(state.out_roughness) < 0.00101:
|
||||||
|
state.out_roughness = '0.001'
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
state.out_metallic = '1.0'
|
state.out_metallic = '1.0'
|
||||||
else:
|
else:
|
||||||
def parse_bsdfglossy(node: bpy.types.ShaderNodeBsdfAnisotropic, out_socket: NodeSocket, state: ParserState) -> None:
|
def parse_bsdfglossy(node: bpy.types.ShaderNodeBsdfAnisotropic, out_socket: NodeSocket, state: ParserState) -> None:
|
||||||
@ -199,6 +205,12 @@ else:
|
|||||||
c.write_normal(node.inputs[4])
|
c.write_normal(node.inputs[4])
|
||||||
state.out_basecol = c.parse_vector_input(node.inputs[0])
|
state.out_basecol = c.parse_vector_input(node.inputs[0])
|
||||||
state.out_roughness = c.parse_value_input(node.inputs[1])
|
state.out_roughness = c.parse_value_input(node.inputs[1])
|
||||||
|
# Prevent black material when metal = 1.0 and roughness = 0.0
|
||||||
|
try:
|
||||||
|
if float(state.out_roughness) < 0.00101:
|
||||||
|
state.out_roughness = '0.001'
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
state.out_metallic = '1.0'
|
state.out_metallic = '1.0'
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user