This addon is a client for the AssetFetch protocol, an open system for 3D asset discovery and automated imports.
- Visit the Releases page
- Choose the latest version and click on "Assets" below the informative text
- Download the
.zip
archive for the addon (not "Source code") - Go into Blender and select Edit -> Preferences -> Get Extensions.
- Open the small drop-down menu in the top-right corner and click on Install from disk... and navigate to the ZIP file (no need to unpack it).
- The AssetFetch panel will be added in the right-side menu in the 3D-window.
This is the setup for developing the addon.
- Create a symlink in your filesystem that connects the
/src
folder in this repository with blender's addon directory, for example on Windows this would beC:\Users\<User>\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\src
. - Download the required python-dependencies:
# Make sure that you are in the root of this repository (same directory as this readme file)
# Download the required packages into the src/lib directory
pip install --target ./src/lib/ -r ./requirements.txt
- Download the JSON-Schema for AssetFetch
# Download the latest json schema version for AssetFetch
# Change the -b parameter to use a different branch/tag
mkdir ./tmp
git -C ./tmp/ clone -b '0.4' --single-branch https://github.com/AssetFetch/spec.git
cp -r ./tmp/spec/json-schema/ ./src/
rm -rf ./tmp
- I recommend developing in VS Code with the Blender Development Extension by Jacques Lucke
The addon is split into multiple modules:
operator
contains all the bpy operators, meaning all the distinct actions this addon can perform.property
contains all the bpy properties that are used to store and handle the incoming data from the provider. AF stores all its data inbpy.context.window_manager.af
.ui
contains the code for the individual panels, all of which are in theVIEW_3D
section (meaning the window that you get by opening the right-side panel in the 3D view).util
is for miscellaneous functionality.
Every module's __init__.py
imports all relevant classes and stores them in a registration_targets
array from where the register()
and unregister()
functions read them when the addon is (un)loaded inside Blender.
The global __init__.py
for the entire addon does the same pattern again by loading the registration functions from all the other modules.
Required dependencies are loaded from the /src/lib
directory.
The following YAPF style configuration is recommended:
{based_on_style: pep8, indent_width:4, continuation_indent_width:4, continuation_align_style = fixed, column_limit: 180, use_tabs: true}
When using VSCode you can install the YAPF extension (eeyore.yapf
) and add the following to your settings.json:
"yapf.args": ["--style", "{based_on_style: pep8, indent_width:4, continuation_indent_width:4, continuation_align_style = fixed, column_limit: 180, use_tabs: true}"]