FBFilter Class Reference


Detailed Description

Filters are used to modify motion capture data.

Filters are objects which can be applied on a FCurve, or the animation node associated with an animated object property, to modify shape and number of keys. Filters can be created from the GUI, using the Filters tool, or programmatically with an instance of a FBFilterManager.

The filter properties can be found in the object's PropertyList data member. They will use the same name, and be of the same type, as what can be seen in the GUI.

Warning:
Instances of FBFilter should be created with the help of the class FBFilterManager. Only internal application code should call the FBFilter's class constructor.

Sample C++ code:

    FBFilterManager lFilterManager;

    // Create a filter instace.
    HFBFilter lFilter = lFilterManager.CreateFilter( "Key Reducing" );

    if( lFilter )
    {
        // Create a FCurve and populate it with keys.
        FBFCurve lCurve( "Temp Curve" );
        for( int lIdx = 1; lIdx < 10; ++lIdx )
        {
            FBTime lTime( 0, 0, 0, lIdx * 5 );
            lCurve.KeyAdd( lTime, lIdx * 5 );
        }

        FBTrace( "Keys before: %d\n", lCurve.Keys.GetCount() ); // Should be 9.

        // Apply the key reducing filter.
        lFilter->Apply( &lCurve );

        FBTrace( "Keys after: %d\n", lCurve.Keys.GetCount() ); // Should be 2.
    }

Sample Python code:

    from pyfbsdk import *

    # Find a given model in the scene.
    lModel = FBFindModelByName( 'Cube' )

    if lModel:
        # Create a Key Reducing filter.
        lFilter = FBFilterManager().CreateFilter( 'Key Reducing' )

        if lFilter:
            # Set the filter's precision to 2.0, and apply it to
            # the object's translation animation.
            lFilter.PropertyList.Find( 'Precision' ).Data = 2.0
            lFilter.Apply( lModel.Translation.GetAnimationNode(), True )
Inheritance diagram for FBFilter:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  __init__ (object pObject=None)
  Constructor.
bool  Apply (HFBFCurve pCurve)
  Apply the filter to an FCurve.
bool  Apply (HFBAnimationNode pNode, bool pRecursive)
  Apply the filter to an animation node.
  Reset ()
  Reset properties.

Public Attributes

FBPropertyBase  Start
  Read Write Property: Start time of the filtering region.
FBPropertyBase  Stop
  Read Write Property: Stop time of the filtering region.

Member Function Documentation

__init__ ( object  pObject = None )

Constructor.

Parameters:
pObject For internal use only (default is NULL).

Reimplemented from FBComponent.

bool Apply ( HFBFCurve  pCurve )

Apply the filter to an FCurve.

This is one of the two apply method that is meant to be called by client code. The FCurve can be a standalone independant FCurve, or can be associated to an object's animated property.

Parameters:
pCurve FCurve to apply filter to.
Returns:
true if successful.
bool Apply ( HFBAnimationNode  pNode,
bool  pRecursive 
)

Apply the filter to an animation node.

This is the other apply method and it can be used on an object's animation node.

Parameters:
pNode Node to apply filter to.
pRecursive Recursively apply filter on child nodes?
Returns:
true if successful.
Reset ( )

Reset properties.

Warning:
This method will only work on plug-in filters, not built-in types.

Member Data Documentation

FBPropertyBase Start

Read Write Property: Start time of the filtering region.

FBPropertyBase Stop

Read Write Property: Stop time of the filtering region.


FBFilter FBFilter FBFilter FBFilter FBFilter FBFilter FBFilter FBFilter FBFilter FBFilter
FBFilter FBFilter FBFilter FBFilter FBFilter FBFilter FBFilter FBFilter FBFilter FBFilter