AL_USDMaya  0.29.4
USD to Maya Bridge
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
NodeFactory.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 #include <AL/usdmaya/ForwardDeclares.h>
18 #include <string>
19 #include <unordered_map>
20 #include "AL/maya/utils/ForwardDeclares.h"
21 #include "AL/usd/utils/ForwardDeclares.h"
22 
23 PXR_NAMESPACE_USING_DIRECTIVE
24 
25 namespace AL {
26 namespace usdmaya {
27 namespace fileio {
28 
29 //----------------------------------------------------------------------------------------------------------------------
33 //----------------------------------------------------------------------------------------------------------------------
35 {
37  NodeFactory();
38 
40  ~NodeFactory();
41 
48  MObject createNode(const UsdPrim& from, const char* const nodeType, MObject parent, bool parentUnmerged = false);
49 
50  static void setupNode(const UsdPrim& from, MObject obj, MObject parent, bool parentUnmerged);
51 
55  void setImportParams(const ImporterParams* params)
56  { m_params = params; }
57 
58 private:
59  std::unordered_map<std::string, translators::DgNodeTranslator*> m_builders;
60  const ImporterParams* m_params;
61 };
62 
63 //----------------------------------------------------------------------------------------------------------------------
66 //----------------------------------------------------------------------------------------------------------------------
67 NodeFactory& getNodeFactory();
68 
69 //----------------------------------------------------------------------------------------------------------------------
71 //----------------------------------------------------------------------------------------------------------------------
72 void freeNodeFactory();
73 
74 //----------------------------------------------------------------------------------------------------------------------
75 } // fileio
76 } // usdmaya
77 } // AL
78 //----------------------------------------------------------------------------------------------------------------------
parameters for the importer
Definition: ImportParams.h:40
MObject createNode(const UsdPrim &from, const char *const nodeType, MObject parent, bool parentUnmerged=false)
create a node
A simple node factory to convert nodes between Maya and USD.
Definition: NodeFactory.h:34
void setImportParams(const ImporterParams *params)
Some of the translators rely on import settings specified in the import params. Prior to use of this ...
Definition: NodeFactory.h:55
NodeFactory()
ctor. Currently initialises the inbuilt translators.