20 #include "AL/maya/utils/FileTranslatorBase.h"
44 static constexpr
const char*
const kDynamicAttributes =
"Dynamic Attributes";
45 static constexpr
const char*
const kMeshes =
"Meshes";
46 static constexpr
const char*
const kMeshConnects =
"Mesh Face Connects";
47 static constexpr
const char*
const kMeshPoints =
"Mesh Points";
48 static constexpr
const char*
const kMeshNormals =
"Mesh Normals";
49 static constexpr
const char*
const kMeshVertexCreases =
"Mesh Vertex Creases";
50 static constexpr
const char*
const kMeshEdgeCreases =
"Mesh Edge Creases";
51 static constexpr
const char*
const kMeshUvs =
"Mesh UVs";
52 static constexpr
const char*
const kMeshUvOnly =
"Mesh UV Only";
53 static constexpr
const char*
const kMeshColours =
"Mesh Colours";
54 static constexpr
const char*
const kMeshHoles =
"Mesh Holes";
55 static constexpr
const char*
const kCompactionLevel =
"Compaction Level";
56 static constexpr
const char*
const kNurbsCurves =
"Nurbs Curves";
57 static constexpr
const char*
const kDuplicateInstances =
"Duplicate Instances";
58 static constexpr
const char*
const kMergeTransforms =
"Merge Transforms";
59 static constexpr
const char*
const kAnimation =
"Animation";
60 static constexpr
const char*
const kUseTimelineRange =
"Use Timeline Range";
61 static constexpr
const char*
const kFrameMin =
"Frame Min";
62 static constexpr
const char*
const kFrameMax =
"Frame Max";
63 static constexpr
const char*
const kSubSamples =
"Sub Samples";
64 static constexpr
const char*
const kFilterSample =
"Filter Sample";
65 static constexpr
const char*
const kExportAtWhichTime =
"Export At Which Time";
68 static const char*
const compactionLevels[];
71 static const char*
const timelineLevel[];
76 static MStatus specifyOptions(AL::maya::utils::FileTranslatorOptions& options)
78 ExporterParams defaultValues;
79 if(!options.addFrame(
"AL USD Exporter Options"))
return MS::kFailure;
80 if(!options.addBool(kDynamicAttributes, defaultValues.m_dynamicAttributes))
return MS::kFailure;
81 if(!options.addBool(kMeshes, defaultValues.m_meshes))
return MS::kFailure;
82 if(!options.addBool(kMeshConnects, defaultValues.m_meshConnects))
return MS::kFailure;
83 if(!options.addBool(kMeshPoints, defaultValues.m_meshPoints))
return MS::kFailure;
84 if(!options.addBool(kMeshNormals, defaultValues.m_meshNormals))
return MS::kFailure;
85 if(!options.addBool(kMeshVertexCreases, defaultValues.m_meshVertexCreases))
return MS::kFailure;
86 if(!options.addBool(kMeshEdgeCreases, defaultValues.m_meshEdgeCreases))
return MS::kFailure;
87 if(!options.addBool(kMeshUvs, defaultValues.m_meshUvs))
return MS::kFailure;
88 if(!options.addBool(kMeshUvOnly, defaultValues.m_meshUV))
return MS::kFailure;
89 if(!options.addBool(kMeshColours, defaultValues.m_meshColours))
return MS::kFailure;
90 if(!options.addBool(kMeshHoles, defaultValues.m_meshHoles))
return MS::kFailure;
91 if(!options.addEnum(kCompactionLevel, compactionLevels, defaultValues.m_compactionLevel))
return MS::kFailure;
92 if(!options.addBool(kNurbsCurves, defaultValues.m_nurbsCurves))
return MS::kFailure;
93 if(!options.addBool(kDuplicateInstances, defaultValues.m_duplicateInstances))
return MS::kFailure;
94 if(!options.addBool(kMergeTransforms, defaultValues.m_mergeTransforms))
return MS::kFailure;
95 if(!options.addBool(kAnimation, defaultValues.m_animation))
return MS::kFailure;
96 if(!options.addBool(kUseTimelineRange, defaultValues.m_useTimelineRange))
return MS::kFailure;
97 if(!options.addFloat(kFrameMin, defaultValues.m_minFrame))
return MS::kFailure;
98 if(!options.addFloat(kFrameMax, defaultValues.m_maxFrame))
return MS::kFailure;
99 if(!options.addInt(kSubSamples, defaultValues.m_subSamples))
return MS::kFailure;
100 if(!options.addBool(kFilterSample, defaultValues.m_filterSample))
return MS::kFailure;
101 if(!options.addEnum(kExportAtWhichTime, timelineLevel, defaultValues.m_exportAtWhichTime))
return MS::kFailure;
108 MStatus writer(
const MFileObject& file,
const AL::maya::utils::OptionsParser& options, FileAccessMode mode)
override;
110 AL_MAYA_TRANSLATOR_END();
AL_MAYA_TRANSLATOR_BEGIN(ExportTranslator,"AL usdmaya export", false, true,"usda","*.usdc;*.usda;*.usd;*.usdt")
A Maya export plugin that writes out USD files from Maya (this is largely optimised for the needs of ...