[Bug] Set Brush from Texture

Hello,

I would like to report that the blueprint node “Set Brush from Texture” isn’t working. The texture is not displayed if that node is being used. If instead I use directly “Set Brush” with the “Make Brush from Texture” node as input then the texture is being displayed correctly.

these are the nodes I am talking about :

77892-setbrushfromtexture_bug.jpg

1 Like

Hi ,

  • Does this occur in a clean, blank project with no additional content or is it limited to one project?
  • What steps are you taking to reproduce this error on your end?
  • What blueprints are you attempting to use this in?

hello ,

This occurs in a blank project, no additional content except my icon texture.
I create a UMG user widget blueprint. It contains a button and an image.
As you can see in the screenshot above, all i am trying to do is set the image via the “Set Brush” nodes. One works the other doesn’t.

Have you tried this with any other texture or is it limited to the one? If the one, can you upload that texture here so I can attempt to recreate this? Thus far I have not been able to reproduce this error on my end.

hm i just tried a completly fresh project with minimal setup and indeed i cannot reproduce it either. If however i put back the Set Brush from texture instead of the Set Brush in combination of “Make brush from texture” node then it doesn’t work. I guess I will report back if I ever find out what causes it.

I will leave this post open a few days, just in case you find a reproduction for the error. If you do, please post here and I’ll be happy to take another look.

Hi

I am marking this thread as answered for tracking purposes. If you are able to get a reproduction for the error, please comment with updated reproduction steps and I’ll be happy to take another look.

Hi , I’ve a similar issue too using SetBrushFromTexture, with Unreal 4.12

I’ve a userwidget containing an image that is initialized by blueprint using a texture2D reference for the brush

Case 1:

If the SetBrushFromTexture is called during construct event, everything works fine

Case 2:

If the SetBrushFromTexture is called during a tick event and the texture2D ref has just been loaded during the same tick event, so the bug happens.

In this situation it’s just enough to put a breakpoint in blueprint between the LoadTexture and the SetBrushFromTexture calls to see the texture properly showed…

I’ve replaced the SetBrushFromTexture with the SetBrush + MakeBrush using the just loaded texture and everything was fixed.

I’ve also seen that if SetBrushFromTexture is called during construct, then also the Tick event logic works fine (it correctly updates the brush with the newly loaded texture)

Hi ,

  • Does this occur in a clean, blank project with no additional content or is it limited to one project?
  • Can you provide a screenshot of the setup that is not working?
  • Do you have a specific series of steps I can take to reproduce this on my end?

Hi , I was able to reproduce the issue in a simple situation.

If you see the attached images the configuration that lead to the bug is:

  1. have a texture2d reference and an Image
  2. in designer set the image to use the texture2d as brush
  3. in the first tick event change the texture2D AND then call the SetBrushFromTexture on the image (in blueprint set true to the branch condition)

In that situation the image is not drawn.

Instead, using ‘set brush’ creating a new slate brush it works fine (in blueprint set false to the branch condition)

If I remove the brush binding from the image, both the SetBrush / SetBrushFromTexture calls works fine as expected.

I think anyway that having the binding it’s wrong to call the SetBrush, considering that the image is already configured to use that texture as brush: if the image is bind to the texture in fact, I can just remove from the blueprint all the ‘set brush’ calls and everything works fine just updating the texture with the newly loaded one.

What is your end goal with what you are trying to do? The code in your blueprint image unfortunately will not do anything, do you have a specific end goal in mind?

Hi , the code is supposed (and just does that, I’ve it running) to load a texture2D from a given path (that I omitted in previous screenshots) and set it as brush for an image. It was a sample, which I’ve used just to show you the bug, not the actual code we’re using.

Anyway, I try to be more clear.

In the two blueprints attached there’re two different functions UpdateTexture1 (that uses SetBrushFromTexture) and UpdateTexture2 (that uses SetBrush + slate brush).

Both have a ‘callSetBrush’ bool in input.

Case 1

in the designer test_image brush is bound to test_texture (as shown in the designer.png attached)

with this configuration:

  • calling UpdateTexture1 from construct event correctly update the image shown, whichever the ‘callSetBrush’ value is

  • calling UpdateTexture2 from construct event correctly update the image shown, whichever the ‘callSetBrush’ value is

  • calling UpdateTexture1 from tick event correctly update the image shown, only if ‘callSetBrush’ is false. If ‘callSetBrush’ is true the image is drawn as transparent and that’s, according to me, the bug.

  • calling UpdateTexture2 from tick event correctly update the image shown, whichever the ‘callSetBrush’ value is

Case 2

in the designer test_image brush is unbound, so it uses the default white brush

with this configuration:

  • each call to UpdateTexture1 and UpdateTexture2 has obviously no effect if the ‘callSetBrush’ is false

  • each call to UpdateTexture1 and UpdateTexture2 correctly update the image shown if ‘callSetBrush’ is true, either in construct or tick event.

Do you have a sample project this is occurring in I’d be able to take a look at? If you link it here, I’ll be happy to take a look and see what may be occurring.

We have come across this same issue in our project. It happens in both 4.13 and 4.15.

Our setup:

UMG widget with an Image

“Set Brush from Texture” fails to update if called during tick but works on construct.
The workaround works by switching the node to “Set Brush” with “Make Brush from Texture” to pass in the new texture.

Hello Raf,

I tested this issue on our end. I have been unable to reproduce the issue described. I have a few questions for you that will help narrow down what issue it is that you are experiencing.

  1. Can you reproduce this issue in a clean project?
  2. If so, could you provide a detailed list of steps to reproduce this issue on our end?
  3. Could you provide screen shots of any settings/blueprints/widgets that may be involved with this issue?

Only in this way can Texture 2D textures be set. Then the texture information is displayed correctly after changing the gun.

However, setting texture like this will give an error and texture information is not set correctly. The texture image will be displayed correctly after the gun change. I do not know why this is so. For a long time did not find the reason.

Problem confirmed in latest build 4.19.1- thanks for workaround suggestion .

Hello Raf,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will follow up.

Thanks,

Hello,

We’ve recently made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.

Thanks