First pass FBX -> Scene File conversion. (#1699)
This is the simple pass, minimizing code changes and focused on comments. Signed-off-by: stankowi <4838196+AMZN-stankowi@users.noreply.github.com>
This commit is contained in:
+2
-2
@@ -42,7 +42,7 @@ namespace AZ
|
||||
m_softNames.push_back(aznew NodeSoftNameSetting("^.*_[Pp][Hh][Yy][Ss](_optimized)?$", PatternMatcher::MatchApproach::Regex, "PhysicsMesh", true));
|
||||
m_softNames.push_back(aznew NodeSoftNameSetting("_ignore", PatternMatcher::MatchApproach::PostFix, "Ignore", false));
|
||||
// If the filename ends with "_anim" this will mark all nodes as "Ignore" unless they're derived from IAnimationData. This will
|
||||
// cause only animations to be exported from the .fbx file even if there's other data available.
|
||||
// cause only animations to be exported from the source scene file even if there's other data available.
|
||||
m_softNames.push_back(aznew FileSoftNameSetting("_anim", PatternMatcher::MatchApproach::PostFix, "Ignore", false,
|
||||
{ FileSoftNameSetting::GraphType(SceneAPI::DataTypes::IAnimationData::TYPEINFO_Name()) }));
|
||||
|
||||
@@ -166,7 +166,7 @@ namespace AZ
|
||||
"Soft naming conventions", "Update the naming conventions to suit your project.")
|
||||
->Attribute(AZ::Edit::Attributes::AutoExpand, false)
|
||||
->DataElement(AZ::Edit::UIHandlers::Default, &SceneProcessingConfigSystemComponent::m_UseCustomNormals,
|
||||
"Use Custom Normals", "When enabled, Open 3D Engine will use the DCC assets custom or tangent space normals. When disabled, the normals will be averaged. This setting can be overridden on individual FBX asset settings.")
|
||||
"Use Custom Normals", "When enabled, Open 3D Engine will use the DCC assets custom or tangent space normals. When disabled, the normals will be averaged. This setting can be overridden on an individual scene file's asset settings.")
|
||||
->Attribute(AZ::Edit::Attributes::AutoExpand, false);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -107,7 +107,7 @@ namespace AZ::SceneGenerationComponents
|
||||
return AZ::SceneAPI::Events::ProcessingResult::Failure;
|
||||
}
|
||||
|
||||
// Now that we have the tangents and bitangents, calculate the tangent w values for the ones that we imported from Fbx, as they only have xyz.
|
||||
// Now that we have the tangents and bitangents, calculate the tangent w values for the ones that we imported from the scene file, as they only have xyz.
|
||||
UpdateFbxTangentWValues(graph, nodeIndex, mesh);
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace AZ::SceneGenerationComponents
|
||||
size_t uvSetIndex = 0;
|
||||
while (uvData)
|
||||
{
|
||||
// Get the tangents and bitangents from Fbx.
|
||||
// Get the tangents and bitangents from the source scene.
|
||||
AZ::SceneAPI::DataTypes::IMeshVertexTangentData* fbxTangentData = AZ::SceneAPI::SceneData::TangentsRule::FindTangentData(graph, nodeIndex, uvSetIndex, AZ::SceneAPI::DataTypes::TangentSpace::FromFbx);
|
||||
AZ::SceneAPI::DataTypes::IMeshVertexBitangentData* fbxBitangentData = AZ::SceneAPI::SceneData::TangentsRule::FindBitangentData(graph, nodeIndex, uvSetIndex, AZ::SceneAPI::DataTypes::TangentSpace::FromFbx);
|
||||
|
||||
@@ -197,7 +197,7 @@ namespace AZ::SceneGenerationComponents
|
||||
return true; // No fatal error
|
||||
}
|
||||
|
||||
// Check if we had tangents inside the Fbx file.
|
||||
// Check if we had tangents inside the source scene file.
|
||||
AZ::SceneAPI::DataTypes::IMeshVertexTangentData* fbxTangentData = AZ::SceneAPI::SceneData::TangentsRule::FindTangentData(graph, nodeIndex, 0, AZ::SceneAPI::DataTypes::TangentSpace::FromFbx);
|
||||
AZ::SceneAPI::DataTypes::IMeshVertexBitangentData* fbxBitangentData = AZ::SceneAPI::SceneData::TangentsRule::FindBitangentData(graph, nodeIndex, 0, AZ::SceneAPI::DataTypes::TangentSpace::FromFbx);
|
||||
|
||||
@@ -211,7 +211,7 @@ namespace AZ::SceneGenerationComponents
|
||||
requiredSpaces.emplace_back(AZ::SceneAPI::DataTypes::TangentSpace::MikkT);
|
||||
}
|
||||
|
||||
// If all we need is import from FBX, and we have tangent data from Fbx already, then skip generating.
|
||||
// If all we need is import from the source scene, and we have tangent data from the source scene already, then skip generating.
|
||||
if ((requiredSpaces.size() == 1 && requiredSpaces[0] == AZ::SceneAPI::DataTypes::TangentSpace::FromFbx) && fbxTangentData && fbxBitangentData)
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace SceneBuilder
|
||||
if (m_cachedFingerprint.empty())
|
||||
{
|
||||
// put them in an ORDERED set so that changing the reflection
|
||||
// or the gems loaded does not invalidate FBX files due to order of reflection changing.
|
||||
// or the gems loaded does not invalidate scene files due to order of reflection changing.
|
||||
AZStd::set<AZStd::string> fragments;
|
||||
|
||||
AZ::SerializeContext* context = nullptr;
|
||||
@@ -350,7 +350,7 @@ namespace SceneBuilder
|
||||
AZ::u32 SceneBuilderWorker::BuildSubId(const AZ::SceneAPI::Events::ExportProduct& product) const
|
||||
{
|
||||
// Instead of the just the lower 16-bits, use the full 32-bits that are available. There are production examples of
|
||||
// uber-fbx files that contain hundreds of meshes that need to be split into individual mesh objects as an example.
|
||||
// uber-scene files that contain hundreds of meshes that need to be split into individual mesh objects as an example.
|
||||
AZ::u32 id = static_cast<AZ::u32>(product.m_id.GetHash());
|
||||
|
||||
if (product.m_lod.has_value())
|
||||
|
||||
Reference in New Issue
Block a user