All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cache.h
Go to the documentation of this file.
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_CACHE_H
25 #define USDSKEL_CACHE_H
26 
28 
29 #include "pxr/pxr.h"
30 #include "pxr/usd/usdSkel/api.h"
31 
32 #include "pxr/usd/usd/prim.h"
33 
34 #include "pxr/usd/usdSkel/animQuery.h"
35 #include "pxr/usd/usdSkel/binding.h"
36 
37 #include <memory>
38 
39 
40 PXR_NAMESPACE_OPEN_SCOPE
41 
42 
43 class UsdSkelRoot;
44 class UsdSkelAnimation;
45 class UsdSkelSkeleton;
48 
50 
51 
59 {
60 public:
61  USDSKEL_API
62  UsdSkelCache();
63 
64  USDSKEL_API
65  void Clear();
66 
68  USDSKEL_API
69  bool Populate(const UsdSkelRoot& root);
70 
73  USDSKEL_API
75 
78  USDSKEL_API
80 
83  USDSKEL_API
84  UsdSkelAnimQuery GetAnimQuery(const UsdPrim& prim) const;
85 
92  USDSKEL_API
94 
96  USDSKEL_API
97  bool ComputeSkelBindings(const UsdSkelRoot& skelRoot,
98  std::vector<UsdSkelBinding>* bindings) const;
99 
102  USDSKEL_API
103  bool ComputeSkelBinding(const UsdSkelRoot& skelRoot,
104  const UsdSkelSkeleton& skel,
105  UsdSkelBinding* binding) const;
106 
107 private:
108  std::shared_ptr<class UsdSkel_CacheImpl> _impl;
109 
110  friend class UsdSkelAnimQuery;
111  friend class UsdSkelSkeletonQuery;
112 };
113 
114 
115 PXR_NAMESPACE_CLOSE_SCOPE
116 
117 #endif // USDSKEL_EVALCACHE_H
Object used for querying resolved bindings for skinning.
Definition: skinningQuery.h:50
Thread-safe cache for accessing query objects for evaluating skeletal data.
Definition: cache.h:58
USDSKEL_API UsdSkelAnimQuery GetAnimQuery(const UsdSkelAnimation &anim) const
Get an anim query corresponding to anim.
Class providing efficient queries of primitives that provide skel animation.
Definition: animQuery.h:54
Describes a skel animation, where joint animation is stored in a vectorized form. ...
Definition: animation.h:62
USDSKEL_API UsdSkelSkinningQuery GetSkinningQuery(const UsdPrim &prim) const
Get a skinning query at prim.
USDSKEL_API UsdSkelSkeletonQuery GetSkelQuery(const UsdSkelSkeleton &skel) const
Get a skel query for computing properties of skel.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a &quot;Prim&quot; as ...
Definition: prim.h:131
USDSKEL_API bool Populate(const UsdSkelRoot &root)
Populate the cache for the skeletal data beneath prim root.
Describes a skeleton.
Definition: skeleton.h:63
Helper object that describes the binding of a skeleton to a set of skinnable objects.
Definition: binding.h:44
Boundable prim type used to identify a scope beneath which skeletally-posed primitives are defined...
Definition: root.h:63
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
Definition: declarePtrs.h:75
Primary interface to reading bound skeleton data.
Definition: skeletonQuery.h:70
USDSKEL_API bool ComputeSkelBindings(const UsdSkelRoot &skelRoot, std::vector< UsdSkelBinding > *bindings) const
Compute the set of skeleton bindings beneath skelRoot.
USDSKEL_API bool ComputeSkelBinding(const UsdSkelRoot &skelRoot, const UsdSkelSkeleton &skel, UsdSkelBinding *binding) const
Compute the bindings corresponding to a single skeleton, bound beneath skelRoot.