AL_USDMaya  0.16.6
USD to Maya Bridge
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ExportTranslator.h
1 #pragma once
3 
4 namespace AL {
5 namespace usdmaya {
6 namespace fileio {
7 
8 //----------------------------------------------------------------------------------------------------------------------
12 //----------------------------------------------------------------------------------------------------------------------
13 AL_MAYA_TRANSLATOR_BEGIN(ExportTranslator, "AL usdmaya export", false, true, "*.usda", "*.usdc;*.usda;*.usd;*.usdt");
14 
18 
21 
24 
25  // specify the option names (These will uniquely identify the exporter options)
26  static constexpr const char* const kDynamicAttributes = "Dynamic Attributes";
27  static constexpr const char* const kMeshes = "Meshes";
28  static constexpr const char* const kNurbsCurves = "Nurbs Curves";
29  static constexpr const char* const kDuplicateInstances = "Duplicate Instances";
30  static constexpr const char* const kUseAnimalSchema = "Use Animal Schema";
31  static constexpr const char* const kMergeTransforms = "Merge Transforms";
32  static constexpr const char* const kAnimation = "Animation";
33  static constexpr const char* const kUseTimelineRange = "Use Timeline Range";
34  static constexpr const char* const kFrameMin = "Frame Min";
35  static constexpr const char* const kFrameMax = "Frame Max";
36 
40  static MStatus specifyOptions(maya::FileTranslatorOptions& options)
41  {
42  if(!options.addFrame("AL USD Exporter Options")) return MS::kFailure;
43  if(!options.addBool(kDynamicAttributes, true)) return MS::kFailure;
44  if(!options.addBool(kMeshes, true)) return MS::kFailure;
45  if(!options.addBool(kNurbsCurves, true)) return MS::kFailure;
46  if(!options.addBool(kDuplicateInstances, true)) return MS::kFailure;
47  if(!options.addBool(kUseAnimalSchema, true)) return MS::kFailure;
48  if(!options.addBool(kMergeTransforms, true)) return MS::kFailure;
49  if(!options.addBool(kAnimation, true)) return MS::kFailure;
50  if(!options.addBool(kUseTimelineRange, true)) return MS::kFailure;
51  if(!options.addFloat(kFrameMin, 1.0f)) return MS::kFailure;
52  if(!options.addFloat(kFrameMax, 24.0f)) return MS::kFailure;
53  return MS::kSuccess;
54  }
55 
56 private:
57  MStatus writer(const MFileObject& file, const maya::OptionsParser& options, FileAccessMode mode);
58 
60 
61 //----------------------------------------------------------------------------------------------------------------------
62 } // fileio
63 } // usdmaya
64 } // AL
65 //----------------------------------------------------------------------------------------------------------------------
#define AL_MAYA_TRANSLATOR_END()
Macro to wrap some boiler plate creation of a file translator.
Definition: FileTranslatorBase.h:98
#define AL_MAYA_TRANSLATOR_BEGIN(ClassName, TranslatorName, HaveRead, HaveWrite, DefaultExtension, FilterString)
Macro to wrap some boiler plate creation of a file translator.
Definition: FileTranslatorBase.h:84
This file contains a few macros and templates to help automate the tedious boiler plate setup of Maya...