All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_usdunpack.h
1 //
2 // Copyright 2017 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef __GUSD_SOP_USDUNPACK_H__
25 #define __GUSD_SOP_USDUNPACK_H__
26 
27 #include <PRM/PRM_Template.h>
28 #include <SOP/SOP_Node.h>
29 
30 #include "gusd/defaultArray.h"
31 #include "gusd/purpose.h"
32 #include "gusd/USD_Traverse.h"
33 
34 #include <pxr/pxr.h>
35 #include "pxr/usd/usd/prim.h"
36 
37 PXR_NAMESPACE_OPEN_SCOPE
38 
39 class GusdUSD_Traverse;
40 
41 
42 class GusdSOP_usdunpack : public SOP_Node
43 {
44 public:
45  static OP_Node* Create(OP_Network* net,
46  const char* name,
47  OP_Operator* op);
48 
49  void UpdateTraversalParms();
50 
51 protected:
52  GusdSOP_usdunpack(OP_Network* net, const char* name, OP_Operator* op);
53 
54  virtual ~GusdSOP_usdunpack() {}
55 
56  virtual OP_ERROR cookMySop(OP_Context& ctx);
57 
58  virtual OP_ERROR cookInputGroups(OP_Context& ctx, int alone);
59 
60  OP_ERROR _Cook(OP_Context& ctx);
61 
62  bool _Traverse(const UT_String& traversal,
63  const fpreal time,
64  const UT_Array<UsdPrim>& prims,
65  const GusdDefaultArray<UsdTimeCode>& times,
66  const GusdDefaultArray<GusdPurposeSet>& purposes,
67  bool skipRoot,
68  UT_Array<GusdUSD_Traverse::PrimIndexPair>& traversed);
69 
70 
73  void _AddTraversalParmDependencies();
74 
75  virtual void finishedLoadingNetwork(bool isChildCall);
76 
77 private:
78  UT_Array<PRM_Template> _templates;
79  PRM_Default _tabs[2];
80  const GA_Group* _group;
81 
82 public:
83  static void Register(OP_OperatorTable* table);
84 };
85 
86 PXR_NAMESPACE_CLOSE_SCOPE
87 
88 #endif // __GUSD_SOP_USDUNPACK_H__
Base class for custom stage traversal.
Definition: USD_Traverse.h:57
Methods for USD scene traversal.