AL_USDMaya  0.29.4
USD to Maya Bridge
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
AL::usdmaya::fileio::AnimationTranslator Class Reference

A utility class to help with exporting animated plugs from maya. More...

#include <AnimationTranslator.h>

Public Member Functions

void addPlug (const MPlug &plug, const UsdAttribute &attribute, const bool assumeExpressionIsAnimated)
 add a plug to the animation translator (if the plug is animated) More...
 
void addPlug (const MPlug &plug, const UsdAttribute &attribute, const float scale, const bool assumeExpressionIsAnimated)
 add a plug to the animation translator (if the plug is animated) More...
 
void addTransformPlug (const MPlug &plug, const UsdAttribute &attribute, const bool assumeExpressionIsAnimated)
 add a transform plug to the animation translator (if the plug is animated) More...
 
void forceAddTransformPlug (const MPlug &plug, const UsdAttribute &attribute)
 add a transform plug to the animation translator (if the plug is animated) More...
 
void forceAddPlug (const MPlug &plug, const UsdAttribute &attribute, const float scale)
 add a scaled plug to the animation translator (if the plug is animated) More...
 
void forceAddPlug (const MPlug &plug, const UsdAttribute &attribute)
 add an animated plug to the animation translator (if the plug is animated) More...
 
void addMesh (const MDagPath &path, const UsdAttribute &attribute)
 add a mesh to the animation translator More...
 
AL_USDMAYA_PUBLIC void exportAnimation (const ExporterParams &params)
 After the scene has been exported, call this method to export the animation data on various attributes. More...
 
void addCustomAnimNode (translators::TranslatorBase *translator, MDagPath dagPath, UsdPrim usdPrim)
 insert a prim into the anim translator for custom anim export. More...
 

Static Public Member Functions

static bool isAnimated (const MObject &node, const MObject &attr, const bool assumeExpressionIsAnimated=true)
 returns true if the attribute is animated More...
 
static AL_USDMAYA_PUBLIC bool isAnimated (MPlug attr, bool assumeExpressionIsAnimated=true)
 returns true if the attribute is animated More...
 
static AL_USDMAYA_PUBLIC bool isAnimatedMesh (const MDagPath &mesh)
 returns true if the mesh is animated More...
 
static AL_USDMAYA_PUBLIC bool isAnimatedTransform (const MObject &transformNode)
 returns true if the transform node is animated More...
 

Detailed Description

A utility class to help with exporting animated plugs from maya.

Member Function Documentation

void AL::usdmaya::fileio::AnimationTranslator::addCustomAnimNode ( translators::TranslatorBase translator,
MDagPath  dagPath,
UsdPrim  usdPrim 
)
inline

insert a prim into the anim translator for custom anim export.

Parameters
translatorthe plugin translator to handle the export of anim data for the node
dagPaththe maya dag path for the maya object to export
usdPrimthe prim to write the data into
void AL::usdmaya::fileio::AnimationTranslator::addMesh ( const MDagPath &  path,
const UsdAttribute &  attribute 
)
inline

add a mesh to the animation translator

Parameters
paththe path to the animated maya mesh
attributethe corresponding maya attribute to write the anim data into if the plug is animated
void AL::usdmaya::fileio::AnimationTranslator::addPlug ( const MPlug &  plug,
const UsdAttribute &  attribute,
const bool  assumeExpressionIsAnimated 
)
inline

add a plug to the animation translator (if the plug is animated)

Parameters
plugthe maya attribute to test
attributethe corresponding maya attribute to write the anim data into if the plug is animated
assumeExpressionIsAnimatedif we encounter an expression, assume that the attribute is animated (true) or static (false).
void AL::usdmaya::fileio::AnimationTranslator::addPlug ( const MPlug &  plug,
const UsdAttribute &  attribute,
const float  scale,
const bool  assumeExpressionIsAnimated 
)
inline

add a plug to the animation translator (if the plug is animated)

Parameters
plugthe maya attribute to test
attributethe corresponding maya attribute to write the anim data into if the plug is animated
scalea scale to apply to convert units if needed
assumeExpressionIsAnimatedif we encounter an expression, assume that the attribute is animated (true) or static (false).
void AL::usdmaya::fileio::AnimationTranslator::addTransformPlug ( const MPlug &  plug,
const UsdAttribute &  attribute,
const bool  assumeExpressionIsAnimated 
)
inline

add a transform plug to the animation translator (if the plug is animated)

Parameters
plugthe maya attribute to test
attributethe corresponding maya attribute to write the anim data into if the plug is animated attribute can't be handled by generic DgNodeTranslator
assumeExpressionIsAnimatedif we encounter an expression, assume that the attribute is animated (true) or static (false).
AL_USDMAYA_PUBLIC void AL::usdmaya::fileio::AnimationTranslator::exportAnimation ( const ExporterParams params)

After the scene has been exported, call this method to export the animation data on various attributes.

Parameters
paramsthe export options
void AL::usdmaya::fileio::AnimationTranslator::forceAddPlug ( const MPlug &  plug,
const UsdAttribute &  attribute,
const float  scale 
)
inline

add a scaled plug to the animation translator (if the plug is animated)

Parameters
plugthe maya attribute to test
attributethe corresponding maya attribute to write the anim data into if the plug is animated attribute can't be handled by generic DgNodeTranslator
scalea scale to apply to convert units if needed
void AL::usdmaya::fileio::AnimationTranslator::forceAddPlug ( const MPlug &  plug,
const UsdAttribute &  attribute 
)
inline

add an animated plug to the animation translator (if the plug is animated)

Parameters
plugthe maya attribute to test
attributethe corresponding maya attribute to write the anim data into if the plug is animated attribute can't be handled by generic DgNodeTranslator
void AL::usdmaya::fileio::AnimationTranslator::forceAddTransformPlug ( const MPlug &  plug,
const UsdAttribute &  attribute 
)
inline

add a transform plug to the animation translator (if the plug is animated)

Parameters
plugthe maya attribute to test
attributethe corresponding maya attribute to write the anim data into if the plug is animated attribute can't be handled by generic DgNodeTranslator
static bool AL::usdmaya::fileio::AnimationTranslator::isAnimated ( const MObject &  node,
const MObject &  attr,
const bool  assumeExpressionIsAnimated = true 
)
inlinestatic

returns true if the attribute is animated

Parameters
nodethe node which contains the attribute to test
attrthe attribute handle
assumeExpressionIsAnimatedif we encounter an expression, assume that the attribute is animated (true) or static (false).
Returns
true if the attribute was found to be animated This test only covers the situation that your attribute is actually animated by some types of nodes, e.g. animCurves or expression, or source attribute's full-name match a certain string. But in reality the control network might be really complicated and heavily customized thus it might go far beyond the situation we can cover here.
static AL_USDMAYA_PUBLIC bool AL::usdmaya::fileio::AnimationTranslator::isAnimated ( MPlug  attr,
bool  assumeExpressionIsAnimated = true 
)
static

returns true if the attribute is animated

Parameters
attrthe attribute to test
assumeExpressionIsAnimatedif we encounter an expression, assume that the attribute is animated (true) or static (false).
Returns
true if the attribute was found to be animated This test only covers the situation that your attribute is actually animated by some types of nodes, e.g. animCurves or expression, or source attribute's full-name match a certain string. But in reality the control network might be really complicated and heavily customized thus it might go far beyond the situations we can cover here.
static AL_USDMAYA_PUBLIC bool AL::usdmaya::fileio::AnimationTranslator::isAnimatedMesh ( const MDagPath &  mesh)
static

returns true if the mesh is animated

Parameters
meshthe mesh to test
Returns
true if the mesh was found to be animated This test only covers the situation that your node / upstream nodes are actually animated by animCurves. But in reality the control network might be really complicated and heavily customized thus it might go far beyond the situations we can cover here.
static AL_USDMAYA_PUBLIC bool AL::usdmaya::fileio::AnimationTranslator::isAnimatedTransform ( const MObject &  transformNode)
static

returns true if the transform node is animated

Parameters
transformNodethe transform node to test
Returns
true if the transform was found to be animated It roughly tests a list of common transform attributes, translate, rotate, rotateOrder and scale, if any of those attributes is connected as destination, we take the transform node as animated. This test will be performed recursively up to parent hierarchies, unless the inheritsTransform attribute is turned off.

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