8 #include "flutter/fml/backtrace.h"
9 #include "flutter/fml/command_line.h"
10 #include "flutter/fml/file.h"
11 #include "flutter/fml/mapping.h"
15 #include "impeller/scene/importer/scene_flatbuffers.h"
19 #include "third_party/flatbuffers/include/flatbuffers/flatbuffer_builder.h"
28 std::filesystem::perms::owner_read | std::filesystem::perms::owner_write |
29 std::filesystem::perms::group_read | std::filesystem::perms::others_read;
30 std::error_code error;
31 std::filesystem::permissions(p, permissions, error);
33 std::cerr <<
"Failed to set access on file '" << p
34 <<
"': " << error.message() << std::endl;
40 bool Main(
const fml::CommandLine& command_line) {
41 fml::InstallCrashHandler();
42 if (command_line.HasOption(
"help")) {
49 std::cerr <<
"Invalid flags specified." << std::endl;
54 auto source_file_mapping =
56 if (!source_file_mapping) {
57 std::cerr <<
"Could not open input file." << std::endl;
65 success =
ParseGLTF(*source_file_mapping, scene);
68 std::cerr <<
"Unknown input type." << std::endl;
72 std::cerr <<
"Failed to parse input file." << std::endl;
76 flatbuffers::FlatBufferBuilder builder;
77 builder.Finish(fb::Scene::Pack(builder, &scene), fb::SceneIdentifier());
79 auto output_file_name = std::filesystem::absolute(
81 fml::NonOwnedMapping mapping(builder.GetCurrentBufferPointer(),
103 int main(
int argc,
char const* argv[]) {
105 fml::CommandLineFromPlatformOrArgcArgv(argc, argv))