Skip to content

Commit

Permalink
- Fixed non editor build error
Browse files Browse the repository at this point in the history
  • Loading branch information
dpernuit committed Jul 9, 2024
1 parent a4086d3 commit bce0be7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
9 changes: 8 additions & 1 deletion Source/HoudiniEngine/Private/HoudiniEngineManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ FHoudiniEngineManager::Tick(float DeltaTime)
// Update the tick time for this component
CurrentComponent->LastTickTime = dNow;
}

#if WITH_EDITORONLY_DATA
// See if we need to update this HDA's details panel
if (CurrentComponent->bNeedToUpdateEditorProperties)
{
Expand All @@ -363,6 +363,7 @@ FHoudiniEngineManager::Tick(float DeltaTime)
FHoudiniEngineUtils::UpdateEditorProperties(true);
CurrentComponent->bNeedToUpdateEditorProperties = false;
}
#endif
}

// Handle Asset delete
Expand Down Expand Up @@ -490,9 +491,11 @@ FHoudiniEngineManager::ProcessComponent(UHoudiniAssetComponent* HAC)
// Refresh UI when pause cooking
if (!FHoudiniEngine::Get().HasUIFinishRefreshingWhenPausingCooking())
{
#if WITH_EDITORONLY_DATA
// Trigger a details panel update if the Houdini asset actor is selected
if (HAC->IsOwnerSelected())
HAC->bNeedToUpdateEditorProperties = true;
#endif

// Finished refreshing UI of one HDA.
FHoudiniEngine::Get().RefreshUIDisplayedWhenPauseCooking();
Expand Down Expand Up @@ -660,8 +663,10 @@ FHoudiniEngineManager::ProcessComponent(UHoudiniAssetComponent* HAC)

if(!bCookStarted)
{
#if WITH_EDITORONLY_DATA
// Just refresh editor properties?
HAC->bNeedToUpdateEditorProperties = true;
#endif

// TODO: Check! update state?
HAC->SetAssetState(EHoudiniAssetState::None);
Expand Down Expand Up @@ -1307,8 +1312,10 @@ FHoudiniEngineManager::PostCook(UHoudiniAssetComponent* HAC, const bool& bSucces

FHoudiniEngine::Get().UpdateCookingNotification(FText::FromString(DisplayName + " :\nFinished processing outputs"), true);

#if WITH_EDITORONLY_DATA
// Indicate we want to trigger a details panel update
HAC->bNeedToUpdateEditorProperties = true;
#endif

// If any outputs have HoudiniStaticMeshes, and if timer based refinement is enabled on the HAC,
// set the RefineMeshesTimer and ensure BuildStaticMeshesForAllHoudiniStaticMeshes is bound to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,10 @@ FHoudiniLandscapeSplineTranslator::ProcessLandscapeSplineOutput(
// saves the level.
InOutput->MarkPackageDirty();

#if WITH_EDITORONLY_DATA
if(IsValid(HAC) && HAC->IsOwnerSelected())
HAC->bNeedToUpdateEditorProperties = true;
#endif

return true;
}
Expand Down
4 changes: 4 additions & 0 deletions Source/HoudiniEngine/Private/HoudiniParameterTranslator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ FHoudiniParameterTranslator::UpdateParameters(UHoudiniAssetComponent* HAC)
// Replace with the new parameters
HAC->Parameters = NewParameters;

#if WITH_EDITORONLY_DATA
// Indicate we want to update the details panel after the parameter changes/updates
HAC->bNeedToUpdateEditorProperties = true;
#endif
}


Expand Down Expand Up @@ -216,8 +218,10 @@ FHoudiniParameterTranslator::UpdateLoadedParameters(UHoudiniAssetComponent* HAC)
// Simply replace with the new parameters
HAC->Parameters = NewParameters;

#if WITH_EDITORONLY_DATA
// Indicate we want to update the details panel after the parameter changes/updates
HAC->bNeedToUpdateEditorProperties = true;
#endif
}

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ UHoudiniAssetComponent::UHoudiniAssetComponent(const FObjectInitializer & Object
bReplacePreviousBake = false;
ActorBakeOption = EHoudiniEngineActorBakeOption::OneActorPerComponent;
bAllowPlayInEditorRefinement = false;
bNeedToUpdateEditorProperties = false;
#endif

//
Expand All @@ -263,8 +264,6 @@ UHoudiniAssetComponent::UHoudiniAssetComponent(const FObjectInitializer & Object

// Initialize the default SM Build settings with the plugin's settings default values
StaticMeshBuildSettings = FHoudiniEngineRuntimeUtils::GetDefaultMeshBuildSettings();

bNeedToUpdateEditorProperties = false;
}

UHoudiniAssetComponent::~UHoudiniAssetComponent()
Expand Down

0 comments on commit bce0be7

Please sign in to comment.