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:
authorSamuli Raivio <bqqbarbhg>2021-09-29 18:58:50 +0300
committerBastien Montagne <bastien@blender.org>2021-09-29 19:00:23 +0300
commit9a285d80167fc8c9e8b0c7ab2f2fd3c7487fa01d (patch)
tree16d90e0eead1603cc5d9f1d876d40912b4359909 /io_scene_fbx/export_fbx_bin.py
parentea457d4ab516e0cfa0ea28c5b601c02a87805cf1 (diff)
FBX export / subdivision: Write proper boundary rule
Currently when exporting a subdivision surface (//Geometry / Export Subdivision Surface// enabled) the exporter uses a hard-coded BoundaryRule rule of 2 (CreaseAll, meaning hard corners). The subdivision surface modifier has an option for boundary smoothing mode so this patch propagates that information to the FBX exporter. Example .fbx file with this feature exported from modified Blender 2.93: https://github.com/bqqbarbhg/ufbx/blob/overhaul/data/blender_293x_subsurf_boundary_7400_binary.fbx Reviewed By: mont29 Differential Revision: https://developer.blender.org/D12204
Diffstat (limited to 'io_scene_fbx/export_fbx_bin.py')
-rw-r--r--io_scene_fbx/export_fbx_bin.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/io_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py
index 3950ed5b..09dfaa9f 100644
--- a/io_scene_fbx/export_fbx_bin.py
+++ b/io_scene_fbx/export_fbx_bin.py
@@ -879,7 +879,10 @@ 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
- elem_data_single_int32(geom, b"BoundaryRule", 2) # Round edges like Blender
+ if last_subsurf.boundary_smooth == "PRESERVE_CORNERS":
+ elem_data_single_int32(geom, b"BoundaryRule", 2) # CreaseAll
+ else:
+ elem_data_single_int32(geom, b"BoundaryRule", 1) # CreaseEdge
elem_data_single_int32(geom, b"PreviewDivisionLevels", last_subsurf.levels)
elem_data_single_int32(geom, b"RenderDivisionLevels", last_subsurf.render_levels)