0.2.0-dev Download ZIP
39 lines ·2.0 KB Raw
| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="ResourceImporter" inherits="RefCounted" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | Base class for resource importers. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | This is the base class for Godot's resource importers. To implement your own resource importers using editor plugins, see [EditorImportPlugin]. |
| 8 | </description> |
| 9 | <tutorials> |
| 10 | <link title="Import plugins">$DOCS_URL/tutorials/plugins/editor/import_plugins.html</link> |
| 11 | </tutorials> |
| 12 | <methods> |
| 13 | <method name="_get_build_dependencies" qualifiers="virtual const"> |
| 14 | <return type="PackedStringArray" /> |
| 15 | <param index="0" name="path" type="String" /> |
| 16 | <description> |
| 17 | Called when the engine compilation profile editor wants to check what build options an imported resource needs. For example, [ResourceImporterDynamicFont] has a property called [member ResourceImporterDynamicFont.multichannel_signed_distance_field], that depends on the engine to be build with the "msdfgen" module. If that resource happened to be a custom one, it would be handled like this: |
| 18 | [codeblock] |
| 19 | func _get_build_dependencies(path): |
| 20 | var resource = load(path) |
| 21 | var dependencies = PackedStringArray() |
| 22 | |
| 23 | if resource.multichannel_signed_distance_field: |
| 24 | dependencies.push_back("module_msdfgen_enabled") |
| 25 | |
| 26 | return dependencies |
| 27 | [/codeblock] |
| 28 | </description> |
| 29 | </method> |
| 30 | </methods> |
| 31 | <constants> |
| 32 | <constant name="IMPORT_ORDER_DEFAULT" value="0" enum="ImportOrder"> |
| 33 | The default import order. |
| 34 | </constant> |
| 35 | <constant name="IMPORT_ORDER_SCENE" value="100" enum="ImportOrder"> |
| 36 | The import order for scenes, which ensures scenes are imported [i]after[/i] all other core resources such as textures. Custom importers should generally have an import order lower than [code]100[/code] to avoid issues when importing scenes that rely on custom resources. |
| 37 | </constant> |
| 38 | </constants> |
| 39 | </class> |