Python Reference Guide
 
Loading...
Searching...
No Matches
Tasks\MultiLayerKeying.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 multiple keys on a cube.
8#
9# Topic: FBTake, FBPlayerControl
10#
11from pyfbsdk import *
12
13#Define unselesct all function
14def UnselectAll():
15 for each in Scene.Components:
16 if each.HasObjectFlags(FBObjectFlag.kFBFlagSelectable):
17 each.Selected = False
18
19#Init
20Player = FBPlayerControl()
21Scene = FBSystem().Scene
22System = FBSystem()
23
24
25System.CurrentTake.CreateNewLayer()
26LayerCount = System.CurrentTake.GetLayerCount()
27System.CurrentTake.SetCurrentLayer(LayerCount-1)
28NewLayer = System.CurrentTake.GetLayer(LayerCount-1)
29NewLayer.Name = "New Layer Created"
30
31
32cube = FBModelCube("Cube")
33
34
35cube.Show = True
36cube.Visibility = True
37cube.Selected = True
38Player.Goto(FBTime(0,0,0,0))
39cube.Translation = FBVector3d(10,10,10)
40cube.Rotation = FBVector3d(10,20,30)
41
42
43Player.Key()
44
45
46Player.Goto(FBTime(0,0,0,10))
47cube.Translation = FBVector3d(30,30,30)
48cube.Rotation = FBVector3d(30,0,20)
49Player.Key()
Cube model class.
Definition: pyfbsdk_generated.h:11337
Player control.
Definition: pyfbsdk_generated.h:13745
Provides access to the underlying system, and the MotionBuilder scene.
Definition: pyfbsdk_generated.h:18771
Time data structure.
Definition: pyfbsdk_generated.h:19596