Use keep original textures.

This commit is contained in:
K. S. Ernest (iFire) Lee 2021-11-28 13:48:43 -08:00
parent 9eb3423ca2
commit 2c4a9ade9f
3 changed files with 13 additions and 2 deletions

View File

@ -37,6 +37,7 @@ func _import_scene(path: String, flags: int, bake_fps: int):
var stdout = [].duplicate()
var temp_dir_global = ProjectSettings.globalize_path("res://.godot/imported/")
var ret = OS.execute(fbx2gltf_path, [
"--keep-originals",
"--fbx-temp-dir", temp_dir_global,
"-i", path_global,
"-o", output_path_global], stdout, true)

View File

@ -52,6 +52,12 @@ int main(int argc, char* argv[]) {
gltfOptions.embedResources,
"Inline buffers as data:// URIs within generated non-binary glTF.");
app.add_flag(
"--keep-originals",
gltfOptions.keepOriginals,
"Keep the originals paths in a non-binary glTF.");
app.add_flag(
"-t,--separate-textures", gltfOptions.separateTextures, "Write texture files out separately");
@ -307,7 +313,9 @@ int main(int argc, char* argv[]) {
fmt::printf("Note: Ignoring --embed; it's meaningless with --binary.\n");
}
if (outputPath.empty()) {
if (gltfOptions.keepOriginals) {
outputPath = "./" + FileUtils::GetFileBase(inputPath);
} else if (outputPath.empty() && !gltfOptions.keepOriginals) {
// if -o is not given, default to the basename of the .fbx
outputPath = "./" + FileUtils::GetFileBase(inputPath);
}

View File

@ -90,6 +90,8 @@ struct GltfOptions {
/** If non-binary, whether to inline all resources, for a single (large) .glTF file. */
bool embedResources{true};
bool keepOriginals{false};
bool separateTextures{true};
/** Whether and how to use KHR_draco_mesh_compression to minimize static geometry size. */