godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.12k stars 69 forks source link

Add a new Resource that handles Animation Slicing instead of Advanced Import settings #10666

Open LordMcMutton opened 1 week ago

LordMcMutton commented 1 week ago

Describe the project you are working on

The project uses GLTF-format character models with animations stored in a single Action Track.

Describe the problem or limitation you are having in your project

Godot crashed while reimporting a character model whose animations were being split up and saved via the Advanced Import Animation Slice system. The crash corrupted the model's file and Godot refused to reimport it correctly, necessitating deleting the model file, resulting in the loss of all settings regarding that.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Detach the Animation Slice system from the Advanced Reimport system so that something happening to the base file doesn't affect Animation Slice settings

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

You could create a new type of Resource that handles this- you would set up all of the Animation Slice settings using it, then feed it a model to execute the Animation Slice on.

Other benefits:

-Said Resource could also allow you to pick the Action that the Animation Slices will be derived from, which fixes the bug that requires the Action to be named "Default" to actually work.

-Its implementation would allow for the same settings to be used with different models with the same animation sets, allowing for less tedium and repeated setup.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No- Animation Slice system is an inherent part of the Advanced Import Settings, and wouldn't be able to be handled separately.

Is there a reason why this should be core and not an add-on in the asset library?

Fixing a weakness in Godot's design.

Calinou commented 1 week ago

Godot crashed while reimporting a character model whose animations were being split up and saved via the Advanced Import Animation Slice system, resulting in the loss of all settings regarding that.

Shouldn't we fix the cause of the crash instead, or make Godot able to recover partial data in case of crashes instead?

LordMcMutton commented 1 week ago

That'd be ideal, but I do think that making systems resilient enough to be unaffected by any given crash is also a good idea. It'd also be difficult to figure out the cause of the crash, as I wasn't running the Console executable, and don't see any information in the godot.log (I may have overwritten the .log that did have info, as I didn't know about that feature until a second ago)

In my haste to get the idea down, I misrepresented the actual 'loss of data', though. The settings weren't erased by the corruption or crash, itself, but I had to delete the whole model and re-export it from Blender to rectify the corrupted file.

Godot refused to reimport and overwrite the model when re-exported from Blender while the corrupted file still existed, and attempting to manually reimport it in Godot seemed to attempt a reimport, but it had no affect.

I just have to reinput all of the Animation Slice data, but it would be preferable if that wasn't necessary if it does happens again.

(I've updated the initial post with the correct information about the data loss)