AL_USDMaya  0.29.4
USD to Maya Bridge
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
DagNodeTranslator.h
1 //
2 // Copyright 2017 Animal Logic
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.//
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 #pragma once
17 
18 #include "../../Api.h"
19 
20 #include <AL/usdmaya/ForwardDeclares.h>
21 #include "AL/usdmaya/fileio/translators/DgNodeTranslator.h"
22 #include "maya/MObject.h"
23 #include <pxr/base/tf/token.h>
24 
25 namespace AL {
26 namespace usdmaya {
27 namespace fileio {
28 namespace translators {
29 //----------------------------------------------------------------------------------------------------------------------
32 //----------------------------------------------------------------------------------------------------------------------
34  : public DgNodeTranslator
35 {
36 public:
37 
40  AL_USDMAYA_PUBLIC
41  static MStatus registerType();
42 
49  AL_USDMAYA_PUBLIC
50  MObject createNode(const UsdPrim& from, MObject parent, const char* nodeType, const ImporterParams& params) override;
51 
57  AL_USDMAYA_PUBLIC
58  MStatus copyAttributes(const UsdPrim& from, MObject to, const ImporterParams& params);
59 
65  static MStatus copyAttributes(const MObject& from, UsdPrim& to, const ExporterParams& params)
66  { return MS::kSuccess; }
67 
71  AL_USDMAYA_PUBLIC
72  MStatus applyDefaultMaterialOnShape(MObject shape);
73 
74  AL_USDMAYA_PUBLIC
75  static void initialiseDefaultShadingGroup(MObject& target);
76 
77 protected:
80  static MObject m_initialShadingGroup;
81 
83  static MObject m_visible;
84 
85 
86 };
87 
88 //----------------------------------------------------------------------------------------------------------------------
89 } // translators
90 } // fileio
91 } // usdmaya
92 } // AL
93 //----------------------------------------------------------------------------------------------------------------------
A class to transfer dag node data between Usd <–> Maya.
Definition: DagNodeTranslator.h:33
AL_USDMAYA_PUBLIC MStatus copyAttributes(const UsdPrim &from, MObject to, const ImporterParams &params)
helper method to copy attributes from the UsdPrim to the Maya node
parameters for the exporter. These parameters are constructed by any command or file translator that ...
Definition: ExportParams.h:35
parameters for the importer
Definition: ImportParams.h:40
static MObject m_initialShadingGroup
Definition: DagNodeTranslator.h:80
static AL_USDMAYA_PUBLIC MStatus registerType()
static type registration
AL_USDMAYA_PUBLIC 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. ...
static MObject m_visible
the visibility attribute common to all dag nodes
Definition: DagNodeTranslator.h:83
static MStatus copyAttributes(const MObject &from, UsdPrim &to, const ExporterParams &params)
Copies data from the maya node onto the usd primitive.
Definition: DagNodeTranslator.h:65
AL_USDMAYA_PUBLIC MStatus applyDefaultMaterialOnShape(MObject shape)
assign the default material to the shape specified
Utility class that transfers DgNodes between Maya and USD.
Definition: DgNodeTranslator.h:48