Unreal/CarlaUE4/Plugins/RoadRunnerImporter/Source/RoadRunnerImporter/Private/RoadRunnerImporter.cpp
////////////////////////////////////////////////////////////////////////////////
// Get the modifed light bulb name by its original name under a given scene
// component node.
Get the modifed light bulb name by its original name under a given scene
component node.
Get the modifed light bulb name by its original name under a given scene component node .
FString FindByNamePrefix(USCS_Node* parent, const FString& prefix)
	{
		for (const auto& child : parent->GetChildNodes())
		{
			FString componentName = child->GetVariableName().ToString();
			FString regex = FString(TEXT("^"));
			regex += prefix;
			regex += FString(TEXT("(_[0-9]+)?Node.*"));
			FRegexPattern pattern(regex);
			FRegexMatcher matcher(pattern, componentName);
			if (matcher.FindNext())
			{
				return componentName;
			}
			FString childCheck = FindByNamePrefix(child, prefix);
			if (!childCheck.IsEmpty())
			{
				return childCheck;
			}
		}
		return TEXT("");
	}
FString FindByNamePrefix ( USCS_Node * parent , const FString & prefix ) { for ( const auto & child : parent -> GetChildNodes ( ) ) { FString componentName = child -> GetVariableName ( ) . ToString ( ) ; FString regex = FString ( TEXT ( " " ) ) ; regex += prefix ; regex += FString ( TEXT ( " " ) ) ; FRegexPattern pattern ( regex ) ; FRegexMatcher matcher ( pattern , componentName ) ; if ( matcher . FindNext ( ) ) { return componentName ; } FString childCheck = FindByNamePrefix ( child , prefix ) ; if ( ! childCheck . IsEmpty ( ) ) { return childCheck ; } } return TEXT ( " " ) ; }
Get the modifed light bulb name by its original name under a given scene
component node.
Get the modifed light bulb name by its original name under a given scene component node .
// Check if has match