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

This class provides a transformation matrix that allows you to apply tweaks over some read only transformation information extracted from a UsdPrim. Currently each tweak is a simple offset over the values contained within the UsdPrim. More...

#include <TransformationMatrix.h>

Inheritance diagram for AL::usdmaya::nodes::TransformationMatrix:

Public Member Functions

void setMObject (const MObject object)
 sets the MObject for the transform More...
 
bool isTranslateLocked ()
 checks to see whether the transform attribute is locked More...
 
bool isRotateLocked ()
 checks to see whether the rotate attribute is locked More...
 
bool isScaleLocked ()
 checks to see whether the scale attribute is locked More...
 
 TransformationMatrix ()
 ctor
 
 TransformationMatrix (const UsdPrim &prim)
 ctor More...
 
void setPrim (const UsdPrim &prim, Transform *transformNode)
 set the prim that this transformation matrix will read/write to. More...
 
void enablePushToPrim (bool enabled)
 If set to true, modifications to these transform attributes will be pushed back onto the original prim. More...
 
void enableReadAnimatedValues (bool enabled)
 If set to true, transform values will target the animated key-frame values in the prim. If set to false, the transform values will target the default attribute values. More...
 
UsdTimeCode getTimeCode ()
 Returns the timecode to use when pushing the transform values to the USD prim. If readFromTimeline flag is set to true, then the timecode will be read from the incoming time attribute on the transform node. If readFromTimeline is false, then the timecode will be the magic 'modify default values' timecode, and animation data will not be affected (only the default values found in the USD prim) More...
 
void setLocalTranslationOffset (const MVector &localTranslateOffset)
 Applies a local space translation offset to the computed matrix. Useful for positioning objects on a table. More...
 
const UsdPrim & prim () const
 return the prim this transform matrix is attached to More...
 
Query flags
bool hasAnimation () const
 does the prim have animated scale?
 
bool hasAnimatedScale () const
 does the prim have animated scale?
 
bool hasAnimatedShear () const
 does the prim have animated shear?
 
bool hasAnimatedTranslation () const
 does the prim have animated translation?
 
bool hasAnimatedRotation () const
 does the prim have animated rotation?
 
bool hasAnimatedMatrix () const
 does the prim have an animated matrix only?
 
bool primHasScale () const
 does the UsdGeomXform have a scale transform op?
 
bool primHasRotation () const
 does the UsdGeomXform have a rotation transform op?
 
bool primHasTranslation () const
 does the UsdGeomXform have a translation transform op?
 
bool primHasShear () const
 does the UsdGeomXform have a shear transform op?
 
bool primHasScalePivot () const
 does the UsdGeomXform have a scale pivot op?
 
bool primHasScalePivotTranslate () const
 does the UsdGeomXform have a scale pivot translate op?
 
bool primHasRotatePivot () const
 does the UsdGeomXform have a rotate pivot op?
 
bool primHasRotatePivotTranslate () const
 does the UsdGeomXform have a rotate pivot translate op?
 
bool primHasRotateAxes () const
 does the UsdGeomXform have a rotation axes op?
 
bool primHasPivot () const
 does the UsdGeomXform have a pixar pivot op?
 
bool primHasTransform () const
 does the UsdGeomXform have a transform matrix op?
 
bool readAnimatedValues () const
 should we read the animated keyframes or the defaults?
 
bool pushToPrimEnabled () const
 Is this transform set to write back onto the USD prim.
 
bool pushPrimToMatrix () const
 Is this prim writing back to a matrix (true) or to components (false)
 
bool pushToPrimAvailable () const
 Is this transform set to write back onto the USD prim, and is it currently possible?
 

Static Public Member Functions

static bool readVector (MVector &result, const UsdGeomXformOp &op, UsdTimeCode timeCode=UsdTimeCode::EarliestTime())
 helper method. Reads a vector from the transform op specified at the requested timecode More...
 
static bool readShear (MVector &result, const UsdGeomXformOp &op, UsdTimeCode timeCode=UsdTimeCode::EarliestTime())
 helper method. Reads a shear value from the transform op specified at the requested timecode More...
 
static bool readPoint (MPoint &result, const UsdGeomXformOp &op, UsdTimeCode timeCode=UsdTimeCode::EarliestTime())
 helper method. Reads a point from the transform op specified at the requested timecode More...
 
static bool readRotation (MEulerRotation &result, const UsdGeomXformOp &op, UsdTimeCode timeCode=UsdTimeCode::EarliestTime())
 helper method. Reads an euler rotation from the transform op specified at the requested timecode More...
 
static double readDouble (const UsdGeomXformOp &op, UsdTimeCode timeCode=UsdTimeCode::EarliestTime())
 helper method. Reads a double from the transform op specified at the requested timecode (typically RotateX / rotateY values) More...
 
static bool readMatrix (MMatrix &result, const UsdGeomXformOp &op, UsdTimeCode timeCode=UsdTimeCode::EarliestTime())
 helper method. Reads a matrix from the transform op specified at the requested timecode More...
 
static bool pushVector (const MVector &input, UsdGeomXformOp &op, UsdTimeCode timeCode=UsdTimeCode::Default())
 helper method. Pushes a vector into the transform op specified at the requested timecode More...
 
static bool pushPoint (const MPoint &input, UsdGeomXformOp &op, UsdTimeCode timeCode=UsdTimeCode::Default())
 helper method. Pushes a point into the transform op specified at the requested timecode More...
 
static bool pushRotation (const MEulerRotation &input, UsdGeomXformOp &op, UsdTimeCode timeCode=UsdTimeCode::Default())
 helper method. Pushes a vector into the transform op specified at the requested timecode More...
 
static void pushDouble (const double input, UsdGeomXformOp &op, UsdTimeCode timeCode=UsdTimeCode::Default())
 helper method. Pushes a double into the transform op specified at the requested timecode (typically for RotateX / RotateY) More...
 
static bool pushShear (const MVector &input, UsdGeomXformOp &op, UsdTimeCode timeCode=UsdTimeCode::Default())
 helper method. Pushes a shear into the transform op specified at the requested timecode More...
 
static bool pushMatrix (const MMatrix &input, UsdGeomXformOp &op, UsdTimeCode timeCode=UsdTimeCode::Default())
 helper method. Pushes a matrix into the transform op specified at the requested timecode More...
 
static AL_USDMAYA_PUBLIC
MPxTransformationMatrix * 
creator ()
 create an instance of this transformation matrix More...
 

Static Public Attributes

static AL_USDMAYA_PUBLIC const
MTypeId 
kTypeId
 the type ID of the transformation matrix
 

Convert To-From USD primitive

void initialiseToPrim (bool readFromPrim=true, Transform *node=0)
 this method inspects the UsdGeomXform to find out:

  1. what schema is being used (Maya, Pxr, or just a matrix)
  2. which transformation components are present (e.g. scale, rotate, etc).
  3. which, if any, of those components are animated.
More...
 
void updateToTime (const UsdTimeCode &time)
 this method updates the internal transformation components to the given time. Only the Transform node should need to call this method More...
 
void pushToPrim ()
 pushes any modifications on the matrix back onto the UsdPrim
 

Detailed Description

This class provides a transformation matrix that allows you to apply tweaks over some read only transformation information extracted from a UsdPrim. Currently each tweak is a simple offset over the values contained within the UsdPrim.

Constructor & Destructor Documentation

AL::usdmaya::nodes::TransformationMatrix::TransformationMatrix ( const UsdPrim &  prim)

ctor

Parameters
primthe USD prim that this matrix should represent

Member Function Documentation

static AL_USDMAYA_PUBLIC MPxTransformationMatrix* AL::usdmaya::nodes::TransformationMatrix::creator ( )
static

create an instance of this transformation matrix

Returns
a new instance of this transformation matrix
void AL::usdmaya::nodes::TransformationMatrix::enablePushToPrim ( bool  enabled)

If set to true, modifications to these transform attributes will be pushed back onto the original prim.

Parameters
enabledtrue will cause changes to this transform update the values on the USD prim. False will mean that the changes are simply cached internally.
enabledtrue to write values to the usd prim when changed, false to treat the usd prim as read only.
void AL::usdmaya::nodes::TransformationMatrix::enableReadAnimatedValues ( bool  enabled)

If set to true, transform values will target the animated key-frame values in the prim. If set to false, the transform values will target the default attribute values.

Parameters
enabledtrue to target animated values, false to target the default.
UsdTimeCode AL::usdmaya::nodes::TransformationMatrix::getTimeCode ( )
inline

Returns the timecode to use when pushing the transform values to the USD prim. If readFromTimeline flag is set to true, then the timecode will be read from the incoming time attribute on the transform node. If readFromTimeline is false, then the timecode will be the magic 'modify default values' timecode, and animation data will not be affected (only the default values found in the USD prim)

Returns
the timecode to use when pushing transform values to the USD prim
void AL::usdmaya::nodes::TransformationMatrix::initialiseToPrim ( bool  readFromPrim = true,
Transform node = 0 
)

this method inspects the UsdGeomXform to find out:

  1. what schema is being used (Maya, Pxr, or just a matrix)
  2. which transformation components are present (e.g. scale, rotate, etc).
  3. which, if any, of those components are animated.

Parameters
readFromPrimif true, the maya attribute values will be updated from those found on the USD prim
nodethe transform node to which this matrix belongs (and where the USD prim will be extracted from)
bool AL::usdmaya::nodes::TransformationMatrix::isRotateLocked ( )
inline

checks to see whether the rotate attribute is locked

Returns
true if the rotate attribute is locked
bool AL::usdmaya::nodes::TransformationMatrix::isScaleLocked ( )
inline

checks to see whether the scale attribute is locked

Returns
true if the scale attribute is locked
bool AL::usdmaya::nodes::TransformationMatrix::isTranslateLocked ( )
inline

checks to see whether the transform attribute is locked

Returns
true if the translate attribute is locked
const UsdPrim& AL::usdmaya::nodes::TransformationMatrix::prim ( ) const
inline

return the prim this transform matrix is attached to

Returns
the prim this transform matrix is controlling
static void AL::usdmaya::nodes::TransformationMatrix::pushDouble ( const double  input,
UsdGeomXformOp &  op,
UsdTimeCode  timeCode = UsdTimeCode::Default() 
)
static

helper method. Pushes a double into the transform op specified at the requested timecode (typically for RotateX / RotateY)

Parameters
inputthe new value to insert into the transform operation
opthe transformation op to write into
timeCodethe time at which to set the transform value return true if written ok
static bool AL::usdmaya::nodes::TransformationMatrix::pushMatrix ( const MMatrix &  input,
UsdGeomXformOp &  op,
UsdTimeCode  timeCode = UsdTimeCode::Default() 
)
static

helper method. Pushes a matrix into the transform op specified at the requested timecode

Parameters
inputthe new value to insert into the transform operation
opthe transformation op to write into
timeCodethe time at which to set the transform value return true if written ok
static bool AL::usdmaya::nodes::TransformationMatrix::pushPoint ( const MPoint &  input,
UsdGeomXformOp &  op,
UsdTimeCode  timeCode = UsdTimeCode::Default() 
)
static

helper method. Pushes a point into the transform op specified at the requested timecode

Parameters
inputthe new value to insert into the transform operation
opthe transformation op to write into
timeCodethe time at which to set the transform value return true if written ok
static bool AL::usdmaya::nodes::TransformationMatrix::pushRotation ( const MEulerRotation &  input,
UsdGeomXformOp &  op,
UsdTimeCode  timeCode = UsdTimeCode::Default() 
)
static

helper method. Pushes a vector into the transform op specified at the requested timecode

Parameters
inputthe new value to insert into the transform operation
opthe transformation op to write into
timeCodethe time at which to set the transform value return true if written ok
static bool AL::usdmaya::nodes::TransformationMatrix::pushShear ( const MVector &  input,
UsdGeomXformOp &  op,
UsdTimeCode  timeCode = UsdTimeCode::Default() 
)
static

helper method. Pushes a shear into the transform op specified at the requested timecode

Parameters
inputthe new value to insert into the transform operation
opthe transformation op to write into
timeCodethe time at which to set the transform value return true if written ok
static bool AL::usdmaya::nodes::TransformationMatrix::pushVector ( const MVector &  input,
UsdGeomXformOp &  op,
UsdTimeCode  timeCode = UsdTimeCode::Default() 
)
static

helper method. Pushes a vector into the transform op specified at the requested timecode

Parameters
inputthe new value to insert into the transform operation
opthe transformation op to write into
timeCodethe time at which to set the transform value return true if written ok
static double AL::usdmaya::nodes::TransformationMatrix::readDouble ( const UsdGeomXformOp &  op,
UsdTimeCode  timeCode = UsdTimeCode::EarliestTime() 
)
static

helper method. Reads a double from the transform op specified at the requested timecode (typically RotateX / rotateY values)

Parameters
opthe transformation op to read from
timeCodethe time at which to query the transform value return the returned value
static bool AL::usdmaya::nodes::TransformationMatrix::readMatrix ( MMatrix &  result,
const UsdGeomXformOp &  op,
UsdTimeCode  timeCode = UsdTimeCode::EarliestTime() 
)
static

helper method. Reads a matrix from the transform op specified at the requested timecode

Parameters
resultthe returned result
opthe transformation op to read from
timeCodethe time at which to query the transform value return true if read ok
static bool AL::usdmaya::nodes::TransformationMatrix::readPoint ( MPoint &  result,
const UsdGeomXformOp &  op,
UsdTimeCode  timeCode = UsdTimeCode::EarliestTime() 
)
static

helper method. Reads a point from the transform op specified at the requested timecode

Parameters
resultthe returned result
opthe transformation op to read from
timeCodethe time at which to query the transform value return true if read ok
static bool AL::usdmaya::nodes::TransformationMatrix::readRotation ( MEulerRotation &  result,
const UsdGeomXformOp &  op,
UsdTimeCode  timeCode = UsdTimeCode::EarliestTime() 
)
static

helper method. Reads an euler rotation from the transform op specified at the requested timecode

Parameters
resultthe returned result
opthe transformation op to read from
timeCodethe time at which to query the transform value return true if read ok
static bool AL::usdmaya::nodes::TransformationMatrix::readShear ( MVector &  result,
const UsdGeomXformOp &  op,
UsdTimeCode  timeCode = UsdTimeCode::EarliestTime() 
)
static

helper method. Reads a shear value from the transform op specified at the requested timecode

Parameters
resultthe returned result
opthe transformation op to read from
timeCodethe time at which to query the transform value return true if read ok
static bool AL::usdmaya::nodes::TransformationMatrix::readVector ( MVector &  result,
const UsdGeomXformOp &  op,
UsdTimeCode  timeCode = UsdTimeCode::EarliestTime() 
)
static

helper method. Reads a vector from the transform op specified at the requested timecode

Parameters
resultthe returned result
opthe transformation op to read from
timeCodethe time at which to query the transform value return true if read ok
void AL::usdmaya::nodes::TransformationMatrix::setLocalTranslationOffset ( const MVector &  localTranslateOffset)
inline

Applies a local space translation offset to the computed matrix. Useful for positioning objects on a table.

Parameters
localTranslateOffsetthe local space offset to apply to the transform.
void AL::usdmaya::nodes::TransformationMatrix::setMObject ( const MObject  object)
inline

sets the MObject for the transform

Parameters
objectthe MObject for the custom transform node
void AL::usdmaya::nodes::TransformationMatrix::setPrim ( const UsdPrim &  prim,
Transform transformNode 
)

set the prim that this transformation matrix will read/write to.

Parameters
primthe prim
void AL::usdmaya::nodes::TransformationMatrix::updateToTime ( const UsdTimeCode &  time)

this method updates the internal transformation components to the given time. Only the Transform node should need to call this method

Parameters
timethe new timecode

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