|
1 | 1 | """This is the main module of the "AssetFetch For Blender" addon. |
2 | 2 | It houses the main register() and unregister() functions for the addon along with required metadata. |
3 | | -See also: https://docs.blender.org/manual/en/latest/advanced/scripting/addon_tutorial.html#bringing-it-all-together |
4 | 3 | """ |
5 | 4 |
|
6 | 5 | import os, sys |
7 | 6 | import bpy |
8 | 7 |
|
9 | | -print("Loading AssetFetch for Blender v0.2.0") |
| 8 | +print("Loading AssetFetch for Blender v0.3.0") |
10 | 9 |
|
11 | 10 | # Add the lib/ directory to sys.path to make it all the bundled libraries importable. |
12 | 11 | # The addon is distributed with all its required python libraries in the /lib subdirectory. |
13 | 12 | # This has turned out to be the most reliable since the final python environment of the user (inside Blender) does not need to have pip. |
14 | 13 | # Check the readme.md for instructions on how to download the dependencies using pip. |
| 14 | + |
| 15 | +# TODO: With the introduction of Blender 4.2 this generates a small warning message, therefore it will likely need to be changed in the future. |
15 | 16 | LIB_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "lib") |
16 | 17 | if LIB_PATH not in sys.path: |
17 | 18 | sys.path.insert(0, LIB_PATH) |
|
20 | 21 | # Like with the libraries, instructions for filling the json-schema directory for development can be found in readme.md |
21 | 22 | SCHEMA_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "json-schema") |
22 | 23 |
|
23 | | -# This variable is used for the "Preferences" (bookmarks/settings) definition. |
24 | | -# Normally, it is common practice to use __name__ in the preferences class to tell Blender under which name the preferences should be stored. |
25 | | -# But because we don't define the preferences here in this init file we instead pipe the name over to properties/preferences.py using this variable. |
26 | | -# During development the name may therefore simply be "src" but in a proper installation it will be the name of the subdirectory in the Blender addons directory. |
27 | | -ADDON_NAME = __name__ |
28 | | - |
29 | | -# Standard variable with metadata required for all Blender addons. |
30 | | -bl_info = { |
31 | | - "name": "assetfetch-blender", |
32 | | - "description": "AssetFetch for Blender", |
33 | | - "author": "ambientCG / Lennart Demes", |
34 | | - "version": (0, 2), |
35 | | - "blender": (4, 0, 0), |
36 | | - "location": "View3D", |
37 | | - "category": "3D View" |
38 | | -} |
| 24 | +ADDON_NAME = __package__ |
| 25 | + |
39 | 26 |
|
40 | 27 | def register(): |
41 | 28 | """The main registration function for the entire addon. |
|
0 commit comments