// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "UObject/ObjectMacros.h" #include "Commandlets/Commandlet.h" #include "ParticleSystemAuditCommandlet.generated.h" UCLASS(config=Editor) class UParticleSystemAuditCommandlet : public UCommandlet { GENERATED_UCLASS_BODY() /** All particle systems w/ a NO LOD levels */ TSet ParticleSystemsWithNoLODs; /** All particle systems w/ a single LOD level */ TSet ParticleSystemsWithSingleLOD; /** All particle systems w/out fixed bounds set */ TSet ParticleSystemsWithoutFixedBounds; /** All particle systems w/ LOD Method of Automatic & a check time of 0.0 */ TSet ParticleSystemsWithBadLODCheckTimes; /** All particle systems w/ bOrientZAxisTowardCamera enabled */ TSet ParticleSystemsWithOrientZAxisTowardCamera; /** All particle systems w/ missing materials */ TSet ParticleSystemsWithMissingMaterials; /** All particle systems w/ no emitters */ TSet ParticleSystemsWithNoEmitters; /** All particle systems w/ a high spawn rate or burst */ TSet ParticleSystemsWithHighSpawnRateOrBurst; /** All particle systems w/ a far LODDistance */ TSet ParticleSystemsWithFarLODDistance; /** All particle systems w/ bone location sources that do not match between LODs */ TSet ParticleSystemsWithBoneLocationMismatches; /** All particle systems with warmup time on them */ TSet ParticleSystemsWithWarmupTime; /** All particle systems with lights and the details */ TSet ParticleSystemsWithLights; /** If a particle system has a spawn rate or burst count greater than this value, it will be reported */ UPROPERTY(config) float HighSpawnRateOrBurstThreshold; /** If a particle system has an LODDistance larger than this value, it will be reported */ UPROPERTY(config) float FarLODDistanceTheshold; /** The folder in which the commandlet's output files will be stored */ FString AuditOutputFolder; /** Only assets in this collection will be considered. If this is left blank, no assets will be filtered by collection */ FString FilterCollection; /** Package paths to include */ TArray PackagePaths; /** Entry point */ int32 Main(const FString& Params) override; /** Process all referenced particle systems */ bool ProcessParticleSystems(); /** Dump the results of the audit */ virtual void DumpResults(); /** * Dump the give list of particle systems to an audit CSV file... * * @param InPSysSet The particle system set to dump * @param InFilename The name for the output file (short name) * * @return bool true if successful, false if not */ bool DumpSimplePSysSet(TSet& InPSysSet, const TCHAR* InShortFilename, const TCHAR* OptionalHeader = nullptr); /** Generic function to handle dumping values to a CSV file */ bool DumpSimpleSet(TSet& InSet, const TCHAR* InShortFilename, const TCHAR* InObjectClassName, const TCHAR* OptionalHeader = nullptr); /** Gets an archive to write to an output file */ FArchive* GetOutputFile(const TCHAR* InShortFilename); };