All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
agentUtils.h
Go to the documentation of this file.
1 //
2 // Copyright 2019 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_AGENTUTILS_H
25 #define GUSD_AGENTUTILS_H
26 
36 
37 #include "api.h"
38 #include "purpose.h"
39 
40 #include "pxr/base/vt/array.h"
41 #include "pxr/usd/usd/timeCode.h"
42 
43 #include <GU/GU_AgentDefinition.h>
44 #include <GU/GU_AgentLayer.h>
45 #include <GU/GU_AgentRig.h>
46 #include <GU/GU_AgentShapeLib.h>
47 #include <UT/UT_StringArray.h>
48 
49 
50 PXR_NAMESPACE_OPEN_SCOPE
51 
52 
53 class GT_RefineParms;
54 class UsdSkelBinding;
55 class UsdSkelSkeleton;
58 class UsdSkelTopology;
59 
60 
62 GUSD_API GU_AgentRigPtr
63 GusdCreateAgentRig(const char* name, const UsdSkelSkeletonQuery& skelQuery);
64 
65 
68 GUSD_API GU_AgentRigPtr
69 GusdCreateAgentRig(const char* name,
70  const UsdSkelTopology& topology,
71  const VtTokenArray& jointNames);
72 
73 
80 GUSD_API GU_AgentShapeLibPtr
83  const char* lod=nullptr,
84  GusdPurposeSet purpose=GusdPurposeSet(
85  GUSD_PURPOSE_DEFAULT|GUSD_PURPOSE_PROXY),
86  UT_ErrorSeverity sev=UT_ERROR_WARNING,
87  const GT_RefineParms* refineParms=nullptr);
88 
89 
95 GUSD_API bool
96 GusdCoalesceAgentShapes(GEO_Detail& gd,
97  const UsdSkelBinding& binding,
99  const char* lod=nullptr,
100  GusdPurposeSet purpose=GusdPurposeSet(
101  GUSD_PURPOSE_DEFAULT|GUSD_PURPOSE_PROXY),
102  UT_ErrorSeverity sev=UT_ERROR_WARNING,
103  const GT_RefineParms* refineParms=nullptr);
104 
105 
113 GUSD_API bool
114 GusdReadSkinnablePrim(GU_Detail& gd,
115  const UsdSkelSkinningQuery& skinningQuery,
116  const VtTokenArray& jointNames,
117  const VtMatrix4dArray& invBindTransforms,
119  const char* lod=nullptr,
120  GusdPurposeSet purpose=GusdPurposeSet(
121  GUSD_PURPOSE_DEFAULT|GUSD_PURPOSE_PROXY),
122  UT_ErrorSeverity sev=UT_ERROR_ABORT,
123  const GT_RefineParms* refineParms=nullptr);
124 
125 
132 bool
134  UT_Array<GU_DetailHandle>& details,
136  const char* lod=nullptr,
137  GusdPurposeSet purpose=GusdPurposeSet(
138  GUSD_PURPOSE_DEFAULT|GUSD_PURPOSE_PROXY),
139  UT_ErrorSeverity sev=UT_ERROR_WARNING,
140  const GT_RefineParms* refineParms=nullptr);
141 
142 
143 PXR_NAMESPACE_CLOSE_SCOPE
144 
145 #endif // GUSD_AGENTUTILS_H
Object used for querying resolved bindings for skinning.
Definition: skinningQuery.h:50
GUSD_API GU_AgentRigPtr GusdCreateAgentRig(const char *name, const UsdSkelSkeletonQuery &skelQuery)
Create an agent rig from a skelQuery.
static constexpr UsdTimeCode EarliestTime()
Produce a UsdTimeCode representing the lowest/earliest possible timeCode.
Definition: timeCode.h:102
Object holding information describing skeleton topology.
Definition: topology.h:45
GUSD_API bool GusdCoalesceAgentShapes(GEO_Detail &gd, const UsdSkelBinding &binding, UsdTimeCode time=UsdTimeCode::EarliestTime(), const char *lod=nullptr, GusdPurposeSet purpose=GusdPurposeSet(GUSD_PURPOSE_DEFAULT|GUSD_PURPOSE_PROXY), UT_ErrorSeverity sev=UT_ERROR_WARNING, const GT_RefineParms *refineParms=nullptr)
Read in all skinnable shapes for binding, coalescing them into gd.
bool GusdReadSkinnablePrims(const UsdSkelBinding &binding, UT_Array< GU_DetailHandle > &details, UsdTimeCode time=UsdTimeCode::EarliestTime(), const char *lod=nullptr, GusdPurposeSet purpose=GusdPurposeSet(GUSD_PURPOSE_DEFAULT|GUSD_PURPOSE_PROXY), UT_ErrorSeverity sev=UT_ERROR_WARNING, const GT_RefineParms *refineParms=nullptr)
Read shapes for each shape in binding.
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
Definition: timeCode.h:85
Describes a skeleton.
Definition: skeleton.h:63
GUSD_API bool GusdReadSkinnablePrim(GU_Detail &gd, const UsdSkelSkinningQuery &skinningQuery, const VtTokenArray &jointNames, const VtMatrix4dArray &invBindTransforms, UsdTimeCode time=UsdTimeCode::EarliestTime(), const char *lod=nullptr, GusdPurposeSet purpose=GusdPurposeSet(GUSD_PURPOSE_DEFAULT|GUSD_PURPOSE_PROXY), UT_ErrorSeverity sev=UT_ERROR_ABORT, const GT_RefineParms *refineParms=nullptr)
Read in a skinnable prim given by skinningQuery into gd.
Helper object that describes the binding of a skeleton to a set of skinnable objects.
Definition: binding.h:44
Primary interface to reading bound skeleton data.
Definition: skeletonQuery.h:70
GUSD_API GU_AgentShapeLibPtr GusdCreateAgentShapeLib(const UsdSkelBinding &binding, UsdTimeCode time=UsdTimeCode::EarliestTime(), const char *lod=nullptr, GusdPurposeSet purpose=GusdPurposeSet(GUSD_PURPOSE_DEFAULT|GUSD_PURPOSE_PROXY), UT_ErrorSeverity sev=UT_ERROR_WARNING, const GT_RefineParms *refineParms=nullptr)
Create a shape library where every skinning target of binding is a separate shape.