So I have been working on an exporter as part of my Google Summer of Code project. As I am new to Blender add-on development, I was under the impression that my code would get a clean slate every time it ran, specially when the register / unregister methods were implemented.
Unfortunately my code has been exhibiting some very weird behavior! It is basically as if all the data structures are being cached by the Python interpreter, and all code is being executed several times.
As GSOC projects are open source, you can check the source itself on Github, but it is far from complete yet.
All runs of the exporter produce a debug log with some of the operations carried out. It also helps convey my problem more precisely. Here's the successful output after a run on the default scene. Now here's the incomplete output on the second run of the same scene. Even though it crashes, it is clear that all lines are basically duplicated.
For the record, I am using vscode with this add-on for development. Please let me know if any more details are needed for this question!
bl_options = {'SKIP_SAVE'}to return to defaults on next run. – batFINGER Jun 16 '19 at 12:19Thank you for pointing out my solution was not right, I would have not thought otherwise without your help. How should I go about editing the answer I provided below? Should I remove it?
– Daniel Almeida Jun 17 '19 at 17:08