BasicOperations/CreateShotClip.py

BasicOperations/CreateShotClip.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 # Script description:
7 # Create a Camera, a shotTrack insert a shot clip associated to this Camera
8 #
9 # Topic: FBStoryTrack, FBStoryTrackType, FBStory
10 #
11 
12 from pyfbsdk import *
13 
14 # create a Camera
15 shotName= "My Camera"
16 lCam = FBCamera (shotName)
17 lCam.Visible = True
18 lCam.Show = True
19 lNull = FBModelNull (shotName + "_INT")
20 lCam.Interest = lNull
21 
22 # Create a new ShotTrack. Don't forget to specify to add it to the RootEditFolder
23 lTrackContainer = FBStoryTrack(FBStoryTrackType.kFBStoryTrackShot, FBStory().RootEditFolder)
24 
25 # find our cameras in the camera list
26 cameras = FBSystem().Scene.Cameras
27 for cam in cameras:
28  if cam.Name == shotName:
29  clipStart = FBTime(0,0,0,0)
30  # Insert a clip into our newly created shot track
31  lClip = FBStoryClip (cam, lTrackContainer, clipStart)