Defer the nodeWindowPlugin reinit to main thread update. Set the actor file name through actor asset.

Signed-off-by: rhhong <rhhong@amazon.com>
This commit is contained in:
rhhong
2021-08-17 16:17:27 -07:00
parent bc88d2b381
commit 7650683902
3 changed files with 15 additions and 1 deletions
@@ -327,7 +327,16 @@ namespace EMStudio
void NodeWindowPlugin::OnActorReady([[maybe_unused]] EMotionFX::Actor* actor)
{
ReInit();
m_reinitRequested = true;
}
void NodeWindowPlugin::ProcessFrame([[maybe_unused]] float timePassedInSeconds)
{
if (m_reinitRequested)
{
ReInit();
m_reinitRequested = false;
}
}
//-----------------------------------------------------------------------------------------
@@ -60,6 +60,8 @@ namespace EMStudio
EMStudioPlugin* Clone() override;
void ReInit();
void ProcessFrame(float timePassedInSeconds) override;
public slots:
void OnNodeChanged();
void VisibilityChanged(bool isVisible);
@@ -87,5 +89,7 @@ namespace EMStudio
AZStd::unique_ptr<ActorInfo> m_actorInfo;
AZStd::unique_ptr<NodeInfo> m_nodeInfo;
bool m_reinitRequested = false;
};
} // namespace EMStudio
@@ -63,6 +63,7 @@ namespace EMotionFX
&actorSettings,
"");
assetData->m_emfxActor->SetFileName(asset.GetHint().c_str());
assetData->m_emfxActor->Finalize();
// Clear out the EMFX raw asset data.