Momentum
A library for solving nonlinear optimization problems related to human body kinematics
Loading...
Searching...
No Matches
legacy_json_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
13#include <momentum/math/fwd.h>
14
15#include <nlohmann/json.hpp>
16#include <span>
17#include <string>
18
19namespace momentum {
20
32[[nodiscard]] Character loadCharacterFromLegacyJson(const std::string& jsonPath);
33
39[[nodiscard]] Character loadCharacterFromLegacyJsonBuffer(std::span<const std::byte> jsonBuffer);
40
46[[nodiscard]] Character loadCharacterFromLegacyJsonString(const std::string& jsonString);
47
56void saveCharacterToLegacyJson(const Character& character, const std::string& jsonPath);
57
62[[nodiscard]] std::string characterToLegacyJsonString(const Character& character);
63
68[[nodiscard]] nlohmann::json characterToLegacyJson(const Character& character);
69
70} // namespace momentum
Character loadCharacterFromLegacyJsonBuffer(std::span< const std::byte > jsonBuffer)
Loads a Character from a legacy JSON buffer.
void saveCharacterToLegacyJson(const Character &character, const std::string &jsonPath)
Saves a Character to legacy JSON format.
std::string characterToLegacyJsonString(const Character &character)
Converts a Character to legacy JSON string.
Character loadCharacterFromLegacyJson(const std::string &jsonPath)
Loads a Character from a legacy JSON format that was previously used by older Python libraries (and s...
Character loadCharacterFromLegacyJsonString(const std::string &jsonString)
Loads a Character from a legacy JSON string.
nlohmann::json characterToLegacyJson(const Character &character)
Converts a Character to legacy JSON object.
A character model with skeletal structure, mesh, and optional components.
Definition character.h:32