[Bf-extensions-cvs] [a8ffea50] master: Fix T103949: FBX Exporter: Most loose edges export as one connected polygon

Mysteryem noreply at git.blender.org
Mon Jan 23 15:47:30 CET 2023


Commit: a8ffea50ed75e3490a99c79007ae21f9b7932595
Author: Mysteryem
Date:   Mon Jan 23 15:39:34 2023 +0100
Branches: master
https://developer.blender.org/rBAa8ffea50ed75e3490a99c79007ae21f9b7932595

Fix T103949: FBX Exporter: Most loose edges export as one connected polygon

FBX exporter with the Loose Edges option enabled would add only half of the required polygon loop start indices, causing about half of the exported loose edges to be exported as one large polygon.

This patch doubles the number of loop start indices added for loose edges so that each loose edge gets its own polygon.

---

One 2-sided polygon is added per loose edge. Two loops are added for each 2-sided polygon, so each subsequent loop start index added will be 2 greater than the previous, hence the 'step' of 2 in the `range`. But the 'step' of 2 effectively halves the number of values output by the `range`, so the difference between the 'start' and 'end' of the `range` (the number of loose edges or `len(t_le)`) has to be doubled to accommodate, which is what this patch does.

Reviewed By: mont29

Maniphest Tasks: T103946

Differential Revision: https://developer.blender.org/D17054

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

M	io_scene_fbx/export_fbx_bin.py

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

diff --git a/io_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py
index e35506e9..e7fd4fd9 100644
--- a/io_scene_fbx/export_fbx_bin.py
+++ b/io_scene_fbx/export_fbx_bin.py
@@ -902,7 +902,7 @@ def fbx_data_mesh_elements(root, me_obj, scene_data, done_meshes):
     if scene_data.settings.use_mesh_edges:
         t_le = tuple(e.vertices for e in me.edges if e.is_loose)
         t_pvi.extend(chain(*t_le))
-        t_ls.extend(range(loop_nbr, loop_nbr + len(t_le), 2))
+        t_ls.extend(range(loop_nbr, loop_nbr + len(t_le) * 2, 2))
         del t_le
 
     # Edges...



More information about the Bf-extensions-cvs mailing list