diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2020-02-23 14:03:50 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2020-02-23 14:03:50 +0300 |
commit | b966913caab34eef52f148f9ccf6770cf527d87b (patch) | |
tree | d43b04bfb9114a2be91489c0de3f78b8242b510c /io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py | |
parent | ec5ca6a6cb545bc965ebfe5661a0a4d7ecf57154 (diff) |
glTF importer: use emission/alpha sockets on Principled node
Diffstat (limited to 'io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py')
-rwxr-xr-x | io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py b/io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py index 1c295981..a4910fa0 100755 --- a/io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py @@ -46,28 +46,25 @@ def pbr_metallic_roughness(mh: MaterialHelper): pbr_node = mh.node_tree.nodes.new('ShaderNodeBsdfPrincipled') pbr_node.location = 10, 300 - # Create material output. - # TODO: when the exporter can understand them, use the emission/alpha - # socket on the Principled node instead - emission_socket, alpha_socket = make_output_nodes( + make_output_nodes( mh, location=(250, 260), shader_socket=pbr_node.outputs[0], - make_emission_socket=mh.needs_emissive(), - make_alpha_socket=not mh.is_opaque(), + make_emission_socket=False, + make_alpha_socket=False, ) emission( mh, location=(-200, 860), - color_socket=emission_socket, + color_socket=pbr_node.inputs['Emission'], ) base_color( mh, location=(-200, 380), color_socket=pbr_node.inputs['Base Color'], - alpha_socket=alpha_socket, + alpha_socket=pbr_node.inputs['Alpha'] if not mh.is_opaque() else None, ) metallic_roughness( |