My add-on creates custom node trees, which get saved fine on first creation. But when ever you open a saved file all the trees go back to have zero references and get deleted if you save again without first opening them all in an editor window (which restores them to having a reference)
What is the correct/best way to fix this? When a new tree is created, no methods are called on the tree to let it know it has been made. I guess overriding the creation operator would be an option, but that doesn't seem great? What does it even need to be linked to? The node tree in question is really a top level thing that should be linked to the file as a whole..
The other issue is that when switching to the custom node editor window, nothing is loaded. I would like it to behave like the Shader editor, where the active tree is loaded up when you switch to it, but there doesn't seem to be a way of doing this?
I wish there was some way to register a call back on an operator or prop_collection being updated..