This sample script demonstrates how you can use Python SDK to download assets from Unity Cloud Asset Manager.
Find and connect support services on the Help & Support page.
Note: To download assets from Asset Manager, you need the
Asset Manager Admin
role at the organization level or theAsset Manager Contributor
add-on role at the project level. Asset Manager Contributors can update assets only for the specific projects to which they have access.
Before you download assets from Unity Cloud Asset Manager, make sure you have the following:
-
Python installed on your machine.
-
An up-to-date Python SDK wheel installed ( > 0.5.0).
-
The required permissions. Read more about verifying permissions.
Note: Asset Manager roles define the permissions that you have for a single Asset Manager project. Depending on your work, permissions may vary across projects.
-
A Unity Cloud source project with the Asset Manager service enabled to download assets. Read more about creating a project in Unity Cloud page.
-
A Unity Cloud source project with asset manager service enabled to download assets and assets already uploaded in it. For more information on how to create a new project on Unity Cloud, see the Create a new project page.
The bulk download sample script is provided under the Unity ToS license.
To run the sample, follow these steps:
-
Link the sample to your project by editing the following information in the
main
conditional section of thebulk_download.py
script.- org_id: Enter your organization ID.
- project_id: Enter your project ID.
- download_directory: Enter the path to the directory where you download the assets.
- overwrite: Set to
True
to overwrite already existing files in the download directory. If you set it toFalse
, the script skips the download process for existing files. - include_filter, exclude_filter, or any_filter: If you want to add include, exclude, or any filters to your request, build them as described in the Unity Cloud Python SDK documentation.
Note: The script contains commented code that shows an example of filter usage to help you with the integration of custom filters. However, these comments do not cover the entire filter creation process. For comprehensive details, see the Unity Cloud Python SDK documentation.
- collections: Fill the
collections
list with the names of those collections from which you want to fetch your assets. Leave thecollections
list empty if you want to search through the whole project.
-
Run the script:
- Go to the current folder with a command line tool.
- Run the following command:
python bulk_download.py
.
For more information, see the Unity Cloud Python SDK documentation.
Thank you for exploring our project! Please help us improve and deliver greater value by providing your feedback in our Help & Support page. We appreciate your input!