[PCG] refresh / cache issue

Basically in some cases like described in the repro section, sometimes PCG won’t find components with a specific tag even though the tag is there.

The only way I was able to make it find the tag again is to use the “Force Generate” button on the PCG component.

[Image Removed]

Now this is far from ideal as the whole tool uses a widget UI instead of interacting with the blueprint itself.

I tried to make the PCG Force Generate using blueprint nodes like so:

[Image Removed]

( also tried the local version )

But it doesn’t work, only the Force Generate button on the PCG component itself properly clears the cache and detects the tags.

What is the difference with that button and how can I do the same with blueprint nodes?

Thanks!

Steps to Reproduce
Have a PCG that filter actors by tags, here I get actors in an array on a blueprint, filter the static mesh component with a specific tag

[Image Removed]

Then I clear the PCG link so it creates a “baked” PCG Actor

Remove the custom tag from the mesh component.

Save

Delete the baked PCG Actor.

Add back the tag on the mesh component.

PCG now detects the actor, but doesn’t find the component with the Tag and won’t generate properly.

Hi Yan,

So the difference between the ‘Force generate’ in BP vs. the ‘Force generate (& implicit flush cache)’ is really a question of the cache being flushed.

What happens in this case is that your ‘Get Actor Property’ node result is cached, and the process you’ve used to add the tags hasn’t trigger a change that we’re tracking, hence not only is the graph not regenerating by itself, it will also not do anything different.

In your case, there might be something you can do to force a notification (not quite sure what exactly unfortunately), but otherwise you could try to flush the cache as well - it’s on the PCG subsystem, called ‘Flush Cache’. This is the nuclear option, but it might not be a problem in your case.

I’ll ask a second opinion in the team for the notification thing, but otherwise the flush solution might work for you.

Cheers,

Julien

Yes that`s the one I meant!

Happy it worked out!

Cheers,

Julien

Hi,

I couldn’t find the Flush Cache on PCG Subsystem

[Image Removed]but there is that function that does seem to do the trick!

[Image Removed]

Thanks!