[Bf-extensions-cvs] [329f2c4a] blender-v2.82-release: glTF exporter: fix export of light with shader node

Julien Duroure noreply at git.blender.org
Sat Jan 11 21:29:23 CET 2020


Commit: 329f2c4a8b9fd0cc5a22f0d938757b7749e34b7e
Author: Julien Duroure
Date:   Sat Jan 11 21:28:52 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rBA329f2c4a8b9fd0cc5a22f0d938757b7749e34b7e

glTF exporter: fix export of light with shader node

===================================================================

M	io_scene_gltf2/__init__.py
M	io_scene_gltf2/blender/exp/gltf2_blender_gather_lights.py

===================================================================

diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index ab7946b5..bbb7f12d 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, 1, 37),
+    "version": (1, 1, 38),
     'blender': (2, 81, 6),
     'location': 'File > Import-Export',
     'description': 'Import-Export as glTF 2.0',
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_lights.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_lights.py
index dbb59e21..05284163 100644
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_lights.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_lights.py
@@ -67,7 +67,7 @@ def __gather_intensity(blender_lamp, _) -> Optional[float]:
         if blender_lamp.type != 'SUN':
             # When using cycles, the strength should be influenced by a LightFalloff node
             result = gltf2_blender_search_node_tree.from_socket(
-                emission_node.get("Strength"),
+                emission_node.inputs.get("Strength"),
                 gltf2_blender_search_node_tree.FilterByType(bpy.types.ShaderNodeLightFalloff)
             )
             if result:
@@ -121,7 +121,8 @@ def __gather_extras(blender_lamp, export_settings) -> Optional[Any]:
 def __get_cycles_emission_node(blender_lamp) -> Optional[bpy.types.ShaderNodeEmission]:
     if blender_lamp.use_nodes and blender_lamp.node_tree:
         for currentNode in blender_lamp.node_tree.nodes:
-            if isinstance(currentNode, bpy.types.ShaderNodeOutputLamp):
+            is_shadernode_output = isinstance(currentNode, bpy.types.ShaderNodeOutputLight)
+            if is_shadernode_output:
                 if not currentNode.is_active_output:
                     continue
                 result = gltf2_blender_search_node_tree.from_socket(



More information about the Bf-extensions-cvs mailing list