godot icon indicating copy to clipboard operation
godot copied to clipboard

Expose `ResourceImporter::get_format_version` via `EditorImportPlugin::_get_format_version()`

Open dsnopek opened this issue 1 year ago • 4 comments

Implements https://github.com/godotengine/godot-proposals/issues/10658

I threw this together since it was easy enough to do, however, I haven't tested it since this isn't my area.

@HiddenJesse Could you give this a try with your project? If you're using it with GDExtension, you'll need to use godot --dump-extension-api to get a new extension_api.json for your bindings (ex godot-cpp) to know about the new virtual method.

dsnopek avatar Sep 10 '24 15:09 dsnopek

@dsnopek I was able to give this a test, and TLDR, it worked exactly as hoped.

For full context, we opted to cherry-pick the commit of this CR and apply it to the 4.2 stable branch. This is because our game is currently on the 4.2 line & we wanted to test the change without all the other changes currently on the master branch.

The steps we went through to test were:

  • Rebuild the 4.2 godot editor
  • Export the API extensions .h/json files
  • Clean and Rebuild our GDExtension library with the updated API extension .h/json files
  • Added the needed _get_format_version() line to all our EditorImportPlugin files with a default value of 0 to start & rebuilt
  • Load and verify that the project was operating as expet
  • Closed the editor
  • Incremented the _get_format_version() from 0 => 1 for our custom palettization importer for pngs & rebuilt
  • Opened the editor
  • Saw the editor show the "Importing assets" popup & progress bar as it went back over all of our pre-existing PNGs, reimporting them now that the format version had changed.

So yeah, to reiterate, my testing of these code changes are operating as intended!

HiddenJesse avatar Sep 10 '24 20:09 HiddenJesse

Thanks for testing!

dsnopek avatar Sep 10 '24 20:09 dsnopek

Hi, there seems to be a mistake in your PR's description. I am the creator of the proposal issue that was referenced (https://github.com/godotengine/godot-proposals/issues/10683), and your PR seems to expose an unrelated property. Perhaps you were trying to reference another issue? My proposal has nothing to do with the resource importer.

BrixsterPlanet avatar Sep 12 '24 16:09 BrixsterPlanet

@dsnopek Sorry to ping on this after a month, but I did notice that this was put on the Godot 4.4 milestone. Does that mean there's no chance of this being back ported to the 4.3 line?

HiddenJesse avatar Oct 08 '24 01:10 HiddenJesse

4.3 is on the finish line AFAIU - too late for this to make it in

Zireael07 avatar Oct 08 '24 07:10 Zireael07

Thanks!

Repiteo avatar Dec 12 '24 22:12 Repiteo