Godot-proposals: Add support for running pre- and post-export scripts

Created on 1 Nov 2019  路  3Comments  路  Source: godotengine/godot-proposals

Describe the project you are working on:
We are working on an open source remake of an old game. We use extracted sprites of the game inside the engine. We are not allowed to redistribute the files, thats why we remove the image content and created a system, which extracts the images when the game starts and loads them into godot.

Describe the problem or limitation you are having in your project:
Our system works fine, but its tedious to clear the images outside of godot in preparation of an export.

Describe how this feature / enhancement will help you overcome this problem or limitation:
It would be more elegant, if we were able to let godot run a gd or C# script before it starts the export process. A feature like Unity has for example.

Show a mock up screenshots/video or a flow diagram explaining how your proposal will work:

  1. Add scripts to the "Pre Export Execution List" or the "Post Export Execution List"
  2. Start export process.
  3. Godot executes every script inside the "Pre Export Execution List"
  4. Godot waits for completion of scripts
  5. Godot exports project
  6. Godot executes every script inside the "Post Export Execution List"

Describe implementation detail for your proposal (in code), if possible:
Godot could call a function inside a "Callback" class. We could just inherit that class and override the callback functions for pre and post export.

If this enhancement will not be used often, can it be worked around with a few lines of script?:
I don't see a real why of how we could achieve this inside of godot

Is there a reason why this should be core and not an add-on in the asset library?:
Its an addition to the export process

editor

Most helpful comment

Looks like this class needs some documentation.

All 3 comments

You might be looking at _export_begin and _export_end callbacks in EditorExportPlugin, I haven't used that myself though.

For some reason _export_end doesn't seem to appear in 3.1 documentation despite being added in godotengine/godot#23693.

Looks like this class needs some documentation.

Looks like its missing in the mono implementation. EditorExportPlugin is not found in the Godot namespace. Its also not working with GDScript. This script does not produce any output in version 3.1.1 Mono

extends EditorExportPlugin

func _export_begin(features, is_debug, path, flags):
    print(flags)
    print("Hello!")
Was this page helpful?
0 / 5 - 0 ratings

Related issues

SpyrexDE picture SpyrexDE  路  3Comments

rontarrant picture rontarrant  路  3Comments

regakakobigman picture regakakobigman  路  3Comments

aaronfranke picture aaronfranke  路  3Comments

PLyczkowski picture PLyczkowski  路  3Comments