Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Exception When Closing Play Before Assets are Fully Loaded #168

Open
blhook opened this issue Sep 23, 2021 · 0 comments
Open

[Bug] Exception When Closing Play Before Assets are Fully Loaded #168

blhook opened this issue Sep 23, 2021 · 0 comments

Comments

@blhook
Copy link

blhook commented Sep 23, 2021

I currently have an actor that is attached to the HoudiniPublicAPI in such that when they spawn, they spawn an HDA (see code on bottom for example). When this actor spawns using Play-in-Editor, it will spawn the Actor as expected, as well as the HDA. Generally the play can be stopped fine, too. That said, if the play is stopped before the HDA fully instantiates, this causes an exception in the lambdas of HoudiniEngineDetails.cpp, especially ShouldEnableResetParametersButtonLambda at the code: UHoudiniParameter* NextParm = NextHAC->GetParameterAt(n);. We can circumvent this problem by adding !NextHAC->IsValidLowLevel() to the If performed for the continue (line #229), and then fixing a bad check from a different function to include MainHAC->IsPendingKill() which is missing.

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"

#include "HoudiniPublicAPIAssetWrapper.h"
#include "HoudiniPublicAPI.h"
#include "HoudiniPublicAPIBlueprintLib.h"

#include "TestHoudiniActor.generated.h"

UCLASS()
class ATestHoudiniActor : public AActor
{
    GENERATED_BODY()

public:
    UPROPERTY(EditAnywhere, meta =
        (DisplayName = "Houdini Asset"))
    UHoudiniAsset* HDAToLoad;

protected:
    void BeginPlay() override;

private:
    UPROPERTY()
    UHoudiniPublicAPIAssetWrapper* Asset;
};

inline void ATestHoudiniActor::BeginPlay()
{
    Super::BeginPlay();
    UHoudiniPublicAPI* const HoudiniApi = UHoudiniPublicAPIBlueprintLib::GetAPI();
    Asset = HoudiniApi->InstantiateAsset(HDAToLoad, GetActorTransform(), GetWorld(), nullptr, true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant