Documentation

Support

Custom Scripts (beta)

Use Custom Scripts to add your own code and create custom pipelines.
Read time 2 minutesLast updated 2 days ago

You can provide code tailored to your needs. The following apps support Custom Scripts:
  • Linux Shell
  • Python
  • Blender
You can use Custom Scripts in two ways:
  • Enter custom code in the built-in editor, and execute it with command-line arguments (optional).
  • Fetch a script from a script library and execute it with command-line arguments (optional).

Prerequisites

You can access Custom Scripts when you create or edit a pipeline.

Enter custom script code

To enter your custom code:
  1. Sign in to your Unity Dashboard account.
  2. In the side navigation bar, select Pipeline Automation > Pipelines. You can create or edit a pipeline.
  3. In the pipeline builder, add a step. The Select an action from app dialog opens.
  4. Select the Python app.
  5. Select the Run Custom Script action.
  6. Select Add Action. In the Step Parameters tab, the Custom Scripts section appears in the Inputs section.
  7. Enter your code in the built-in editor or select Browse Files to upload a script file from your local drive. The script code from your file appears in the built-in editor.
  8. Enter Command Line Arguments to pass as pipeline inputs.
  9. Select Save.
Your custom script is now embedded in the pipeline. When you run the pipeline, it runs your script file and prompts for input if you enable Command Line Arguments.

Fetch and run a custom script

To run a script in this way, ensure the script exists in the job’s storage. First download it from a source such as Unity Asset Manager or Unity Version Control. The output of an action that downloads files includes parameters that locate the downloaded script path. You must provide this path to actions that run script files. To fetch and run a custom script file:
  1. Sign in to your Unity Dashboard account.
  2. In the side navigation bar, select Pipeline Automation > Pipelines. You can create or edit a pipeline.
  3. In the pipeline builder, add a step. The Select an action from app dialog opens.
  4. Select the Python app.
  5. Select the Run Custom Script File action.
  6. Select Add Action. In the Step Parameters tab, the Custom Scripts section appears in the Inputs section.
  7. In the Script Path field, select Download file – Download Directory and enter the script file name, for example,
    /scriptexample.py
    .
  8. Enter Command Line Arguments to allow the script to receive parameters generated by the pipeline.
  9. Select Save.
Your custom script is now embedded in the pipeline. When you run the pipeline, it runs your script file and prompts for input if you enable Command Line Arguments.