Fix: glTF importer shading flat/smooth #104717

Merged
Julien Duroure merged 2 commits from fix_gltf_shading into blender-v3.6-release 2023-06-26 19:20:01 +02:00
2 changed files with 4 additions and 2 deletions
Showing only changes of commit f3bc210ae8 - Show all commits

View File

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

View File

@ -641,7 +641,9 @@ 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
poly_smooths = np.full(num_polys, False)
mesh.polygons.foreach_set('use_smooth', poly_smooths)
return return
if gltf.import_settings['import_shading'] == "SMOOTH": if gltf.import_settings['import_shading'] == "SMOOTH":