Files
marc audy 311f7464bf Updated ../Engine/Source/Runtime/... to inline gen.cpp files
Before:
3648 unity files
Total CPU Time: 47886.140625 s
Total time in Parallel executor: 498.81 seconds

After:
3548 unity files
Total CPU Time: 46643.828125 s
Total time in Parallel executor: 486.06 seconds

#jira
#preflight

[CL 22173263 by marc audy in ue5-main branch]
2022-09-24 13:57:58 -04:00

53 lines
2.2 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "ClothingSimulationFactory.h"
#include "HAL/IConsoleManager.h"
#include "Features/IModularFeatures.h"
#include UE_INLINE_GENERATED_CPP_BY_NAME(ClothingSimulationFactory)
const FName IClothingSimulationFactoryClassProvider::FeatureName = TEXT("ClothingSimulationFactoryClassProvider");
namespace ClothingSimulationFactoryConsoleVariables
{
TAutoConsoleVariable<FString> CVarDefaultClothingSimulationFactoryClass(
TEXT("p.Cloth.DefaultClothingSimulationFactoryClass"),
TEXT("ChaosClothingSimulationFactory"), // Chaos is the default provider when Chaos Cloth is enabled
TEXT("The class name of the default clothing simulation factory.\n")
TEXT("Known providers are:\n")
TEXT("ChaosClothingSimulationFactory\n")
, ECVF_Cheat);
}
TSubclassOf<class UClothingSimulationFactory> UClothingSimulationFactory::GetDefaultClothingSimulationFactoryClass()
{
TSubclassOf<UClothingSimulationFactory> DefaultClothingSimulationFactoryClass = nullptr;
const FString DefaultClothingSimulationFactoryClassName = ClothingSimulationFactoryConsoleVariables::CVarDefaultClothingSimulationFactoryClass.GetValueOnAnyThread();
IModularFeatures::Get().LockModularFeatureList();
const TArray<IClothingSimulationFactoryClassProvider*> ClassProviders = IModularFeatures::Get().GetModularFeatureImplementations<IClothingSimulationFactoryClassProvider>(IClothingSimulationFactoryClassProvider::FeatureName);
IModularFeatures::Get().UnlockModularFeatureList();
for (const auto& ClassProvider : ClassProviders)
{
if (ClassProvider)
{
const TSubclassOf<UClothingSimulationFactory> ClothingSimulationFactoryClass = ClassProvider->GetClothingSimulationFactoryClass();
if (ClothingSimulationFactoryClass.Get() != nullptr)
{
// Always set the default to the last non null factory class (in case the search for the cvar doesn't yield any results)
DefaultClothingSimulationFactoryClass = ClothingSimulationFactoryClass;
// Early exit if the cvar string matches
if (ClothingSimulationFactoryClass->GetName() == DefaultClothingSimulationFactoryClassName)
{
break;
}
}
}
}
return DefaultClothingSimulationFactoryClass;
}