Python Reference Guide
 
Loading...
Searching...
No Matches
Samples\HUD\Timeline.py
1# Copyright 2012 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# This script is to demonstrate usage of the HUD Timeline.
7# It sets attributes for the Head, Cut, Tail regions (e.g., color, duration),
8# and plays transport control in loop mode.
9# ...
10#
11# Topic: FBHUD, FBHUDTimelineElement, FBPlayerControl
12#
13
14from pyfbsdk import *
15
16FBApplication().FileNew()
17
18lHud = FBHUD("MyHUD 1")
19lHud.Visibility = True
20FBSystem().Scene.ConnectSrc(lHud) # Connect the HUD to the scene
21FBSystem().Scene.Cameras[0].ConnectSrc(lHud) # Connect to Perspective camera
22
23lTimeline = lHud.CreateElement(FBHUD.eTimeline, "HUD Timeline")
24
25# Set color and duration for Head region
26lTimeline.HeadActiveColor = FBColorAndAlpha(0.3, 0.5, 0.8, 1.0)
27lTimeline.HeadIdleColor = FBColorAndAlpha(0.15, 0.25, 0.4, 0.3)
28lTimeline.HeadDuration = FBTime(0,0,0,30) # 30 frames
29
30# Set color for Cut region
31lTimeline.CutActiveColor = FBColorAndAlpha(1, 0.2, 0.5, 1.0)
32lTimeline.CutIdleColor = FBColorAndAlpha(0.5, 0.1, 0.25, 0.3)
33
34# Set color and duration for Tail region
35lTimeline.TailActiveColor = FBColorAndAlpha(0.7, 1.0, 0.7, 1.0)
36lTimeline.TailIdleColor = FBColorAndAlpha(0.35, 0.5, 0.35, 0.3)
37lTimeline.TailDuration = FBTime(0,0,1,0) # 1 sec
38
39# Play
40gPlayer = FBPlayerControl()
41gPlayer.LoopActive = True
42gPlayer.Play()
FBApplication is used mainly to manage files.
Definition: pyfbsdk_generated.h:801
Color and alpha vector.
Definition: pyfbsdk_generated.h:4497
Heads Up display.
Definition: pyfbsdk_generated.h:9102
Player control.
Definition: pyfbsdk_generated.h:13745
Provides access to the underlying system, and the MotionBuilder scene.
Definition: pyfbsdk_generated.h:18771
Time data structure.
Definition: pyfbsdk_generated.h:19596