From BlenderWiki

Jump to: navigation, search
Note: This is an archived version of the Blender Developer Wiki. The current and active wiki is available on wiki.blender.org.

GSoC 2017 Package Manager

Gsoc-2017-package manager final report splash.png


This is a final report for my GSoC 2017 project, a package manager for Blender. I pushed 187 commits (across two repositories) over the course of three months, and I learned a lot on the way. The package manager supports downloading and installing packages from multiple repositories, updating outdated packages, and browsing all those packages from inside blender. Having such a package manager allows blender addon developers to push updates to addons without waiting for a blender release, and it helps keep initial download sizes down by letting users download only the addons they want, when they want them.

The package manager can be found in this branch: https://developer.blender.org/diffusion/B/browse/soc-2017-package_manager/ A repository generation tool can be found in this repository: https://developer.blender.org/diffusion/BPMA

There's plenty still to do however:

Remaining work

Metadata

As it seems Blender 2.8 will have a number of breaking API changes anyway, now seems like a good opportunity to add additional metadata for packages. Blender addon names are rather like titles, often containing upper and lower case, spaces, non-ascii characters. These The existing addon system uses module names field that allows for more reliable unique identification?

More optional metadata could also be added, such as a changelog url.

Stability

There are lots of small issues still which need to be ironed out.

  • More testing (currently only the repository generation script has automated tests)

User experience

  • Support undo of recent uninstallations
  • Better preferences display

Currently preferences are displayed inline with the package list (like the prexisting UI). This can feel cramped, would be nice to give package preferences their own page.

  • Better progress display

Blender's python API for showing progress can only display a number at the cursor. This means per-package progress can't be shown very effectively. Extending the API with more flexible progress display methods will help addons as well as the package manager.

  • Interface doesn't scroll with package list

Scrolling packages moves the sidebar off the top of the window. It would be nicer if the sidebar was be fixed in place (i.e. put in a region).

Security

  • Enforced https

With free SSL cert providers like LetsEncrypt, https can likely be force enabled.

  • Package signing

Farther down the road

I've been keeping the idea that a "package" could consist of something besides an addon in mind. While the package manager is currently limited to addons, in the future it could support installing themes, textures, nodepacks, etc.


Test it for yourself

1. Clone blender and checkout the `soc-2017-package_manager` branch: https://developer.blender.org/diffusion/B/browse/soc-2017-package_manager/.

 git clone git://git.blender.org/blender.git
 git checkout soc-2017-package_manager

2. Build: https://wiki.blender.org/index.php/Dev:Doc/Building_Blender. You may wish to build without addons (or delete them from `<build dir>/bin/<version>/scripts/addons*` afterwards). This is because system addons are typically installed where they can't be altered by the user without elevated permissions, so the package manager won't be able to uninstall/update them. Plus, the test repo only contains official addons, so if left as is, all addons will be installed already.

6. Add a repository in *User Preferences > Packages > Repositories* by clicking *edit repositories* and then the "plus" icon. You can use a local repository (see below), or use the ones I set up for testing: This one contains a snapshot of the official addons traditionally bundled with blender: http://blendermonkey.com/bpkg This one contains a few fake addons: http://blendermonkey.com/fakerepo


Repository creation

A local repository can be generated with the `generate_repository` script found here: https://developer.blender.org/diffusion/BPMA/. Example usage:

./generate_repository /path/to/packages --baseurl 'http://localhost/'

This will produce a `repo.json` file in the current directory, which can then be copied to the server. The baseurl is prepended to the filename of each package to form the package's url (so for example, `http://localhost/node_wrangler.py`).


Also see the user documentation here: https://wiki.blender.org/index.php?title=User:Gandalf3/GSoC_2017/User_Documentation

Known issues

I've noticed a couple issues which I believe are on the blender side of things, but I haven't fully tracked them down:

  • After clicking a button, blender acts as if the mouse is over a completely different button until the mouse is moved.
  • The repository list sometimes flickers.


I of course want to thank my mentors Dr. Sybren and Mitchell Stokes for sharing their time and knowledge, and also Ton and the rest of the Blender community for making Blender — clearly the most amazing piece of software ever — exist.

Thank you.



Old demo video:

Initial proposal: https://wiki.blender.org/index.php/User:Gandalf3/GSoC_2017/Proposal.