I am trying to obtain a reference to the texture of a material which has been applied to a static mesh in the editor.
- I created a subclass of AActor and dragged an instance into the editor.
- I attached a static mesh component (shape) to my actor in the editor.
- I added a new UMediaTexture to my content browser, created a material from this texture, then applied the material to my static mesh
Here’s what I tried:
- Override
PostInitializeComponents
- Get all components (which should only be my mesh, right?)
- Get the material at index 0 for the first component
- Get the texture of the material
To add a bit more context, I’m trying to get the texture (which is a UMediaTexture) and set it on a UMediaPlayer, then play a streaming video. This doesn’t seem to be working. Am I going about this the correct way? Any advice at all would be greatly appreciated.