Want to abstract material parameters in mutable graphs based on static switches

Hi, Our team is using mutable as our main character customization system for the game. Our material setup includes one master material and multiple instances that we are using for different cosmetics. These material instances are driven by static switches and we only use certain parameters in the material instance. We want to abstract away the extra parameter based on static switches from the mesh section node in the pins viewer. Also based on the material instance change and resave we want to reflect that automatically in the customizable Object editor graphs and remap the pins.

[Image Removed]

Hello,

For engine modifications like this, we can offer information about existing functionality, and we leave the details of the implementation to you.

The Material Instance Editor filters parameters for view via the function “FMaterialPropertyHelpers::ShouldShowExpression(…)” in MaterialPropertyHelpers.cpp. This can serve as an example implementation of this type of filtering.

Mutable uses the pins on the UEdGraphNode as the source of the pin UI you pictured. For more information, please see “SPinViewer::GeneratePinInfoList()” from SPinViewer.cpp.

For Materials, the list of pins is populated by “UCustomizableObjectNodeMaterial::AllocateDefaultParameterPins(…)” from CustomizableObjectNodeMaterial.cpp. This is called when the Material is changed, or the value of one of it’s pins is changed. It is not called when there is a change in the underlying Material (Instance) is changed. You can observe this by adding a parameter to the Material assigned, and observing the pin list is not updated until another change refreshes it.

Pin remapping is handled by the function “UCustomizableObjectNodeMaterialRemapPinsByName::RemapPins(…)” from CustomizableObjectNodeMaterial.cpp.

Please let us know if this helps.