This is an add-on for using components from CADBase in the Blender UI and synchronizing local library data with CADBase cloud storage.
CADBase is a platform for publishing and sharing information about 3D components (parts), drawings and manufacturers.
Important Note: To use the add-on, you must have an account on the CADBase Platform. You can also create an account via add-on, if the entered username is free, a new user will be created with the specified username and password.
The add-on is designed to use components from CADBase in the Blender interface.
Component modifications contain sets of files for various CAD systems. This add-on will work with data from the Blender set, without downloading documentation and data from other file sets.
Files uploaded to file sets are versioned, allowing you to restore earlier versions, get the old state they were in before the changes, review the changes, and find out who last changed something and caused the problem.
This add-on requires no additional steps and will work without additional libraries. But will attempt to perform automatic dependency installation when installing the add-on.
When installing the add-on, the Blake3 library will be extracted to the site-packages directory of the add-on itself.
Please Note: The add-on will work without this Blake3 library, the only difference is that the files in the CADBase remote storage that have already been uploaded will not be replaced.
First you need to set the library location. CADBase remote storage will be synchronized with this location. Also there will storage files with technical data for add-on.
This location can be changed in the add-on settings in the field Library path.
On the CADBase Library card in the Add-ons section of the Blender “Preferences...” there are username and password fields.
To obtain a token for an existing account or create a new account to access CADBase, you must provide a username and password. This data will be saved and available after restarting Blender.
After entering these data to receive the token and pressing the Login button. Please wait until you receive the token.
Important Note: If the access token has expired, you need to repeat the steps above.
The disadvantage (or advantage) of this option is that it only saves changes until Blender restarts. After a new startup, Blender restores the data if it is set in the Add-ons Manager.
In the CADBase Library window, click the Authorization button.
When the Authorization on CADBase platform window opens, you need to set a username and password in order to access CADBase.
After entering these data to receive the token and pressing the OK button. Please wait until you receive the token.
Once installed, the add-on will be available in the 3D View > Sidebar menu.
Select the CADBase Library add-on in the Import-Export category.
Open
- open the next level (deeper). If a component of a list of user's favorite components is selected, it will open the list of modifications for that component; if a modification of a component modifications list is selected, it will open a set of files for Blender.
Go back
- return to the previous level (higher). If a set of files is open, the button opens a list of modifications of a component; if a list of modifications of a component is open, the button opens a list of a user's favorite component.
Pull (data)
- retrieves data from the remote server and updates the local library view.
Add component
- the button opens a modal window in which ability create a new component (part, project, etc.) with a given name.
Link file
- link creates a reference to the data in the source file such that changes made there will be reflected in the referencing file the next time it is reloaded.
Push (data)
- button to upload files from Blender folder (set of files for Blender) of local library to CADBase storage. Before uploading, the hash of existing files in local and remote storage is checked, if they are different, the files in remote storage are updated. The Blake3 library is used to calculate the hash, if it is not available, the hash is not checked and existing files in the remote storage are not updated.
Settings
- this button opens a modal window where you can specify the path to the local library, where the files received from CADBase will be stored, and the address of CADBase server.
Authorization
- this button opens a modal window where you can specify login and password from CADBase profile to get a new authorization token. This action must be repeated if the access token is revoked or expired.
Changes made through Settings and Authorization will be reset when Blender restarts. For changes to be saved after restarting Blender, they must be made via Add-ons in Preferences...
Create new components with the add-on and add target components to bookmarks (favorites) on CADBase website.
In Blender will only display components that the user has bookmarked on CADBase platform, as well as those that have been previously downloaded.
Favorite components are displayed at root level. After selecting and opening a component, a list of its modifications is displayed this Component level. These levels correspond to the location of folders in the directory that is specified in the Library path
property.
When you open a modification (modification level), it actually displays files from the Blender file set that is in the Blender folder, not directly in the modification folder.
Files for Blender will be downloaded through this add-on, files from kits for other programs will not be downloaded.
The data display can be divided into three levels, the first one is the root level (rl), this level displays all components from the local library, the second one is the component level (cl), it displays the list of modifications of the open component, and the third level displays the data of a set of files (fl). The folder for Blender file set in local storage is created regardless of the presence of file set in the modification on CADBase platform, the file set will be created automatically when sending files.
-Library path # set in add-on (rl)
├── Vertical Pump (@lookme) # component folder (cl)
│ ├── N1 # modification folder
│ │ ├── Blender # Blender fileset (fl)
│ │ │ ├── modification # technical data file
│ │ │ ├── vertical Pump.blend # file of the Blender fileset
│ │ │ └── ... # files of the Blender fileset
│ │ ├── FreeCAD # example file set (fl)
│ │ └── ... # other filesets (fl)
│ ├── ... # other modifications
│ └── component # technical data file
├── ... # other components (rl)
├── cadbase_file_2018.log # stores logs and responses
└── cadbase_file_2018 # technical data file
To get the data, click on the Pull (data) button. Depending on the open position (directory), this will start the process of retrieving a list of the user's favorite components, a list of component modifications, or downloading files from the file set of the selected component modification for Blender.
Open the modification from which you want to upload the files.
Click the Push (data) button to upload the local files for the set of component modification files to CADBase storage (remote storage).
Information about the upload process will be displayed in the Blender report.
After uploading the files, a message will be displayed in the Blender report with information about the number of successfully uploaded files.
The add-on's settings, such as the local library path, server (API Point) address, and access token, are stored in the Blender user settings file (userpref.blend
), which is located at the path bpy.utils.resource_path('USER')/config
.
Please don't use cadbase_file_2018
and cadbase_file_2018.log
as file or folder names in the library path folder. These files store server responses and logs, if you use these filenames for your data, you may lose them.
If you need to save logs to a file (for example, for debugging, study, or other purposes), you need to create a cadbase_file_2018.log file in your local library folder.
In component folders, a component
file is created with the technical data about the component.
In fileset folders, a modification
file is created with the technical data about the component modification and fileset.
To avoid losing local data when downloading from CADBase storage (from remote storage), files already in local storage are skipped.
Before uploading files to CADBase storage (remote storage), the add-on checks for existing files in the remote storage and excludes files from the upload list if their local and remote storage hashes match. A hash is calculated using the Blake3 library.
This check is skipped and previously uploaded files (already in remote storage) are not updated unless the Blake3 library is installed.
Several fixes:
This extension requests the following permissions:
Import/export library data from/to disk
Need to to sync library data with a remote server
Thanks for your submission. Even though the service this extension depends on is free, it still goes against this platform guidelines:
Extensions should not require any external functional components (other than Blender itself) that need to be downloaded from elsewhere. See the Extensions terms of service.
If you can't (or don't want) to change your extension to adapt to it, you can self-host it without this restriction.
Thanks for the review and the comment. Can you please tell me if I understand you correctly, we are talking about Blake3? It is optional, it just extends the functionality, but in general will work without it (just without versioning). Do I need to remove the attempt to use this library from the add-on code, or maybe I should further to describe that this is optional?
We've added new mandatory fields: Featured Image and Icon. Featured Image is shown at the home page instead of the first preview image, and icon is shown in the extension's title (and later will be shown in Blender as well).
Could you please update your extension with an icon and a featured image?
Apologies for the late heads up.
Anna, thank you for that news! Of course. I'll try to fix all the mistakes in the near update. Also I hope get to hear back from Dalai to choose how to decide the issue with using the illegal dependence. Because I hopefully, the option with a more detailed description of the Blake3 dependency will comply with the rules and not require code removal. Which might be helpful for those who already have the dependency.
Hi, we recently changed the site guidelines to allow add-ons to connect to free services (proven that the service is not a demo nor has a commercial offering). So in that sense your add-on will be more than welcome here :)
As for blake Blender now supports wheels. See the documentation.
And sorry for not getting back earlier, but I had to focus on finishing up the platform and left the approval queue on hold.
Thank you for your reply! I'm very happy that this add-on is welcome here.
Please help me to do this correctly. In my case, is it enough just to add these lines to the manifest? (should be version 3.11?)
wheels = [
"./wheels/blake3-0.4.1-cp311-cp311-macosx_10_12_x86_64.whl",
"./wheels/blake3-0.4.1-cp311-cp311-macosx_11_0_arm64.whl",
"./wheels/blake3-0.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"./wheels/blake3-0.4.1-cp311-none-win32.whl",
"./wheels/blake3-0.4.1-cp311-none-win_amd64.whl",
]
Hello!
In 4.2 new "Online Access" property was added in preferences. It's a read-only property that Blender and add-ons should refer to. Add-ons that access the internet are now expected to check for bpy.app.online_access
and not connect if user turns it off.
Could you please update your add-on to adapt to that requirement? You can read more here https://developer.blender.org/docs/release_notes/4.2/python_api/#additions
I'm not able to install the addon from disk:
UnboundLocalError: cannot access local variable 'item_key' where it is not associated with a value
Also, can you update your manifest to use the new version? (The permissions section has changed recently) Blender Extensions Schema 1.0.0
I re-tested on another computer and a later Blender 4.2 version, and I still have the issue on my side (fresh Blender preferences also).
Here is the full trackball:
`Python: Traceback (most recent call last):
File "C:\Users\vchedeville\Documents\Blender Version\daily\blender-4.2.0-beta+daily.b73b66330905\4.2\scripts\addons_core\bl_pkg\cli\blender_ext.py", line 665, in pkg_manifest_from_archive_and_validate
return pkg_manifest_from_zipfile_and_validate(zip_fh, archive_subdir, strict=strict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\vchedeville\Documents\Blender Version\daily\blender-4.2.0-beta+daily.b73b66330905\4.2\scripts\addons_core\bl_pkg\cli\blender_ext.py", line 629, in pkg_manifest_from_zipfile_and_validate
manifest = pkg_manifest_from_zipfile_and_validate_impl(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\vchedeville\Documents\Blender Version\daily\blender-4.2.0-beta+daily.b73b66330905\4.2\scripts\addons_core\bl_pkg\cli\blender_ext.py", line 616, in pkg_manifest_from_zipfile_and_validate_impl
return pkg_manifest_from_dict_and_validate_impl(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\vchedeville\Documents\Blender Version\daily\blender-4.2.0-beta+daily.b73b66330905\4.2\scripts\addons_core\bl_pkg\cli\blender_ext.py", line 472, in pkg_manifest_from_dict_and_validate_impl
if (error_msg := pkg_manifest_is_valid_or_error(data, from_repo=from_repo, strict=strict)) is not None:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\vchedeville\Documents\Blender Version\daily\blender-4.2.0-beta+daily.b73b66330905\4.2\scripts\addons_core\bl_pkg\cli\blender_ext.py", line 1586, in pkg_manifest_is_valid_or_error
error_list = pkg_manifest_is_valid_or_error_impl(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\vchedeville\Documents\Blender Version\daily\blender-4.2.0-beta+daily.b73b66330905\4.2\scripts\addons_core\bl_pkg\cli\blender_ext.py", line 1565, in pkg_manifest_is_valid_or_error_impl
if (error_msg := x_check_fn(x_val, strict)) is not None:
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\vchedeville\Documents\Blender Version\daily\blender-4.2.0-beta+daily.b73b66330905\4.2\scripts\addons_core\bl_pkg\cli\blender_ext.py", line 1364, in pkg_manifest_validate_field_permissions
if not isinstance(item_key, str):
^^^^^^^^
UnboundLocalError: cannot access local variable 'item_key' where it is not associated with a value
Hey everyone,
Just a heads-up about a recent change regarding the licensing of add-ons on the Blender extension platform. Moving forward, all add-ons will need to be released under the GNU/GPL 3.0 license (SPDX:GPL-3.0-or-later). This is mainly to keep things simple and consistent across the board.
Previously, we accepted various licenses as long as they were compatible with Blender’s distribution. However, to avoid any confusion and streamline the process, all add-ons using the bpy API should now be presented as GPL 3 (the same license the Blender bundle is distributed). Regardless of whether the original code was under GPL 2, or something else like MIT or ZLIB.
Existing add-ons versions won't be affected. However, new updates will need to comply to the revised requirements.
Thanks for understanding, and feel free to reach out if you have any questions.
Sign in to comment.
Extension is ready for initial review