[UMG] Sample project included ~ If Button uses a custom image and that image is used in another widget that is added, button loses its image

Dear Epic,

I encountered the following bug merely by upgrading from 4.10 to 4.11, no project content was changed.

  1. if a button is using a custom image instead of default and
  2. another widget is added to the viewport ( for example via clicking that button), that uses the same image as a background as the button is using for its image, then
  3. The button loses its image and keeps only its custom coloring once that 2nd widget is added

My theory: somehow because the image resource is the same (a material in this case) for the new widget and for the button, the button is somehow losing the right to use that resource or it is getting cleared somehow.

#Sample Project For You!

Here is a link to a 1.15mb sample project where I’ve repro’ed this issue!

Project Download (1.15mb)

www.lightningfitness.org/misc/video/UMGImageSharing.zip

When you go in game, and press the button, its custom background will disappear because the new widget that gets added uses that custom background resource as its own image.

#Workaround

I know it’s a resource sharing issue, because if I simply duplicate the material that the button styling image and the other widget image are sharing, then the issue goes away!

So a short term solution is to simply duplicate the resource that the button wants to use that the rest of your umg is also using.

Please note this is better to do with materials than textures, try to make it a material if it was a texture to minimize project size increae.

#:heart:

Thank you for UE4 and UMG!

Hello ,

Thank you for your detailed report. I was unable to reproduce this issue on our end. I tried using the information provided to reproduce this issue in a clean project. I also tried downloading the project provided in your post. However, I could not get the project provided to work correctly and I could not reproduce the issue in a clean project. Nothing in the project provided would open and so I could not run the test needed to confirm this issue. Could you try sending another copy of the project or send the version before it was updated to see if that allows me to test things on my end?

Hi there!

I just downloaded my project from the link in original post, I put it on my desktop and unzipped it.

Then I just ran the .uproject and it created intermediate and loaded fine.

I am using 4.11.0 release, launcher version, I wonder why its not working for you? very strange!

I am not sure what else to do, so I’ve created a Content folder and migrated the assets to this folder, ala marketplace submissions.

Can you access and merge this content into a project? You’d then need to add Main to viewport via level BP.

www.lightningfitness.org/misc/video/UMGButtonErrorContent.zip

Nice to hear from you Rudy!

Hello ,

After testing this issue again I was able to reproduce this issue on our end. I have written up a report (UE-29310) and I have submitted it to the developers for further consideration. I will provide updates with any pertinent information as it becomes available. Thank you for your time and information.

Make it a great day

Thanks for the update Ruddy!

:heart: