godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.1k stars 21.15k forks source link

Animation Slice system doesn't auto-append filetype despite warning you about overwriting existing files #96732

Open LordMcMutton opened 1 month ago

LordMcMutton commented 1 month ago

Tested versions

Occurs in 4.3

System information

Godot v4.3.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated GeForce GTX 1060 6GB - Intel(R) Core(TM) i5-10400 CPU @ 2.90GHz (12 Threads)

Issue description

Re-Importing a model to overwrite an Animation Resource that's in an Animation Library fails, corrupting the model.

Errors:

Saving of animation failed: res://Visual/Characters/Player/Animations/Locomotion/Falling_Direction_1
Resource file not found: res://Visual/Characters/Player/Animations/Locomotion/Falling_Direction_1 (expected type: Animation)
scene/resources/animation_library.cpp:54 - Condition "p_animation.is_null()" is true. Returning: ERR_INVALID_PARAMETER

Distinct from https://github.com/godotengine/godot/issues/95744 in that Godot doesn't crash when this occurs, as well as occurring when the Animation Window is not open

The Animation Slice system appears to be very unstable at the moment

Steps to reproduce

-Have a pre-existing Animation Resource saved to a file -Open Advanced Import Settings on a new model and create an Animation Slice which, when Saved to File, would overwrite the aforementioned Animation Resource. -Reimport the model -The Reimport process will fail, Godot will present the error, and the source model will be corrupted

Minimal reproduction project (MRP)

mrp.zip

All set up- select the Untitled2.glb, enter its Advanced Import Settings, click on Armature_Action, then click Reimport

LordMcMutton commented 1 month ago

More information- the cause seems to be because the Animation Slice system doesn't auto-append the filetype to the end of the Path setting, even if you navigate to a folder and it prompts that you'll be replacing a file.

For example, it claims that saving "Walk" with no filetype will overwrite "Walk.res", and then proceed to not add the .res to the end of the Path setting, which is why "Resource file not found: res://Visual/Characters/Player/Animations/Locomotion/Falling_Direction_1 (expected type: Animation)" crops up.

That said, this occurring still corrupts the model, so I'm not sure how to proceed with that part of the bug report

EDIT:

ALSO, apparently the Animation Slice system DOES append the filetype to the end of the Path setting, but only if you add ".res" to the filename that you want to save the Slice as. So if you navigate to a folder and type the filename as "Walk", it doesn't append the filetype, but if you type the filename as "Walk.res", then it tries to save it as "Walk.res.res"