All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
bakeSkinning.h
1 //
2 // Copyright 2016 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 USDSKEL_BAKESKINNING_H
25 #define USDSKEL_BAKESKINNING_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/usd/usdSkel/api.h"
29 
30 #include "pxr/base/gf/interval.h"
31 #include "pxr/base/vt/array.h"
32 #include "pxr/base/vt/types.h"
33 
34 #include "pxr/usd/sdf/layer.h"
35 #include "pxr/usd/usdSkel/binding.h"
36 
37 #include <vector>
38 
39 PXR_NAMESPACE_OPEN_SCOPE
40 
41 class UsdPrimRange;
42 class UsdSkelCache;
43 class UsdSkelRoot;
44 
47 {
50  DeformPointsWithLBS = 1 << 0,
51  DeformNormalsWithLBS = 1 << 1,
52  DeformXformWithLBS = 1 << 2,
53  DeformPointsWithBlendShapes = 1 << 3,
54  DeformNormalsWithBlendShapes = 1 << 4,
55  DeformWithLBS = (DeformPointsWithLBS|
56  DeformNormalsWithLBS|
57  DeformXformWithLBS),
58  DeformWithBlendShapes = (DeformPointsWithBlendShapes|
59  DeformNormalsWithBlendShapes),
60  DeformAll = DeformWithLBS|DeformWithBlendShapes,
63  ModifiesPoints = DeformPointsWithLBS|DeformPointsWithBlendShapes,
64  ModifiesNormals = DeformNormalsWithLBS|DeformNormalsWithBlendShapes,
65  ModifiesXform = DeformXformWithLBS
66  };
67 
69  int deformationFlags = DeformAll;
70 
74  bool saveLayers = true;
75 
84  size_t memoryLimit = 0;
85 
90  bool updateExtents = true;
91 
95  bool updateExtentHints = true;
96 
98  std::vector<UsdSkelBinding> bindings;
99 
109  std::vector<SdfLayerHandle> layers;
110 
115  VtUIntArray layerIndices;
116 };
117 
118 
136 USDSKEL_API
137 bool
138 UsdSkelBakeSkinning(const UsdSkelCache& skelCache,
139  const UsdSkelBakeSkinningParms& parms,
140  const GfInterval& interval=GfInterval::GetFullInterval());
141 
142 
148 USDSKEL_API
149 bool
150 UsdSkelBakeSkinning(const UsdSkelRoot& root,
151  const GfInterval& interval=GfInterval::GetFullInterval());
152 
153 
159 USDSKEL_API
160 bool
161 UsdSkelBakeSkinning(const UsdPrimRange& range,
162  const GfInterval& interval=GfInterval::GetFullInterval());
163 
164 
165 PXR_NAMESPACE_CLOSE_SCOPE
166 
167 
168 #endif // USDSKEL_BAKESKINNING_H
Thread-safe cache for accessing query objects for evaluating skeletal data.
Definition: cache.h:58
std::vector< UsdSkelBinding > bindings
The set of bindings to bake.
Definition: bakeSkinning.h:98
bool updateExtents
If true, extents of UsdGeomPointBased-derived prims are updated as new skinned values are produced...
Definition: bakeSkinning.h:90
Parameters for configuring UsdSkelBakeSkinning.
Definition: bakeSkinning.h:46
Flags indicating which components of skinned prims may be modified, based on the active deformations...
Definition: bakeSkinning.h:63
DeformationFlags
Flags for identifying different deformation paths.
Definition: bakeSkinning.h:49
int deformationFlags
Flags determining which deformation paths are enabled.
Definition: bakeSkinning.h:69
A basic mathematical interval class.
Definition: interval.h:50
static GfInterval GetFullInterval()
Returns the full interval (-inf, inf).
Definition: interval.h:346
bool updateExtentHints
If true, extents hints of models that already stored an extentsHint are updated to reflect skinning c...
Definition: bakeSkinning.h:95
std::vector< SdfLayerHandle > layers
Data layers being written to.
Definition: bakeSkinning.h:109
size_t memoryLimit
Memory limit for pending stage writes, given in bytes.
Definition: bakeSkinning.h:84
bool saveLayers
Determines whether or not layers are saved during skinning.
Definition: bakeSkinning.h:74
Boundable prim type used to identify a scope beneath which skeletally-posed primitives are defined...
Definition: root.h:63
An forward-iterable range that traverses a subtree of prims rooted at a given prim in depth-first ord...
Definition: primRange.h:118
VtUIntArray layerIndices
Array providing an index per elem in bindings, indicating which layer the skinned result of the bindi...
Definition: bakeSkinning.h:115