HoudiniEngineForUnreal
HoudiniEngineForUnreal copied to clipboard
Unable to cook HDA after PIE session
Hi,
The plugin has a bug that the Houdini engine ticking is not resumed after PIE, which makes it impossible to cook/build any HDAs afterwards.
Repro steps:
- Start the editor, then start PIE immediately.
- Close PIE, try to cook/build any HDAs in the project.
- Nothing happens.
The bug is in
void FHoudiniEngineEditor::RegisterEditorDelegates()
{
...
if (FHoudiniEngine::Get().IsTicking())
{
const bool bWasConnected = FHoudiniEngine::Get().GetSessionStatus() == EHoudiniSessionStatus::Connected;
EndPIEEditorDelegateHandle = FEditorDelegates::EndPIE.AddLambda([&, bWasConnected](const bool bEndPIEIsSimulating)
{
if (bWasConnected)
{
// If the Houdini session was previously connected, we need to reestablish the connection after PIE.
// We need to restart the current Houdini Engine Session
// This will reuse the previous session if it didnt shutdown, or start a new one if needed.
// (HARS shuts down when stopping the session, so we cant just reconnect when not using Session Sync)
FHoudiniEngineCommands::RestartSession();
}
#if 1
else
{
FHoudiniEngine::Get().StartTicking();
}
#endif
FEditorDelegates::EndPIE.Remove(EndPIEEditorDelegateHandle);
});
}
}
So if the houdini engine wasn't connected before PIE, bWasConnected will be false and the plugin will never attempt to resume the ticking when PIE ends. The part within the #if 1/#endif section is my fix and I can veirfy it works.