Skip to main content
Inspiring
March 4, 2025
Solved

Reverting to original texture in script.

Is there a way to revert to original texture a model is imported with, in script? Similar to what button in desktop editor does, that reverts any texture you applied back to the original mesh texture. I tried to see if I can getTexture of a Mesh but that does not seem to exist. Only setting a new texture exists. 

Shards632
Shards632Answer
Honored Contributor
March 4, 2025

I do not think there is a programmatic way to 'revert'. But you can always use the MeshEntity.setMaterial() (or MeshEntity.setTexture(), if working with a _UIO material) to change the texture being used to whatever you want. You would just need to 'know' the default in your code to set it back to that.

June Programming Calendar

1 reply

Shards632
Shards632Answer
Honored Contributor
March 4, 2025

I do not think there is a programmatic way to 'revert'. But you can always use the MeshEntity.setMaterial() (or MeshEntity.setTexture(), if working with a _UIO material) to change the texture being used to whatever you want. You would just need to 'know' the default in your code to set it back to that.

June Programming Calendar