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:
+10
-1
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
|
||||
+4
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user