Commands
VuppetMaster
All the following commands are functions of the api object from new Vuppetmaster.
constructor
Example:
start
Parameter: options object
The command start(options) loads the project and starts the render and animation engine.
Options object:
ignore_aspect_ratio: Normally the aspect ratio defined in STorybuilder will be used. With the parameter you can ignore the valuse [default: false]language: set lanuage ('en','de',...)hideModelsAfterLoading: [default: false]target: div name to render
The command start should be started only once per session. It is also important, that the size of the DIV target has allway a size greater then 0.
Example:
destroy
Stops rendering.
on
Parameter: event string
| Event | Description | Parameter |
|---|---|---|
| project.loaded | The project is loaded | |
| model.progress | Called while loading the model | value of the loading progress |
With the event model.progress you can handle an own loading progress bar. In this case, the internal orange progress bar will be not rendered.
Example:
playAnimationByName()
Parameter: name string
With playAnimationByName an animation created in Stroybuilder can be started.
Example:
setSceneByName()
Parameter: name string
setSceneByName set the current scene.
Example:
setCameraByName
Parameter: name : [string] name of the camera
setCameraByName moves the camera to in the project definded camera.
Parameter:
name: Name of the cameraoptions: Options
speak
Sends a text sequence, which will be spoken by the avatar using a server sided TTS.
Parameter:
jsonobject: A json object{ voice:'voicename', text:'text2speak' }endCB: Function callback when the tts output has ended.
The voice key defines the voice name of the Amazon Polly TTS. See list in http://docs.aws.amazon.com/polly/latest/dg/voicelist.html
The text key can be a normal string like:
or a SSML text like:
See http://docs.aws.amazon.com/polly/latest/dg/supported-ssml.html for more information about SSML.
For compatibility reasons, it is also possible to call speak with a normal string: speak('Hello');
And for compatibility reasons, the command { tts:{ voice:'Marlene':text:'' }} is also valid.
speakStop
Stops the current running speak sound.