Skip to content

Commit

Permalink
mesh: add GLTF writing support
Browse files Browse the repository at this point in the history
  • Loading branch information
cdcseacave committed Apr 17, 2021
1 parent 4325703 commit 0f2a5a0
Show file tree
Hide file tree
Showing 5 changed files with 28,410 additions and 2 deletions.
11 changes: 9 additions & 2 deletions apps/TextureMesh/TextureMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ bool Initialize(size_t argc, LPCTSTR* argv)
("help,h", "produce this help message")
("working-folder,w", boost::program_options::value<std::string>(&WORKING_FOLDER), "working directory (default current directory)")
("config-file,c", boost::program_options::value<std::string>(&OPT::strConfigFileName)->default_value(APPNAME _T(".cfg")), "file name containing program options")
("export-type", boost::program_options::value<std::string>(&OPT::strExportType)->default_value(_T("ply")), "file type used to export the 3D scene (ply or obj)")
("export-type", boost::program_options::value<std::string>(&OPT::strExportType)->default_value(_T("gltf")), "file type used to export the 3D scene (ply, obj or gltf)")
("archive-type", boost::program_options::value(&OPT::nArchiveType)->default_value(ARCHIVE_DEFAULT), "project archive type: 0-text, 1-binary, 2-compressed binary")
("process-priority", boost::program_options::value(&OPT::nProcessPriority)->default_value(-1), "process priority (below normal by default)")
("max-threads", boost::program_options::value(&OPT::nMaxThreads)->default_value(0), "maximum number of threads (0 for using all available cores)")
Expand Down Expand Up @@ -166,7 +166,14 @@ bool Initialize(size_t argc, LPCTSTR* argv)
}
if (OPT::strInputFileName.IsEmpty())
return false;
OPT::strExportType = OPT::strExportType.ToLower() == _T("obj") ? _T(".obj") : _T(".ply");
OPT::strExportType = OPT::strExportType.ToLower();
if (OPT::strExportType == _T("obj"))
OPT::strExportType = _T(".obj");
else
if (OPT::strExportType == _T("gltf"))
OPT::strExportType = _T(".gltf");
else
OPT::strExportType = _T(".ply");

// initialize optional options
Util::ensureValidPath(OPT::strOutputFileName);
Expand Down
Loading

0 comments on commit 0f2a5a0

Please sign in to comment.