11
$\begingroup$

Why is it that if I go to install an add-on from User Preferences > Add-ons > Install from File... and choose a *.ZIP, some add-ons will install, while others will return me to the User Preferences with nothing having happened (as far as I can tell)?

Is there a specific file structure required in the .ZIP? I get many add-ons from GitHub, using the Download Zip button, and even there installation of the actual Zip file only works some of the time.

enter image description here

$\endgroup$
  • 1
    $\begingroup$ You should always unzip a folder before trying to install it if I remember correctly. $\endgroup$ – VRM Oct 9 '15 at 18:40
12
$\begingroup$

You can install from zip directly if the zip is either:

  • a zipped single .py file

      addon_name.zip
           |  
           addon_name.py   
    
  • a zipped folder, important that it's not a zip that contains a folder first.

      addon_name.zip
           |  
           addon_foo.py   
           __init__.py
    

    this will also work

      addon_name.zip
           |  
           addon_name_folder
                  |
                  addon_foo.py   
                  __init__.py
    
    • for instance: this zip will fail, because the add-on folder is nested too deep, there's another folder inside the zip:
      • https://github.com/zeffii/TubeTool (this is a link to a branch that first has an extra level of folder nesting)
      • Github will generate a zip from that repo that looks like this:

      repository_name.zip
           |  
           repository_name_folder
                |
                first_folder_in_repo
                        | 
                        addon_foo.py   
                        __init__.py
    

Zipped add-ons with a structure that doesn't work with the install-from-file feature may or may not have a good reason for being that way.

$\endgroup$
  • $\begingroup$ I wondered about this too, good to know $\endgroup$ – VRM Oct 9 '15 at 19:02
  • $\begingroup$ Can I get a fact check on this? The last one should not fail as the .zip file is extracted into the add-ons folder (as it does in the source code) and the __init__.py file will get picked up by Blender. The system has been this way since Blender 2.6 according to git blame. I structured my add-on like the last one and it works fine... $\endgroup$ – Coburn Sep 13 '18 at 2:24
  • $\begingroup$ i'm going to agree, that last written zip structure should prove no problem to the installer. i'll edit my answer. (if you look at the zip of the github repo i linked to, you'll see I missed a nested folder in the example here) $\endgroup$ – zeffii Sep 15 '18 at 7:32
  • $\begingroup$ i'll edit it further when at the desktop. $\endgroup$ – zeffii Sep 15 '18 at 7:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.