This add-on allows the user to interact with CADBase (upload and download parts) via the Blender user interface.
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.
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
This add-on requires no additional steps and will work without additional libraries. But Blake3 can be used if it is already installed and is version-compatible with Blender 3D running.
Please Note: The add-on will work without external Python modules.
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.
The local library location is specified in the Library path section field. When the location is changed, the data from the previous location will not be moved (it can be moved manually).
In the Server URL section you can set URL/IP for communication with the platform.
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.
The Upload settings section allows you to set parameters to improve workbench operation in the absence of Blake3 and in case of necessity of forced updating of files on CADBase storage.
If you set Forcibly update files to True, the Skip calculate hash value will be ignored. The hash will not be calculated, as it is unnecessary.
The parameters affect only the uploading of data to the server. When downloading data, existing files will not be overwritten regardless of the settings.
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)
- the button opens the window for downloading files from the Blender folder (set of files for Blender) of the local library to the CADBase repository.
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.
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.
The Add component button is used to create a new component on the CADBase platform. Сlicking on the button opens a modal window in which ability create a new component (part, project, etc.) with a given name.
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.
Only files from Blender file set will be loaded to CADBase storage.
Click the Push (data) button to process data and display information about detected changes between local and remote storage. The local storage (library) is considered to be the reference storage.
The Commit message section can optionally contain a message that allows users to better understand what has changed in this update. The message will be associated with all files that were added or changed in this update and can be viewed on the platform's website.
Files affected by the update will be displayed in the table under the Commit message section. In addition to the file names, the type of changes is indicated:
new
- the file is not detected in the remote storage and will be uploaded as a new onemodified
- the file exists in remote storage and will be updated to the new revisiondeleted
- the file no longer exists locally and will be deleted from remote storage in this updateClick the Ok button for upload local files of select modification folder to CADBase storage (cloud).
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.
In general check is skipped and previously uploaded files (already in remote storage) are updated unless off force upload in settings.
As an option (Blake3 is needed), before uploading files to CADBase storage (remote storage) the add-on can check for existing files in the remote storage and excludes files from the upload list if their local and remote storage hashes match.
Skip calculate hash
means that there will be no comparison between files in local and remote storageForcibly update files
means that files should be uploaded to remote storage without further checksThis extension requests the following permissions:
Import/export library data from/to disk
Need to to sync library data with a remote server