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

Add two parameters modification support for ProcessHDA blueprint node #251

Open
wants to merge 1 commit into
base: Houdini19.5-Unreal5.00
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Source/HoudiniEngineEditor/Private/HoudiniPublicAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "HoudiniPublicAPIAssetWrapper.h"
#include "HoudiniPublicAPIInputTypes.h"
#include "HoudiniEngineCommands.h"
#include "HoudiniAssetComponent.h"

#include "Engine/World.h"

Expand Down Expand Up @@ -78,6 +79,8 @@ UHoudiniPublicAPI::InstantiateAsset_Implementation(
const bool bInEnableAutoBake,
const FString& InBakeDirectoryPath,
const EHoudiniEngineBakeOption InBakeMethod,
const EHoudiniStaticMeshMethod InStaticMeshMethod,
const FMeshBuildSettings InMeshBuildSettings,
const bool bInRemoveOutputAfterBake,
const bool bInRecenterBakedActors,
const bool bInReplacePreviousBake)
Expand Down Expand Up @@ -106,6 +109,8 @@ UHoudiniPublicAPI::InstantiateAsset_Implementation(
bInEnableAutoBake,
InBakeDirectoryPath,
InBakeMethod,
InStaticMeshMethod,
InMeshBuildSettings,
bInRemoveOutputAfterBake,
bInRecenterBakedActors,
bInReplacePreviousBake))
Expand All @@ -129,6 +134,8 @@ UHoudiniPublicAPI::InstantiateAssetWithExistingWrapper_Implementation(
const bool bInEnableAutoBake,
const FString& InBakeDirectoryPath,
const EHoudiniEngineBakeOption InBakeMethod,
const EHoudiniStaticMeshMethod InStaticMeshMethod,
const FMeshBuildSettings InMeshBuildSettings,
const bool bInRemoveOutputAfterBake,
const bool bInRecenterBakedActors,
const bool bInReplacePreviousBake)
Expand Down Expand Up @@ -173,6 +180,8 @@ UHoudiniPublicAPI::InstantiateAssetWithExistingWrapper_Implementation(
BakeDirectoryPath.Path = InBakeDirectoryPath;
InWrapper->SetBakeFolder(BakeDirectoryPath);
InWrapper->SetBakeMethod(InBakeMethod);
InWrapper->SetStaticMeshMethod(InStaticMeshMethod);
InWrapper->SetMeshBuildSettings(InMeshBuildSettings);
InWrapper->SetRemoveOutputAfterBake(bInRemoveOutputAfterBake);
InWrapper->SetRecenterBakedActors(bInRecenterBakedActors);
InWrapper->SetReplacePreviousBake(bInReplacePreviousBake);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,52 @@ UHoudiniPublicAPIAssetWrapper::GetBakeMethod_Implementation(EHoudiniEngineBakeOp
return true;
}

bool
UHoudiniPublicAPIAssetWrapper::SetStaticMeshMethod_Implementation(const EHoudiniStaticMeshMethod InStaticMeshMethod)
{
UHoudiniAssetComponent* HAC = nullptr;
if (!GetValidHoudiniAssetComponentWithError(HAC))
return false;

HAC->StaticMeshMethod = InStaticMeshMethod;

return true;
}

bool UHoudiniPublicAPIAssetWrapper::GetStaticMeshMethod_Implementation(EHoudiniStaticMeshMethod& OutStaticMeshMethod)
{
UHoudiniAssetComponent* HAC = nullptr;
if (!GetValidHoudiniAssetComponentWithError(HAC))
return false;

OutStaticMeshMethod = HAC->StaticMeshMethod;

return true;
}

bool
UHoudiniPublicAPIAssetWrapper::SetMeshBuildSettings_Implementation(const FMeshBuildSettings InMeshBuildSettings)
{
UHoudiniAssetComponent* HAC = nullptr;
if (!GetValidHoudiniAssetComponentWithError(HAC))
return false;

HAC->StaticMeshBuildSettings = InMeshBuildSettings;

return true;
}

bool UHoudiniPublicAPIAssetWrapper::GetMeshBuildSettings_Implementation(FMeshBuildSettings& OutMeshBuildSettings)
{
UHoudiniAssetComponent* HAC = nullptr;
if (!GetValidHoudiniAssetComponentWithError(HAC))
return false;

OutMeshBuildSettings = HAC->StaticMeshBuildSettings;

return true;
}

bool
UHoudiniPublicAPIAssetWrapper::SetRemoveOutputAfterBake_Implementation(const bool bInRemoveOutputAfterBake)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ UHoudiniPublicAPIProcessHDANode::ProcessHDA(
const bool bInEnableAutoBake,
const FString& InBakeDirectoryPath,
const EHoudiniEngineBakeOption InBakeMethod,
const EHoudiniStaticMeshMethod InStaticMeshMethod,
const FMeshBuildSettings InMeshBuildSettings,
const bool bInRemoveOutputAfterBake,
const bool bInRecenterBakedActors,
const bool bInReplacePreviousBake,
Expand All @@ -91,6 +93,8 @@ UHoudiniPublicAPIProcessHDANode::ProcessHDA(
Node->bEnableAutoBake = bInEnableAutoBake;
Node->BakeDirectoryPath = InBakeDirectoryPath;
Node->BakeMethod = InBakeMethod;
Node->StaticMeshMethod = InStaticMeshMethod;
Node->StaticMeshBuildSettings = InMeshBuildSettings;
Node->bRemoveOutputAfterBake = bInRemoveOutputAfterBake;
Node->bRecenterBakedActors = bInRecenterBakedActors;
Node->bReplacePreviousBake = bInReplacePreviousBake;
Expand Down Expand Up @@ -134,6 +138,8 @@ UHoudiniPublicAPIProcessHDANode::Activate()
bEnableAutoBake,
BakeDirectoryPath,
BakeMethod,
StaticMeshMethod,
StaticMeshBuildSettings,
bRemoveOutputAfterBake,
bRecenterBakedActors,
bReplacePreviousBake))
Expand Down
5 changes: 5 additions & 0 deletions Source/HoudiniEngineEditor/Public/HoudiniPublicAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#pragma once

#include "CoreMinimal.h"
#include "HoudiniAssetComponent.h"
#include "UObject/NoExportTypes.h"
#include "Templates/SubclassOf.h"

Expand Down Expand Up @@ -134,6 +135,8 @@ class HOUDINIENGINEEDITOR_API UHoudiniPublicAPI : public UHoudiniPublicAPIObject
const bool bInEnableAutoBake=false,
const FString& InBakeDirectoryPath="",
const EHoudiniEngineBakeOption InBakeMethod=EHoudiniEngineBakeOption::ToActor,
const EHoudiniStaticMeshMethod InStaticMeshMethod=EHoudiniStaticMeshMethod::RawMesh,
const FMeshBuildSettings InMeshBuildSettings = FMeshBuildSettings(),
const bool bInRemoveOutputAfterBake=false,
const bool bInRecenterBakedActors=false,
const bool bInReplacePreviousBake=false);
Expand Down Expand Up @@ -170,6 +173,8 @@ class HOUDINIENGINEEDITOR_API UHoudiniPublicAPI : public UHoudiniPublicAPIObject
const bool bInEnableAutoBake=false,
const FString& InBakeDirectoryPath="",
const EHoudiniEngineBakeOption InBakeMethod=EHoudiniEngineBakeOption::ToActor,
const EHoudiniStaticMeshMethod InStaticMeshMethod = EHoudiniStaticMeshMethod::RawMesh,
const FMeshBuildSettings InMeshBuildSettings = FMeshBuildSettings(),
const bool bInRemoveOutputAfterBake=false,
const bool bInRecenterBakedActors=false,
const bool bInReplacePreviousBake=false);
Expand Down
12 changes: 12 additions & 0 deletions Source/HoudiniEngineEditor/Public/HoudiniPublicAPIAssetWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,18 @@ class HOUDINIENGINEEDITOR_API UHoudiniPublicAPIAssetWrapper : public UHoudiniPub
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category="Houdini|Public API")
bool GetBakeMethod(EHoudiniEngineBakeOption& OutBakeMethod);

UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category="Houdini|Public API")
bool SetStaticMeshMethod(const EHoudiniStaticMeshMethod InStaticMeshMethod);

UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category="Houdini|Public API")
bool GetStaticMeshMethod(EHoudiniStaticMeshMethod& OutStaticMeshMethod);

UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category="Houdini|Public API")
bool SetMeshBuildSettings(const FMeshBuildSettings InMeshBuildSettings);

UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category="Houdini|Public API")
bool GetMeshBuildSettings(FMeshBuildSettings& OutMeshBuildSettings);

/**
* Set the bRemoveOutputAfterBake property, that controls if temporary outputs are removed after a successful bake.
* @param bInRemoveOutputAfterBake If true, then after a successful bake, the HACs outputs will be cleared and
Expand Down
12 changes: 12 additions & 0 deletions Source/HoudiniEngineEditor/Public/HoudiniPublicAPIProcessHDANode.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@

#include "HoudiniPublicAPIAssetWrapper.h"

#include "HoudiniAssetComponent.h"

#include "HoudiniPublicAPIProcessHDANode.generated.h"


Expand Down Expand Up @@ -103,6 +105,8 @@ class HOUDINIENGINEEDITOR_API UHoudiniPublicAPIProcessHDANode : public UBlueprin
const bool bInEnableAutoBake=false,
const FString& InBakeDirectoryPath="",
const EHoudiniEngineBakeOption InBakeMethod=EHoudiniEngineBakeOption::ToActor,
const EHoudiniStaticMeshMethod InStaticMeshMethod=EHoudiniStaticMeshMethod::RawMesh,
const FMeshBuildSettings InMeshBuildSettings=FMeshBuildSettings(),
const bool bInRemoveOutputAfterBake=false,
const bool bInRecenterBakedActors=false,
const bool bInReplacePreviousBake=false,
Expand Down Expand Up @@ -223,6 +227,14 @@ class HOUDINIENGINEEDITOR_API UHoudiniPublicAPIProcessHDANode : public UBlueprin
UPROPERTY()
EHoudiniEngineBakeOption BakeMethod;

/** The static mesh generation method. */
UPROPERTY()
EHoudiniStaticMeshMethod StaticMeshMethod;

/** Build Settings to be used when generating the Static Meshes for this Houdini Asset */
UPROPERTY()
FMeshBuildSettings StaticMeshBuildSettings;

/** Remove temporary HDA output after a bake. */
UPROPERTY()
bool bRemoveOutputAfterBake;
Expand Down