Momentum
A library for solving nonlinear optimization problems related to human body kinematics
Loading...
Searching...
No Matches
usd_mesh_io.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#pragma once
9
12#include <momentum/math/mesh.h>
13
14#include <pxr/usd/usd/stage.h>
15#include <pxr/usd/usdGeom/mesh.h>
16#include <pxr/usd/usdSkel/skeleton.h>
17
18PXR_NAMESPACE_USING_DIRECTIVE
19
20namespace momentum {
21
29Mesh loadMeshFromUsd(const UsdStageRefPtr& stage);
30
39SkinWeights loadSkinWeightsFromUsd(const UsdStageRefPtr& stage, size_t numVertices);
40
47void saveMeshToUsd(const Mesh& mesh, UsdGeomMesh& meshPrim);
48
58 const SkinWeights& skinWeights,
59 UsdGeomMesh& meshPrim,
60 const UsdSkelSkeleton& skelPrim);
61
69void saveBlendShapesToUsd(const BlendShape& blendShape, UsdGeomMesh& meshPrim);
70
78std::shared_ptr<BlendShape> loadBlendShapesFromUsd(const UsdStageRefPtr& stage, size_t numVertices);
79
80} // namespace momentum
void saveMeshToUsd(const Mesh &mesh, UsdGeomMesh &meshPrim)
Save a mesh to a USD stage.
std::shared_ptr< BlendShape > loadBlendShapesFromUsd(const UsdStageRefPtr &stage, size_t numVertices)
Load blend shapes from a USD stage.
void saveBlendShapesToUsd(const BlendShape &blendShape, UsdGeomMesh &meshPrim)
Save blend shapes to a USD stage.
MeshT< float > Mesh
Definition fwd.h:20
SkinWeights loadSkinWeightsFromUsd(const UsdStageRefPtr &stage, size_t numVertices)
Load skin weights from a USD stage.
void saveSkinWeightsToUsd(const SkinWeights &skinWeights, UsdGeomMesh &meshPrim, const UsdSkelSkeleton &skelPrim)
Save skin weights to a USD stage.
Mesh loadMeshFromUsd(const UsdStageRefPtr &stage)
Load a mesh from a USD stage.
Skinning class that combines blend shape vectors with a base shape.
Definition blend_shape.h:19
Linear blend skinning weights for a character mesh: per-vertex joint indices and influence weights.