AL_USDMaya  0.29.4
USD to Maya Bridge
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ProxyShapePostLoadProcess.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 "AL/usdmaya/fileio/ImportParams.h"
19 #include "maya/MPxCommand.h"
20 #include "AL/usdmaya/fileio/translators/TranslatorContext.h"
21 
22 #include "pxr/pxr.h"
23 #include "pxr/usd/usd/common.h"
24 
25 PXR_NAMESPACE_USING_DIRECTIVE
26 
27 namespace AL {
28 namespace usdmaya {
29 namespace cmds {
30 
31 //----------------------------------------------------------------------------------------------------------------------
47 //----------------------------------------------------------------------------------------------------------------------
49 {
50 public:
51 
53  typedef std::vector<std::pair<MObject, UsdPrim> > MObjectToPrim;
54 
59  static MStatus initialise(nodes::ProxyShape* shape);
60 
68  nodes::ProxyShape* shape,
69  const std::vector<UsdPrim>& schemaPrims,
70  const MDagPath& proxyTransformPath,
71  MObjectToPrim& objsToCreate);
72 
79  static void createSchemaPrims(
80  nodes::ProxyShape* proxy,
81  const std::vector<UsdPrim>& objsToCreate,
83 
88  static void connectSchemaPrims(
89  nodes::ProxyShape* proxy,
90  const std::vector<UsdPrim>& objsToCreate);
91 
95  static void updateSchemaPrims(
96  nodes::ProxyShape* proxy,
97  const std::vector<UsdPrim>& objsToUpdate);
98 
99 private:
100  static fileio::ImporterParams m_params;
101 };
102 
103 //----------------------------------------------------------------------------------------------------------------------
104 } // cmds
105 } // usdmaya
106 } // AL
107 //----------------------------------------------------------------------------------------------------------------------
static MStatus initialise(nodes::ProxyShape *shape)
called after a proxy shape has been created. Traverses the prim hierarchy and looks to see whether an...
A custom proxy shape node that attaches itself to a USD file, and then renders it. The stage is held internally as a member variable, and it will be composed based on a change to the "filePath" attribute.
Definition: ProxyShape.h:244
parameters for the importer
Definition: ImportParams.h:40
Transient aggregate of values that aims to direct the Translation of Prims. Typically an object of th...
Definition: TranslatorContext.h:54
static void createSchemaPrims(nodes::ProxyShape *proxy, const std::vector< UsdPrim > &objsToCreate, const fileio::translators::TranslatorParameters &param=fileio::translators::TranslatorParameters())
After transforms exist to parent the custom plugin-prim types (i.e. after a call to createTranformCha...
static void connectSchemaPrims(nodes::ProxyShape *proxy, const std::vector< UsdPrim > &objsToCreate)
called once all plugin nodes have been created, and will request that each plugin translator performs...
static void createTranformChainsForSchemaPrims(nodes::ProxyShape *shape, const std::vector< UsdPrim > &schemaPrims, const MDagPath &proxyTransformPath, MObjectToPrim &objsToCreate)
given a specific proxy shape, and a collection of UsdPrims that represent custom DagNode types...
std::vector< std::pair< MObject, UsdPrim > > MObjectToPrim
a mapping from an MObject to a UsdPrim
Definition: ProxyShapePostLoadProcess.h:53
When importing a new usd stage into an AL::usdmaya::nodes::ProxyShape, there are a selection of post ...
Definition: ProxyShapePostLoadProcess.h:48
static void updateSchemaPrims(nodes::ProxyShape *proxy, const std::vector< UsdPrim > &objsToUpdate)
updates the list of UsdPrims after a variant switch (but when the nodes have not changed) ...