Material Layers feature has inheritance issues + related problems

Please see THIS VIDEO LINK for a demonstration of the issues, which are also described below:

https://youtu.be/OyJt2FcRt6g?si=jlntFKL6g4Y1RbBX

I have attached a self-contained copy of the project set up to demonstrate the issues

This bug report is specifically related to the Material Layers feature (Documentation here: https://dev.epicgames.com/documentation/unreal-engine/using-material-layers-in-unreal-engine?lang=en-US ).

Our studio (Cyan Worlds, Inc.) has for years used a custom-modified version of the engine, and ran into a slew of issues surrounding the Material Layers features. We made custom changes to fix up the problems, and found success doing so, for the most part (and shipped multiple titles using those “fixed” custom builds). The problem is now that we are in the process of trying to switch to more “vanilla” versions of the latest Unreal Engine releases, both to get better support for new UE features, but also to not have to continue merging large, complicated custom changes across many versions, where the integrations get increasingly difficult as the core engine changes more.

So this bug report is an effort to see if we can get some official Epic support, and maybe arrive at a solution that could be useful to the community at large.

Steps to Reproduce:

  1. Set up a basic hierarchy of materials that use the Material Layers system
  2. Add or remove a layer to the parent material. Note that changes to the layer stack do not immediately or correctly propagate to the child materials until those until each child material is manually “kicked”.
  3. Quite often, the editor will simply crash when kicking/updating those child materials (this seems somewhat dependent on whether the child material’s MaterialEditor tab was currently open in the editor when the parent material was updated… It seems more likely to crash if the child mat’s panel was also open)
  4. Note that rearranging the Material Layers does not function at all.
  5. Note that toggling visibility of a layer on a parent never propagates to children

MatLayersDebug57.zip(10.7 MB)

Hi Eric,

Thanks for providing the feedback and bug reports.

  1. Toggling visibility not propagating to children is likely a bug
  2. The issues where editing a parent Material Layer doesn’t propagate to Material Instances in the scene is also likely a bug. It’s possible that saving the parent Material would cause the Material Instances to update and there may be implications of propagating changes if a Material has many Material Instances. This is a common problem and just needs a bug fix.
  3. Can you provide the callstack/crash report from the crash you experienced in the video?
  4. The issue where you cannot re-order the layers was actually introduced when we fixed another bug where adding a layer to a parent wasn’t propagating to the child. We have a task to fix re-ordering but if already have it fixed in your codebase a PR would be welcome.

I’ll update this ticket with some public issue links when I have them made, but wanted to give an update on our progress.

Attached is the full Crash Report (zipped folder from the Saves/Crashes directory) for that crash requested in item #3.

One of our engineers is going to take a look at our old codebase and reply with info regarding a possible PR (or other info) for item # 4.

Thanks so much,

-eaa

UnrealCrashReport.zip(571 KB)

Hello,

Apologies for the delay. I’ve verified the issues still exist in latest and created the following issues which should be visible publicly soon:

Toggling Material Layer visibility in Parent Material doesn’t propagate to children (https://issues.unrealengine.com/issue/UE-383824)

Adding/Removing a Material Layer on a Parent Material doesn’t propagate to Children correctly (https://issues.unrealengine.com/issue/UE-383828)

Editor crashes when Material Layer visibility is toggled after removing a Material Layer in Parent (https://issues.unrealengine.com/issue/UE-383839)

Material Layers cannot be re-ordered by dragging in the Material Layer Parameters tab (https://issues.unrealengine.com/issue/UE-383841)

Thanks for reporting these and for the crash report!