Manage transformations

Read time 3 minutes
Last updated 9 months ago

Before you start

To access and create transformations, make sure the app has the right accesses. Read more about managing Identity.

How do I...?

Start a transformation

To start a transformation on a given dataset, follow these steps:

  1. Pass all the information to identify the dataset.
  2. Pass the WorkflowType you would like to start.

The possible values for WorkflowType are:

  • THUMBNAIL_GENERATION
  • GLB_PREVIEW
  • DATA_STREAMING
  • TRANSCODE_VIDEO

The returned object is the created transformation. Make sure to retrieve the id contained in the return object to later refresh and track the progress of the transformation.

    transformation = unity_cloud.assets.start_transformation(
        org_id = "012345678912",
        project_id = "1234abcd-ab12-cd34-ef56-123456abcdef",
        asset_id = "0123456789abcdefghijklmn",
        asset_version = "1234abcd-ab12-cd34-ef56-123456abcdef",
        dataset_id = "1234abcd-12ab-34cd-56ef-123456abcdef",
        workflow_type = unity_cloud.WorkflowType.THUMBNAIL_GENERATION
    )

Get a transformation

To get a previously started transformation on a dataset whether already completed or not, pass the information of the dataset and the id of the transformation.

    transformation = unity_cloud.assets.get_transformation(
        org_id = "012345678912",
        project_id = "1234abcd-ab12-cd34-ef56-123456abcdef",
        asset_id = "0123456789abcdefghijklmn",
        asset_version = "1234abcd-ab12-cd34-ef56-123456abcdef",
        dataset_id = "1234abcd-12ab-34cd-56ef-123456abcdef",
        workflow_id = "012345678912"
    )

List transformations

You can list transformations from an organization and project by using one or many of those optional arguments:

  • asset_id : The asset affected by the transformation. Leave empty to search all assets.
  • asset_version : The version of the asset. Leave empty to search all asset versions.
  • dataset_id: The dataset ID. Leave empty to search through all possible datasets.
  • transformation_status. The transformation status. Leave empty to search all transformation statuses.
  • user_id: The user that started the transformation. Leave empty to search all users.
  • limit_to: The maximum of amount of results that should be returned. Leave empty to return everything.
  • skip: Use in combination of limit_to to page through results.
transformations = unity_cloud.assets.list_transformations(
        org_id = "012345678912",
        project_id = "1234abcd-ab12-cd34-ef56-123456abcdef",
        <optional arguments>)