Description

Reparenting a MaterialInstance that uses Material Layers to another instance with a different layer configuration can cause the editor to crash when opening the Layer Parameters tab. This appears to be due to an invalid index access in FMaterialLayersFunctions::GetLayerVisibility.

Issue occurs consistently when the new parent has fewer or no layers than the previous one. A workaround suggested to the licensee is to save and close the material instance after reparenting and reopen it before selecting the Layer Parameters tab in which the crash does not occur.

Issue has been reproduced in UE 5.6 (launcher build) and in a source build from Main (CL 44397245).

Ticket was generated from 3rd party UDN Vendor report via Slack-bot and is pending pre-processing.

Steps to Reproduce

Steps to reproduce:
1. Open the attached repro project
2. Open the MI_Material_To_Reparent material instance
3. In the Details panel, change its parent from MI_Opaque_Weather to MI_Causes_Crash
4. Click on the Layer Parameters tab
4. The engine crashes

The crash is highly consistent but not 100% repro rate in my tests. In the rare case the crash does not occur, you may need to revert the parent asset to MI_Opaque_Weather, save the asset, close the asset window and retry again.

Callstack

Callstack (Main CL 44397245)
> UnrealEditor-MaterialEditor-Win64-Debug.dll!FMaterialLayersFunctions::GetLayerVisibility(int Index) Line 614 C++
UnrealEditor-MaterialEditor-Win64-Debug.dll!SMaterialLayersFunctionsInstanceTree::IsLayerVisible(int Index) Line 1274 C++
[External Code]
UnrealEditor-PropertyEditor-Win64-Debug.dll!TAttribute<bool>::Get() Line 251 C++
UnrealEditor-PropertyEditor-Win64-Debug.dll!PropertyCustomizationHelpers::GetVisibilityDisplay(TAttribute<bool> bEnabled) Line 582 C++
[External Code]
UnrealEditor-Slate-Win64-Debug.dll!SlateAttributePrivate::TSlateAttributeBase<SWidget,FText,SlateAttributePrivate::FSlateAttributeNoInvalidationReason,TSlateAttributeFTextComparePredicate,0>::FSlateAttributeGetterWrapper<SlateAttributePrivate::TSlateAttributeBase<SWidget,FText,SlateAttributePrivate::FSlateAttributeNoInvalidationReason,TSlateAttributeFTextComparePredicate,0>>::UpdateAttribute(const SWidget & Widget) Line 584 C++
UnrealEditor-SlateCore-Win64-Debug.dll!FSlateAttributeMetaData::UpdateAttributesImpl(SWidget & OwningWidget, FSlateAttributeMetaData::EInvalidationPermission InvalidationStyle, int StartIndex, int IndexNum) Line 492 C++
UnrealEditor-SlateCore-Win64-Debug.dll!FSlateAttributeMetaData::UpdateExceptVisibilityAttributes(SWidget & OwningWidget, FSlateAttributeMetaData::EInvalidationPermission InvalidationStyle) Line 454 C++
UnrealEditor-SlateCore-Win64-Debug.dll!SWidget::Prepass_ChildLoop::__l2::<lambda_1>::operator()(SWidget & Child) Line 1784 C++
UnrealEditor-SlateCore-Win64-Debug.dll!FChildren::ForEachWidget<`SWidget::Prepass_ChildLoop'::`2'::<lambda_1> &>(SWidget::Prepass_ChildLoop::__l2::<lambda_1> & Pred) Line 76 C++
UnrealEditor-SlateCore-Win64-Debug.dll!SWidget::Prepass_ChildLoop(float InLayoutScaleMultiplier, FChildren * MyChildren) Line 1811 C++

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-308768 in the post.

0
Login to Vote

Unresolved
CreatedAug 1, 2025
UpdatedSep 10, 2025
View Jira Issue