My script creates an image, bakes to it and saves it. The first time, it works. However, if I try to re-bake to the same image, and in the mean time the user decides to delete the image from disk for whatever reason, bake throws an error:
RuntimeError: Error: Uninitialized image
How do I re-initialize an image to solve the user-deletion problem, or, say, to change its resolution?
I tried creating and deleting a new temporary image for each bake, and that sort of works, but if I do this at the end,
it leaves an unresolved reference in the uv/image editor, if that happens to be open at the time the bake is started. How do I unlink the image from the image editor?