All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
agentUtils.h File Reference

Utilities for translating agents to/from USD. More...

+ Include dependency graph for agentUtils.h:

Go to the source code of this file.

Functions

GUSD_API GU_AgentRigPtr GusdCreateAgentRig (const char *name, const UsdSkelSkeletonQuery &skelQuery)
 Create an agent rig from a skelQuery. More...
 
GUSD_API GU_AgentRigPtr GusdCreateAgentRig (const char *name, const UsdSkelTopology &topology, const VtTokenArray &jointNames)
 Create an agent rig from topology and jointNames. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Detailed Description

Utilities for translating agents to/from USD.

These do not provide complete, automatic conversion to/from USD at this stage. Rather, these utilities may be used to build out a conversion pipeline, such as generating all of the various JSON files needed to build out the components of GU_Agent primitives.

Definition in file agentUtils.h.

Function Documentation

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.

The sev defines the error severity when reading in each shape. If the severity is less than UT_ERROR_ABORT, the invalid shape is skipped. Otherwise, creation of the coalesced detail fails if errors are produced processing any shapes.

GUSD_API GU_AgentRigPtr GusdCreateAgentRig ( const char *  name,
const UsdSkelSkeletonQuery skelQuery 
)

Create an agent rig from a skelQuery.

GUSD_API GU_AgentRigPtr GusdCreateAgentRig ( const char *  name,
const UsdSkelTopology topology,
const VtTokenArray &  jointNames 
)

Create an agent rig from topology and jointNames.

Each joint name must be unique.

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.

The sev defines the error severity when reading in each shape. If the severity is less than UT_ERROR_ABORT, the invalid shape is skipped. Otherwise, creation of the shape lib fails if errors are produced processing any shapes.

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.

The jointNames array provides the names of the joints of the bound Skeleton, using the ordering specified on the Skeleton. The invBindTransforms array holds the inverse of the Skeleton's bind transforms. Errors encountered while reading the skinnable primitive are reported with a severity of sev.

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.

The sev defines the error severity when reading in each shape. If the severity is less than UT_ERROR_ABORT, invalid shapes are skipped, and an empty detail handle is stored in details for the corresponding shape. Otherwise, the process returns false if errors are encountered processing any shapes.