From dfab1f7c5dbb6c5612a27beed2d60fe1bbb3ae81 Mon Sep 17 00:00:00 2001 From: Syoyo Fujita Date: Wed, 23 Nov 2016 18:27:19 +0900 Subject: [PATCH] Emit "name" for each "mesh" object. --- examples/alembic_to_gltf/abc2gltf.cc | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/examples/alembic_to_gltf/abc2gltf.cc b/examples/alembic_to_gltf/abc2gltf.cc index 4a56542..d9fc124 100644 --- a/examples/alembic_to_gltf/abc2gltf.cc +++ b/examples/alembic_to_gltf/abc2gltf.cc @@ -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; }