Parameter collection override will not show in the material instance. The MPC that won’t show up but does show up in the reference viewer and does affect the material when the values are changed.
Master material - 2 original MPC
Material instance - Replaced the MPC with an “instanced MPC” (has original MPCs in the base)
Steps to Reproduce
I have created a material with 2 material parameter collections referenced in the material. Then I created a material instance from that. I have 2 additional MPC “instances” that I made that use the 2 referenced in the master material as their base. In the material instance I use the parameter collection overrides to replace the original 2 MPC with the “instance” MPC. At some point 1 of the parameter collection overrides stopped showing up in the material instance details panel. The “instanced” MPCs both still show up as a reference in the reference viewer and will still function in the material instance when editing values in the MPC but I am unable to see the one in the details panel or replace it.
Sometimes I am able to get it to show up if I click on and off some of the bool parameters, edit the names of the MPC parameters, or change the name of the MPC. This also isn’t consistent and it will often just never show up with no apparent cause.
This could indicate the parameter collection StateId is somehow different than the parent and so the details panel doesn’t show it. If you make some minor change to the base material (disconnect & reconnect a node) and recompile and save it, do the parameter collection overrides show up in the material instance details panel? You may need to re-open the panel after recompiling/saving the base material.
I have disconnected and reconnected a node in the parent material then closed the material windows and reopened them. This does not make the 2nd MPC show up. Interesting enough we did discover that we can make it appear by clicking on one specific bool parameter. It does show up incorrectly (unchecked displaying the wrong MPC than what is actually being used in the material). I am able to check the MPC from there and replace it, so we do have a workaround for the moment. The MPC is being used even without that specific bool being true but just doesn’t display in the material instance details.
I have been debugging this by using the reference viewer to see what MPC is being used and changing the values. Doing this does change the material as expected but the MPC won’t show in that instance details unless checking this one specific bool value.
All of the material parameter collections were showing through all the instances before but while working in the project we have encountered this issue.
The code for determining if the MPC override should appear is in FMaterialInstanceParameterDetails::CreateParameterCollectionOverrideCategory.
I’ve been unable to reproduce the error locally but I think you can narrow this down by attaching a debugger and setting a breakpoint in FMaterialInstanceParameterDetails::CreateParameterCollectionOverrideCategory where it iterates over the parameter collection infos on line 548. I’m interested to know if when you open the material instance that has the missing MPC override, if this part of the if condition fails because the StateId isn’t found using IsInstanceOf
Result.Value.ParameterCollection->IsInstanceOf(CollectionInfo.StateId)If that’s the cause of the MPC not resolving then it’s an issue with the StateId and we can try adding some logic to resolve the MPC parameter another way.
The thing that kinda throws a wrench in this is that this logic should be unaffected by toggling a bool parameter in the UI. Is this a bool Material Property that’s exposed in the Material Instance details panel or a bool on the base Material itself?
The bool is from a switch param in the base material.
I did hit the “Show Inactive” button on the top of the instance and it does show the MPC incorrectly (showing unchecked and using the base MPC when it is using an instance MCP). I did find that changing the group string in the Material Expression Collection Parameter in the base material does seem to make it show up in the instances.
When I opened the project today It is now showing the Base MPC instead of the instanced one but the reference viewer is showing the instance MPC.
The way you mentioned to debug this issue is a bit over my head but if you could explain the steps a different way I would give it a try.
Can you use the migrate tool to copy the assets into a vanilla UE project and attach that project to this ticket? Then I can more easily see what’s going on with these specific assets.
To use the migrate tool, first create a new vanilla blank Blueprint project (so it’s simple and small). Select the assets in the content browser, and right click, select ‘Migrate assets’ and migrate them to the Content folder of the new project.
[Image Removed]There is an known issue where the assets will disappear from the Content Browser after migration, but if you re-open the project they’ll be visible again.