Helios - LYN-3250 - Fixed morph targets for meshes that had multiple … (#696)
* Helios - LYN-3250 - Fixed morph targets for meshes that had multiple materials (#374) Fixed morph targets for meshes that had multiple materials and were split by AssImp: Recombined them into one mesh in the O3DE scene graph, so the behavior would match FBX SDK.
This commit is contained in:
@@ -285,8 +285,26 @@ namespace AZ
|
||||
void BlendShapeData::GetDebugOutput(SceneAPI::Utilities::DebugOutput& output) const
|
||||
{
|
||||
output.Write("Positions", m_positions);
|
||||
int index = 0;
|
||||
for (const auto& position : m_positions)
|
||||
{
|
||||
output.Write(AZStd::string::format("\t%d", index).c_str(), position);
|
||||
++index;
|
||||
}
|
||||
index = 0;
|
||||
output.Write("Normals", m_normals);
|
||||
for (const auto& normal : m_normals)
|
||||
{
|
||||
output.Write(AZStd::string::format("\t%d", index).c_str(), normal);
|
||||
++index;
|
||||
}
|
||||
index = 0;
|
||||
output.Write("Faces", m_faces);
|
||||
for (const auto& face : m_faces)
|
||||
{
|
||||
output.WriteArray(AZStd::string::format("\t%d", index).c_str(), face.vertexIndex, 3);
|
||||
++index;
|
||||
}
|
||||
}
|
||||
} // GraphData
|
||||
} // SceneData
|
||||
|
||||
@@ -45,7 +45,6 @@ namespace AZ
|
||||
behaviorContext->Class<MeshData>()
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
|
||||
->Attribute(AZ::Script::Attributes::Module, "scene")
|
||||
->Method("GetSdkMeshIndex", &MeshData::GetSdkMeshIndex)
|
||||
->Method("GetControlPointIndex", &MeshData::GetControlPointIndex)
|
||||
->Method("GetUsedControlPointCount", &MeshData::GetUsedControlPointCount)
|
||||
->Method("GetUsedPointIndexForControlPoint", &MeshData::GetUsedPointIndexForControlPoint)
|
||||
@@ -77,10 +76,6 @@ namespace AZ
|
||||
void MeshData::CloneAttributesFrom(const IGraphObject* sourceObject)
|
||||
{
|
||||
IMeshData::CloneAttributesFrom(sourceObject);
|
||||
if (const auto* typedSource = azrtti_cast<const MeshData*>(sourceObject))
|
||||
{
|
||||
SetSdkMeshIndex(typedSource->GetSdkMeshIndex());
|
||||
}
|
||||
}
|
||||
|
||||
void MeshData::AddPosition(const AZ::Vector3& position)
|
||||
@@ -111,15 +106,6 @@ namespace AZ
|
||||
m_faceMaterialIds.push_back(faceMaterialId);
|
||||
}
|
||||
|
||||
void MeshData::SetSdkMeshIndex(int sdkMeshIndex)
|
||||
{
|
||||
m_sdkMeshIndex = sdkMeshIndex;
|
||||
}
|
||||
int MeshData::GetSdkMeshIndex() const
|
||||
{
|
||||
return m_sdkMeshIndex;
|
||||
}
|
||||
|
||||
void MeshData::SetVertexIndexToControlPointIndexMap(int vertexIndex, int controlPointIndex)
|
||||
{
|
||||
m_vertexIndexToControlPointIndexMap[vertexIndex] = controlPointIndex;
|
||||
@@ -206,8 +192,26 @@ namespace AZ
|
||||
void MeshData::GetDebugOutput(SceneAPI::Utilities::DebugOutput& output) const
|
||||
{
|
||||
output.Write("Positions", m_positions);
|
||||
int index = 0;
|
||||
for (const auto& position : m_positions)
|
||||
{
|
||||
output.Write(AZStd::string::format("\t%d", index).c_str(), position);
|
||||
++index;
|
||||
}
|
||||
index = 0;
|
||||
output.Write("Normals", m_normals);
|
||||
for (const auto& normal : m_normals)
|
||||
{
|
||||
output.Write(AZStd::string::format("\t%d", index).c_str(), normal);
|
||||
++index;
|
||||
}
|
||||
index = 0;
|
||||
output.Write("FaceList", m_faceList);
|
||||
for (const auto& face : m_faceList)
|
||||
{
|
||||
output.WriteArray(AZStd::string::format("\t%d", index).c_str(), face.vertexIndex, 3);
|
||||
++index;
|
||||
}
|
||||
output.Write("FaceMaterialIds", m_faceMaterialIds);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,9 +49,6 @@ namespace AZ
|
||||
SCENE_DATA_API void AddFace(const AZ::SceneAPI::DataTypes::IMeshData::Face& face,
|
||||
unsigned int faceMaterialId = AZ::SceneAPI::DataTypes::IMeshData::s_invalidMaterialId);
|
||||
|
||||
SCENE_DATA_API void SetSdkMeshIndex(int sdkMeshIndex);
|
||||
SCENE_DATA_API int GetSdkMeshIndex() const;
|
||||
|
||||
SCENE_DATA_API void SetVertexIndexToControlPointIndexMap(int vertexIndex, int controlPointIndex);
|
||||
SCENE_DATA_API size_t GetUsedControlPointCount() const override;
|
||||
SCENE_DATA_API int GetControlPointIndex(int vertexIndex) const override;
|
||||
@@ -80,8 +77,6 @@ namespace AZ
|
||||
|
||||
AZStd::unordered_map<int, int> m_vertexIndexToControlPointIndexMap;
|
||||
AZStd::unordered_map<int, int> m_controlPointToUsedVertexIndexMap;
|
||||
|
||||
int m_sdkMeshIndex = -1;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user