How to Prevent Infinite Loop When Customizing Property Panel for Nested DataTable Structures in Unreal Engine
I’m using IPropertyTypeCustomization
to create a custom property panel for the FGameTableDataDetialView
struct:
struct FGameTableDataDetialView
{
FString TableId;
TSoftObjectPtr<UDataTable> DataTableObject;
}
The functionality of this custom panel is: when DataTableObject
has a value, it creates a structure details view using FPropertyEditorModule::CreateStructureDetailView()
to display the contents of the DataTable.
However, when the struct inside DataTableObject
also contains a FGameTableDataDetialView
field with a value, this easily creates an infinite loop of structure creation, eventually causing the editor to crash.
What I need help with:
Is there any way to detect or retrieve the nesting level within either:
- The
CustomizeChildren
method ofIPropertyTypeCustomization
, OR - During the
CreateStructureDetailView
call
I’m looking for approaches to:
- Track how many levels of nesting have occurred
- Potentially set a maximum nesting depth limit
- Detect circular references before they cause infinite loops
- Access parent hierarchy information from within the property customization
Any suggestions or best practices for handling this kind of recursive structure display in Unreal’s property system would be greatly appreciated.