Skip to content
Snippets Groups Projects
Commit 92e2024c authored by Julien Duroure's avatar Julien Duroure Committed by Julien DUROURE
Browse files

Fix: glTF importer shading flat/smooth

glTF importer: fix shading flat/smooth. polygons were to be flat by default, now they are smooth.

So updating to flat when no normals in input glTF

Pull Request: https://projects.blender.org/blender/blender-addons/pulls/104717
parent 06328e8a
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
bl_info = { bl_info = {
'name': 'glTF 2.0 format', 'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors', 'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
"version": (3, 6, 25), "version": (3, 6, 27),
'blender': (3, 5, 0), 'blender': (3, 5, 0),
'location': 'File > Import-Export', 'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0', 'description': 'Import-Export as glTF 2.0',
......
...@@ -641,7 +641,8 @@ def set_poly_smoothing(gltf, pymesh, mesh, vert_normals, loop_vidxs): ...@@ -641,7 +641,8 @@ def set_poly_smoothing(gltf, pymesh, mesh, vert_normals, loop_vidxs):
num_polys = len(mesh.polygons) num_polys = len(mesh.polygons)
if gltf.import_settings['import_shading'] == "FLAT": if gltf.import_settings['import_shading'] == "FLAT":
# Polys are flat by default; don't have to do anything # Polys are smooth by default, setting to flat
mesh.shade_flat()
return return
if gltf.import_settings['import_shading'] == "SMOOTH": if gltf.import_settings['import_shading'] == "SMOOTH":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment