Momentum
A library for solving nonlinear optimization problems related to human body kinematics
Loading...
Searching...
No Matches
usd_io.cpp File Reference
#include "momentum/io/usd/usd_io.h"
#include "momentum/character/blend_shape.h"
#include "momentum/character/character.h"
#include "momentum/character/character_utility.h"
#include "momentum/character/collision_geometry.h"
#include "momentum/character/inverse_parameter_transform.h"
#include "momentum/character/parameter_transform.h"
#include "momentum/character/skeleton.h"
#include "momentum/character/skin_weights.h"
#include "momentum/character/types.h"
#include "momentum/common/checks.h"
#include "momentum/common/log.h"
#include "momentum/io/common/json_utils.h"
#include "momentum/io/file_save_options.h"
#include "momentum/io/usd/usd_animation_io.h"
#include "momentum/io/usd/usd_mesh_io.h"
#include "momentum/io/usd/usd_skeleton_io.h"
#include "momentum/io/usd/usd_utils.h"
#include "momentum/math/mesh.h"
#include <nlohmann/json.hpp>
#include <pxr/base/tf/diagnosticMgr.h>
#include <pxr/base/tf/errorMark.h>
#include <pxr/base/tf/staticTokens.h>
#include <pxr/pxr.h>
#include <pxr/usd/sdf/layer.h>
#include <pxr/usd/sdf/valueTypeName.h>
#include <pxr/usd/usd/primRange.h>
#include <pxr/usd/usd/stage.h>
#include <pxr/usd/usdGeom/scope.h>
#include <pxr/usd/usdSkel/root.h>
#include <tbb/global_control.h>
#include <atomic>
#include <ctime>
#include <fstream>
#include <iostream>
#include <memory>
#include <mutex>
#include <span>
#include <thread>
#include <unordered_set>
#include <vector>

Go to the source code of this file.

Namespaces

namespace  momentum

Functions

PXR_NAMESPACE_USING_DIRECTIVE TF_DEFINE_PRIVATE_TOKENS (_tokens,((momentumCharacterName, "momentum:characterName"))((momentumParameterTransform, "momentum:parameterTransform"))((momentumParameterLimits, "momentum:parameterLimits"))((momentumParameterSets, "momentum:parameterSets"))((momentumPoseConstraints, "momentum:poseConstraints"))(PhysicalProperties)((momentumJoint, "momentum:joint"))((momentumPhysicalProperties, "momentum:physicalProperties")))
Character momentum::loadUsdCharacter (const filesystem::path &inputPath)
 Load a USD character from a local file path.
Character momentum::loadUsdCharacter (std::span< const std::byte > inputSpan)
 Load a USD character from a buffer.
void momentum::saveUsd (const filesystem::path &filename, const Character &character, const FileSaveOptions &options=FileSaveOptions())
 Save a character to a USD file.
std::tuple< Character, std::vector< SkeletonState >, std::vector< float > > momentum::loadUsdCharacterWithSkeletonStates (const filesystem::path &inputPath)
 Load a USD character with skeleton states from a local file path.
std::tuple< Character, std::vector< SkeletonState >, std::vector< float > > momentum::loadUsdCharacterWithSkeletonStates (std::span< const std::byte > inputSpan)
 Load a USD character with skeleton states from a buffer.
void momentum::saveUsdCharacter (const filesystem::path &filename, const Character &character, float fps, std::span< const SkeletonState > skeletonStates, std::span< const std::vector< Marker > > markerSequence={}, const FileSaveOptions &options=FileSaveOptions())
 Save a character with skeleton state animation to a USD file.
void momentum::saveUsdCharacterWithMotion (const filesystem::path &filename, const Character &character, float fps=120.0f, const MotionParameters &motion={}, const IdentityParameters &offsets={}, std::span< const std::vector< Marker > > markerSequence={}, const FileSaveOptions &options=FileSaveOptions())
 Save a character with model-parameter motion to a USD file.
std::tuple< Character, MotionParameters, IdentityParameters, float > momentum::loadUsdCharacterWithMotion (const filesystem::path &inputPath)
 Load a USD character with model-parameter motion from a local file path.
std::tuple< Character, MotionParameters, IdentityParameters, float > momentum::loadUsdCharacterWithMotion (std::span< const std::byte > inputSpan)
 Load a USD character with model-parameter motion from a buffer.
std::tuple< Character, MatrixXf, ModelParameters, float > momentum::loadUsdCharacterWithMotionModelParameterScales (const filesystem::path &inputPath)
 Load a USD character with motion and apply scale parameters to the motion.
std::tuple< Character, MatrixXf, ModelParameters, float > momentum::loadUsdCharacterWithMotionModelParameterScales (std::span< const std::byte > inputSpan)
 Load a USD character with motion and apply scale parameters to the motion.
MarkerSequence momentum::loadUsdMarkerSequence (const filesystem::path &inputPath)
 Load a marker sequence from a USD file.

Function Documentation

◆ TF_DEFINE_PRIVATE_TOKENS()

PXR_NAMESPACE_USING_DIRECTIVE TF_DEFINE_PRIVATE_TOKENS ( _tokens ,
((momentumCharacterName, "momentum:characterName"))((momentumParameterTransform, "momentum:parameterTransform"))((momentumParameterLimits, "momentum:parameterLimits"))((momentumParameterSets, "momentum:parameterSets"))((momentumPoseConstraints, "momentum:poseConstraints"))(PhysicalProperties)((momentumJoint, "momentum:joint"))((momentumPhysicalProperties, "momentum:physicalProperties"))  )