Expose texture as editable?

I’m trying to make it so I can select textures from the device editor, but of course textures are not concrete. Is there a way to do this?

I use enums to workaround that

metaball_color := enum:
    White
    Blue
    Red

(Wrapper: metaball_color).GetMaterial():material=
    case(Wrapper):
        metaball_color.Blue => M_Metaball_Blue # Your texture/material
        metaball_color.Red => M_Metaball_Red # Your texture/material
        metaball_color.White => M_Metaball # Your texture/material

Then you can set

@editable
MetaballTexture : metaball_color = metaball_color.White
2 Likes

Hello, yes it is posible to do it, but it is not as simple as it could seem.

First of all you need to open your projects folder and open de .Uplugin file and add the following line:
“EnableVerseAssetReflection”: true

It allows you to use your images/textures inside your code.

After that you can insert your images/textures in the folder you want in your project and click on “Build verse code”. Now you can go to the code and you will see a new folder in it called Assets.digest.verse wher you will found a reference of all your textures:
in my case is something like this:

the folder where i saved my images was colled Images, so the Name of the module will be the name of the folder that keeps your images.

And last of all to call this textures is as simple as this:

I know about this already, the question is specifically about being able to make a texture selector for the @editable ui. It would be useful for my designer, rather than having to select the index of a table, which is less ideal

1 Like