Hi everyone,
I’m running into an annoying validation issue with data routing in my PCG graph.
I am using a Filter Data By Index node. The downstream spawning nodes are connected to the Inside pin, and the Outside pin is left completely disconnected because I want nothing to happen when the filter conditions aren’t met.
The Issue:
When the filter condition fails (meaning there are no matching indices), the downstream nodes throw a “No Input Found” warning/error.
Logically, if the filter doesn’t output data, the downstream nodes shouldn’t execute at all. Instead, it seems like the graph still attempts to validate or run the downstream nodes, and because they receive an empty PCGDataCollection container along the wire, they error out.
Is there a standard way to cleanly halt execution downstream when a filter returns zero points, without triggering “No Input Found” errors? I want the graph to just fail silently when no data passes the filter.
Appreciate any advice or clean workarounds for this!
[Attachment Removed]
Hi! Thanks for reaching out!
There are two ways of achieving that at the moment.
1st Solution (simplest, no engine modification, a bit cumbersome):
Use the Data count + Branch node. Data count will be interpreted as false if == 0, True otherwise.
[Image Removed]2nd Solution (require engine change):
Modify the node to enable dynamic culling of the output.
In `Engine/Plugins/PCG/Source/PCG/Public/Elements/PCGFilterByIndex.h`, I add a boolean and a virtual override
class UPCGFilterByIndexSettings : public UPCGFilterDataBaseSettings
{
...
virtual bool OutputPinsCanBeDeactivated() const override { return bDisableEmptyOutputs; }
...
/** Mimic branch node when the filtering yield no data in one of the output pins. */
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Settings)
bool bDisableEmptyOutputs = false;
}
And in the cpp, add the output inactive mask
bool FPCGFilterByIndexElement::ExecuteInternal(FPCGContext* Context) const
{
...
TArray<FPCGTaggedData>& Outputs = Context->OutputData.TaggedData;
Outputs = Inputs;
// At the start all pins are inactive.
// When a pin has some data, we switch the bit to 0.
Context->OutputData.InactiveOutputPinBitmask = 0x3;
for (int Index = 0; Index < Outputs.Num(); ++Index)
{
bool bIndexIsFiltered = FilteredIndices.ContainsIndex(Index);
bIndexIsFiltered = Settings->bInvertFilter ? !bIndexIsFiltered : bIndexIsFiltered;
if (bIndexIsFiltered)
{
Outputs[Index].Pin = PCGPinConstants::DefaultInFilterLabel;
// Output bitmask of deactivated pins.
Context->OutputData.InactiveOutputPinBitmask = (Context->OutputData.InactiveOutputPinBitmask & ~0x1);
}
else
{
Outputs[Index].Pin = PCGPinConstants::DefaultOutFilterLabel;
// Output bitmask of deactivated pins.
Context->OutputData.InactiveOutputPinBitmask = (Context->OutputData.InactiveOutputPinBitmask & ~0x2);
}
}
return true;
}
I tested in 5.8, but I’m assuming this should work in 5.6 too.
Also if you also want to remove empty point data, there is the `Remove Empty Data` node, it’s available in 5.6
Hope that helps!
Adrien
[Attachment Removed]
Glad to help! Have a nice day 
[Attachment Removed]
Hi Adrien, I have tried the first, PCG graph based solution, and it worked. Thank you very much!
[Attachment Removed]