55 const Vector3f& positionOffset = Vector3f::Zero(),
56 const Quaternionf& rotationOffset = Quaternionf::Identity(),
60 void addMesh(
const Mesh& mesh,
const std::string& name,
bool addColor =
false);
88 bool addExtensions =
true,
89 const std::string& customName =
"default",
90 std::span<const int64_t> timestamps = {});
95 const Character& character,
97 std::span<const SkeletonState> skeletonStates,
98 const std::string& customName =
"default");
110 std::span<
const std::vector<momentum::Marker>> markerSequence,
112 const std::string& animName =
"default");
118 const filesystem::path& filename,
120 bool embedResources =
false);
123 fx::gltf::Document& document,
124 const filesystem::path& filename,
126 bool embedResources =
false);
151 std::unique_ptr<Impl> impl_;
void setAnimationInterpolation(GltfAnimationInterpolation interpolation)
Set how the joint and blend shape animation samplers added afterwards interpolate between their keys ...
GltfBuilder(GltfBuilder &&) noexcept
GltfBuilder(GltfBuilder const &)=delete
void operator=(GltfBuilder const &)=delete
const fx::gltf::Document & getDocument()
Allow copy the document, but do not allow modify the file outside of the builder to keep metadata con...
void addMotion(const Character &character, float fps=120.0f, const MotionParameters &motion={}, const IdentityParameters &offsets={}, bool addExtensions=true, const std::string &customName="default", std::span< const int64_t > timestamps={})
Add a motion to the provided character.
void addMarkerSequence(float fps, std::span< const std::vector< momentum::Marker > > markerSequence, MarkerMesh markerMesh=MarkerMesh::UnitCube, const std::string &animName="default")
Add marker data to the file.
size_t getNumCharacters()
std::vector< size_t > getCharacterMotions(const std::string &characterName)
void addCharacter(const Character &character, const Vector3f &positionOffset=Vector3f::Zero(), const Quaternionf &rotationOffset=Quaternionf::Identity(), const FileSaveOptions &options=FileSaveOptions())
Add a character to the scene.
void addMesh(const Mesh &mesh, const std::string &name, bool addColor=false)
Add a static mesh, such as an environment or a target scan.
void save(const filesystem::path &filename, GltfFileFormat fileFormat=GltfFileFormat::Auto, bool embedResources=false)
MarkerMesh
Specify how marker mesh is represented in the glb file.
size_t getCharacterRootIndex(const std::string &name)
size_t getNumJoints(const std::string &name)
void addSkeletonStates(const Character &character, float fps, std::span< const SkeletonState > skeletonStates, const std::string &customName="default")
Add a skeleton states to the provided character.
GltfAnimationInterpolation getAnimationInterpolation() const
void forceEmbedResources()
Set all existing buffers to embed resources.
std::tuple< std::vector< std::string >, JointParameters > IdentityParameters
A tuple of skeleton joint names and identity parameters.
Quaternion< float > Quaternionf
std::tuple< std::vector< std::string >, Eigen::MatrixXf > MotionParameters
A tuple of model parameter names and a matrix of poses across a sequence of frames.
GltfAnimationInterpolation
How animation samplers written to a GLTF file interpolate between their keys.
JointParametersT< float > JointParameters
GltfFileFormat
File format in which the character is saved.
Vector3< float > Vector3f
MatrixX< float > MatrixXf
A character model with skeletal structure, mesh, and optional components.
Unified options for saving files in both FBX and GLTF formats.