[Bf-extensions-cvs] [f1334a21] master: glTF importer: take into account normal map scale/strength
Julien Duroure
noreply at git.blender.org
Wed Jan 23 21:51:00 CET 2019
Commit: f1334a212bfb0c1419b4bada6a66230332217ce2
Author: Julien Duroure
Date: Wed Jan 23 21:50:25 2019 +0100
Branches: master
https://developer.blender.org/rBAf1334a212bfb0c1419b4bada6a66230332217ce2
glTF importer: take into account normal map scale/strength
===================================================================
M io_scene_gltf2/blender/imp/gltf2_blender_map_normal.py
===================================================================
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_map_normal.py b/io_scene_gltf2/blender/imp/gltf2_blender_map_normal.py
index ba8302b7..f28b6fc4 100755
--- a/io_scene_gltf2/blender/imp/gltf2_blender_map_normal.py
+++ b/io_scene_gltf2/blender/imp/gltf2_blender_map_normal.py
@@ -77,6 +77,12 @@ class BlenderNormalMap():
else:
normalmap_node["gltf2_texcoord"] = 0 # TODO set in pre_compute instead of here
+ # Set strength
+ if pymaterial.normal_texture.scale is not None:
+ normalmap_node.inputs[0].default_value = pymaterial.normal_texture.scale
+ else:
+ normalmap_node.inputs[0].default_value = 1.0 # Default
+
# create links
node_tree.links.new(mapping.inputs[0], uvmap.outputs[0])
node_tree.links.new(text.inputs[0], mapping.outputs[0])
More information about the Bf-extensions-cvs
mailing list