def parse_bsdfprincipled(node: bpy.types.ShaderNodeBsdfPrincipled, out_socket: NodeSocket, state: ParserState) -> None: if state.parse_surface: c.write_normal(node.inputs[20]) state.out_basecol = c.parse_vector_input(node.inputs[0]) # subsurface = c.parse_vector_input(node.inputs[1]) # subsurface_radius = c.parse_vector_input(node.inputs[2]) # subsurface_color = c.parse_vector_input(node.inputs[3]) state.out_metallic = c.parse_value_input(node.inputs[4]) state.out_specular = c.parse_value_input(node.inputs[5]) # specular_tint = c.parse_vector_input(node.inputs[6]) state.out_roughness = c.parse_value_input(node.inputs[7]) # aniso = c.parse_vector_input(node.inputs[8]) # aniso_rot = c.parse_vector_input(node.inputs[9]) # sheen = c.parse_vector_input(node.inputs[10]) # sheen_tint = c.parse_vector_input(node.inputs[11]) # clearcoat = c.parse_vector_input(node.inputs[12]) # clearcoat_rough = c.parse_vector_input(node.inputs[13]) # ior = c.parse_vector_input(node.inputs[14]) # transmission = c.parse_vector_input(node.inputs[15]) # transmission_roughness = c.parse_vector_input(node.inputs[16]) if node.inputs[17].is_linked or node.inputs[17].default_value[0] != 0.0: state.out_emission = '({0}.x)'.format(c.parse_vector_input(node.inputs[17])) state.emission_found = True # clearcoar_normal = c.parse_vector_input(node.inputs[21]) # tangent = c.parse_vector_input(node.inputs[22]) if state.parse_opacity: if len(node.inputs) > 21: state.out_opacity = c.parse_value_input(node.inputs[19])
def parse_emission(node: bpy.types.ShaderNodeEmission, out_socket: NodeSocket, state: ParserState) -> None: if state.parse_surface: # Multiply basecol state.out_basecol = c.parse_vector_input(node.inputs[0]) state.out_emission = '1.0' state.emission_found = True emission_strength = c.parse_value_input(node.inputs[1]) state.out_basecol = '({0} * {1})'.format(state.out_basecol, emission_strength)