glTF exporter: fix export of light with shader node

This commit is contained in:
Julien Duroure 2020-01-11 21:28:52 +01:00
parent 8304b9bac7
commit 329f2c4a8b
2 changed files with 4 additions and 3 deletions

View File

@ -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',

View File

@ -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(