Python Reference Guide
 
Loading...
Searching...
No Matches
Tasks\StopDevice.py
1# Copyright 2009 Autodesk, Inc. All rights reserved.
2# Use of this software is subject to the terms of the Autodesk license agreement
3# provided at the time of installation or download, or which otherwise accompanies
4# this software in either electronic or hard copy form.
5#
6# Script description:
7# Find a Device (from its name) in the scene and stop it
8#
9# Topic: FBDevice, FBPlayerControl
10#
11
12from pyfbsdk import *
13
14#Change the name of the following constant to match your device name
15DeviceName = "My Device"
16
17def FindDevice( pName ):
18 lResult = None
19 lDeviceList = FBSystem().Scene.Devices
20
21 if lDeviceList:
22 #print "get camera device"
23 for lDevice in lDeviceList:
24 #print "Device Name = %s" % lDevice.Name
25 if lDevice.Name == pName:
26 lResult = lDevice
27 break
28 else:
29 print('No device found')
30
31 return lResult
32
33
34#Actual script
35lDevice = FindDevice( DeviceName )
36if lDevice:
37 lPlayer = FBPlayerControl()
38 lPlayer.Stop()
39
40 lDevice.RecordMode = False
41 lDevice.Live = False
42else:
43 print('No device found')
44
Player control.
Definition: pyfbsdk_generated.h:13745
Provides access to the underlying system, and the MotionBuilder scene.
Definition: pyfbsdk_generated.h:18771