import os
from pyfbsdk import *
FBApplication().FileNew()
lHud = FBHUD("MyHUD 1")
lHud.Visibility = True
FBSystem().Scene.ConnectSrc(lHud)
FBSystem().Scene.Cameras[0].ConnectSrc(lHud)
lBloopSlate = lHud.CreateElement(FBHUD.eBloopSlate, "Bloop Slate")
lBloopSlate.ShowAfterDelayOnRecordPlay = FBTime(0,0,0,30)
lBloopSlate.ShowDuration = FBTime(0,0,0,15)
gPlayer = FBPlayerControl()
gIdleEvent = FBSystem().OnUIIdle
G_RECORDING_DURATION = 3
gFrame = 0
def DoRecord():
gPlayer.Record(True, True)
gPlayer.Play()
gIdleEvent.Add( OnIdleEvent )
def OnIdleEvent( pControl, pEvent ):
if FBSystem().LocalTime.GetSecondDouble() >= G_RECORDING_DURATION:
gPlayer.Record(False, False)
gPlayer.Stop()
gIdleEvent.Remove( OnIdleEvent )
lStory = FBStory()
lCube = FBModelCube("Cube")
lCube.Show = True
lTrack = FBStoryTrack(FBStoryTrackType.kFBStoryTrackAnimation, lStory.RootFolder)
lTrack.ChangeDetailsBegin()
lTrack.Details.append(lCube)
lTrack.ChangeDetailsEnd()
lCube.Translation.SetAnimated(True)
lTrack.RecordClipPath = "."
lTrack.RecordTrack = True
DoRecord()