#include
<fbfilter.h>
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.
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.
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 |
FBFilter | ( | HIObject | pObject = NULL |
) |
Constructor.
pObject | For internal use only (default is NULL). |
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.
pCurve | FCurve to apply filter to. |
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.
pNode | Node to apply filter to. | |
pRecursive | Recursively apply filter on child nodes? |
virtual void Reset | ( | ) | [virtual] |
Reset properties.
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.