Public Member Functions | Public Attributes

FBFilter Class Reference

Search for all occurrences

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 )

Definition at line 307 of file fbfilter.h.

#include <fbfilter.h>

Inheritance diagram for FBFilter:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  FBFilter (HIObject pObject=NULL)
  Constructor.
virtual bool  Apply (HFBFCurve pCurve)
  Apply the filter to an FCurve.
virtual bool  Apply (HFBAnimationNode pNode, bool pRecursive)
  Apply the filter to an animation node.
virtual void  Reset ()
  Reset properties.

Public Attributes

FBPropertyTime  Start
  Read Write Property: Start time of the filtering region
FBPropertyTime  Stop
  Read Write Property: Stop time of the filtering region

Constructor & Destructor Documentation

FBFilter ( HIObject  pObject = NULL )

Constructor.

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

Member Function Documentation

virtual bool Apply ( HFBFCurve  pCurve ) [virtual]

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.
virtual bool Apply ( HFBAnimationNode  pNode,
bool  pRecursive 
) [virtual]

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.
virtual void Reset ( ) [virtual]

Reset properties.

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

Member Data Documentation

Read Write Property: Start time of the filtering region

Definition at line 340 of file fbfilter.h.

Read Write Property: Stop time of the filtering region

Definition at line 341 of file fbfilter.h.


The documentation for this class was generated from the following file:

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