A layer is a level of animation in a scene. You can have multiple layers in a scene and make changes to one layer without affecting the others.
Layers can be used to adjust data without altering the original data. For example, you can have your original animation in the base layer, then add a layer for translation animation, creating a second level of animation (AnimLayer1) on top of the base layer (BaseAnimation).
You can access layer functionality through the FBTake and FBAnimationLayer classes, both of which inherit from the FBPlug class. However, all of the functionality that is available in the User Interface (UI) is not exposed to the SDK.
The following functions are accessible using the SDK:
You can access layers through FBAnimationLayer and FBTake, for example, as shown in the following Python commands:
>>>System = FBSystem() >>>System.CurrentTake.GetCurrentLayer() 0 >>>print System.CurrentTake.GetLayerCount() 2 >>>System.CurrentTake.CreateNewLayer() >>>print System.CurrentTake.GetLayerCount() 3
Only the current layer receives keyframes and there can be only one current layer. You get and set the current layer with FBTake::GetCurrentLayer() and FBTake::SetCurrentLayer().
By default, there is a base layer (called BaseAnimation) and a Layer 1 (AnimLayer1), which you can access by their index, or pLayerID. The index varies according to the position of the layer in the layer hierarchy (called the stack in the UI).