# Copyright 2009 Autodesk, Inc.  All rights reserved.
# Use of this software is subject to the terms of the Autodesk license agreement 
# provided at the time of installation or download, or which otherwise accompanies
# this software in either electronic or hard copy form.
#
# Script description:
# Create character track for the current character and insert current take in it.
#
# Topic: FBStory, FBScene
#

from pyfbsdk import *

app = FBApplication()
system = FBSystem()
story = FBStory()
scene = system.Scene

# create a track for our character:
track = FBStoryTrack(FBStoryTrackType.kFBStoryTrackCharacter, story.RootFolder)

# assign our CurrentCharacter to the track
track.Details.append(app.CurrentCharacter)

# Insert current take in the newly created track
clip = track.CopyTakeIntoTrack( system.CurrentTake.LocalTimeSpan, system.CurrentTake )