Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--io_scene_fbx/__init__.py2
-rw-r--r--io_scene_fbx/export_fbx_bin.py4
-rw-r--r--io_scene_fbx/import_fbx.py5
3 files changed, 9 insertions, 2 deletions
diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py
index ec1afd09..7fdef2b0 100644
--- a/io_scene_fbx/__init__.py
+++ b/io_scene_fbx/__init__.py
@@ -21,7 +21,7 @@
bl_info = {
"name": "FBX format",
"author": "Campbell Barton, Bastien Montagne, Jens Restemeier",
- "version": (4, 17, 2),
+ "version": (4, 17, 3),
"blender": (2, 81, 6),
"location": "File > Import-Export",
"description": "FBX IO meshes, UV's, vertex colors, materials, textures, cameras, lamps and actions",
diff --git a/io_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py
index e4d0feb3..b852adaa 100644
--- a/io_scene_fbx/export_fbx_bin.py
+++ b/io_scene_fbx/export_fbx_bin.py
@@ -1010,7 +1010,9 @@ def fbx_data_mesh_elements(root, me_obj, scene_data, done_meshes):
for e in me.edges:
if e.key not in edges_map:
continue # Only loose edges, in theory!
- t_ec[edges_map[e.key]] = e.crease
+ # Blender squares those values before sending them to OpenSubdiv, when other softwares don't,
+ # so we need to compensate that to get similar results through FBX...
+ t_ec[edges_map[e.key]] = e.crease * e.crease
lay_crease = elem_data_single_int32(geom, b"LayerElementEdgeCrease", 0)
elem_data_single_int32(lay_crease, b"Version", FBX_GEOMETRY_CREASE_VERSION)
diff --git a/io_scene_fbx/import_fbx.py b/io_scene_fbx/import_fbx.py
index 27e46076..9b8fbad1 100644
--- a/io_scene_fbx/import_fbx.py
+++ b/io_scene_fbx/import_fbx.py
@@ -1117,6 +1117,8 @@ def blen_read_geom_layer_smooth(fbx_obj, mesh):
return False
def blen_read_geom_layer_edge_crease(fbx_obj, mesh):
+ from math import sqrt
+
fbx_layer = elem_find_first(fbx_obj, b'LayerElementEdgeCrease')
if fbx_layer is None:
@@ -1151,6 +1153,9 @@ def blen_read_geom_layer_edge_crease(fbx_obj, mesh):
fbx_layer_data, None,
fbx_layer_mapping, fbx_layer_ref,
1, 1, layer_id,
+ # Blender squares those values before sending them to OpenSubdiv, when other softwares don't,
+ # so we need to compensate that to get similar results through FBX...
+ xform=sqrt,
)
else:
print("warning layer %r mapping type unsupported: %r" % (fbx_layer.id, fbx_layer_mapping))