Nuke binary plugins  14.0.8
DD::Image::AxisVals Class Reference

Public Member Functions

 AxisVals ()=default
 Default ctor leaves junk in values.
 
 AxisVals (const fdk::TimeValue &time, bool _parent_enable)
 Assigns standard default values to all vars.
 
bool operator< (const AxisVals &b) const
 Compares time value. Used by the sort routine.
 
void print (const char *prefix, std::ostream &o) const
 Print values out.
 
fdk::Mat4d parentTransform () const
 
fdk::Mat4d localTransform () const
 
fdk::Vec3d totalScaling () const
 Get the total scaling factor as a Vec3 (scaling * uniform_scale.)
 
void setToDefault (const fdk::TimeValue &_time=fdk::defaultTimeValue())
 Assigns standard default values to all params.
 
void setLocalXformValsToDefault ()
 Assigns standard default values to transform params (rotate, scale, etc.)
 
void setParentXformValsToDefault ()
 
bool isLocalXformValsDefault () const
 Return true if xform vals are at default settings.
 
bool isParentXformValsDefault () const
 
void enableParentXformVals (bool enable=true)
 Enable the parent knobs so that they are stored and sampled.
 
bool extractFromMatrix (const fdk::Mat4d &m, bool T_enable, bool R_enable, bool S_enable, fdk::RotateOrder decompose_rot_order, bool apply_to_parent=false)
 

Static Public Member Functions

static void applyEulerFilter (fdk::RotateOrder target_rot_order, AxisValsArray &vals, bool sort=false)
 

Public Attributes

fdk::TimeValue time
 Sample time.
 
bool parent_enable
 Are parent transform values being used?
 
fdk::Vec3d parentT
 Parent xform translation.
 
fdk::Vec3d parentR
 Parent xform rotation angles in degrees (always XYZ order)
 
fdk::Vec3d parentS
 Parent xform scale.
 
fdk::XformOrder xform_order
 (matches the Axis_KnobI enums)
 
fdk::RotateOrder rot_order
 (matches the Axis_KnobI enums)
 
fdk::Vec3d translate
 Local xform translation.
 
fdk::Vec3d rotate
 Local xform rotation angles in degrees
 
fdk::Vec3d scaling
 Local xform scale factor.
 
double uniform_scale
 Local xform scalar value multiplied with scaling vector.
 
fdk::Vec3d skew
 Local xform skew/shear.
 
fdk::Vec3d pivotT
 Local xform pivot translation (the location of the rotation/scale/shear center)
 
fdk::Vec3d pivotR
 Local xform pivot rotation angles in degrees (always XYZ order)
 
bool use_matrix
 Ignore separate transform params, use an explicit matrix.
 
fdk::Mat4d matrix
 If use_matrix is true this defines the local xform.
 

Detailed Description

Encapsulates all the parameters in an Axis_Knob so they can be considered as a set and processed as arrays of coherent values.

Member Function Documentation

Mat4d AxisVals::parentTransform ( ) const

Build a matrix from the current parent TRS values. Transform order is always SRT and rotation order is always XYZ.

References parent_enable, parentR, parentS, and parentT.

Mat4d AxisVals::localTransform ( ) const

Build a matrix from the current local TRS values - unless use_matrix is true, then the matrix var is returned. xform_order and rot_order control the composition sequence.

References matrix, pivotR, pivotT, rot_order, rotate, skew, totalScaling(), translate, use_matrix, and xform_order.

bool AxisVals::extractFromMatrix ( const fdk::Mat4d &  m,
bool  T_enable,
bool  R_enable,
bool  S_enable,
fdk::RotateOrder  decompose_rot_order,
bool  apply_to_parent = false 
)

Decompose the matrix into TRS values, targeting either the local or parent TRS params. If a TRS enable is false the respective param is set to its default value. Targeting the parent TRS will also turn on parent_enable.

References enableParentXformVals(), parentR, parentS, parentT, rotate, scaling, setLocalXformValsToDefault(), skew, and translate.

Referenced by DD::Image::AxisOp::importScenePrim().

void AxisVals::applyEulerFilter ( fdk::RotateOrder  target_rot_order,
AxisValsArray &  vals,
bool  sort = false 
)
static

Apply an euler filter to the local and parent rotations in the array of AxisVals. This is typically needed after matrix decomposition of a series of animated matrix keyframes.

target_rot_order specifies the preferred rotation order for the filter to use on the entire series, usually taken from rot_order of the first AxisVal.

If sort is true the vals array is first sorted by time, then filtered.

References parent_enable.

Referenced by DD::Image::AxisOp::importScenePrim().



©2024 The Foundry Visionmongers, Ltd. All Rights Reserved.
www.foundry.com