Skip to content

Commit 4778212

Browse files
committed
Merge pull request #101270 from aaronfranke/gltf-export-img-num-pad
GLTF: Only pad zeros when exporting numbered images
2 parents abd565e + aeece9d commit 4778212

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

modules/gltf/gltf_document.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3832,10 +3832,9 @@ Error GLTFDocument::_serialize_images(Ref<GLTFState> p_state) {
38323832
if (p_state->filename.to_lower().ends_with("gltf")) {
38333833
String img_name = p_state->images[i]->get_name();
38343834
if (img_name.is_empty()) {
3835-
img_name = itos(i);
3835+
img_name = itos(i).pad_zeros(3);
38363836
}
38373837
img_name = _gen_unique_name(p_state, img_name);
3838-
img_name = img_name.pad_zeros(3);
38393838
String relative_texture_dir = "textures";
38403839
String full_texture_dir = p_state->base_path.path_join(relative_texture_dir);
38413840
Ref<DirAccess> da = DirAccess::open(p_state->base_path);

0 commit comments

Comments
 (0)