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] 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() -> (DataValidationResult, asset_data=AssetData, validation_errors=Array(Text), validation_warnings=Array(Text))
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

asset_data (AssetData):

validation_errors (Array(Text)):

validation_warnings (Array(Text)):

Return type

tuple

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

object (Object) –

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

Called to validate assets from either the UI or a commandlet

Parameters
  • asset_data_list (Array(AssetData)) –

  • skip_excluded_directories (bool) – If true, will not validate files in excluded directories

  • show_if_no_failures (bool) – If true, will add notifications for files with no validation and display even if everything passes

Returns

Number of assets with validation failures or warnings

Return type

int32

property validate_on_save

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

Type

(bool)