Hey there - we noticed that if an actor is under any sort of hierarchy in the outliner, then the GetFolderPath BP actor function will return None unless it is the top most actor in the hierarchy. We’ve easily coded a workaround, but are wondering if this is the intended use of this function and if it will eventually be tweaked to look at the entire parent hierarchy of an actor to grab the parent outliner folder the child is contained in?
Steps to Reproduce
- Create a hierarchy of actors in the outliner, attaching one underneath another
- Place the parent actor in an outliner folder
- Run a EUW that looks at the currently selected actor (ie. GetSelectedActors under VRScouting), and run GetFolderPat on the selected actor
- Print the result - if it’s a child, it will return None, if its the parent it will return the folder name
Hey Josh,
This is the setup I am using and piping the result into a text field to verify with. If I have a nested hierarchy, or a folder within a folder, then it returns both folders that the actor is contained within as the path result. Is that not happening?[Image Removed]
Subsequently, if you wanted to have the name of the actor, you could add it using a format text node and add the actor label to the formatted string.
[Image Removed]
To clarify a bit; I’m receiving this result when an actor is parented underneath another actor. When I run GetFolderPath on the child attached actor, it returns “None” as the folder, even if the parent actor is within a folder in the outliner.
Here’s the C++ snippet we added to call a new node in Blueprints to get the top-most actor’s folder in the outliner.
//================================================================================
const AActor* GetTopParent(const AActor* InActor)
{
if (!InActor)
{
return nullptr;
}
const AActor* ParentActor = InActor->GetAttachParentActor();
if (!ParentActor)
{
//No parent, this is the top-most
return InActor;
}
//Recursive
return GetTopParent(ParentActor);
}
//================================================================================
FName USPIBlueprintLibrary::GetFolderName(const AActor* InActor)
{
if (!InActor)
{
return NAME_None;
}
const AActor* TopParent = GetTopParent(InActor);
if (!TopParent)
{
return NAME_None;
}
return TopParent->GetFolderPath();
}
Thank you Josh. Hopefully this can have some resolution in future releases.