Removing a function that was originally added to convert model asset ids in levels that were created prior to December 2020, which pre-dates anything created for the public O3DE release.

Signed-off-by: amzn-tommy <waltont@amazon.com>
This commit is contained in:
amzn-tommy
2021-09-29 12:07:01 -07:00
parent b79c2f385d
commit 96d833fc4e
@@ -194,41 +194,13 @@ namespace AZ
incompatible.push_back(AZ_CRC("MeshService", 0x71d8a455));
}
// [GFX TODO] [ATOM-13339] Remove the ModelAsset id fix up function in MeshComponentController
// Model id was changed due to fix for [ATOM-13312]. We can remove this code when all the levels are updated.
void FixUpModelAsset(Data::Asset<RPI::ModelAsset>& modelAsset)
{
Data::AssetId assetId;
Data::AssetCatalogRequestBus::BroadcastResult(
assetId,
&Data::AssetCatalogRequestBus::Events::GetAssetIdByPath,
modelAsset.GetHint().c_str(),
AZ::RPI::ModelAsset::TYPEINFO_Uuid(),
false);
if (assetId != modelAsset.GetId())
{
if (assetId.IsValid())
{
modelAsset = Data::Asset<RPI::ModelAsset>{ assetId, AZ::RPI::ModelAsset::TYPEINFO_Uuid(), modelAsset.GetHint().c_str() };
modelAsset.SetAutoLoadBehavior(AZ::Data::AssetLoadBehavior::QueueLoad);
}
else
{
AZ_Error("MeshComponentController", false, "Failed to find asset id for [%s] ", modelAsset.GetHint().c_str());
}
}
}
MeshComponentController::MeshComponentController(const MeshComponentConfig& config)
: m_configuration(config)
{
FixUpModelAsset(m_configuration.m_modelAsset);
}
void MeshComponentController::Activate(const AZ::EntityComponentIdPair& entityComponentIdPair)
{
FixUpModelAsset(m_configuration.m_modelAsset);
const AZ::EntityId entityId = entityComponentIdPair.GetEntityId();
m_entityComponentIdPair = entityComponentIdPair;