Inspecting types with custom Details panels

By default, UObject-derived UAssets open in the generic property editor. It looks like the following screenshot:

Inspecting types with custom Details panels

However, at times you may wish for custom widgets to allow editing of properties on your class. To facilitate this, Unreal supports Details Customization, which is the focus of this recipe.

How to do it...

  1. Create a new header file called MyCustomAssetDetailsCustomization.h.
  2. Add the following includes to the header:
    #include "MyCustomAsset.h"
    #include "DetailLayoutBuilder.h"
    #include "IDetailCustomization.h"
    #include "IPropertyTypeCustomization.h"
  3. Define our customization class as follows:
    class FMyCustomAssetDetailsCustomization ...

Get Unreal Engine 4 Scripting with C++ Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.