Change CalculateTangents to false as default and calculate normals/tangents by default if missing
This commit is contained in:
@@ -117,8 +117,8 @@ namespace FlaxEditor.Content.Import
|
||||
/// <summary>
|
||||
/// True if calculate model tangents, otherwise will import them.
|
||||
/// </summary>
|
||||
[EditorOrder(40), DefaultValue(true), EditorDisplay("Geometry"), Tooltip("Enable model tangent vectors recalculating")]
|
||||
public bool CalculateTangents { get; set; } = true;
|
||||
[EditorOrder(40), DefaultValue(false), EditorDisplay("Geometry"), Tooltip("Enable model tangent vectors recalculating")]
|
||||
public bool CalculateTangents { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Calculated normals smoothing angle.
|
||||
|
||||
@@ -514,7 +514,7 @@ bool ProcessMesh(OpenFbxImporterData& data, const ofbx::Mesh* aMesh, MeshData& m
|
||||
}
|
||||
|
||||
// Normals
|
||||
if (data.Options.CalculateNormals)
|
||||
if (data.Options.CalculateNormals || !normals)
|
||||
{
|
||||
if (mesh.GenerateNormals(data.Options.SmoothingNormalsAngle))
|
||||
{
|
||||
@@ -540,7 +540,7 @@ bool ProcessMesh(OpenFbxImporterData& data, const ofbx::Mesh* aMesh, MeshData& m
|
||||
}
|
||||
|
||||
// Tangents
|
||||
if (data.Options.CalculateTangents && mesh.UVs.HasItems())
|
||||
if ((data.Options.CalculateTangents || !tangents) && mesh.UVs.HasItems())
|
||||
{
|
||||
if (mesh.GenerateTangents(data.Options.SmoothingTangentsAngle))
|
||||
{
|
||||
|
||||
@@ -170,7 +170,7 @@ public:
|
||||
float SmoothingNormalsAngle = 175.0f;
|
||||
bool FlipNormals = false;
|
||||
float SmoothingTangentsAngle = 45.0f;
|
||||
bool CalculateTangents = true;
|
||||
bool CalculateTangents = false;
|
||||
bool OptimizeMeshes = true;
|
||||
bool MergeMeshes = true;
|
||||
bool ImportLODs = true;
|
||||
|
||||
Reference in New Issue
Block a user