/Engine/Plugins/Enterprise/DatasmithImporter/Source/DatasmithImporter/Public/Utility/DatasmithImporterUtils.h
Finds all materials that are referenced by other materials in the scene and returns a list ordered by dependencies, making sure that materials referencing other materials in the list will come after. The list also include the direct parents (materials or functions) that are using the functions.
static [TArray](API\Runtime\Core\Containers\TArray)< [FFunctionAndMaterialsThatUseIt](API\Plugins\DatasmithImporter\Utility\FDatasmithImporterUtils\FFunctionAndMate-) > GetOrderedListOfMaterialsReferencedByMaterials ( [TSharedPtr](API\Runtime\Core\Templates\TSharedPtr)< [IDatasmithScene](API\Runtime\DatasmithCore\IDatasmithScene) > & SceneElement )