If I add a custom float array uproperty to UMaterialEditorInstanceConstant, it is not properly updated when I click on the + icon in the UI. I expect the array to have one more item, and the shown list to show the new item, initialized to zero. Instead, array’s size is increased, but the UI is not updated. Closing a category triggers the UI refresh, showing the array properly.
[Image Removed]
Steps to Reproduce
Add the following line in class UMaterialEditorInstanceConstant, after GENERATED_UCLASS_BODY():
UPROPERTY(EditAnywhere, Category = MaterialEditorInstanceConstant)
TArray <float> TestArray;
Hello,
Thank you for reaching out.
I’ve been assigned this issue, and we will be looking into why the editor UI is not updating for you.
Hello,
Thank you for your patience.
We are speaking with our colleagues about this issue.
Hello,
You code addition seems fine.
However, it is one of the customizations to the Details View in the Material Instance Editor that is causing this behavior.
The UI refresh is normally triggered by property node validation. However, the Material Instance Editor uses a custom validator, which causes the UI refresh to be missed.
The custom validator is a pass-through validator, and can be found in MaterialInstanceEditor.cpp:
void FMaterialInstanceEditor::CreateInternalWidgets() { ... auto ValidationLambda = ([](const FRootPropertyNodeList& PropertyNodeList) { return true; }); MaterialInstanceDetails->SetCustomValidatePropertyNodesFunction(FOnValidateDetailsViewPropertyNodes::CreateLambda(MoveTemp(ValidationLambda))); ... }
You can try removing these two lines to workaround the issue, however, you will need to test the change. We have not thoroughly tested it.
For engine modifications like this, we can offer information about existing functionality, and we leave the details of the implementation to you.
Please let us know if this helps.
Thanks. This fixes my issue. I will keep the mod on my local repository to test it.
Hello,
Thank you for reporting this. I can confirm this issue can be reproduced as described in the latest CL, and have opened a bug report:
The tracker will be visible after it is approved internally at Epic Games and is publicly accessible.
If you have any further questions, please let us know.