17
$\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$
0

1 Answer 1

18
$\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$
5
  • $\begingroup$ I wondered about this too, good to know $\endgroup$
    – J Sargent
    Oct 9, 2015 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$
    – Cobertos
    Sep 13, 2018 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, 2018 at 7:32
  • $\begingroup$ i'll edit it further when at the desktop. $\endgroup$
    – zeffii
    Sep 15, 2018 at 7:49
  • $\begingroup$ For Blender 2.9 though self installed addons will not always show up n the search bar. any ideas on how to solve that ? $\endgroup$
    – Peter
    Jun 26, 2020 at 12:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .