![]() |
|
Go to the source code of this file.
Classes | |
struct | CustomUsdPhysicsTokens |
Token lists for custom physics objects that allow for custom physics objects to be reported by parsing. More... | |
Typedefs | |
using | UsdPhysicsReportFn = std::function< void(UsdPhysicsObjectType type, TfSpan< const SdfPath > primPaths, TfSpan< const UsdPhysicsObjectDesc > objectDescs, const VtValue &userData)> |
UsdPhysicsReportFn - report function that reports parsed data in a batched manner. | |
Functions | |
USDPHYSICS_API bool | LoadUsdPhysicsFromRange (const UsdStageWeakPtr stage, const std::vector< SdfPath > &includePaths, UsdPhysicsReportFn reportFn, const VtValue &userData, const std::vector< SdfPath > *excludePaths=nullptr, const CustomUsdPhysicsTokens *customPhysicsTokens=nullptr, const std::vector< SdfPath > *simulationOwners=nullptr) |
Load USD physics from a given list of paths. | |
struct CustomUsdPhysicsTokens |
Token lists for custom physics objects that allow for custom physics objects to be reported by parsing.
Definition at line 50 of file parseUtils.h.
Class Members | ||
---|---|---|
vector< TfToken > | instancerTokens | Custom physics instancers, these make sure that the subhierarchy is skipped and expected to be parsed individually. |
vector< TfToken > | jointTokens | Custom joints to be reported by parsing. |
vector< TfToken > | shapeTokens | Custom shapes to be reported by parsing. |
using UsdPhysicsReportFn = std::function<void(UsdPhysicsObjectType type, TfSpan<const SdfPath> primPaths, TfSpan<const UsdPhysicsObjectDesc> objectDescs, const VtValue& userData)> |
UsdPhysicsReportFn - report function that reports parsed data in a batched manner.
This function is called after all the parsing is done and all the physics descriptors are constructed.
[in] | type | Type of the parsed physics objects |
[in] | primPaths | Span of prim paths of the reported type |
[in] | objectDescs | Corresponding span of object descriptors of the reported type |
[in] | userData | User data provided to the called parsing function |
Definition at line 39 of file parseUtils.h.
USDPHYSICS_API bool LoadUsdPhysicsFromRange | ( | const UsdStageWeakPtr | stage, |
const std::vector< SdfPath > & | includePaths, | ||
UsdPhysicsReportFn | reportFn, | ||
const VtValue & | userData, | ||
const std::vector< SdfPath > * | excludePaths = nullptr , |
||
const CustomUsdPhysicsTokens * | customPhysicsTokens = nullptr , |
||
const std::vector< SdfPath > * | simulationOwners = nullptr |
||
) |
Load USD physics from a given list of paths.
This helper function traverses the provided USD stage by constructing UsdPrimRanges from given include paths (subhierarchies can be prunes through exclude paths) and returns parsed physics objects through the report function.
See the parsing utils documentation for more details.
[in] | stage | Stage to be traversed and parsed. |
[in] | includePaths | The vector of SdfPaths that are used to construct UsdPrimRange for traversals. For each path a UsdPrim is found on the stage and UsdRange traversal is constructed from it. All the traversed UsdPrims are parsed and physics descriptors are constructed and reported through the report function. |
[in] | reportFn | Report function that gets parsed USD physics data see |
[in] | userData | User data passed to report function, this can be arbitrary data structure, user data acts as a bridge between reportFn and the data structures understood by the Simulator. Implementer of reportFn can use the parsed "objectDesc" to populate these simulator-compatible data structures, which are passed as userData here. |
[in] | excludePaths | The vector of SdfPaths that are used to prune UsdPrims from the parsing UsdPrimRange traversals constructed from the include paths. |
[in] | customPhysicsTokens | Custom tokens to be reported by the parsing see |
[in] | simulationOwners | List of simulation owners that should be parsed, adding SdfPath() indicates that objects without a simulation owner should be parsed too. |