How to add addons to blender
How to add addons to blender
Process/Addons
Blender builds and releases include python script add-ons that extend its functionality. This page has information for developers who want to have their add-on bundled with Blender.
Mandatory prerequisites to get an add-on accepted
You must be aware that your add-on will be integrated into the official Blender distribution. Therefore you must ensure there is continuous support for keeping your add-on working and fixing bugs as they appear. So you must commit yourself (or find a maintainer who does it for you) to do the maintenance (see General Guidelines for Add-on Developers below)
Key requirements for Add-ons
We want to implement fair and uniform rules for all add-ons included in Blender releases.
This implies that:
Contact
Repositories
Add-ons are hosted in two Git repositories, that are automatically checked out as a submodule of the main Blender repository.
They can be found in these two directories of the main Blender repository:
Submitting an Add-on
The reviewer will decide if the add-on can be included in official release, included in the Contrib repository or can’t be included. If the add-on is in the Contrib repository and matures, you can later mail bf-python and ask for the add-on to be moved to the repository for official releases.
If the add-on is on track to be included in official releases, you may be asked to submit it to our Code Review tool for a closer review.
General Guidelines for Add-on Developers
If you attempt to submit your add-on either to the contrib section or to the release section of the add-on Repository, then your add-on will undergo a review process. Within this process changes may be requested to keep inline with good coding practices. Those changes may be provided by you or by the reviewer. This will be clarified with the reviewer on a case by case basis.
Once your add-on is accepted and hosted in the Blender release section or the contrib section, you become responsible for maintaining your add-on and you get commit permissions to the add-on repository.
Duties of an Add-on maintainer
As soon as you got the commit permissions you.
Must Do
Avoid unmaintained Add-ons
Add-ons that are not supported (or no longer supported) by their authors may be removed from Blender if they are broken & we can not find a maintainer.
Should Do
Never Do
Working with Git
The same advice from our Git Usage page applies here.
If you have a full Blender checkout, you can go into the release/scripts/addons or release/scripts/addons_contrib directory, and it’s as if you are working in the Blender Add-ons or Blender Add-ons Contrib repositories directly. You can do all the typical git commands there for adding files, committing changes, and fetching and rebasing updates.
Optionally you can choose to clone the individual repositories and work there:
Bug Reports
Bugs for all add-ons are reported to the add-ons project on developer.blender.org. If a bug is filed for your add-on, the bug will be assigned to you as the add-on maintainer.
You can also help out with bugs that are marked as Needs Triage in the tracker, to assign them to the right maintainer, confirm the problem or even fix the bug yourself.
Want to master Blender? Click here! and get our E-Book
A Blender addon is just a piece of software that extend Blenders functionality. It can be in the form of a new tool, a new way to export a file format or a bunch of shortcuts that someone thought was a clever idea to put together.
The goal of blender addons is the same: Simplify some process or add functionality.
If you are just interested in the add-on list, click here to take you further down the page.
There is not much limit to what can be put into an addon. There are addons like animation nodes that extend Blender to allow for node-based programming of your scenes to the f2 addon that simply adds some functionality to an existing tool.
In this article, I will go through and look at how Blender organizes addons, how we install new ones, as well as a list of addons that can be helpful to you in one way or another. I list my own favorite addons as well as some that are considered useful. Most of them do some action in bulk, like exporting multiple formats at once, automatically pack UV islands effectively or simply make an existing tool use fewer clicks.
Manage Blender addons
Let’s start to look at how we manage addons and what addons come with blender by default.
Blender comes with a large set of built-in add-ons. Some of them are enabled by default while others are not. To find the built-in add-ons go to «Edit->Preferences» and find the “Add-ons” section. There are three categories of blender addons. These are:
You can toggle the visibility of each category by clicking on the respective buttons at the top. Hold shift while clicking on the categories to enable multiple categories. When all three buttons are blue you have a complete list of available addons to scroll through and explore.
There is also a filter drop-down where you can filter add-ons based on subcategory or status, like enabled or disabled just below the three category buttons. Addons with a checked checkbox and white text are enabled. Simply click the checkbox to enable any addon in the list.
We can also search, install and refresh. When searching the list of add-ons will update as we start to type. We will look at the installation of addons later.
For now, let’s zoom in on an addon in the list and see what information is available. Click on the little arrow to the left of any addons checkbox.
I will use the node wrangler addon as an example. Addons generally have the following information.
Most of these are self-explanatory and just basic information. For usage of the addon, I would say that the description can be a good read but the location is the most important information to get going with an addon.
The Internet property lists links to external webpages and if you have an addon that you installed yourself and was not built-in, there will be a “remove” button here to uninstall the addon. Checking to see if there is a «remove» button here will therefore also tell you if the addon was built-in or not.
Just another word on the location property. It is helpful, but it is not always accurate.
If you where to go to the node editor you would soon realize that “ctrl+space” is the shortcut for full screen on the window your mouse is hovering. But if we press “n” we will find a tab for node wrangler and there we will find out that the shortcut is changed to “shift+w”
This may be the case for quite a few addons at this time since this information has not been updated since the shortcut key changes for Blender 2.80. If you are using 2.79 or earlier, chances are that more of these shortcut keys are more accurate. Still, I always look at the location property after installing a new addon to easily find where it is located in the interface.
When an addon is enabled, there may appear even more settings and information depending on the addon. In the case of node wrangler, we get a handful of preferences and a hotkey list. Most addons though has no extra information here but for the more advanced ones, there may be anything from extra installation instructions to API key inputs to just a couple of shortcut key references. It all depends on the addon of course.
Blender addons installation
So, how do we install an addon in Blender? It can be easy to be tripped over by some small difference between how different addons are installed. Therefore, we will now continue by looking over the most common ways to install addons and some hiccups that you may encounter.
In a perfect world, after you have downloaded an addon, all you would have to do is:
For the most part, this is all that you need to do.
Common installation problems
The world is not always perfect though and addons don’t always install the way you would like. Almost all addon installation problems though are related to a misunderstanding between how the creator intended an addon to be installed and your idea or it. Here are some common problems.
These are the three key issues I come across when installing addons. None of them are related to blender itself but rather how the addon is packaged by the addon creator. I have had these issues with both paid and free blender addons. Let’s look at them in turn.
Troubleshooting Blender addons installation
Sometimes an addon is just thrown up on a web server with a link. In these cases when you press the link to download the addon, instead you see the addon code as a python file directly in the browser.
The solution to this is to go back one step to the download page and right-click the download link and select “save target as…” or similar depending on your browser. Then you will get to download the file instead. Then proceed with the “perfect world” example above.
Depending on what we find there are different solutions.
When an addon is supposed to install as it comes it sometimes comes packed one level too deep. This is sometimes a problem when downloading addons from GitHub. We will use it as an example.
You found the addon on GitHub and press “clone or download” and then “download zip”. The browser starts to download a file that looks like “-master.zip” In a lot of cases you will have to unpack this file and make a new zip of the folder inside before you try to install it or it won’t install properly.
The last case we will cover is when an addon is packed inside a package. That is some confusing terminology I know, but it is a quite good solution to distribute addons.
Sometimes when you download an addon you get a zip package, but instead of being intended to directly install, the zip package contains documentation, install instructions and other files along with the actual addon installation files.
It looks like you could install the addon directly, but in reality, the actual installation file is contained within this package that is making up the entire addon.
Those are some common pitfalls that I have experienced when installing addons in Blender. Usually, it is small differences that make you unable to install an addon. Knowing how the addon creator intended the install experience is essential to get an addon installed.
How to find addons for the correct Blender version?
These days with 2.80 just released there is a new problem with addons. Incompatibility. When installing an addon in 2.80 and it looks like it installs as it should but you get the message “upgrade to 2.8x required”. This means that the addon was made for Blender version 2.79 or earlier and will not work in 2.80.
A lot of addons have been reworked to work in Blender 2.80 and a google search might help you find a newer version of the addon you are trying to get to work.
For example, the popular textool addon is made for blender version 2.79, and at the time of this writing, there is no indication of a 2.80 version on their website.
However, viewing this thread on blenderartists.org there is another developer who has unofficially ported the addon that can be found on GitHub.
Even if the official channel for an addon does not have a 2.80 version ready you may be able to find an unofficial update.
If you are interested in porting addons to 2.80 here are some resources that might help.
With the simpler blender addons it is not as hard as it first may sound.
Where do addons go?
When an addon is installed it can be hard to know where it actually gets installed. On windows, there are generally two locations with a third sometimes existing. According to the manual, this last one is called “addons_contrib” in the application folder and it needs to be created manually. However, for me, this has been created automatically in some way. Either way, there are the locations on Windows that is used for addons in Blender.
If you end up having to troubleshoot an addon these are the places to look at to see if an addon is installed. For other platforms and more information on Blender’s paths you can take a look in the manual.
Now that you know how to install add-ons and what pitfalls there are to look for if an addon does not install correctly, we can continue to look at some of the most common and useful ones.
So these are the add-ons that I have found useful over the years of Blending. The list is 2.80 compatible. Some are built-in, some are free and others are paid addons.
30 Blender add-ons to start with
All add-ons below has a version compatible with 2.80 or later. Some may be in alpha or beta stage.
Modeling add-ons
BoolTool
How to get: Built-in
This add-on adds a few shortcuts to quickly create boolean operations. Select the boolean object and then shift select the base object. The operations are then done by holding ctrl and press one of the basic math operations on the Numpad. Most commonly used is probably “ctrl+num-” for a different operation.
F2 Addon
How to get: Built-in
The F2 addon is my absolute favorite add-on of all time. The only thing it does is that it adds some functionality to the F key that improves the modeling workflow. It adds a few functions to the «F» key. You can create a face from a selected corner vertex and fill faces way quicker than without this addon. Watch this short video on how it works. It works pretty much the same in 2.80 but it has some added settings for further customization.
Scatter Objects
How to get: Built-in
This addon makes it easy to scatter objects in an area based on a grease pencil stroke. Very handy when you want to add some debris or scatter some rocks around an area. Select the objects you want to scatter, then select a target object last. Hit F3 or space and search for «scatter». Start the operation and paint on the target object. Hit enter when done. Extra settings are available in the Active Tool tab in the properties panel.
Simple Lattice
How to get: Github add-on page (free version)
Just like bool tool enhances the boolean workflow, simple lattice improves the lattice workflow. The addon adds a menu entry in the object menu in object mode and in the mesh menu in edit mode. When selecting either of them a lattice will be created around the selection, adding a lattice modifier to the object.
It even works with Blenders new multi-edit support. It will add a lattice modifier to any object that is fully or partially selected and add a lattice modifier to that. Then it will also add a vertex group for the selected geometry in edit mode.
Three point arch
How to get: Github add-on page (Free version)
This addon adds a tool that makes you able to create quick arches. It is found in the N-panel in the 3D view under the create tab. Hold ctrl to snap to vertex then just click three times following the gizmos visuals.
MakePillow
How to get: Github page (Free version)
Search for «Make Pillow» in the F3/Spacebar menu and just click it. A pillow will be added with everything needed to simulate it and the simulation will even start, making a pillow within a second or so. From there you just have to adjust it to your needs.
MB-Lab
An addon that allows you to add a human character and adjust it with just a few clicks. It is really impressive. Perfect for anyone who does not work with characters from day to day but still occasionally needs one.
If nothing else it is a pretty fun addon to just play around with. Like so many other addons it is available through the «n-panel». It has its own tab named «MB-Lab».
Modeling cloth
How to get: Blendermarket (Free & paid version)
This addon aims to bring some of the functionality of Marvelous Designer to Blender. It is a stand-alone cloth system that is built on top of shape keys. The most noteworthy feature is probably that you can grab and move the cloth in real-time in the viewport.
modularTree
How to get: Github page (Free version)
ModularTree adds a new node editor to Blender specifically designed to create trees using nodes. It is a pretty cool implementation that, once you get going feels natural. You can add levels of branches and adjust a large set of parameters to get the tree you want. The biggest advantage I have found is that you can go back and adjust a tree at a later point if you want to change something. This has not been possible with other tree generating solutions.
The sapling tree addon that is the built-in free alternative to this only allows you to modify the tree right after its creation. As soon as another operation is carried out the settings for adjusting the tree is no longer available.
The Grove
How to get: The grove website (Paid version)
The go-to solution to generate realistic trees. It is a very intuitive add-on. As with most tree generating software and addons, there are a ton of settings. This one, however, takes a different approach and the settings are more natural. This is a «grow tree» addon rather than a «make tree» addon. It is a more organic process where settings are more related to what happened to your tree during its lifetime rather than fixed parameters.
Archipack
How to get: Free built-in with Blender, paid version on the archipack website (Free & paid version)
Archipack has a built-in version in Blender. There is also a paid version that comes with a lot more features that helps with making kitchens, terrain and a whole lot more. I would suggest starting with the built-in version and if you find it useful, have a look at their website for more features.
Shading & Texturing add-ons
Node wrangler add-on
How to get: Built-in
Another built-in addon that significantly speeds up work with shaders and nodes. You can quickly import entire materials with this addon or add multiple nodes with a shortcut. There is quite a large array with speedup tools within this add-on. Personally, I only use a handful. Those include «ctrl+shift+t» when having a principled shader selected or «ctrl+t» on a texture node. Also «ctrl+shift+click» on a node is helpful to get a preview of its output.
UV Mapping add-ons
UVPackmaster Pro 2
This add-on is an absolute must-have for anyone tired of manually packing UV maps. It is a well thought out add-on that quickly packs your UV Maps according to your needs. Since I have already written a full review, check that out for more info.
UV Squares
How to get: Github page (Free version)
A neat addon for hard-surface and archviz modeling. Makes it easy to create straight UVs. Select a UV island in the UV Editor, the click «alt+w» to straighten it. Simple.
Lighting add-ons
Pro Lighting Studio
How to get: Blendermarket (Paid version)
The number one lighting add-on in my opinion. Very quickly add a template light set up and work from there instead of creating all lights from scratch every time. This one is on the expensive end in add-on terms though. If you are working professionally with Blender though, I have not yet found an add-on that can be considered expensive.
Gaffer
Gaffer is a complement to Pro lighting studio. It works quite differently. It more organizes your light set up instead of coming with templates and gathers some neat functions like being able to turn off all lights except one or some tools to easily aim your lights. Works best with cycles, but some functions also work in Eevee.
Rendering add-ons
D-NOISE Denoiser
How to get: Github page (Free version)
This one requires an Nvidia graphics card. But if you got one this is probably the best denoiser available for Blender right now. Easy to use and gives a better result than the built-in denoiser for the most part. Denoisers are not that great for animation yet since they don’t take the previous or coming frames into account. This results in flickering.
In Blender version 2.81 there will be an implementation of Intels denoiser. If you get the latest daily build, it is already available as a node in the compositor.
Turnaround camera
How to get: Built-in
Very fast and simple camera set up for rendering showcase turnarounds. Settings are found in the «n-panel» under the «view» tab. After a camera is a set up you will have to go into the graph editor and change the interpolation of the camera animation to linear if you don’t want the camera to accelerate or slow down as it goes around.
Create IsoCam
Same as above but for iso cam instead of a turnaround. Just add this one and you can start creating your low poly square floating world kind of image. Add the iso cam through the «shft+a» add menu in object mode.
Eevee Presets
How to get: Github page (Free)
This addon adds a section to the render tab in the properties panel when using Eevee. It has a very simple interface where you can add, remove and load render setting presets. Saves a ton of time!
Render Burst
How to get: Github page (Free)
This addon enables us to render multiple camera angles at once one after the other. This is very useful when a project Is supposed to be rendered from multiple angles. The addon adds a small interface in the render tab, properties panel, where you can choose to render all cameras or only selected cameras.
Video Sequence editing add-ons
Power Sequencer
The one and only add-on for VSE in Blender, made by GDQuest. It adds a whole range of useful shortcuts and operators to Blenders VSE. It also has a few scripts that can’t be run from within Blender yet. This includes creating proxies and rendering with multiple cores. Check the add-on subfolder called scripts and these videos on how those functions work.
Baking add-ons
Bake Tools
I also wrote a review that you can find here: Blender add-on review: Baketools
A very nice tool to set up multiple render jobs with Blenders baking system. It takes a little while to understand the interface but if you are used to baking with Blenders default tools or with another package then you will most likely get up to speed quite quickly. Access it in the «n-panel» under the «BakeTool» tab. Not that cycles must be enabled for the tab to appear. Eevee does not have support for baking.
Principled baker
How to get: Github page (Free)
This add-on bakes the inputs of a principled shader to textures. Very handy when you have created your material and just want to convert it to a texture set.
Textools
How to get: Github (Free)
Both a utility baker and UV tools add-on in one. Personally, I mostly use it for baking capabilities. But it also features a very large collection of tools to work with UV Maps.
Asset add-ons
Simple asset manager
How to get: Gitlab page (Free)
Currently, Blender does not have its built-in asset manager. This add-on is probably the best solution to that right now. You will still likely have add-ons that implement their own kind of mini asset management system but for everything else. Start here.
Simple Renaming panel
This is another handy add-on to manage large chunks of objects. It is located in the «n-panel» under the «misc» tab. The interface gives you a serach and replace function to change the name of objects. You can also add prefix or sufix to a name.
Graswald
You can also check out my review here:
This is really an asset pack. Well known in the community. It is a large pack of grass and weed assets of very high quality. It comes with a well-thought-out add-on that lets you easily manage the grass particle systems.
Other add-ons
Screencast keys
How to get: Github page (Free)
When making videos explaining a workflow in Blender or similar this can be used so that the audience can see what keys are being pressed. Like so many other addons it is found in what I like to call the «n-panel».
Multi Exporter
This is another one of those time-saving add-ons. If you want to export to multiple formats at once, let’s say that you want to export a model for use in multiple applications, then this is another one of those timesavers. It puts all the export settings for the supported formats in one place and makes you able to export them all at once. It is located in the «ME» tab in the «n-panel». Sadly, it lacks support for some major file formats.
Final thoughts
There we have it. A smorgasbord of add-ons together with some basics of how to install, manage and troubleshoot for the most part. When you have reached this paragraph you should have a good understanding of how Blender addons work on a high-level overview.
Pullusb/How_to_install_Blender_addons
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
First, dear user, know that there can be two types of addon files
Single file addon:
Just a plain python file «the_addon_name.py«
The easy (user friendly) Way
Go to preferences, addons, click on «install. » to look for either the «.py» or the «.zip«.
Then just click on the enable checkbox.
If you dont want to bother more, this is the only method you need to know (except if the addon use modules, most of them don’t). So you can stop here. But! The rest will be usefull to manage your addon more efficiently and personally.
Once an addon is manually installed in sources folders. You’ll have to click on the refresh button to see it.
Let’s see where addons (and python modules) are stored and the differences of these locations.
There are 3 places :
Placed in installation folder.
Something like : C:\Program Files\Blender Foundation\Blender\2.80\scripts\addons\
«Release» addons (those who are built-in when you download blender) are stored inside the script folder of the blender datas.
These are local to this blender version only, you can put your downloaded addon here, but the next place is precisely designed for them.
note that the intermediate RC (release candidate) versions also come with a lot more of «contrib» addons for you to test. If integrated, these are stored inside «addons_contrib» just aside «addons» folder. The «contrib» are those who didn’t make it to the release for various reason but are usually solid and powerfull stuff.
Placed in user apps configs.
Somewhere like this:
on windows: C:/Users/username/AppData/Roaming/Blender Foundation/Blender/2.80/scripts/addons
on linux:
This is where your file actually goes when you use the automatic install!
Here is what happens when you click on install addon:
note : If you never installed addons from the «install» button the folder probably wont be there. You have to create «addons» (and eventually «modules») if there are not in ‘scripts’.
Bonus : For the same reason, that’s also where your preferences are stored, aside the «script» folder there is a «config» that contains userpref.blend, startup.blend, file-history, etc.
Placed in a folder of your choice (optional and not set by default).
This place is defined by you in the preferences and allow a third folder to be scanned for addons and modules.
You add the path in Preferences > File Paths > Scripts
As mentionned in the official doc, the folder that you target must have the same directory structure as the two other location.
In the directory that you point (you do not have to name it ‘scripts’) create a subfolder «addons» (and the folder «modules» if you need it)
This folder is interesting because you can even set the path to a local server for exemple. So all the computer on the same network can load the same addons and updating the file will update for all.
That’s it, now you know where the addons files are stored, you can manage them your own way. 👍
Final note : In the addon DevTools you have buttons to open these locations from blender in the text-editor toolbar.
How to add addons to blender
Аддоны Blender / Blender Add-ons. Введение
Аддоны это дополнительные программы, написанные сторонними разработчиками (а иногда и основыми), использующие внутренние API основной программы и расширяющие ее возможности.
Я не смогу без них работать в Blender?
Нет, сможете, но их использование обычно расширяет возможности и упрощает работу, автоматизирует рутинные операции.
Где найти addon-ы?
Как установить Addon?
Обычно автор прилагает к аддону инструкции, но вот что нужно делать, если их нет:
Как им управлять?
Как его удалить?
ВАЖНО: Аддоны имеют такую важную особенность, как совместимость с версиями Blender! Это касается сторонних аддонов, т.е. аддонов, которые не входят в «коробку» с программой. Если вы перейдёте по ссылке для скачивания соответствующего аддона, то обязательно ознакомьтесь с его описанием. Как правило, одним из первых пунктов будет указано, с какими версиями Blender совместим этот аддон. Аддон может работать с версиями, не указанными в описании, но гарантировать стабильность и правильность его функционирования никто не сможет. Использование несовместимых аддонов может повлечь за собой сбои в работе программы и потерю данных!
Список addon-ов по категориям.
В каждой категории сначала идут встроенные (не отмечены никак).
Потом бесплатные внешние: у них есть ссылка, а потом платные: у них тоже есть ссылка и они отмеченны символом $
Работа с нодами
Работа с HardSurface
Работа со Sculpt
Волосы и шерсть
Природные явления и живая природа
Ускорение работы и дополнительные инструменты
Работа с камерой
Работа с UV развёрткой
Для работы аддона требуется, чтобы в системе был установлен Adobe Substance 3D Painter.
Для работы аддона требуется, чтобы в системе был установлен Headus UVlayout.
Для работы аддона требуется, чтобы в системе были установлены Headus UVlayout и RizomUV.
Аддоны All in One (многофункциональные аддоны)
Addon TutorialВ¶
IntroductionВ¶
Intended AudienceВ¶
This tutorial is designed to help technical artists or developers learn to extend Blender. An understanding of the basics of Python is expected for those working through this tutorial.
PrerequisitesВ¶
Before going through the tutorial you should.
Suggested reading before starting this tutorial.
Documentation LinksВ¶
While going through the tutorial you may want to look into our reference documentation.
AddonsВ¶
What is an Addon?В¶
An addon is simply a Python module with some additional requirements so Blender can display it in a list with useful information.
To give an example, here is the simplest possible addon.
Notice this addon does not do anything related to Blender, (the bpy module is not imported for example).
This is a contrived example of an addon that serves to illustrate the point that the base requirements of an addon are simple.
So an addon is just a way to encapsulate a Python module in a way a user can easily utilize.
Running this script within the text editor won’t print anything, to see the output it must be installed through the user preferences. Messages will be printed when enabling and disabling.
Your First AddonВ¶
The simplest possible addon above was useful as an example but not much else. This next addon is simple but shows how to integrate a script into Blender using an Operator which is the typical way to define a tool accessed from menus, buttons and keyboard shortcuts.
For the first example we’ll make a script that simply moves all objects in a scene.
Write The ScriptВ¶
Add the following script to the text editor in Blender.
Click the Run Script button, all objects in the active scene are moved by 1.0 Blender unit. Next we’ll make this script into an addon.
Write the Addon (Simple)В¶
This addon takes the body of the script above, and adds them to an operator’s execute() function.
bl_info is split across multiple lines, this is just a style convention used to more easily add items.
To test the script you can copy and paste this into Blender text editor and run it, this will execute the script directly and call register immediately.
However running the script wont move any objects, for this you need to execute the newly registered operator.
The objects should move as before.
Install The AddonВ¶
Once you have your addon within in Blender’s text editor, you will want to be able to install it so it can be enabled in the user preferences to load on startup.
Even though the addon above is a test, lets go through the steps anyway so you know how to do it for later.
Once the file is on disk, you can install it as you would for an addon downloaded online.
Now the addon will be listed and you can enable it by pressing the check-box, if you want it to be enabled on restart, press Save as Default.
The destination of the addon depends on your Blender configuration. When installing an addon the source and destination path are printed in the console. You can also find addon path locations by running this in the Python console.
More is written on this topic here: Directory Layout
Your Second AddonВ¶
Write The ScriptВ¶
As before, first we will start with a script, develop it, then convert into an addon.
Now try copy this script into Blender and run it on the default cube. Make sure you click to move the 3D cursor before running as the duplicate will appear at the cursor’s location.
Next, we’re going to do this in a loop, to make an array of objects between the active object and the cursor.
Try run this script with with the active object and the cursor spaced apart to see the result.
With this script you’ll notice we’re doing some math with the object location and cursor, this works because both are 3D mathutils.Vector instances, a convenient class provided by the mathutils module and allows vectors to be multiplied by numbers and matrices.
For now we’ll focus on making this script an addon, but its good to know that this 3D math module is available and can help you with more advanced functionality later on.
Write the AddonВ¶
The first step is to convert the script as-is into an addon.
Everything here has been covered in the previous steps, you may want to try run the addon still and consider what could be done to make it more useful.
Both these additions are explained next, with the final script afterwards.
Operator PropertyВ¶
There are a variety of property types that are used for tool settings, common property types include: int, float, vector, color, boolean and string.
These properties are handled differently to typical Python class attributes because Blender needs to be display them in the interface, store their settings in key-maps and keep settings for re-use.
While this is handled in a fairly Pythonic way, be mindful that you are in fact defining tool settings that are loaded into Blender and accessed by other parts of Blender, outside of Python.
These properties from bpy.props are handled specially by Blender when the class is registered so they display as buttons in the user interface. There are many arguments you can pass to properties to set limits, change the default and display a tooltip.
This document doesn’t go into details about using other property types, however the link above includes examples of more advanced property usage.
Menu ItemВ¶
Addons can add to the user interface of existing panels, headers and menus defined in Python.
For this example we’ll add to an existing menu.
To find the identifier of a menu you can hover your mouse over the menu item and the identifier is displayed.
The method used for adding a menu item is to append a draw function into an existing class.
KeymapВ¶
In Blender addons have their own key-maps so as not to interfere with Blenders built in key-maps.
In the example below, a new object-mode bpy.types.KeyMap is added, then a bpy.types.KeyMapItem is added to the key-map which references our newly added operator, using Ctrl-Shift-Space as the key shortcut to activate it.
Notice how the key-map item can have a different total setting then the default set by the operator, this allows you to have multiple keys accessing the same operator with different settings.
While Ctrl-Shift-Space isn’t a default Blender key shortcut, its hard to make sure addons won’t overwrite each others keymaps, At least take care when assigning keys that they don’t conflict with important functionality within Blender.
Bringing it all togetherВ¶
Run the script (or save it and add it through the Preferences like before) and it will appear in the menu.
After selecting it from the menu, you can choose how many instance of the cube you want created.
Directly executing the script multiple times will add the menu each time too. While not useful behavior, theres nothing to worry about since addons won’t register them selves multiple times when enabled through the user preferences.
ConclusionsВ¶
Addons can encapsulate certain functionality neatly for writing tools to improve your work-flow or for writing utilities for others to use.
While there are limits to what Python can do within Blender, there is certainly a lot that can be achieved without having to dive into Blender’s C/C++ code.
The example given in the tutorial is limited, but shows the Blender API used for common tasks that you can expand on to write your own tools.
Further ReadingВ¶
Blender comes commented templates which are accessible from the text editor header, if you have specific areas you want to see example code for, this is a good place to start.
Here are some sites you might like to check on after completing this tutorial.