Screening Room API (for RV)

last updated 13-Aug-2013

 

If you don't have the Screening Room API installed, you can download it here: Screening Room API (right click and choose "Save Link As...")

Note for Developers:  If you wish to use the Screening Room API to launch the Screening Room for RV Timeline or Submit Tool from your own applications, it needs to be installed somewhere on the PYTHONPATH.

 

Screening Room has a small API to launch the Timeline or Submit Tool with a desired context in Screening Room for RV. For example, to launch the timeline to the Version with id 900:

>>> import screeningroom
>>> screeningroom.launch_timeline('https://mysg.shotgunstudio.com', {'type': 'Version', 'id': 900})

 

You can also launch the timeline to an Asset, Sequence, Shot, Playlist or Version Page:

>>> screeningroom.launch_timeline('https://mysg.shotgunstudio.com', {'type': 'Playlist', 'id': 4})

 

They’re not entities in Shotgun, but you can open Screening Room to an asset type by supplying the asset type’s code and a project id in the context dictionary:

>>> screeningroom.launch_timeline('https://mysg.shotgunstudio.com', {'asset_type': 'Character', 'project_id': 58})

 

To submit an image or image sequence using the submit tool, you only need to supply the server and source image. You can optionally specify the path where the QuickTime file should be generated. If the path is omitted, the QuickTime will be written to the same directory as the source images. Providing a context will partially populate the submission form and link the newly created Version to the given Task or entity:

>>> screeningroom.launch_submit_tool('https://mysg.shotgunstudio.com', {'type': 'Task', 'id': 398},  '/Users/Downloads/poster_bunny_small.jpg')

 

Both functions take an optional path_to_rv. If omitted, the Screening Room API will use the rvlink protocol to launch RV via a web browser. If provided, RV will be launched directly in a subprocess, bypassing the browser. On a Mac, the path to RV should be the path to the RV executable inside the RV.app bundle.

 

 

screeningroom.launch_timeline(base_url, context, path_to_rv=None)
Launch the Screening Room timeline to the given context, on the given base_url.

Parameters:


  • base_url (str) – The base url for Shotgun, i.e. https://mysg.shotgunstudio.com

  • context (dict) – Optional. A dictionary containing one of the following sets of key-value configurations:

    • A Shotgun entity

      • type: Must be one of the following entity types: ‘Version’, ‘Asset’,

      • ‘Sequence’, ‘Shot’, ‘Playlist’ or ‘Page’. If using ‘Page’ the page type must be a Version page.

      • id: The corresponding id for the entity

    • An asset type in a project

      • asset_type: The code for an asset type in Shotgun, e.g. ‘Character’,

      • ‘Environment’, ‘Prop’, etc.

      • project_id: A Shotgun project id.

  • path_to_rv (str) – Optional. Path to the RV executable. If omitted, RV will be started via a web browser using the rvlink protocol

 

screeningroom.launch_submit_tool(base_url, context, source_image_seq, qt_output_path=None, path_to_rv=None)
Launch the Screening Room Submit Tool on the given base_url, using the given context to determine the task and entity link for the created Version, if possible. If the context is not a Task, then an entity and pipeline step id must be provided and a best guess will be made based on this information to determine the Task. An optional QuickTime output path can be provided. If not provided, the QuickTime will be generated to the same path as the source images.

Parameters:


  • base_url (str) – The base url for Shotgun, i.e. https://mysg.shotgunstudio.com

  • context (dict) – Optional. A dictionary containing one of the following sets of key-value configurations:

    • A Shotgun task. If provided, no other context information is necessary:

      • type: Should be “Task”

      • id: The task id.

    • A Shotgun entity and pipeline step id. From this, Screening Room will make a best guess as to the task that should be associated with the Version:

      • type: An entity type, e.g. “Shot”, “Asset”

      • id: The associated id of the entity

      • step_id: The id of the pipeline step associated with this submission.

  • source_image_seq (str) – The image sequence to be submitted

  • qt_output_path (str) – The path to which the quicktime for this submission should be generated.

  • path_to_rv (str) – Optional. Path to the RV executable. If omitted, RV will be started via a web browser using the rvlink protocol




The screeningroom.py module can also be run from the command line to open the Screening Room Timeline or Submit Tool with a specified context. The help text, which you can view by running python screeningroom.py -h in the directory containing the screeningroom.py module, is listed below:

$ python screeningroom.py -h
Usage: screeningroom.py [options]
Options:
 -h, --help            show this help message and exit
 -u BASE_URL, --base-url=BASE_URL
                       Required. The Shotgun base url to be used. Of the
                       form: https://mysg.shotgunstudio.com
 -m MODE, --mode=MODE  Optional. The mode in which to launch the Screening Room App.
                       One of: "timeline", or "submit". Defaults to
                       "timeline".
 -v VERSION_ID, --version-id=VERSION_ID
                       Optional. A version id, in "timeline" mode.
 -y ENTITY_TYPE, --entity-type=ENTITY_TYPE
                       Optional. An entity type, in "submit" mode if no Task
                       id is provided, or in "timeline" mode if no Version id
                       has been provided
 -e ENTITY_ID, --entity-id=ENTITY_ID
                       Optional. An entity id, in "submit" mode if no Task id
                       is provided, or in "timeline" mode if no Version id
                       has been provided.
 -a ASSET_TYPE, --asset-type=ASSET_TYPE
                       Optional. The code for an asset type to show in
                       "timeline" mode. Also requires that --project-id be
                       specified
 -p PROJECT_ID, --project-id=PROJECT_ID
                       Optional. Required if using --asset-type.
 -t TASK_ID, --task-id=TASK_ID
                       Optional. A task id, in "submit" mode.
 -s STEP_ID, --step-id=STEP_ID
                       Optional. The id of a pipeline step, in "submit" mode
                       if no Task id is provided.
 -i SOURCE_IMAGE_SEQUENCE, --source-image-sequence=SOURCE_IMAGE_SEQUENCE
                       Required in "submit" mode. The source image sequence
                       path.
 -o QUICKTIME_OUTPUT_PATH, --quicktime-output-path=QUICKTIME_OUTPUT_PATH
                       Optional. An output path for the generated QuickTime
                       in "submit" mode. If omitted, the QuickTime will be
                       generated in the same directory as the source image
                       sequence
 -r PATH_TO_RV, --path-to-rv=PATH_TO_RV
                   Optional. The path to the RV executable. If omitted,
                   RV will be started via a web browser using the rvlink
                   protocol.

 

 User Guide: Review & Approval >>

Follow

0 Comments

Article is closed for comments.