Skip to content

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

@blhook

Description

@blhook

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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions