Can I convert a Texture2D Dynamic to Texture2D?

When using the Download Image blueprint node in 4.14 I would get a Texture2D object that I would use to set the Texture Parameter value of my dynamic materials during runtime. But now in 4.15 I get a Texture2D Dynamic object as the output instead. Is there any way to convert this to a Texture2D?

3 Likes

I have the same problem. Did you find any way to fix it?

3 Likes

Unfortunately no, I haven’t. I ended up resuming development in 4.14 and waiting to see if it would be addressed in a later version of Unreal Engine. When I took a quick look at 4.16 it seems like this is still an issue, so right now I’m not sure how to address it besides sticking with 4.14.

2 Likes

I would also like to know this. Also using the Download Image node.

Texture2DDynamic is not very usable for many nodes that only accept Texture2D.

1 Like

Im still looking for a solution

1 Like

Use “Set Brush from Texture Dynamic” Node.

Set Brush from Texture Dynamic

5 Likes

This allows me to use an image in UMG but does it actually convert to Texture 2D? I need texture 2D so that I can pull sizeX and sizeY from it for some calulations. How would I get that?

3 Likes

Bump!

I’m trying to download images and use them as 2D textures in scene actors.

The only workaround I’ve found is converting the dynamic image to Brush, put the image in a widget, then include that widget as component of a blueprint actor. Messy…

Anyone found a way to convert Texture2D Dynamic objects to good old Texture2D?

No need to convert. Instead, feed a Dynamic Material Instance parameter with the output.

But I still have the same problem than @3Daoist . Did not find any way to get the size of the texture. I need that info to automatically scale the canvas static mesh to fit each image aspect ratio.

2 Likes

Hi @BryanRam !

After spending some time trying to convert a Texture2D into a Texture2DDynamic and vice-versa. I figured out that it was not possible directly, that is because both classes inherit from the same class “UTexture”. Then I tried to create a new Texture2D using the values from Texture2DDynamic, I had problems but it seems possible on c++, on blueprints on the other side, it doesn’t look like it’s going to be easy.

So a new approach came into mind after reading what @TechLord posted, what if we try to cast the Texture of the Brush? Something like this

I can’t test it right now, as I don’t have a Dynamic Texture, but hopefully, it works, as the brush is being set right before calling this.

Tell me if it works! Kind Regards,
Raimundo

1 Like

It’s a little too late but unfortunately no, this doesn’t work and there’s still no solution in UE 5.1

1 Like

For any still looking I noticed that the latest (UE5.1) that I am using now has a “import file as texture 2D” node. This works for me as my new solution involves downloading image files to the local storage and then pulling them in to use in game at runtime. So now I just point that new node at the path of the image file stored locally and bam. Texture2D ready to use in the rest of the blueprint.

3 Likes

If what you want is to correctly scale the images, one option is to change the transform like this. I assigned the dynamic texture first and then transformed it