Tasks/PlotSelectedCharStoryTracks.py

Tasks/PlotSelectedCharStoryTracks.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 # Will plot all selected story tracks assigned to a character.
8 #
9 # Topic: FBStory, FBStoryTrack, FBCharacter, FBPlotOptions
10 #
11 
12 from pyfbsdk import *
13 
14 lStory = FBStory()
15 lScene = FBSystem().Scene
16 lcharactersList = lScene.Characters
17 
18 
19 # Set options for Plot process
20 
21 lOptions = FBPlotOptions()
22 
23 lOptions.ConstantKeyReducerKeepOneKey = True
24 lOptions.PlotAllTakes = False
25 lOptions.PlotOnFrame = True
26 lOptions.PlotPeriod = FBTime( 0, 0, 0, 1 )
27 lOptions.PlotTranslationOnRootOnly = True
28 lOptions.PreciseTimeDiscontinuities = True
29 lOptions.RotationFilterToApply = FBRotationFilter.kFBRotationFilterGimbleKiller
30 lOptions.UseConstantKeyReducer = True
31 
32 
33 for lTracks in lStory.RootFolder.Tracks:
34  if lTracks.Selected == True:
35  lCharacterIdx = lTracks.CharacterIndex
36  lCharacter = lcharactersList[lCharacterIdx - 1]
37  lCharacter.PlotAnimation (FBCharacterPlotWhere.kFBCharacterPlotOnSkeleton,lOptions )
38  lTracks.Mute = True
39 
40 
41 for lFolders in lStory.RootFolder.Childs:
42  for lTracks in lFolders.Tracks:
43  if lTracks.Selected == True:
44  lCharacterIdx = lTracks.CharacterIndex
45  lCharacter = lcharactersList[lCharacterIdx - 1]
46  lCharacter.PlotAnimation (FBCharacterPlotWhere.kFBCharacterPlotOnSkeleton,lOptions )
47  lTracks.Mute = True
48 
49 
50 
51 
52 
53