AL_USDMaya  0.29.4
USD to Maya Bridge
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SchemaPrims.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/fileio/translators/TranslatorBase.h"
18 #include "AL/usdmaya/fileio/translators/TranslatorContext.h"
19 
20 #include "pxr/pxr.h"
21 #include <pxr/base/tf/token.h>
22 
23 #include <unordered_set>
24 #include <string>
25 #include "AL/maya/utils/ForwardDeclares.h"
26 #include "AL/usd/utils/ForwardDeclares.h"
27 
28 PXR_NAMESPACE_USING_DIRECTIVE
29 
30 namespace AL {
31 namespace usdmaya {
32 namespace fileio {
33 
35 extern const TfToken ALSchemaType;
36 extern const TfToken ALExcludedPrimSchema;
37 
38 //----------------------------------------------------------------------------------------------------------------------
48 //----------------------------------------------------------------------------------------------------------------------
49 bool importSchemaPrim(
50  const UsdPrim& usdPrim,
51  MObject& parent,
52  MObject& created,
53  translators::TranslatorContextPtr context = TfNullPtr,
54  const translators::TranslatorRefPtr translator = TfNullPtr,
55  const fileio::translators::TranslatorParameters& param = fileio::translators::TranslatorParameters());
56 
57 //----------------------------------------------------------------------------------------------------------------------
63 //----------------------------------------------------------------------------------------------------------------------
64 bool isSchemaOfType(const UsdPrim& prim, const TfToken& typeToken);
65 
66 //----------------------------------------------------------------------------------------------------------------------
69 //----------------------------------------------------------------------------------------------------------------------
71 {
72 public:
73 
77 
81  fileio::translators::TranslatorRefPtr isSchemaPrim(const UsdPrim& prim);
82 
86  bool needsTransformParent(const UsdPrim& prim);
87 
88 private:
90  //std::unordered_set<std::string> m_nonTransformParentTypes;
91 };
92 
93 
94 //----------------------------------------------------------------------------------------------------------------------
95 } // fileio
96 } // usdmaya
97 } // AL
98 //----------------------------------------------------------------------------------------------------------------------
fileio::translators::TranslatorRefPtr isSchemaPrim(const UsdPrim &prim)
utility function to determine if a prim is one of our custom schema prims
SchemaPrimsUtils(fileio::translators::TranslatorManufacture &manufacture)
ctor
utility class to determine whether a usd transform chain should be created
Definition: SchemaPrims.h:70
bool isSchemaOfType(const UsdPrim &prim, const TfToken &typeToken)
utility function to determine whether the prim specified is of the given type
Forms a registry of all plug-in translator types registered.
Definition: TranslatorBase.h:246
bool importSchemaPrim(const UsdPrim &usdPrim, MObject &parent, MObject &created, translators::TranslatorContextPtr context=TfNullPtr, const translators::TranslatorRefPtr translator=TfNullPtr, const fileio::translators::TranslatorParameters &param=fileio::translators::TranslatorParameters())
a method called to import a schema prim into maya
bool needsTransformParent(const UsdPrim &prim)
returns true if the prim specified requires a transform when importing custom nodes into the maya sce...