[EMFX][ATOM] crash during mesh reload (#1301)
* Fixed a crash when entering game mode, removing a mesh and re-adding mesh.
This commit is contained in:
@@ -629,6 +629,11 @@ namespace AZ
|
||||
|
||||
Data::Asset<RPI::ModelLodAsset> lodAsset;
|
||||
modelLodCreator.End(lodAsset);
|
||||
if (!lodAsset.IsReady())
|
||||
{
|
||||
// [GFX TODO] During mesh reload the modelLodCreator could report errors and result in the lodAsset not ready.
|
||||
return nullptr;
|
||||
}
|
||||
modelCreator.AddLodAsset(AZStd::move(lodAsset));
|
||||
|
||||
lodIndex++;
|
||||
|
||||
@@ -311,7 +311,8 @@ namespace AZ
|
||||
Data::Asset<RPI::ModelAsset> modelAsset = actor->GetMeshAsset();
|
||||
if (!modelAsset.IsReady())
|
||||
{
|
||||
AZ_Error("CreateSkinnedMeshInputFromActor", false, "Attempting to create skinned mesh input buffers for an actor that doesn't have a loaded model.");
|
||||
AZ_Warning("CreateSkinnedMeshInputFromActor", false, "Check if the actor has a mesh added. Right click the source file in the asset browser, click edit settings, "
|
||||
"and navigate to the Meshes tab. Add a mesh if it's missing.");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -456,9 +456,8 @@ namespace AZ
|
||||
void AtomActorInstance::Create()
|
||||
{
|
||||
Destroy();
|
||||
|
||||
m_skinnedMeshInputBuffers = GetRenderActor()->FindOrCreateSkinnedMeshInputBuffers();
|
||||
AZ_Error("AtomActorInstance", m_skinnedMeshInputBuffers, "Failed to get SkinnedMeshInputBuffers from Actor.");
|
||||
AZ_Warning("AtomActorInstance", m_skinnedMeshInputBuffers, "Failed to create SkinnedMeshInputBuffers from Actor. It is likely that this actor doesn't have any meshes");
|
||||
if (m_skinnedMeshInputBuffers)
|
||||
{
|
||||
m_boneTransforms = CreateBoneTransformBufferFromActorInstance(m_actorInstance, GetSkinningMethod());
|
||||
|
||||
Reference in New Issue
Block a user