Momentum
A library for solving nonlinear optimization problems related to human body kinematics
Loading...
Searching...
No Matches
openfbx_loader.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
14#include <momentum/math/types.h>
15
16#include <span>
17
18namespace momentum {
19
20// Custom property names for identifying Momentum-specific FBX nodes
21constexpr const char* kMomentumMarkersRootProperty = "Momentum_Markers_Root";
22constexpr const char* kMomentumMarkerProperty = "Momentum_Marker";
23
24// Using keepLocators means the Nulls in the transform hierarchy will be turned into Locators.
25// This is different from historical momentum behavior so it's off by default.
26// Permissive mode allows loading mesh-only characters (without skin weights).
28 const filesystem::path& inputPath,
29 KeepLocators keepLocators = KeepLocators::No,
30 Permissive permissive = Permissive::No,
31 LoadBlendShapes loadBlendShapes = LoadBlendShapes::No,
32 bool stripNamespaces = true);
33
34// Permissive mode allows loading mesh-only characters (without skin weights).
36 std::span<const std::byte> inputData,
37 KeepLocators keepLocators = KeepLocators::No,
38 Permissive permissive = Permissive::No,
39 LoadBlendShapes loadBlendShapes = LoadBlendShapes::No,
40 bool stripNamespaces = true);
41
42// Permissive mode allows loading mesh-only characters (without skin weights).
43std::tuple<Character, std::vector<MatrixXf>, float> loadOpenFbxCharacterWithMotion(
44 const filesystem::path& inputPath,
45 KeepLocators keepLocators = KeepLocators::No,
46 Permissive permissive = Permissive::No,
47 LoadBlendShapes loadBlendShapes = LoadBlendShapes::No,
48 bool stripNamespaces = true);
49
50// Permissive mode allows loading mesh-only characters (without skin weights).
51std::tuple<Character, std::vector<MatrixXf>, float> loadOpenFbxCharacterWithMotion(
52 std::span<const std::byte> inputData,
53 KeepLocators keepLocators = KeepLocators::No,
54 Permissive permissive = Permissive::No,
55 LoadBlendShapes loadBlendShapes = LoadBlendShapes::No,
56 bool stripNamespaces = true);
57
59 const filesystem::path& filename,
60 bool stripNamespaces = true);
61
72 std::span<const std::byte> inputData,
73 bool stripNamespaces = true);
74
75} // namespace momentum
constexpr const char * kMomentumMarkersRootProperty
std::tuple< Character, std::vector< MatrixXf >, float > loadOpenFbxCharacterWithMotion(std::span< const std::byte > inputData, KeepLocators keepLocators, Permissive permissive, LoadBlendShapes loadBlendShapes, bool stripNamespaces)
MarkerSequence loadOpenFbxMarkerSequence(std::span< const std::byte > inputData, bool stripNamespaces)
Load a MarkerSequence from an in-memory FBX byte buffer.
Character loadOpenFbxCharacter(const std::span< const std::byte > inputData, KeepLocators keepLocators, Permissive permissive, LoadBlendShapes loadBlendShapes, bool stripNamespaces)
LoadBlendShapes
Definition fbx_io.h:26
KeepLocators
Definition fbx_io.h:23
constexpr const char * kMomentumMarkerProperty
A character model with skeletal structure, mesh, and optional components.
Definition character.h:32
All frames from a single motion capture sequence for one subject (actor).
Definition marker.h:37