, 9 tweets, 5 min read
Ever wondered how to define your own Data Validation rules with Editor Utility Blueprints? Here's an example to validate that material asset names are prefixed with "M_".

@UnrealEngine #UE4 #GameDev #Tutorial
1. Enable the Data Validation plugin and restart the editor.
2. Add bAllowBlueprintValidators=true to DefaultEditor.ini

(And optionally enable validate on save and cook by setting to true)
3. Create an Editor Utility Blueprint of type EditorValidatorBase, call it something meaningful like MaterialValidator
4. Open the validator blueprint, override the "Can Validate Asset", add in a Material pure cast just to return if the asset is a material.
5. Override Validate Loaded Asset, check if the object name starts with "M_". If it does, pass the asset; otherwise, fail with a meaningful message
6. Restart the editor. This is important, as validators only get registered on editor start.
7. Finally, find a material to validate (Note: Material Instances are of a different asset type), right click it then go to Asset Actions->Validate Assets. This will run your validator and return the result in the message log.
Additionally, enabling validate on save and cook will then ensure that newly created assets (and older ones) won't slip through the cracks.

Editor Utility Blueprints are a powerful addition to Unreal, and I can't wait to see what you all come up with! 😁
Missing some Tweet in this thread? You can try to force a refresh.

Enjoying this thread?

Keep Current with Alex Stevens

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!