Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(508)

Side by Side Diff: converter/cross/converter_main.cc

Issue 147192: Updates the o3dConverter to turn on filtering by default... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright 2009, Google Inc. 2 * Copyright 2009, Google Inc.
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 if (values.size() == 1) { 73 if (values.size() == 1) {
74 // If we're only given one argument, then construct the output 74 // If we're only given one argument, then construct the output
75 // filename by substituting the extension on the filename (if any) 75 // filename by substituting the extension on the filename (if any)
76 // with .o3dtgz. 76 // with .o3dtgz.
77 in_filename = o3d::WideToFilePath(values[0]); 77 in_filename = o3d::WideToFilePath(values[0]);
78 out_filename = in_filename.ReplaceExtension(FILE_PATH_LITERAL(".o3dtgz")); 78 out_filename = in_filename.ReplaceExtension(FILE_PATH_LITERAL(".o3dtgz"));
79 } else if (values.size()== 2) { 79 } else if (values.size()== 2) {
80 in_filename = o3d::WideToFilePath(values[0]); 80 in_filename = o3d::WideToFilePath(values[0]);
81 out_filename = o3d::WideToFilePath(values[1]); 81 out_filename = o3d::WideToFilePath(values[1]);
82 } else { 82 } else {
83 std::cerr << "Usage: " << argv[0] 83 std::cerr << "Usage: " << argv[0]
84 << " [--no-condition] [--base-path=<path>] [--up-axis=x,y,z]" 84 << " [ options ] <infile.dae> [ <outfile> ]\n";
85 << " [--pretty-print] <infile.dae> [ <outfile> ]\n"; 85 std::cerr
86 << "--no-condition\n"
87 << " Stops the converter from conditioning shaders.\n"
88 << "--base-path=<path>\n"
89 << " Sets the base path for finding textures and other external\n"
90 << " files.\n"
91 << "--up-axis=x,y,z\n"
92 << " Converts the file to have this up axis.\n"
93 << "--pretty-print\n"
94 << " Makes the exported JSON easier to read.\n"
95 << "--keep-filters\n"
96 << " Stops the converter from forcing all texture samplers to use\n"
97 << " tri-linear filtering.\n"
98 << "--keep-materials\n"
99 << " Stops the converter from changing materials to <constant> if\n"
100 << " they are used by a mesh that has no normals.\n";
86 return EXIT_FAILURE; 101 return EXIT_FAILURE;
87 } 102 }
88 103
89 o3d::converter::Options options; 104 o3d::converter::Options options;
90 options.condition = !command_line->HasSwitch(L"no-condition"); 105 options.condition = !command_line->HasSwitch(L"no-condition");
91 options.pretty_print = command_line->HasSwitch(L"pretty-print"); 106 options.pretty_print = command_line->HasSwitch(L"pretty-print");
92 if (command_line->HasSwitch(L"base-path")) { 107 if (command_line->HasSwitch(L"base-path")) {
93 options.base_path = o3d::WideToFilePath( 108 options.base_path = o3d::WideToFilePath(
94 command_line->GetSwitchValue(L"base-path")); 109 command_line->GetSwitchValue(L"base-path"));
95 } 110 }
(...skipping 21 matching lines...) Expand all
117 return EXIT_SUCCESS; 132 return EXIT_SUCCESS;
118 } else { 133 } else {
119 std::cerr << error_messages.c_str() << std::endl; 134 std::cerr << error_messages.c_str() << std::endl;
120 std::cerr << "FAILED to convert '" 135 std::cerr << "FAILED to convert '"
121 << o3d::FilePathToUTF8(in_filename).c_str() 136 << o3d::FilePathToUTF8(in_filename).c_str()
122 << "' to '" << o3d::FilePathToUTF8(out_filename).c_str() 137 << "' to '" << o3d::FilePathToUTF8(out_filename).c_str()
123 << "'." << std::endl; 138 << "'." << std::endl;
124 return EXIT_FAILURE; 139 return EXIT_FAILURE;
125 } 140 }
126 } 141 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698