unreal.EditorValidatorSubsystem

class unreal.EditorValidatorSubsystem(outer=None, name='None')

Bases: unreal.EditorSubsystem

UEditorValidatorSubsystem manages all the asset validation in the engine. The first validation handled is UObject::IsDataValid and its overridden functions. Those validations require custom classes and are most suited to project-specific classes. The next validation set is of all registered UEditorValidationBases. These validators have a function to determine if they can validate a given asset, and if they are currently enabled. They are good candidates for validating engine classes or very specific project logic.

C++ Source:

  • Plugin: DataValidation

  • Module: DataValidation

  • File: EditorValidatorSubsystem.h

Editor Properties: (see get_editor_property/set_editor_property)

  • validate_on_save (bool): [Read-Write] Validate on Save: Whether it should validate assets on save inside the editor deprecated: Use bValidateOnSave on UDataValidationSettings instead.

add_validator(validator) None
  • Adds a validator to the list, making sure it is a unique instance

Parameters

validator (EditorValidatorBase) –

is_asset_valid(asset_data, validation_usecase) -> (DataValidationResult, validation_errors=Array(Text), validation_warnings=Array(Text))
Parameters
Returns

Returns Valid if the object pointed to by AssetData contains valid data; returns Invalid if the object contains invalid data or does not exist; returns NotValidated if no validations was performed on the object

validation_errors (Array(Text)):

validation_warnings (Array(Text)):

Return type

tuple

is_object_valid(object, validation_usecase) -> (DataValidationResult, validation_errors=Array(Text), validation_warnings=Array(Text))
Parameters
Returns

Returns Valid if the object contains valid data; returns Invalid if the object contains invalid data; returns NotValidated if no validations was performed on the object

validation_errors (Array(Text)):

validation_warnings (Array(Text)):

Return type

tuple

validate_assets(asset_data_list, skip_excluded_directories=True, show_if_no_failures=True) int32

Validate Assets deprecated: Use ValidateAssetsWithSettings instead

Parameters
Return type

int32

validate_assets_with_settings(asset_data_list, settings) -> (int32, out_results=ValidateAssetsResults)

Called to validate assets from either the UI or a commandlet

Parameters
Returns

Number of assets with validation failures or warnings

out_results (ValidateAssetsResults): More detailed information about the results of the validate assets command

Return type

ValidateAssetsResults

property validate_on_save

[Read-Write] Validate on Save: Whether it should validate assets on save inside the editor deprecated: Use bValidateOnSave on UDataValidationSettings instead.

Type

(bool)