I'm working on a small post-save-hook, which is working pretty nicely only if the file is saved first and then the script is loaded later on. If I install my addon from the file and I save the currently opened new blender project I have this error:
AttributeError: '_RestrictData' object has no attribute 'filepath'
Which comes from the line, where I try to access the filepath data of my blender file:
path = bpy.data.filepath
When I remove my script, save the blender file and then readd my script it works again. So basically my question is:
What is the workaround of this issue? Can an already loaded module reload itself? Or is there some other way to do this properly?
Thanks in advance!