Momentum
A library for solving nonlinear optimization problems related to human body kinematics
Loading...
Searching...
No Matches
usd_animation_io.cpp File Reference
#include "momentum/io/usd/usd_animation_io.h"
#include "momentum/io/usd/usd_skeleton_io.h"
#include "momentum/common/checks.h"
#include "momentum/common/log.h"
#include "momentum/math/utility.h"
#include <pxr/base/tf/staticTokens.h>
#include <pxr/base/gf/half.h>
#include <pxr/base/gf/quatf.h>
#include <pxr/base/gf/vec3d.h>
#include <pxr/base/gf/vec3f.h>
#include <pxr/base/gf/vec3h.h>
#include <pxr/base/vt/array.h>
#include <pxr/usd/sdf/valueTypeName.h>
#include <pxr/usd/usd/primRange.h>
#include <pxr/usd/usdGeom/scope.h>
#include <pxr/usd/usdGeom/xform.h>
#include <pxr/usd/usdGeom/xformCommonAPI.h>
#include <pxr/usd/usdSkel/animation.h>
#include <pxr/usd/usdSkel/bindingAPI.h>
#include <cmath>
#include <unordered_map>
#include <unordered_set>

Go to the source code of this file.

Namespaces

namespace  momentum

Functions

PXR_NAMESPACE_USING_DIRECTIVE TF_DEFINE_PRIVATE_TOKENS (_tokens,(Animation)(Markers)((momentumMotionFps, "momentum:motion:fps"))((momentumMotionParameterNames, "momentum:motion:parameterNames"))((momentumMotionPoses, "momentum:motion:poses"))((momentumMotionNumFrames, "momentum:motion:numFrames"))((momentumMotionNumParams, "momentum:motion:numParams"))((momentumMotionJointNames, "momentum:motion:jointNames"))((momentumMotionOffsets, "momentum:motion:offsets"))((momentumMarkerName, "momentum:marker:name"))((momentumMarkerOccluded, "momentum:marker:occluded"))((momentumMarkerConfidence, "momentum:marker:confidence"))((momentumMarkersFps, "momentum:markers:fps")))
void momentum::saveSkeletonStatesToUsd (const UsdStageRefPtr &stage, UsdSkelSkeleton &skelPrim, const Skeleton &skeleton, std::span< const SkeletonState > skeletonStates, float fps)
 Save skeleton states as a UsdSkelAnimation on the stage.
std::tuple< std::vector< SkeletonState >, std::vector< float > > momentum::loadSkeletonStatesFromUsd (const UsdStageRefPtr &stage, const Skeleton &skeleton)
 Load skeleton states from a USD stage.
void momentum::saveMotionToUsd (const UsdPrim &prim, float fps, const MotionParameters &motion, const IdentityParameters &offsets)
 Save model-parameter motion as custom attributes on a USD prim.
std::tuple< MotionParameters, IdentityParameters, float > momentum::loadMotionFromUsd (const UsdPrim &prim)
 Load model-parameter motion from custom attributes on a USD prim.
void momentum::saveMarkerSequenceToUsd (const UsdStageRefPtr &stage, const SdfPath &skelRootPath, float fps, std::span< const std::vector< Marker > > markerSequence)
 Save marker sequence as animated Xform prims under a Markers scope.
MarkerSequence momentum::loadMarkerSequenceFromUsd (const UsdStageRefPtr &stage)
 Load marker sequence from animated Xform prims.

Function Documentation

◆ TF_DEFINE_PRIVATE_TOKENS()

PXR_NAMESPACE_USING_DIRECTIVE TF_DEFINE_PRIVATE_TOKENS ( _tokens ,
(Animation)(Markers)((momentumMotionFps, "momentum:motion:fps"))((momentumMotionParameterNames, "momentum:motion:parameterNames"))((momentumMotionPoses, "momentum:motion:poses"))((momentumMotionNumFrames, "momentum:motion:numFrames"))((momentumMotionNumParams, "momentum:motion:numParams"))((momentumMotionJointNames, "momentum:motion:jointNames"))((momentumMotionOffsets, "momentum:motion:offsets"))((momentumMarkerName, "momentum:marker:name"))((momentumMarkerOccluded, "momentum:marker:occluded"))((momentumMarkerConfidence, "momentum:marker:confidence"))((momentumMarkersFps, "momentum:markers:fps"))  )