I’m writing a plugin for the editor that works as a material previewer for the entire project. I have it generating thumbnails of all the resources in my project. I’m doing this by rendering a thumbnail image of a mesh using the material to an offscreen buffer. (Since there are a large number of materials, I need to take snapshots since creating a separate offscreen buffer for each materail will quickly consume all the available slots for offscreen buffers).
Anyhow, if the user updates the material, I need to update the snapshot. How would I do this? I thought that if I loaded the resource and monitored it’s changed signal that would work, but it’s not being called (for StandardMaterial3D at least). I’m also listening for EditorFileSystem.resources_reimported, but it’s not being called either. How can I detect if the user has made a change to a material resource?
I don’t think this will help. To override _notification() I’d have to be writing my own class that extends Material. What I’m trying to do is determine when an existing ShaderMaterial3D has changed.