[Bf-extensions-cvs] [7a850287] master: Fix FBX IO handling of BoundaryRule enum values.

Samuli Raivio noreply at git.blender.org
Mon Jul 11 12:02:18 CEST 2022


Commit: 7a8502871c34db0343cc7de52d6b49b15a84238a
Author: Samuli Raivio
Date:   Mon Jul 11 11:56:49 2022 +0200
Branches: master
https://developer.blender.org/rBA7a8502871c34db0343cc7de52d6b49b15a84238a

Fix FBX IO handling of BoundaryRule enum values.

Support for BoundaryRule (how to handle edges/vertices in subdivision
surface) was added in rBA9a285d80167f, but the values between
'CreaseAll' and 'CreaseEdge' were inverted.

Reviewed By: mont29

Differential Revision: D15035

===================================================================

M	io_scene_fbx/__init__.py
M	io_scene_fbx/export_fbx_bin.py
M	io_scene_fbx/import_fbx.py

===================================================================

diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py
index 1b7e646d..feea8436 100644
--- a/io_scene_fbx/__init__.py
+++ b/io_scene_fbx/__init__.py
@@ -3,7 +3,7 @@
 bl_info = {
     "name": "FBX format",
     "author": "Campbell Barton, Bastien Montagne, Jens Restemeier",
-    "version": (4, 36, 2),
+    "version": (4, 36, 3),
     "blender": (3, 2, 0),
     "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 ae7be61c..c34a5182 100644
--- a/io_scene_fbx/export_fbx_bin.py
+++ b/io_scene_fbx/export_fbx_bin.py
@@ -865,9 +865,9 @@ def fbx_data_mesh_elements(root, me_obj, scene_data, done_meshes):
         if last_subsurf:
             elem_data_single_int32(geom, b"Smoothness", 2) # Display control mesh and smoothed
             if last_subsurf.boundary_smooth == "PRESERVE_CORNERS":
-                elem_data_single_int32(geom, b"BoundaryRule", 2) # CreaseAll
+                elem_data_single_int32(geom, b"BoundaryRule", 1) # CreaseAll
             else:
-                elem_data_single_int32(geom, b"BoundaryRule", 1) # CreaseEdge
+                elem_data_single_int32(geom, b"BoundaryRule", 2) # CreaseEdge
             elem_data_single_int32(geom, b"PreviewDivisionLevels", last_subsurf.levels)
             elem_data_single_int32(geom, b"RenderDivisionLevels", last_subsurf.render_levels)
 
diff --git a/io_scene_fbx/import_fbx.py b/io_scene_fbx/import_fbx.py
index 90f0c016..72d666c1 100644
--- a/io_scene_fbx/import_fbx.py
+++ b/io_scene_fbx/import_fbx.py
@@ -2929,7 +2929,7 @@ def load(operator, context, filepath="",
                             mod.levels = preview_levels
                             mod.render_levels = render_levels
                             boundary_rule = elem_prop_first(elem_find_first(fbx_sdata, b'BoundaryRule'), default=1)
-                            if boundary_rule == 2:
+                            if boundary_rule == 1:
                                 mod.boundary_smooth = "PRESERVE_CORNERS"
                             else:
                                 mod.boundary_smooth = "ALL"



More information about the Bf-extensions-cvs mailing list