Use keep original textures.
This commit is contained in:
parent
9eb3423ca2
commit
2c4a9ade9f
|
@ -37,6 +37,7 @@ func _import_scene(path: String, flags: int, bake_fps: int):
|
||||||
var stdout = [].duplicate()
|
var stdout = [].duplicate()
|
||||||
var temp_dir_global = ProjectSettings.globalize_path("res://.godot/imported/")
|
var temp_dir_global = ProjectSettings.globalize_path("res://.godot/imported/")
|
||||||
var ret = OS.execute(fbx2gltf_path, [
|
var ret = OS.execute(fbx2gltf_path, [
|
||||||
|
"--keep-originals",
|
||||||
"--fbx-temp-dir", temp_dir_global,
|
"--fbx-temp-dir", temp_dir_global,
|
||||||
"-i", path_global,
|
"-i", path_global,
|
||||||
"-o", output_path_global], stdout, true)
|
"-o", output_path_global], stdout, true)
|
||||||
|
|
|
@ -52,6 +52,12 @@ int main(int argc, char* argv[]) {
|
||||||
gltfOptions.embedResources,
|
gltfOptions.embedResources,
|
||||||
"Inline buffers as data:// URIs within generated non-binary glTF.");
|
"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(
|
app.add_flag(
|
||||||
"-t,--separate-textures", gltfOptions.separateTextures, "Write texture files out separately");
|
"-t,--separate-textures", gltfOptions.separateTextures, "Write texture files out separately");
|
||||||
|
|
||||||
|
@ -306,8 +312,10 @@ int main(int argc, char* argv[]) {
|
||||||
if (gltfOptions.embedResources && gltfOptions.outputBinary) {
|
if (gltfOptions.embedResources && gltfOptions.outputBinary) {
|
||||||
fmt::printf("Note: Ignoring --embed; it's meaningless with --binary.\n");
|
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
|
// if -o is not given, default to the basename of the .fbx
|
||||||
outputPath = "./" + FileUtils::GetFileBase(inputPath);
|
outputPath = "./" + FileUtils::GetFileBase(inputPath);
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,6 +90,8 @@ struct GltfOptions {
|
||||||
/** If non-binary, whether to inline all resources, for a single (large) .glTF file. */
|
/** If non-binary, whether to inline all resources, for a single (large) .glTF file. */
|
||||||
bool embedResources{true};
|
bool embedResources{true};
|
||||||
|
|
||||||
|
bool keepOriginals{false};
|
||||||
|
|
||||||
bool separateTextures{true};
|
bool separateTextures{true};
|
||||||
|
|
||||||
/** Whether and how to use KHR_draco_mesh_compression to minimize static geometry size. */
|
/** Whether and how to use KHR_draco_mesh_compression to minimize static geometry size. */
|
||||||
|
|
Loading…
Reference in New Issue