Python Reference Guide
 
Loading...
Searching...
No Matches
Tasks\GoToNextTake.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# Topic: FBTake, FBSystem.CurrentTake,
7#
8
9from pyfbsdk import FBSystem
10
11# Get the name of the current take, to look it up in the list
12# of system takes. Names are unique.
13lSystem = FBSystem()
14lCurrentTakeName = lSystem.CurrentTake.Name
15
16# Look in the list until we find the index of the current take.
17for lTakeIdx in range( len( lSystem.Scene.Takes )):
18 if lSystem.Scene.Takes[lTakeIdx].Name == lCurrentTakeName:
19 break;
20
21# Increment the index to point to the next take.
22lTakeIdx = lTakeIdx + 1
23
24# Wrap around the end if the current take is the last.
25if lTakeIdx == len( lSystem.Scene.Takes ): lTakeIdx = 0
26
27# Set the current take using our new index.
28lSystem.CurrentTake = lSystem.Scene.Takes[lTakeIdx]
29
30# Cleanup of local variables.
31del( lSystem, lCurrentTakeName, lTakeIdx )
32
33# Cleanup of imported modules.
34del( FBSystem )
35
Provides access to the underlying system, and the MotionBuilder scene.
Definition: pyfbsdk_generated.h:18771