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 (it's free :)).
Component modifications contain sets of files for various CAD systems and other softwares. This add-on will work with data from the Blender set, without downloading documentation and data from other file sets.
Files loaded into file sets are versioned, allowing you to restore earlier versions, get the old state they were in before the changes, review the changes, and, for example, find out who last changed something and caused the problem.
To use this addon to update files already in the CADBase storage, Blake3 must be installed.
# Install on Unix/macOS
python3 -m pip install "blake3"
# Install on Windows
py -m pip install "blake3"
Please Note: The addon will work without this Blake3 library, the only difference is that the files in the CADBase storage (cloud) that have already been uploaded will not be replaced.
Once installed, the addon will be available in the 3D View > Sidebar menu.
Select the CADBase Library addon in the Import-Export category.
First you need to set the library location. CADBase cloud storage will be synchronized with this location. Also there will storage files with technical data for addon.
This location can be changed in the addon settings in the field Library path.
In the CADBase Library window, click the Authorization button.
When the CADBase Library Authorization 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.
Important Note: If the access token has expired, you need to repeat the steps above.
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.
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 changes
- 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 cloud storage is checked, if they are different, the files in cloud storage are updated. Blake3 library is used to calculate the hash, if it is unavailable, the hash is not checked and existing files in the cloud 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.
Add target components to bookmarks (favorites) on the CADBase site.
In Blender will only display components that the user has bookmarked on CADBase platform, as well as those that have been previously downloaded.
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 changes button to upload the local files for the set of component modification files to CADBase storage (cloud).
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 addon settings in Blender, such as the local library path, server address (API Point), and access token, will be saved in the cadbase_library.dat
file, which will be located at the bpy.utils.resource_path('USER')
path.
Please don't use cadbase_file_2018
and cadbase_file_2018.log
as file or folder names in the CADBase library 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, studying, or other purposes), you need to create a cadbase_file_2018.log file in the 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 the cloud), files already in local storage are skipped.
Before uploading files to CADBase storage (to the cloud), the addon checks for existing files in the cloud and excludes files from the upload list if their local and cloud hashes match. A hash is calculated using the Blake3 library.
This check is skipped and previously uploaded files (already in the cloud) are not updated unless the Blake3 library is installed.
This extension does not require special permissions.
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.
Sign in to comment.