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

The AL::usdmaya::nodes::Transform node is a custom transform node that allows you to manipulate a USD. More...

#include <Transform.h>

Inheritance diagram for AL::usdmaya::nodes::Transform:

Public Member Functions

 AL_MAYA_DECLARE_NODE ()
 
 AL_DECL_ATTRIBUTE (primPath)
 
 AL_DECL_ATTRIBUTE (inStageData)
 
 AL_DECL_ATTRIBUTE (time)
 
 AL_DECL_ATTRIBUTE (timeOffset)
 
 AL_DECL_ATTRIBUTE (timeScalar)
 
 AL_DECL_ATTRIBUTE (localTranslateOffset)
 
 AL_DECL_ATTRIBUTE (pushToPrim)
 
 AL_DECL_ATTRIBUTE (readAnimatedValues)
 
 AL_DECL_ATTRIBUTE (outTime)
 

Methods

TransformationMatrixtransform () const
 returns the transformation matrix for this transform node More...
 
MPxNode::SchedulingType schedulingType () const override
 Enable parallel evaluation. More...
 
const MObject getProxyShape () const
 

Detailed Description

The AL::usdmaya::nodes::Transform node is a custom transform node that allows you to manipulate a USD.

custom MPxTransformationMatrix type (AL::usdmaya::nodes::TransformationMatrix). The custom transformation matrix listens for changes that affect the transform (e.g. rotateBy, translateBy, etc), and if pushToPrim is enabled, applies those changes to the USD transformation.

Typically this node should have two input connections:

    The following attributes can be used to scale and offset the time values:
     \li \b timeOffset - an offset (in current UI time units) of say 30, means animation wont start until frame 30.
     \li \b timeScalar - a speed multiplier. 2.0 will double the playback speed, 0.5 will halve it.


    The following attribute determines which UsdPrim is being watched:
     \li \b primPath - a Usd path of the prim being watched, e.g.  "/root/foo/pCube1"


    We then have these two attributes:
     \li \b localTranslateOffset - an offset applied *after* all other transforms. Useful for positioning items on a table.
     \li \b pushToPrim - When enabled, any changes you make to the transform values in maya, will be pushed back onto the USD primitive.


    Finally we have the following outputs:
     \li \b outTime = (time - timeOffset) * timeScalar
Todo:
General todo list, and other quirks....
  1. pushToPrim when enabled, does not add transform operations into the UsdPrim it is tracking. So for example, if you have a prim with no transform ops, not much is going to happen. If however your prim has the full spectrum of rotate axis, translate, scale, rotate, shear, etc; then you will be able to have full control over the prim. This will need to be addressed at some point soon. One of the more challenging aspects here is that we will need to modify a) the geom op order [e.g. insert a scale op, where there was not one before]; and b) rotation is going to be a PITA [There may be a rotateX op, but after modification that may need to be deleted, and replaced with a rotateXYZ op]
  2. If pushToPrim is disabled, any modifications to the transform values are stored as offsets from the USD prim values. This works quite well for local space operations such as scale and rotation, semi-works for translation [effectively this is a parent space translation offset - useful for moving an anim clip] However for values such as rotation and scale pivots, yeah, the result might be a little strange.
  3. I'm not convinced the way that I've organised compute and validateAndSetValue is ideal. It works, but if anyone has some improvements to suggest, I'm all ears.
  4. Generally speaking, when localTranslateOffset is (0,0,0), then the translate/rotate/scale tools work quite well. If however localTranslateOffset is not (0,0,0), then the behaviour of the rotate tool is a little odd. Really this should be taken into account within the AL::usdmaya::nodes::TransformationMatrix::rotateBy and AL::usdmaya::nodes::TransformationMatrix::rotateTo methods.
  5. If the usd prim xform stack has only one pivot, any separate modifications of scale/rotate pivot in maya will result in an undefined behavior.

Member Function Documentation

MPxNode::SchedulingType AL::usdmaya::nodes::Transform::schedulingType ( ) const
inlineoverride

Enable parallel evaluation.

Returns
MPxNode::kParallel
TransformationMatrix* AL::usdmaya::nodes::Transform::transform ( ) const
inline

returns the transformation matrix for this transform node

Returns
the transformation matrix

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