I have a type of object with a custom inspector that will add or remove children, modifying what the object as a whole looks like. This works perfectly in the hierarchy when I can see those changes in the scene view, but in the inspector view if I want to see those changes in the preview window I have to deselect the object and select it again (which is tedious.)
Is there some way to force the inspector to re-draw that preview window as if the object had been re-selected?
Things I’ve tried :
Calling Repaint(); after modifying those objects.
Calling EditorUtility.SetDirty(myObject); after modifying those objects
Tried implementing OnPreviewGui() as well but I couldn’t really get it to do anything I wanted to do.
Anyone have any tips on this?
EDIT : Heres an image that will hopefully make it clearer what I’m trying to do. I need to refresh that model preview at the bottom whenever the preview or clear buttons are pressed.