Editor for custom asset type. How to show list of structs that stored in array?

I’m developing an attributes system for role-playing game. I have an attribute set asset that is created in the content browser and attribute struct that stores values for each attribute. I have custom editor for my attribute sets. What i need is to show my array of attributes as list similar to Niagara effect editor’s emmiters list. I created two widgets one for list and other for list item. In list item widget i need to show attribute struct properties similar to default property editor.

This is code of constrcut function for list item widget:

void SNeatAttributesListItemWidget::Construct(const FArguments& InArgs)
{
	Attribute = InArgs._Attribute;
	NeatSetObj = InArgs._NeatSetObj;
	NeatEditor = InArgs._NeatEditor;

	if (!Details.IsValid()) {
		
		FPropertyEditorModule& PropertyEditorModule = FModuleManager::GetModuleChecked<FPropertyEditorModule>("PropertyEditor");

		FDetailsViewArgs DetailsViewArgs;
		FStructureDetailsViewArgs StructureDetailsViewArgs;

		FStructOnScope* NewStructOnScope = new FStructOnScope(FNeatAttribute::StaticStruct());

		Details = PropertyEditorModule.CreateStructureDetailView(
			DetailsViewArgs,
			StructureDetailsViewArgs,
			MakeShareable(NewStructOnScope),
			FText::FromString("New Attribute")
		);

		ChildSlot[
			SNew(SVerticalBox) + SVerticalBox::Slot().Padding(4)[
				Details->GetWidget().ToSharedRef()
			]
		];
		
	}
}

Everything works as I expected, but the problem is that the values not saving, because ‘FStructOnScope’ is not associated with a specific struct in attributes set. Main question, how can i link ‘FStructOnScope’ to ‘Attribute’ that i have?

The documentation for ’ FStructOnScope ’ has a description of the constructor with two parameters, as I realized the second option must be raw data of my struct. But I don’t understand how can I get “uint8 * InData” from my struct?

I think you’ll find this will do the trick:

FStructOnScope* NewStructOnScope = new 
 StructOnScope(FNeatAttribute::StaticStruct(), MyUObject->MyFNeatAttribute);
NewStructOnScope->SetPackage(MyUObject->GetOutermost());

Hey.

If you are using UE4 way of details view customization (IPropertyTypeCustomization), then it’s pretty straightforward.
You can check out example in FCollisionProfileNameCustomization.

Important bits are within FCollisionProfileNameCustomization::CustomizeChildren (31-33) FCollisionProfileNameCustomization::GetPropertyAsName (137-140) functions.

You’ll need an access to UE4 github repo(branch 4.18) to see these.

Hope this helps.