Skip to content

Commit 33bbcfc

Browse files
committed
Update downstream callsites to use saveGltfCharacter
Differential Revision: D86017756
1 parent c3a1cc6 commit 33bbcfc

File tree

6 files changed

+9
-63
lines changed

6 files changed

+9
-63
lines changed

momentum/examples/animate_shapes/animate_shapes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ int main(int argc, char* argv[]) {
8787
}
8888

8989
// save the result
90-
saveCharacter(
90+
saveGltfCharacter(
9191
options->outFile,
9292
character,
9393
20.f,

momentum/examples/convert_model/convert_model.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,15 +221,15 @@ int main(int argc, char** argv) {
221221
} else if (oextension == ".glb" || oextension == ".gltf") {
222222
MT_LOGI("Saving gltf/glb file...");
223223
if (hasMotion) {
224-
saveCharacter(
224+
saveGltfCharacter(
225225
options->output_model_file,
226226
character,
227227
fps,
228228
{character.parameterTransform.name, poses},
229229
{character.skeleton.getJointNames(), offsets},
230230
markerSequence.frames);
231231
} else {
232-
saveCharacter(options->output_model_file, character);
232+
saveGltfCharacter(options->output_model_file, character);
233233
}
234234
}
235235
if (!options->output_locator_local.empty()) {

momentum/io/character_io.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ void saveCharacter(
177177
void saveCharacter(
178178
const filesystem::path& filename,
179179
const Character& character,
180+
const float fps,
180181
std::span<const SkeletonState> skeletonStates,
181-
const std::vector<std::vector<Marker>>& markerSequence,
182-
float fps) {
182+
const std::vector<std::vector<Marker>>& markerSequence) {
183183
// Parse format from file extension
184184
const auto format = parseCharacterFormat(filename);
185185
MT_THROW_IF(

momentum/io/character_io.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ void saveCharacter(
6969
const filesystem::path& filename,
7070
const Character& character,
7171
float fps,
72-
const MatrixXf& motion /* = MatrixXf()*/,
72+
const MatrixXf& motion = MatrixXf(),
7373
const std::vector<std::vector<Marker>>& markerSequence = {});
7474

7575
/// High level function to save a character with motion in skeleton states and markers to any
@@ -85,7 +85,7 @@ void saveCharacter(
8585
void saveCharacter(
8686
const filesystem::path& filename,
8787
const Character& character,
88-
std::span<const SkeletonState> skeletonStates,
89-
const std::vector<std::vector<Marker>>& markerSequence = {},
90-
float fps = 120.f);
88+
float fps,
89+
std::span<const SkeletonState> skeletonStates = {},
90+
const std::vector<std::vector<Marker>>& markerSequence = {});
9191
} // namespace momentum

momentum/io/gltf/gltf_io.cpp

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,19 +1325,6 @@ void saveGltfCharacter(
13251325
GltfBuilder::save(model, filename, fileFormat, kEmbedResources);
13261326
}
13271327

1328-
void saveCharacter(
1329-
const filesystem::path& filename,
1330-
const Character& character,
1331-
const float fps,
1332-
const MotionParameters& motion,
1333-
const IdentityParameters& offsets,
1334-
const std::vector<std::vector<Marker>>& markerSequence,
1335-
const GltfFileFormat fileFormat,
1336-
const GltfOptions& options) {
1337-
return saveGltfCharacter(
1338-
filename, character, fps, motion, offsets, markerSequence, fileFormat, options);
1339-
}
1340-
13411328
void saveGltfCharacter(
13421329
const filesystem::path& filename,
13431330
const Character& character,
@@ -1354,18 +1341,6 @@ void saveGltfCharacter(
13541341
GltfBuilder::save(model, filename, fileFormat, kEmbedResources);
13551342
}
13561343

1357-
void saveCharacter(
1358-
const filesystem::path& filename,
1359-
const Character& character,
1360-
const float fps,
1361-
std::span<const SkeletonState> skeletonStates,
1362-
const std::vector<std::vector<Marker>>& markerSequence,
1363-
const GltfFileFormat fileFormat,
1364-
const GltfOptions& options) {
1365-
return saveGltfCharacter(
1366-
filename, character, fps, skeletonStates, markerSequence, fileFormat, options);
1367-
}
1368-
13691344
std::vector<std::byte> saveCharacterToBytes(
13701345
const Character& character,
13711346
float fps,

momentum/io/gltf/gltf_io.h

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -108,22 +108,6 @@ fx::gltf::Document makeCharacterDocument(
108108
bool embedResource = true,
109109
const GltfOptions& options = GltfOptions());
110110

111-
/// Saves character motion to a glb file.
112-
///
113-
/// @param[in] motion The model parameters representing the motion of the character (numModelParams,
114-
/// numFrames)
115-
/// @param[in] offsets Offset values per joint capturing the skeleton bone lengths using translation
116-
/// and scale offset (7*numJoints, 1)
117-
[[deprecated("Use saveGltfCharacter() instead")]] void saveCharacter(
118-
const filesystem::path& filename,
119-
const Character& character,
120-
float fps = 120.0f,
121-
const MotionParameters& motion = {},
122-
const IdentityParameters& offsets = {},
123-
const std::vector<std::vector<Marker>>& markerSequence = {},
124-
GltfFileFormat fileFormat = GltfFileFormat::Extension,
125-
const GltfOptions& options = GltfOptions());
126-
127111
/// Saves character motion to a glb file.
128112
///
129113
/// @param[in] motion The model parameters representing the motion of the character (numModelParams,
@@ -140,19 +124,6 @@ void saveGltfCharacter(
140124
GltfFileFormat fileFormat = GltfFileFormat::Extension,
141125
const GltfOptions& options = GltfOptions());
142126

143-
/// Saves character skeleton states to a glb file.
144-
///
145-
/// @param[in] skeletonStates The skeleton states for each frame of the motion sequence (numFrames,
146-
/// numJoints, 8)
147-
[[deprecated("Use saveGltfCharacter() instead")]] void saveCharacter(
148-
const filesystem::path& filename,
149-
const Character& character,
150-
float fps,
151-
std::span<const SkeletonState> skeletonStates,
152-
const std::vector<std::vector<Marker>>& markerSequence = {},
153-
GltfFileFormat fileFormat = GltfFileFormat::Extension,
154-
const GltfOptions& options = GltfOptions());
155-
156127
/// Saves character skeleton states to a glb file.
157128
///
158129
/// @param[in] skeletonStates The skeleton states for each frame of the motion sequence (numFrames,

0 commit comments

Comments
 (0)