All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
translatorMesh.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 
26 
27 #ifndef PXRUSDMAYA_TRANSLATOR_MESH_H
28 #define PXRUSDMAYA_TRANSLATOR_MESH_H
29 
30 #include "usdMaya/api.h"
31 
32 #include "usdMaya/primReaderArgs.h"
34 
35 #include "pxr/pxr.h"
36 
37 #include "pxr/usd/usdGeom/mesh.h"
38 #include "pxr/usd/usdGeom/primvar.h"
39 
40 #include <maya/MFnMesh.h>
41 #include <maya/MObject.h>
42 
43 
44 PXR_NAMESPACE_OPEN_SCOPE
45 
46 
50 {
51  public:
53  PXRUSDMAYA_API
54  static bool Create(
55  const UsdGeomMesh& mesh,
56  MObject parentNode,
57  const UsdMayaPrimReaderArgs& args,
58  UsdMayaPrimReaderContext* context);
59 
60  private:
61  static bool _AssignSubDivTagsToMesh(
62  const UsdGeomMesh& primSchema,
63  MObject& meshObj,
64  MFnMesh& meshFn);
65 
66  static bool _AssignUVSetPrimvarToMesh(
67  const UsdGeomPrimvar& primvar,
68  MFnMesh& meshFn);
69 
70  static bool _AssignColorSetPrimvarToMesh(
71  const UsdGeomMesh& primSchema,
72  const UsdGeomPrimvar& primvar,
73  MFnMesh& meshFn);
74 
75  static bool _AssignConstantPrimvarToMesh(
76  const UsdGeomPrimvar& primvar,
77  MFnMesh& meshFn);
78 };
79 
80 
81 PXR_NAMESPACE_CLOSE_SCOPE
82 
83 
84 #endif
This class holds read-only arguments that are passed into reader plugins for the usdMaya library...
Provides helper functions for translating UsdGeomMesh prims into Maya meshes.
Schema wrapper for UsdAttribute for authoring and introspecting attributes that are primvars...
Definition: primvar.h:260
Encodes a mesh surface whose definition and feature-set will converge with that of OpenSubdiv...
Definition: mesh.h:86
This class provides an interface for reader plugins to communicate state back to the core usd maya lo...
static PXRUSDMAYA_API bool Create(const UsdGeomMesh &mesh, MObject parentNode, const UsdMayaPrimReaderArgs &args, UsdMayaPrimReaderContext *context)
Creates an MFnMesh under parentNode from mesh.