I have a python script that essentially mimics the DataValidationCommandlet.cpp validator, however, it produces different output.
The Cpp validator checks for many more assets than the python version, according to the log.
My python script simply does the following:
def evs_validate_all_assets(skip_excluded_directories=True,
show_if_no_failures=True,
validation_usecase=unreal.DataValidationUsecase.COMMANDLET):
# Creates default validation settings, uses the same values as DataValidationCommandlet.cpp
default_settings = unreal.ValidateAssetsSettings(skip_excluded_directories,
show_if_no_failures,
validation_usecase)
uar = unreal.AssetRegistryHelpers.get_asset_registry()
evs = unreal.EditorValidatorSubsystem()
# Grabs all assets from the asset registry module
assets = uar.get_all_assets()
# calls validate_assets_with_settings on the validator subsystem with our default settings
evs.validate_assets_with_settings(assets, default_settings)
return True
Yet, if I call the commandlet, by typing:
[...]/UnrealEditor-Cmd.exe "C:/[...]/myProj.uproject" -run=pythonscript -script="C:[...]/ValidateAssets.py" > .\validation_python_script.log
the generated log file is substantially different from the one running:
[...]/UnrealEditor-Cmd.exe "C:/[...]/myProj.uproject" -run=DataValidation > .\validation_commandlet.log
The main difference being, it seems the DataValidationCommandlet is being run on many more assets, as indicated by dozens of entries(about 70) of:
[2022.10.18-17.16.50:834][ 0]LogInit: Display: AssetCheck: Error: [AssetLog] C:\[...]/some_asset.uasset: Soft references /Game/[...]/some_other_asset which does not exist. (AssetValidator_AssetReferenceRestrictions)
[2022.10.18-17.16.50:835][ 0]LogInit: Display: NOTE: Only first 50 errors
And [some_other_asset] does exist, I’ve checked every single instance of the error.
My question:
Is DataValidationCommandlet, or some other subsystem doing additional checks on other assets or checking some other type of dependencies, not apparent in the implementation present in DataValidationCommandlet.cpp file? Why would it behave differently than a python commandlet, since it should be doing the same thing?