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>2022-03-28 10:36:27 +0300
committerBastien Montagne <bastien@blender.org>2022-03-28 10:36:27 +0300
commitd700a6888ecd93092c0c2f00ce7c2815a813613b (patch)
tree1719cf469dfb787ec16075f445e370b297ce1faa /io_scene_fbx/__init__.py
parent0f6165054bb2c802156e8fcd1d2d55c501455bc2 (diff)
Add "Triangulate Faces" option to FBX export
I noticed the FBX export was missing a triangulation option seen in other software and other Blender exporters such as .obj. This feature is rather useful for example for ensuring consistent normal map baking in third party software, where tangent space gets easily messed up with tools using mikktspace that depends on triangulation choices. This patch adds a "Triangulate Faces" option in the export options similarly to what the Wavefront OBJ exporter has. Diff-wise it's rather simple by reusing the temporary mesh creation from "Apply Modifiers". Reviewed By: mont29 Differential Revision: https://developer.blender.org/D14352
Diffstat (limited to 'io_scene_fbx/__init__.py')
-rw-r--r--io_scene_fbx/__init__.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py
index 0abafc33..9933322b 100644
--- a/io_scene_fbx/__init__.py
+++ b/io_scene_fbx/__init__.py
@@ -5,7 +5,7 @@
bl_info = {
"name": "FBX format",
"author": "Campbell Barton, Bastien Montagne, Jens Restemeier",
- "version": (4, 34, 2),
+ "version": (4, 35, 0),
"blender": (3, 2, 0),
"location": "File > Import-Export",
"description": "FBX IO meshes, UV's, vertex colors, materials, textures, cameras, lamps and actions",
@@ -477,6 +477,11 @@ class ExportFBX(bpy.types.Operator, ExportHelper):
"(will only work correctly with tris/quads only meshes!)",
default=False,
)
+ use_triangles: BoolProperty(
+ name="Triangulate Faces",
+ description="Convert all faces to triangles",
+ default=False,
+ )
use_custom_props: BoolProperty(
name="Custom Properties",
description="Export custom properties",
@@ -754,6 +759,7 @@ class FBX_PT_export_geometry(bpy.types.Panel):
#sub.enabled = operator.use_mesh_modifiers and False # disabled in 2.8...
#sub.prop(operator, "use_mesh_modifiers_render")
layout.prop(operator, "use_mesh_edges")
+ layout.prop(operator, "use_triangles")
sub = layout.row()
#~ sub.enabled = operator.mesh_smooth_type in {'OFF'}
sub.prop(operator, "use_tspace")