Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Duroure <julien.duroure@gmail.com>2020-02-23 14:03:50 +0300
committerJulien Duroure <julien.duroure@gmail.com>2020-02-23 14:03:50 +0300
commitb966913caab34eef52f148f9ccf6770cf527d87b (patch)
treed43b04bfb9114a2be91489c0de3f78b8242b510c /io_scene_gltf2
parentec5ca6a6cb545bc965ebfe5661a0a4d7ecf57154 (diff)
glTF importer: use emission/alpha sockets on Principled node
Diffstat (limited to 'io_scene_gltf2')
-rwxr-xr-xio_scene_gltf2/__init__.py2
-rwxr-xr-xio_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py13
2 files changed, 6 insertions, 9 deletions
diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index 29856ca6..df658cad 100755
--- a/io_scene_gltf2/__init__.py
+++ b/io_scene_gltf2/__init__.py
@@ -15,7 +15,7 @@
bl_info = {
'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
- "version": (1, 2, 29),
+ "version": (1, 2, 30),
'blender': (2, 82, 7),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',
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(