AL_USDMaya  0.16.6
USD to Maya Bridge
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
TransformTranslator.h
1 #pragma once
2 #include "AL/usdmaya/TransformOperation.h"
3 #include "AL/usdmaya/fileio/translators/DagNodeTranslator.h"
4 
5 #include "pxr/usd/usd/attribute.h"
6 #include "pxr/usd/usdGeom/xform.h"
7 #include "pxr/usd/usdGeom/xformCommonAPI.h"
8 
9 #include <vector>
10 
11 namespace AL {
12 namespace usdmaya {
13 namespace fileio {
14 namespace translators {
15 
16 //----------------------------------------------------------------------------------------------------------------------
19 //----------------------------------------------------------------------------------------------------------------------
21  : public DagNodeTranslator
22 {
23 public:
24 
27  static MStatus registerType();
28 
35  MObject createNode(const UsdPrim& from, MObject parent, const char* nodeType, const ImporterParams& params) override;
36 
42  MStatus copyAttributes(const UsdPrim& from, MObject to, const ImporterParams& params);
43 
49  static MStatus copyAttributes(const MObject& from, UsdPrim& to, const ExporterParams& params);
50 
57  static bool getAnimationVariables(TransformOperation operation, MObject& attribute, double& conversionFactor);
58 
59 private:
60  static MStatus processMetaData(const UsdPrim& from, MObject& to, const ImporterParams& params);
61 
62  static MObject m_inheritsTransform;
63  static MObject m_scale;
64  static MObject m_shear;
65  static MObject m_rotation;
66  static MObject m_rotationX;
67  static MObject m_rotationY;
68  static MObject m_rotationZ;
69  static MObject m_rotateOrder;
70  static MObject m_rotateAxis;
71  static MObject m_rotateAxisX;
72  static MObject m_rotateAxisY;
73  static MObject m_rotateAxisZ;
74  static MObject m_translation;
75  static MObject m_scalePivot;
76  static MObject m_rotatePivot;
77  static MObject m_scalePivotTranslate;
78  static MObject m_rotatePivotTranslate;
79  static MObject m_selectHandle;
80  static MObject m_transMinusRotatePivot;
81 };
82 
83 //----------------------------------------------------------------------------------------------------------------------
84 } // translators
85 } // fileio
86 } // usdmaya
87 } // AL
88 //----------------------------------------------------------------------------------------------------------------------
A class to transfer dag node data between Usd <–> Maya.
Definition: DagNodeTranslator.h:14
parameters for the exporter. These parameters are constructed by any command or file translator that ...
Definition: ExportParams.h:17
parameters for the importer
Definition: ImportParams.h:18
MObject createNode(const UsdPrim &from, MObject parent, const char *nodeType, const ImporterParams &params) override
Creates a new maya node of the given type and set attributes based on input prim. ...
A utility class to transfer transform nodes between Maya and USD.
Definition: TransformTranslator.h:20
static bool getAnimationVariables(TransformOperation operation, MObject &attribute, double &conversionFactor)
retrieve the corresponding maya attribute for the transform operation.
MStatus copyAttributes(const UsdPrim &from, MObject to, const ImporterParams &params)
helper method to copy attributes from the UsdPrim to the Maya node
static MStatus registerType()
static type registration
TransformOperation
An enum describing the type of transformation found in a UsdGeomXformOp.
Definition: TransformOperation.h:16