17

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

Shawn Altorio
  • 645
  • 5
  • 11

1 Answers1

18

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.

zeffii
  • 39,634
  • 9
  • 103
  • 186
  • I wondered about this too, good to know – J Sargent Oct 09 '15 at 19:02
  • 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... – Cobertos Sep 13 '18 at 02:24
  • 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) – zeffii Sep 15 '18 at 07:32
  • i'll edit it further when at the desktop. – zeffii Sep 15 '18 at 07:49
  • For Blender 2.9 though self installed addons will not always show up n the search bar. any ideas on how to solve that ? – Peter Jun 26 '20 at 12:42