AL_USDMaya  0.29.4
USD to Maya Bridge
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ImportTranslator.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/maya/utils/FileTranslatorBase.h"
21 #include "AL/usdmaya/fileio/ImportParams.h"
22 
23 namespace AL {
24 namespace usdmaya {
25 namespace fileio {
26 
27 //----------------------------------------------------------------------------------------------------------------------
30 //----------------------------------------------------------------------------------------------------------------------
31 AL_MAYA_TRANSLATOR_BEGIN(ImportTranslator, "AL usdmaya import", true, false, "*.usda", "*.usdc;*.usda;*.usd;*.usdt");
32 
36 
39 
42 
43  // specify the option names (These will uniquely identify the exporter options)
44  static constexpr const char* const kParentPath = "Parent Path";
45  static constexpr const char* const kMeshes = "Import Meshes";
46  static constexpr const char* const kNurbsCurves = "Import Curves";
47  static constexpr const char* const kAnimations = "Import Animations";
48  static constexpr const char* const kDynamicAttributes = "Import Dynamic Attributes";
49  static constexpr const char* const kStageUnload = "Load None";
50  static constexpr const char* const kReadDefaultValues = "Read Default Values";
51 
55  static MStatus specifyOptions(AL::maya::utils::FileTranslatorOptions& options)
56  {
57  if(!options.addFrame("AL USD Importer Options")) return MS::kFailure;
58  if(!options.addString(kParentPath, "")) return MS::kFailure;
59  if(!options.addBool(kMeshes, true)) return MS::kFailure;
60  if(!options.addBool(kNurbsCurves, true)) return MS::kFailure;
61  if(!options.addBool(kAnimations, true)) return MS::kFailure;
62  if(!options.addBool(kDynamicAttributes, true)) return MS::kFailure;
63  if(!options.addBool(kStageUnload, false)) return MS::kFailure;
64  if(!options.addBool(kReadDefaultValues, true)) return MS::kFailure;
65  return MS::kSuccess;
66  }
67 
68 private:
69  AL_USDMAYA_PUBLIC
70  MStatus reader(const MFileObject& file, const AL::maya::utils::OptionsParser& options, FileAccessMode mode) override;
71  ImporterParams m_params;
72 
73 AL_MAYA_TRANSLATOR_END();
74 
75 //----------------------------------------------------------------------------------------------------------------------
76 } // fileio
77 } // usdmaya
78 } // AL
79 //----------------------------------------------------------------------------------------------------------------------
80 
AL_MAYA_TRANSLATOR_BEGIN(ImportTranslator,"AL usdmaya import", true, false,"*.usda","*.usdc;*.usda;*.usd;*.usdt")
A USD importer into Maya (partially supporting Animal Logic specific things)