godotengine / godot

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

Need ability to trigger reimport of resources from importer script #26276

Closed slapin closed 3 years ago

slapin commented 5 years ago

Godot has very powerful asset management mechanism which allows handling most of asset management issues and allows automate most of jobs associated with imported assets to integrate them into game, like creating needed nodes automatically. These are importer scripts. I currently use them to not get overwhelmed with animation import and automagically create AnimationTree pieces, which saves a lot of time. However, there is a problem.

I have X .escn scenes which I use to import animations into files. It is easier to split animations into several files and use lighter version of character within these files for easier animation. The animations can use several characters. Also I have 2 separate .escn character scenes, where are full characters with all meshes, etc. but only basic animations.

Every time I add or change animations I need to do the following:

  1. reimport animations from animation scenes
  2. reimport character scenes.

This is because in step 1. animations are extracted, filtered and put into .anim files and animation metadata like initial position is recorded among other data, also AnimationTree parts are created and updated. On step 2. animations are loaded into AnimationPlayer of each character.

This works like a charm, but I have to manually reimport each resource because of ordering. It would be nice if I could force reimport of scenes in scriptable way on demand every time animations change, as passing every time through sequence manually is quite boring and annoying.

Zylann commented 3 years ago

See also https://github.com/godotengine/godot-proposals/issues/1615 The title is another use case but shows that when dealing with generated files, one solution is to expose an API to trigger importing on them because Godot does not do it (sometimes it does but is too late). Currently the only workaround is to launch a re-scan of the entire project with EditorFileSystem, in the hope it picks up new files or changes.

Calinou commented 3 years ago

Closing in favor of https://github.com/godotengine/godot-proposals/issues/1615, as feature proposals are now tracked on the Godot proposals repository.