Download

Swapping position of shader elements

I’m building a modular character that creates a dynamic material instance in the Construction Script, and applies it to all parts of clothing that has skin exposed, so that skin color can be changed during game play.

The problem is that some of my meshes with multiple shaders (for example a shoe mesh which contains a section of the ankle) have the skin shader at different positions (sometimes Element 0, sometimes Element 1) so then the skin shader gets applied on the actual shoe.

During export, I made sure to apply the same shader to the ‘skin’ part of the mesh hoping that UE4 would pick up that it should place the same shader at the same Element position, but it seems to be hit and miss.

Is there a way to swap this manually?

So is this actually not possible? I find it strange that a decision that the editor makes for you that affects some nodes can’t be changed manually.

It would be different if it didn’t affect anything whatsoever and the order or the materials was purely an aesthetic thing, but Element 0, Element 1 etc are actually important distinctions that are used in blueprints, so are we just at the mercy of UE4 to make the decision either correctly or incorrectly upon mesh import?

Unity does this too, I believe they are assigned in the order they are encounter as the vertexes are imported.