8 #include "flutter/fml/backtrace.h"
9 #include "flutter/fml/command_line.h"
10 #include "flutter/fml/file.h"
11 #include "flutter/fml/macros.h"
12 #include "flutter/fml/mapping.h"
16 #include "impeller/scene/importer/scene_flatbuffers.h"
20 #include "third_party/flatbuffers/include/flatbuffers/flatbuffer_builder.h"
29 std::filesystem::perms::owner_read | std::filesystem::perms::owner_write |
30 std::filesystem::perms::group_read | std::filesystem::perms::others_read;
31 std::error_code error;
32 std::filesystem::permissions(p, permissions, error);
34 std::cerr <<
"Failed to set access on file '" << p
35 <<
"': " << error.message() << std::endl;
41 bool Main(
const fml::CommandLine& command_line) {
42 fml::InstallCrashHandler();
43 if (command_line.HasOption(
"help")) {
50 std::cerr <<
"Invalid flags specified." << std::endl;
55 auto source_file_mapping =
57 if (!source_file_mapping) {
58 std::cerr <<
"Could not open input file." << std::endl;
66 success =
ParseGLTF(*source_file_mapping, scene);
69 std::cerr <<
"Unknown input type." << std::endl;
73 std::cerr <<
"Failed to parse input file." << std::endl;
77 flatbuffers::FlatBufferBuilder builder;
78 builder.Finish(fb::Scene::Pack(builder, &scene), fb::SceneIdentifier());
80 auto output_file_name = std::filesystem::absolute(
82 fml::NonOwnedMapping mapping(builder.GetCurrentBufferPointer(),
104 int main(
int argc,
char const* argv[]) {
106 fml::CommandLineFromPlatformOrArgcArgv(argc, argv))