diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index d00bd616ba..19f6def62b 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -3832,10 +3832,9 @@ Error GLTFDocument::_serialize_images(Ref p_state) { if (p_state->filename.to_lower().ends_with("gltf")) { String img_name = p_state->images[i]->get_name(); 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 = img_name.pad_zeros(3); String relative_texture_dir = "textures"; String full_texture_dir = p_state->base_path.path_join(relative_texture_dir); Ref da = DirAccess::open(p_state->base_path);