This page contains information related to connecting a Python client to Live
|
To connect a Python client to Shogun Live:
Start Python and begin by importing the Vicon Core API:
from vicon_core_api import *
Create a client. In this example, the object is named shogun_client
:
shogun_client = Client('localhost')
Where:
shogun_client
: is the name of the object, which can be any name you wantlocalhost
: can be replaced with an IP address or hostname running Shogun Live.Check that the client is connected: shogun_client.connected
This returns True if connected, and False if not.
In Shogun Live, towards the top of the Capture panel, the default capture name is Take.
This example shows how you can change the capture name using the Python API.
Import the relevant class for interacting with capture:
from shogun_live_api import CaptureServices
Create an object for the capture services. In this example, the object is named capture
, but you can name it as required.
It references the object name used for the shogun client that was created:
capture = CaptureServices(shogun_client)
Use the set_capture_name
method to set the capture name to 'MyTake001'
:
result = capture.set_capture_name('MyTake001')
Check the return value to make sure that this succeeded:
In Shogun Live the capture name has changed:
For further information, see:
Run the Python dir()
command on objects created, to show the methods that can be called:
For example, dir(shogun_client)
or dir(capture)
Run help()
on specific methods or classes.
For example, help(capture.set_capture_name)