UAssetValidator
in Blogs / Unreal Engine on Blogs, Ue, Doc
Configuration and Usage
Follow the steps below
- Add allow validation usecase in project setting
- All usecese:
/** No usecase specified */ None = 0, /** Triggered on user's demand */ Manual, /** A commandlet invoked the validation */ Commandlet, /** Saving a package triggered the validation */ Save, /** Submit dialog triggered the validation */ PreSubmit, /** Triggered by blueprint or c++ */ Script,
None
Means all case, it always trigger validation- Allow validation usecase empty, same as
None
Manual
needs enable validate on save in Editor preferences
- Create a data asset and select
Asset Validation Relus
- Select the
Asset Class
which you want to validation - Check Configure Rules to define rules
- Create a data asset and select
- Once the rule asset is saved, it takes effect
- Find a asset to check your rule is correct or not
- You may need to test several times to ensure the rule is correct
Configure Rules
Base rule
Asset Class
decides which assets the rules apply toName Format
Format of the asset name, whether it needs prefixes, suffixes, and contains special textCriteria Entries
Define the properties and values that need to be validated(Click the plus sign to add)Attribute Name
Right click property,Copy Intername Name
(Highly recommended, but UE versions below 5.5 may not have it) orCopy Display Name
Values
A property can have multiple values, and you can add multiple entries. As long as one value matches, the validation will passValue
A specific value used to compare with the asset’s propertiesWarning
If selected, the validation will pass even if the above values are different, and it will output the following error messageError Message
Error message for failed validation, optionalAdvance
Group Pattern
Regular expression for extracting group names from asset’s name The regular expression needs to include parentheses () to define a capturing group. The capturing group will extract the content matched within the parentheses.
Ps. Capture GroupGroup Value
With the group name, you can define the attribute values for the group. The format is the same asValue
, but with a higher priority