Forum Discussion

izukingz's avatar
izukingz
MHCP Partner
1 year ago
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. 

  • 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.

1 Reply

  • 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.