When pressing the "Show Inactive" button in the material instance editor, all material parameters are supposed to be displayed in the EditorUI. This is not the case, only some of the parameters are displayed in the EditorUI.
Workaround:
//MaterialEditorInstanceDetailCustomization.cpp // add_start (copied from MaterialEditingLibrary.cpp) FMaterialInstanceEditor* FindMaterialInstanceEditorForAsset(UObject* InAsset) { if (IAssetEditorInstance* AssetEditorInstance = (InAsset != nullptr) ? GEditor->GetEditorSubsystem<UAssetEditorSubsystem>()->FindEditorForAsset(InAsset, false) : nullptr) { // Ensure this is not a UMaterialInstanceDynamic, as that doesn't use FMaterialInstanceEditor as its editor if (!InAsset->IsA(UMaterialInstanceDynamic::StaticClass())) { return static_cast<FMaterialInstanceEditor*>(AssetEditorInstance); } } return nullptr; } // add_end void FMaterialInstanceParameterDetails::CreateGroupsWidget(TSharedRef<IPropertyHandle> ParameterGroupsProperty, IDetailCategoryBuilder& GroupsCategory) { bool bShowSaveButtons = false; check(MaterialEditorInstance); for (int32 GroupIdx = 0; GroupIdx < MaterialEditorInstance->ParameterGroups.Num(); ++GroupIdx) { FEditorParameterGroup& ParameterGroup = MaterialEditorInstance->ParameterGroups[GroupIdx]; if (ParameterGroup.GroupAssociation == EMaterialParameterAssociation::GlobalParameter && ParameterGroup.GroupName != FMaterialPropertyHelpers::LayerParamName) { bShowSaveButtons = true; bool bCreateGroup = false; for (int32 ParamIdx = 0; ParamIdx < ParameterGroup.Parameters.Num() && !bCreateGroup; ++ParamIdx) { UDEditorParameterValue* Parameter = ParameterGroup.Parameters[ParamIdx]; const bool bIsVisible = MaterialEditorInstance->VisibleExpressions.Contains(Parameter->ParameterInfo); bCreateGroup = bIsVisible && (!MaterialEditorInstance->bShowOnlyOverrides || FMaterialPropertyHelpers::IsOverriddenExpression(Parameter)); } // add_start if (!bCreateGroup) { FMaterialInstanceEditor* MIE = FindMaterialInstanceEditorForAsset(MaterialEditorInstance->SourceInstance); if (MIE) { bool bShowHiddenParameters = false; MIE->GetShowHiddenParameters(bShowHiddenParameters); if (bShowHiddenParameters) { bCreateGroup = true; } } } // add_end
1. Open the attached project
2. Open the material instance "M_Base_Inst" and press the "Show Inactive" button
Expected:
All parameters (A,B,C) must appear in the editor UI.
Result:
If Sw=true, only parameters A and C will be displayed in the editor UI.
If Sw=false, only the parameter B is displayed in the editor UI.
All parameters are not displayed.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-220755 in the post.
0 |
Component | UE - Rendering Architecture - Materials |
---|---|
Affects Versions | 5.4, 5.3 |
Created | Aug 1, 2024 |
---|---|
Updated | Aug 8, 2024 |