How can I export to c++ to export 2Dtexture?

I want to know how to do c++ script that exports 2D texture to TGA

For example, texture of the path “Game/texture/test_texture.test_texture”
I want to export in the “d:/test/” folder.

I think I’ll use UTextureExporterTGA.

thank you

Hello,

Did you end up using UTextureExporterTGA?

I’m unsure how to call this off a UTexture…or what it does exactly, there’s not much documentation.

I was looking at UExporter::ExportToFile() , but I’m not sure this is correct for textures.

Without getting into it since I do not know exactly for Unreal
You need a string to format the file name
You need a image package format to format a image with unreal type of setup.
You need an int 8 bit array to hold the data and a loop to read thru the data.
There may be a wrapper for this from unreal to dump the tga into the file name, there is I know it is it’s for importing images but I think maybe it can be used for exports as well.

I imported images with C++ with this , so it can be done in reverse it’s the same thing, you need to write a format for texture to be able to read the texture, a transient one maybe and get the original texture into your C++ with 2d texture setup then pass it to the transient format , then stick it inside the 8 bit array , the data from the texture, then the data from the array to file name with the wrapper I think.

Step one is to get your 2d texture inside C++
Second read the texture and get it’s data, the data go’s into an 8bit binary array.
Third from the array you dump it into what unreal has as a setup for you to wrap it as a tga file name and last step is the string file name I guess to give the tga a name and file path all done with string.