[4.8.1] - Potential Material Assignment Bug in Construction Scripts of Blueprints

Hey Guys,

This appears to be a bug but this is the first time I’ve seen this. What’s happening, and as a note, I’ve seen this in 2 different UE4 projects is that if you create a DynamicMaterialInstance (and appears a simple MaterialInstance as well) and then assign that to a mesh in a Construction Script, it fails to render on the mesh. The odd part is I can see it overriding the Material in the ‘Overriden Materials’ drop down for the StaticMeshComponent in its Details Panel. ??

So maybe it’s getting it but something in the engine isn’t allowing the shader to be rendered? Your guess is as good as mine but I wanted to bring it up in case it was easy for the dev team to lock down. I do need it for both projects but it won’t kill me (at least at the moment) for a Hotfix release but if it’s not until 4.9 (which looks to be August), then it possibly could prove problematic in both games I’m working on.

Thanks again!

Hey ,

Would you provide me with your blueprint set up so I can replicate this issue on my end please?

I am assuming you are doing this within a Static Mesh Actor Blueprint, similar to the set up I have below?

Dynamic Material Instance Blueprint

49434-dynamicmatinst.png

I am not seeing the issue you are reporting, so let me know how our steps differ so we can find a solution.

Cheers,

Hey Andrew,

Long time no talk and hope all has been well. Sure. Let me dig in today and take another look. If its working for you, there might be something I am doing wrong but I’ll definitely double check.

BTW… sweet caustic texture, is that in the engine?

Okay, just did some testing and w/ a new Actor, this works as expected.

I want to apologize for not simply doing that before posting this in the bug reports and admit I may have been wrong in labeling this one as an engine issue.

I however did just find an Actor that will not accept the Material Override directly through the Details panel. I just checked my C++ base class and I’m not overriding the material so it’s possible I did see the above but it could be a very specific case. But on that one, setting a Dynamic Material Instance through the Construction Script did work so that’s good but directly dragging and dropping a material in the overrides for the mesh failed.

I was working w/ one of the team members on one of the projects I’m working on and we’re pretty sure we saw this happen together but I might have to dig around the assets and see if I can find it.

I’ll do a deep dive here shortly and see what I can find. I’m almost positive I saw this and I’ll even go digging around on my other project to see if I find it there.

I’ll keep you posted and in the meantime, if you want me to try anything regarding directly setting the material to find out what is causing that, let me know.

Thanks Andrew!

No worries, it is part of my job to ask these questions!

Yes let me know if/when you discover any new information. If find this issue is resolved go ahead and accept the initial answer I gave you, but if you need help don’t hesitate to ask.

Cheers,

Thanks a ton Andrew, you guys are awesome over there!

I’ll try to reach back by tomorrow afternoon w/ an update. Have a great day!

Hey Andrew, didn’t have a whole lot of time today on this but I’ll try to seeing if I can find it shortly. One thing I might have noticed quickly, but will need to go back to check is I might have mistaken this issue w/ seeing it directly in the editor in the details panel. What I think it might have been since I thought I saw this for a split second this morning was a material failing to apply inside the editor after its already in the level. The experimental tool to edit BPs in editor may be still early and what was the issue. But I think I tried clicking the inner mesh component, and attempting to set it there in it’s material overrides. I’ll try to check this out likely tomorrow but at least wanted to get back to you.

Thanks!

So I attempted to try the above idea and it seems to work. I’ll keep an eye out as it could’ve been a weird use-case.

In the meantime, feel free to mark this Resolved and if I do happen to notice it again, I’ll try to find a way to repro it for you.

Have a great weekend Andrew!