Can I access the .blend file path during the first execution of
Here’s some context:
My addon allows users to import several files, but the data would be referenced rather than saved as part of the .blend file. So I need to store the path to the imported file. I would like to be able to save the path as a relative path. Only problem is, before the .blend file is saved, there’s nothing to make the path relative to.
I was thinking I could capture the
save_pre() event, grab the intended .blend file path, go convert the absolute paths to relative ones, then let Blender save the file. However, during my testing, I found that
bpy.data.filepath is not set until after the
save_pre() event. It’s available in the
save_post() event, but by that point it’s too late to make the change; the user would have to save the file twice the first time.
Any ideas? Is there some equivalent of