I am developing a program that will include a custom importer and exporter for blender.
I would like the installer for my program to be able to automatically install and enable the import/export python scripts. Here are the steps I think I need to do:
- Find the blender add-on directory. My program is windows-only, so I presume this will just be in %appdata%\Blender Foundation
- Copy my add-on files to a subdirectory of the add-on directory
- Enable the plugin in blender
- Save the user preferences so that the plugin stays enabled after a restart.
I can work out 1, and 2 is easy, but I'm not sure that 3 and 4 are even possible without using the UI. Is it possible to do them programmatically, perhaps via a python script that I launch with blender?