From 62966fc479a88591b99130cc6c1e6b0e48ac4b81 Mon Sep 17 00:00:00 2001 From: Michael Schnabel Date: Sun, 19 Jul 2020 18:13:18 +0200 Subject: [PATCH] slight changes --- io_mesh_w3d/common/utils/material_import.py | 2 -- io_mesh_w3d/common/utils/mesh_import.py | 1 + tests/w3x/cases/test_roundtrip.py | 3 --- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/io_mesh_w3d/common/utils/material_import.py b/io_mesh_w3d/common/utils/material_import.py index 963f9108..29543856 100644 --- a/io_mesh_w3d/common/utils/material_import.py +++ b/io_mesh_w3d/common/utils/material_import.py @@ -15,7 +15,6 @@ def create_materials(context, mesh_struct, mesh, triangles): b_mesh = bmesh.new() b_mesh.from_mesh(mesh) - # shader material stuff if mesh_struct.shader_materials: # TODO: check for no tx coords and more than 1 shader material tx_coords = mesh_struct.material_passes[0].tx_coords @@ -24,7 +23,6 @@ def create_materials(context, mesh_struct, mesh, triangles): material = create_shader_material(context, mesh_struct.shader_materials[0], uv_layer) mesh.materials.append(material) - # vertex material stuff elif mesh_struct.vert_materials: # TODO: check for no tx coords and more than 1 vertex material / material pass tx_coords = mesh_struct.material_passes[0].tx_stages[0].tx_coords[0] diff --git a/io_mesh_w3d/common/utils/mesh_import.py b/io_mesh_w3d/common/utils/mesh_import.py index ae6aab38..00121daf 100644 --- a/io_mesh_w3d/common/utils/mesh_import.py +++ b/io_mesh_w3d/common/utils/mesh_import.py @@ -17,6 +17,7 @@ def create_mesh(context, mesh_struct, coll): mesh.from_pydata(mesh_struct.verts, [], triangles) mesh.normals_split_custom_set_from_vertices(mesh_struct.normals) + mesh.use_auto_smooth = True # TODO: remove this and fix tests accordingly mesh.update() mesh.validate() diff --git a/tests/w3x/cases/test_roundtrip.py b/tests/w3x/cases/test_roundtrip.py index 5095e12d..bbf39243 100644 --- a/tests/w3x/cases/test_roundtrip.py +++ b/tests/w3x/cases/test_roundtrip.py @@ -170,9 +170,6 @@ def test_roundtrip_splitted(self): # check created include entries root = find_root(self, self.outpath() + 'output_skn.w3x') - print('##############') - for incl in root.find('Includes').findall('Include'): - print(incl.get('source')) self.assertEqual(6, len(root.find('Includes').findall('Include'))) self.reset_scene()