mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-10 05:38:58 +08:00
Emit "name" for each "mesh" object.
This commit is contained in:
parent
8598af65b0
commit
dfab1f7c5d
@ -973,6 +973,7 @@ static bool ConvertMeshToGLTF(picojson::object *buffers_out, picojson::object *b
|
||||
primitive_array.push_back(picojson::value(primitive));
|
||||
|
||||
picojson::object m;
|
||||
m["name"] = picojson::value(mesh.name);
|
||||
m["primitives"] = picojson::value(primitive_array);
|
||||
|
||||
picojson::object meshes;
|
||||
@ -1089,6 +1090,7 @@ static bool ConvertCurvesToGLTF(picojson::object *buffers_out, picojson::object
|
||||
primitive_array.push_back(picojson::value(primitive));
|
||||
|
||||
picojson::object m;
|
||||
m["name"] = picojson::value(curves.name);
|
||||
m["primitives"] = picojson::value(primitive_array);
|
||||
|
||||
picojson::object meshes;
|
||||
@ -1278,29 +1280,5 @@ int main(int argc, char** argv) {
|
||||
|
||||
SaveSceneToGLTF(gltf_filename, scene);
|
||||
|
||||
#if 0
|
||||
if (scene.curves_map.size() > 0) {
|
||||
}
|
||||
if (foundMesh) {
|
||||
bool ret = SaveMeshToGLTF(gltf_filename, mesh);
|
||||
if (ret) {
|
||||
std::cout << "Wrote " << gltf_filename << std::endl;
|
||||
} else {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
} else {
|
||||
std::cout << "No polygon mesh found in Alembic file" << std::endl;
|
||||
}
|
||||
|
||||
if (foundCurves) {
|
||||
bool ret = SaveCurvesToGLTF(gltf_filename, curves);
|
||||
if (ret) {
|
||||
std::cout << "Wrote " << gltf_filename << std::endl;
|
||||
} else {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user