1
0
Fork 0

GLTF: Only pad zeros on numbers when exporting images

This commit is contained in:
Aaron Franke 2025-01-08 00:04:25 -08:00
parent d2ada64a03
commit f268b7373f
No known key found for this signature in database
GPG Key ID: 40A1750B977E56BF
1 changed files with 1 additions and 2 deletions

View File

@ -3814,10 +3814,9 @@ Error GLTFDocument::_serialize_images(Ref<GLTFState> p_state) {
if (p_state->filename.to_lower().ends_with("gltf")) { if (p_state->filename.to_lower().ends_with("gltf")) {
String img_name = p_state->images[i]->get_name(); String img_name = p_state->images[i]->get_name();
if (img_name.is_empty()) { if (img_name.is_empty()) {
img_name = itos(i); img_name = itos(i).pad_zeros(3);
} }
img_name = _gen_unique_name(p_state, img_name); img_name = _gen_unique_name(p_state, img_name);
img_name = img_name.pad_zeros(3);
String relative_texture_dir = "textures"; String relative_texture_dir = "textures";
String full_texture_dir = p_state->base_path.path_join(relative_texture_dir); String full_texture_dir = p_state->base_path.path_join(relative_texture_dir);
Ref<DirAccess> da = DirAccess::open(p_state->base_path); Ref<DirAccess> da = DirAccess::open(p_state->base_path);