Python Reference Guide
 
Loading...
Searching...
No Matches
Samples\HUD\BloopSlate.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# This scipt is to demonstrate/test the usage of the bloop slate.
7# The script starts recording, displays a bloop slate after 30 frames, that remains onscreen
8# for 15 frames.
9# ...
10#
11# Topic: FBPlayerControl, FBHUD, FBStory, FBStoryTrack
12#
13
14# for directory access
15import os
16from pyfbsdk import *
17
18FBApplication().FileNew()
19
20lHud = FBHUD("MyHUD 1")
21lHud.Visibility = True
22FBSystem().Scene.ConnectSrc(lHud) # Connect the HUD to the scene
23FBSystem().Scene.Cameras[0].ConnectSrc(lHud) # Connect to Perspective camera
24
25lBloopSlate = lHud.CreateElement(FBHUD.eBloopSlate, "Bloop Slate")
26lBloopSlate.ShowAfterDelayOnRecordPlay = FBTime(0,0,0,30)
27lBloopSlate.ShowDuration = FBTime(0,0,0,15)
28#lBloopSlate.ForegroundColor = FBColorAndAlpha(0.0, 0.0, 1.0, 1.0)
29#lBloopSlate.BackgroundColor = FBColorAndAlpha(1.0, 0.0, 0.0, 1.0)
30
31gPlayer = FBPlayerControl()
32gIdleEvent = FBSystem().OnUIIdle
33
34G_RECORDING_DURATION = 3
35
36gFrame = 0
37
38def DoRecord():
39 gPlayer.Record(True, True)
40 gPlayer.Play()
41 gIdleEvent.Add( OnIdleEvent )
42
43def OnIdleEvent( pControl, pEvent ):
44 if FBSystem().LocalTime.GetSecondDouble() >= G_RECORDING_DURATION:
45 gPlayer.Record(False, False)
46 gPlayer.Stop()
47 gIdleEvent.Remove( OnIdleEvent )
48
49
50
51lStory = FBStory()
52
53lCube = FBModelCube("Cube")
54lCube.Show = True
55
56lTrack = FBStoryTrack(FBStoryTrackType.kFBStoryTrackAnimation, lStory.RootFolder)
57
58lTrack.ChangeDetailsBegin()
59lTrack.Details.append(lCube)
60lTrack.ChangeDetailsEnd()
61
62lCube.Translation.SetAnimated(True)
63
64lTrack.RecordClipPath = "."
65lTrack.RecordTrack = True
66
67DoRecord()
68
69
70
FBApplication is used mainly to manage files.
Definition: pyfbsdk_generated.h:801
Heads Up display.
Definition: pyfbsdk_generated.h:9102
Cube model class.
Definition: pyfbsdk_generated.h:11337
Player control.
Definition: pyfbsdk_generated.h:13745
Story Management class.
Definition: pyfbsdk_generated.h:17689
Story Track class.
Definition: pyfbsdk_generated.h:18315
Provides access to the underlying system, and the MotionBuilder scene.
Definition: pyfbsdk_generated.h:18771
Time data structure.
Definition: pyfbsdk_generated.h:19596