From 95633e7f1b1bb40f058cbb6d7ed0d7afd1512a24 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 9 Feb 2015 20:54:57 +0100 Subject: Fix T43582: FBX IO: Handling of 'smooth edges' was rather flacky on both export and import. On export, we also want to tage as sharp edges from flat faces, and edges shared by more than two faces. On import, we want to tag all faces as smooth and enable autosmooth, when we only have smooth edge data... --- io_scene_fbx/import_fbx.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'io_scene_fbx/import_fbx.py') diff --git a/io_scene_fbx/import_fbx.py b/io_scene_fbx/import_fbx.py index dc2e69b3..ccc5caef 100644 --- a/io_scene_fbx/import_fbx.py +++ b/io_scene_fbx/import_fbx.py @@ -987,17 +987,21 @@ def blen_read_geom_layer_smooth(fbx_obj, mesh): if fbx_layer_mapping == b'ByEdge': # some models have bad edge data, we cant use this info... if not mesh.edges: + print("warning skipping sharp edges data, no valid edges...") return False blen_data = mesh.edges - ok_smooth = blen_read_geom_array_mapped_edge( + blen_read_geom_array_mapped_edge( mesh, blen_data, "use_edge_sharp", fbx_layer_data, None, fbx_layer_mapping, fbx_layer_ref, 1, 1, layer_id, xform=lambda s: not s, ) - return ok_smooth + # We only set sharp edges here, not face smoothing itself... + mesh.use_auto_smooth = True + mesh.show_edge_sharp = True + return False elif fbx_layer_mapping == b'ByPolygon': blen_data = mesh.polygons return blen_read_geom_array_mapped_polygon( -- cgit v1.2.3