Material flags switching on automatically in editor mode

Hello,

we are having problems in all our projects with rendering sequences on the rendering farm or using -game attribute locally. Some materials, often on geometry caches, skeletal meshes or other more untypical components. I figured it has to have something to do with Material flags called “Used with”. But every time when i opened the scene to investigate report from an artist i found that all is working in the editor and all the correct flags are ticked. Then it struck me that even if i disable certain flag, it comes back as enabled after i save the asset - but no save is required.

I also found logs saying something about automatic flag enablement and that the change won’t be saved automatically.

I consider this a bug or a very poorly designed feature that i would love to disable. We would rather see the issue on the material in editor than see it pop up on the farm where its much harder to catch and fix. It often happens to unexperienced users who panic and have no idea how to even start with debugging such issues.

We would like to propose resolving this by either adding checkbox in settings that will disable automatic flag enabling in editor or marking asset dirty after enabling the flag automatically (or even saving it).

Steps to Reproduce

  1. Open Editor
  2. Create Material - check if Used with skeletal meshes is disabled.
  3. Put skeletal mesh on the scene
  4. Assign newly created material to a skeletal mesh.
  5. By now Used with skeletal meshes flag should be enabled but not saved. (no marked dirty icon visible on the material)
  6. The issue is right there but if you want you can also try running the same scene in game mode (without the editor) to see that material will fallback to grey checker.

Hi Jakub,

The Material class has a member called bAutomaticallySetUsageInEditor which allows for the usage flags to be updated automatically. Look for it under the Usage\Advanced section in the material editor. The default value for that attribute when creating a new material is decided through the project settings. Look for Rendering\Materials\Automatically set Material usage flags in editor default

The engine default is to automatically set the usage flags for accessibility reasons. Lots of advanced users to turn this off.

Regards,

Martin