Skip to content

Commit

Permalink
Apply suggestion from raulsntos
Browse files Browse the repository at this point in the history
Co-Authored-By: Raul Santos <raulsntos@gmail.com>
  • Loading branch information
esainane and raulsntos committed Aug 19, 2024
1 parent 45431d3 commit a28f172
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions doc/classes/EditorImportPlugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,6 @@
This function can only be called during the [method _import] callback and it allows manually importing resources from it. This is useful when the imported file generates external resources that require importing (as example, images). Custom parameters for the ".import" file can be passed via the [param custom_options]. Additionally, in cases where multiple importers can handle a file, the [param custom_importer] can be specified to force a specific one. This function performs a resource import and returns immediately with a success or error code. [param generator_parameters] defines optional extra metadata which will be stored as [code skip-lint]generator_parameters[/code] in the [code]remap[/code] section of the [code].import[/code] file, for example to store a md5 hash of the source data. For example:
[codeblocks]
[gdscript]
var _editor: EditorInterface

func _import(source_file, save_path, options, r_platform_variants, r_gen_files):
# Make textures folder if required.
var source_file_folder: String = source_file.rsplit("/", true, 1)[0]
Expand All @@ -259,7 +257,7 @@
export_image_file.close()

# Refresh view of exported file.
var editor_file_system: EditorFileSystem = _editor.get_resource_filesystem()
var editor_file_system: EditorFileSystem = EditorInterface.get_resource_filesystem()
editor_file_system.update_file(textures_folder)
editor_file_system.update_file(export_path)

Expand Down

0 comments on commit a28f172

Please sign in to comment.