24 #ifndef PXRUSDTRANSLATORS_MESH_WRITER_H
25 #define PXRUSDTRANSLATORS_MESH_WRITER_H
34 #include "pxr/base/gf/vec2f.h"
35 #include "pxr/base/gf/vec3f.h"
36 #include "pxr/base/gf/vec4f.h"
37 #include "pxr/base/tf/token.h"
38 #include "pxr/base/vt/array.h"
39 #include "pxr/usd/sdf/path.h"
40 #include "pxr/usd/usd/timeCode.h"
41 #include "pxr/usd/usdGeom/gprim.h"
42 #include "pxr/usd/usdGeom/mesh.h"
43 #include "pxr/usd/usdGeom/primvar.h"
45 #include <maya/MFnDependencyNode.h>
46 #include <maya/MFnMesh.h>
47 #include <maya/MString.h>
53 PXR_NAMESPACE_OPEN_SCOPE
62 const MFnDependencyNode& depNodeFn,
76 void assignSubDivTagsToUSDPrim(MFnMesh& meshFn,
UsdGeomMesh& primSchema);
89 bool _GetMeshUVSetData(
90 const MObject& meshObj,
91 const MString& uvSetName,
96 bool _GetMeshColorSetData(
97 const MObject& meshObj,
98 const MString& colorSet,
107 MFnMesh::MColorRepresentation* colorSetRep,
110 bool _createAlphaPrimVar(
119 bool _createRGBPrimVar(
128 bool _createRGBAPrimVar(
138 bool _createUVPrimVar(
149 bool _addDisplayPrimvars(
152 const MFnMesh::MColorRepresentation colorRep,
158 const bool authored);
175 const VtIntArray& indices,
181 void _CleanupPrimvars();
187 bool _IsMeshAnimated()
const;
191 static const GfVec2f _DefaultUV;
195 static const GfVec3f _ShaderDefaultRGB;
196 static const float _ShaderDefaultAlpha;
200 static const GfVec3f _ColorSetDefaultRGB;
201 static const float _ColorSetDefaultAlpha;
202 static const GfVec4f _ColorSetDefaultRGBA;
205 MObject _skelInputMesh;
209 std::set<std::string> _excludeColorSets;
213 PXR_NAMESPACE_CLOSE_SCOPE
Provides basic functionality and access to shared data for UsdMayaPrimWriters.
Exports Maya mesh objects (MFnMesh)as UsdGeomMesh prims, taking into account subd/poly, skinning, reference objects, UVs, and color sets.
Basic type for a vector of 3 float components.
void PostExport() override
Post export function that runs before saving the stage.
Token for efficient comparison, assignment, and hashing of known strings.
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
A path value used to locate objects in layers or scenegraphs.
Basic type for a vector of 4 float components.
void Write(const UsdTimeCode &usdTime) override
Main export function that runs when the traversal hits the node.
Base class for all geometric primitives.
Basic type for a vector of 2 float components.
Schema wrapper for UsdAttribute for authoring and introspecting attributes that are primvars...
Base class for all built-in and user-defined prim writers.
Encodes a mesh surface whose definition and feature-set will converge with that of OpenSubdiv...
Provides a container which may hold any type, and provides introspection and iteration over array typ...
bool ExportsGprims() const override
Whether this prim writer directly create one or more gprims on the current model on the USD stage...