Python Reference Guide
 
Loading...
Searching...
No Matches
Tasks\TimeCodeKeying.py
1# Copyright 2011 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# Create multiple FBTimeCode keys on a custom property on a cube.
8#
9# Topic: FBTimeCode, FBTake, FBPlayerControl
10#
11from pyfbsdk import *
12
13#Init
14Player = FBPlayerControl()
15Scene = FBSystem().Scene
16System = FBSystem()
17
18
19cube = FBModelCube("Cube")
20TCProp = cube.PropertyCreate( 'TimeCode_2997_Drop', FBPropertyType.kFBPT_TimeCode, 'TimeCode', True, True, None )
21TCProp.SetAnimated(True)
22
23
24cube.Show = True
25cube.Visibility = True
26cube.Selected = True
27tc = FBTimeCode(FBTimeCode.NTSC_DROP)
28
29
30Player.Goto(FBTime(0,0,0,0))
31tc.SetTimeCode(0,0,0,1.0)
32TCProp.Data = tc
33TCProp.Key()
34
35
36Player.Goto(FBTime(0,0,0,10))
37tc.SetTimeCode(0,0,0,10.0)
38TCProp.Data = tc
39TCProp.Key()
40
41
42tc.SetTimeCode(0,0,0,20.0)
43TCProp.Data = tc
44TCProp.KeyAt(FBTime(0,0,0,20))
45
46
47Player.Goto(FBTime(0,0,0,5))
48tc = TCProp.Data
49print("Frame %f" % tc.Frame)
Cube model class.
Definition: pyfbsdk_generated.h:11337
Player control.
Definition: pyfbsdk_generated.h:13745
Provides access to the underlying system, and the MotionBuilder scene.
Definition: pyfbsdk_generated.h:18771
TimeCode data structure.
Definition: pyfbsdk_generated.h:19724
Time data structure.
Definition: pyfbsdk_generated.h:19596