@@ -856,7 +856,7 @@ FHoudiniEngineManager::ProcessComponent(UHoudiniAssetComponent* HAC)
856
856
// We want to check again for PDG after a rebuild
857
857
HAC->bIsPDGAssetLinkInitialized = false ;
858
858
859
- HAC->MarkAsNeedCook ();
859
+ // HAC->MarkAsNeedCook();
860
860
HAC->SetAssetState (EHoudiniAssetState::PreInstantiation);
861
861
break ;
862
862
}
@@ -1270,29 +1270,28 @@ FHoudiniEngineManager::PreCook(UHoudiniAssetComponent* HAC)
1270
1270
1271
1271
if (HAC->HasBeenLoaded () || HAC->IsParameterDefinitionUpdateNeeded ())
1272
1272
{
1273
- bool bPresetSuccess = false ;
1274
1273
if (!HAC->ParameterPresetBuffer .IsEmpty ())
1275
1274
{
1276
- TRACE_CPUPROFILER_EVENT_SCOPE (FHoudiniEngineManager::PreCook-SetPreset);
1275
+ // Only apply parameters presets for rebuilds, not after a param change
1276
+ if (HAC->HasRebuildBeenRequested ())
1277
+ {
1278
+ TRACE_CPUPROFILER_EVENT_SCOPE (FHoudiniEngineManager::PreCook-SetPreset);
1279
+ FHoudiniEngineUtils::SetAssetPreset (HAC->GetAssetId (), HAC->ParameterPresetBuffer );
1280
+ }
1277
1281
1278
- // If we have stored parameter preset - restore them
1279
- if ( FHoudiniEngineUtils::SetAssetPreset (HAC-> GetAssetId (), HAC-> ParameterPresetBuffer ))
1280
- bPresetSuccess = true ;
1282
+ // We don't want to apply param presets after loading a level
1283
+ // Clean it up until next cook
1284
+ HAC-> ParameterPresetBuffer . Empty () ;
1281
1285
}
1282
1286
1283
- if (!bPresetSuccess)
1287
+ // Nothing to do for Node Sync Components!
1288
+ if (!HAC->IsA <UHoudiniNodeSyncComponent>())
1284
1289
{
1285
1290
// This will sync parameter definitions but not upload values to HAPI or fetch values for existing parameters
1286
1291
// in Unreal. It will creating missing parameters in Unreal.
1287
1292
FHoudiniParameterTranslator::UpdateLoadedParameters (HAC);
1288
1293
HAC->bParameterDefinitionUpdateNeeded = false ;
1289
1294
}
1290
- else
1291
- {
1292
- // We've successfully applied the parameter presets
1293
- // Clean it up until next cook
1294
- HAC->ParameterPresetBuffer .Empty ();
1295
- }
1296
1295
}
1297
1296
1298
1297
// Upload the changed/parameters back to HAPI
0 commit comments