Skip to content

Export Animation Commands

Expert Topic for experienced builders.

Animation Indexes/names are optional parameters, that set which animations to include in the export. If unset, the response will include all animations. If both are received, indexes will be used.

Starting animation name/index is optional and used to determine which animation is used for the starting motor positions in the register commands of the exported commands. If both are received, index will be used. If unset, the response will use animation index 0.

Effector identifiers is an optional array of objects to include only certain drivers and/or effectors in the response. If left unset, all drivers and effectors will be included. The format of the request array of objects should look like this:

Request Effector Object Shape
[
{"Name" : "Default Driver", "Identifiers" : ["3", "5", "6"]},
{"Name" : "My Other Driver", "Identifiers" : ["3", "5", "6"]},
]

Each object should have a ‘Name’ field, with the name of the driver as a string and an ‘Identifiers’ field which is an array of strings, each string the identifier of a desired effector to include.

URI (GET)
/AnimationCommands/
Request Parameters
int[] animationIdexes
string[] animationNames
int startingAnimationIndex
String startingAnimationName
object[] effectorIdentifiers
Response Parameters
JSON formatted animation commands
Example_ExportAnimationCommands.py
import requests
import json
port = 59224
baseUrl = 'http://localhost:{}/'.format(port)
requestUrl = baseUrl + 'AnimationCommands/'
try:
requestParams = {}
# desired animations
# requestParams['animationIdexes'] = [0, 1] # optional array of ints, if you want to only include the given animations by index in the exported code
# requestParams['animationNames'] = ['myAnim', 'myOtherAnim'] # optional array of strings, if you want to only include the given animations by name in the exported code
# names will be ignored if indexes are also sent.
# returns an error if you try and select invalid animations
# All animations will be included if not sent
# starting animation for setup strings
# requestParams['startingAnimationIndex'] = 0 # optional, if you want to set which animation is used for the starting position of motors in the setup commands.
# requestParams['startingAnimationName'] = 'myAnim' # optional string based, same as index, you can use either. Only index will be used if both are present.
# returns an error if you try and select invalid animation
# Index 0 animation will be used if not sent
# desired effectors
# requestParams['effectorIdentifiers'] = [{"Name" : "Default Driver", "Identifiers" : ["3", "5", "6"]}]
# optional, if you want to only include certain drivers or effectors.
# should be formatted as an array of objects.
# Each object should have a 'Name' field, with the name of the driver as a string and
# an 'Identifiers' field which is an array of strings, each string the identifier of a desired effector to include
# defaults to all drivers and effectors if not sent.
response = requests.get(requestUrl, json=requestParams)
response.raise_for_status()
responseData = response.json()
print(responseData)
except requests.exceptions.RequestException as e:
raise SystemExit(e)