How to press the "Resimulate" button from the editor utility blueprint on procedural foliage actor?

Story in short
I have a big level and 400 procedural foliage spawn volumes. I need to select 10 volumes, resimulate, save and repeat with the next 10 volumes. This takes days when done manually.

Ful story (optional to read :smiley: )

Possible solution
My plan is to automate the process. I thought I might use the Editor Utility Blueprint, describe all my sets in some array once, and then iterate through them, making a delay for stability and save the project every 10 volumes. This will not crash and can go on automatically.

Problem
I’ve been experimenting with the Editor Utility Blueprint the whole week.
I have created my script in the context menu of level actors, I can select and iterate through my volumes, read their names. Blueprint is here

But I just cannot access that RESIMULATE button\function from the Details View.

I found only the SIMULATE function that runs on a Procedural Foliage Spawner. But I need to run it on my volume in the World Outliner.

I even found that button in the Editor source code (ProceduralFoliageComponentDetails.cpp), but lack experience with C++ and don’t know what to do with this code.

FReply FProceduralFoliageComponentDetails::OnResimulateClicked()
{
for (TWeakObjectPtr<UProceduralFoliageComponent>& Component : SelectedComponents)
{
if (Component.IsValid() && Component->FoliageSpawner)
{
FScopedTransaction Transaction(LOCTEXT("Resimulate_Transaction", "Procedural Foliage Simulation"));
TArray <FDesiredFoliageInstance> DesiredFoliageInstances;
if (Component->GenerateProceduralContent(DesiredFoliageInstances))
{
if (DesiredFoliageInstances.Num() > 0)
{
Component->RemoveProceduralContent(false);

FFoliagePaintingGeometryFilter OverrideGeometryFilter;
OverrideGeometryFilter.bAllowLandscape = Component->bAllowLandscape;
OverrideGeometryFilter.bAllowStaticMesh = Component->bAllowStaticMesh;
OverrideGeometryFilter.bAllowBSP = Component->bAllowBSP;
OverrideGeometryFilter.bAllowFoliage = Component->bAllowFoliage;
OverrideGeometryFilter.bAllowTranslucent = Component->bAllowTranslucent;

FEdModeFoliage::AddInstances(Component->GetWorld(), DesiredFoliageInstances, OverrideGeometryFilter, true);
}

// If no instances were spawned, inform the user
if (!Component->HasSpawnedAnyInstances())
{
FNotificationInfo Info(LOCTEXT("NothingSpawned_Notification", "Unable to spawn instances. Ensure a large enough surface exists within the volume."));
Info.bUseLargeFont = false;
Info.bFireAndForget = true;
Info.bUseThrobber = false;
Info.bUseSuccessFailIcons = true;
FSlateNotificationManager::Get().AddNotification(Info);
}
}
}
}
return FReply::Handled();
}

**Any help is appreciated. **

Hi @zvukoper ,
I’ve been trying the same. I found that OnResimulate is protected as well as not Blueprint Visible. That’s why evn if we access it through code it doens’t compile or cannot be accessed via blueprint.
I am also looking for a solution. Will update as soon as I get one. Did you find any yet?

Hi, did you find any solution for this?

Unfortunately, still no solution. I just select the volumes, press Resimulate, wait until it crashes. Select -1 volume, resimulate. If it is not crashing, I select the next volume batch and so on. Like a salve on a ship :slight_smile:

Still no solution to this?

I found documentation for 2 blueprint nodes that sound like exactly what were looking for, but I can’t seem to find either of them anywhere in the editor? Anyone know why?

Currently using 4.26.2 can’t find it in 5.1.1 either.