From f054563bf41bb969dc2300d3c0af04339c5240c5 Mon Sep 17 00:00:00 2001 From: kobewi Date: Sat, 25 Dec 2021 16:55:03 +0100 Subject: [PATCH] Improve docs about plugin registration (cherry picked from commit 4fc795194b29f21194c6f9c3a0ffbe605007200f) --- doc/classes/EditorExportPlugin.xml | 3 ++- doc/classes/EditorImportPlugin.xml | 3 ++- doc/classes/EditorInspectorPlugin.xml | 4 ++-- doc/classes/EditorSceneImporter.xml | 2 ++ doc/classes/EditorSpatialGizmoPlugin.xml | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/doc/classes/EditorExportPlugin.xml b/doc/classes/EditorExportPlugin.xml index 46131d1091a..e029d126b8d 100644 --- a/doc/classes/EditorExportPlugin.xml +++ b/doc/classes/EditorExportPlugin.xml @@ -4,7 +4,8 @@ A script that is executed when exporting the project. - Editor export plugins are automatically activated whenever the user exports the project. Their most common use is to determine what files are being included in the exported project. For each plugin, [method _export_begin] is called at the beginning of the export process and then [method _export_file] is called for each exported file. + [EditorExportPlugin]s are automatically invoked whenever the user exports the project. Their most common use is to determine what files are being included in the exported project. For each plugin, [method _export_begin] is called at the beginning of the export process and then [method _export_file] is called for each exported file. + To use [EditorExportPlugin], register it using the [method EditorPlugin.add_export_plugin] method first. diff --git a/doc/classes/EditorImportPlugin.xml b/doc/classes/EditorImportPlugin.xml index d7e9dd78e99..625d64d9370 100644 --- a/doc/classes/EditorImportPlugin.xml +++ b/doc/classes/EditorImportPlugin.xml @@ -4,7 +4,7 @@ Registers a custom resource importer in the editor. Use the class to parse any file and import it as a new resource type. - EditorImportPlugins provide a way to extend the editor's resource import functionality. Use them to import resources from custom files or to provide alternatives to the editor's existing importers. Register your [EditorPlugin] with [method EditorPlugin.add_import_plugin]. + [EditorImportPlugin]s provide a way to extend the editor's resource import functionality. Use them to import resources from custom files or to provide alternatives to the editor's existing importers. EditorImportPlugins work by associating with specific file extensions and a resource type. See [method get_recognized_extensions] and [method get_resource_type]. They may optionally specify some import presets that affect the import process. EditorImportPlugins are responsible for creating the resources and saving them in the [code].import[/code] directory (see [member ProjectSettings.application/config/use_hidden_project_data_directory]). Below is an example EditorImportPlugin that imports a [Mesh] from a file with the extension ".special" or ".spec": [codeblock] @@ -46,6 +46,7 @@ var filename = save_path + "." + get_save_extension() return ResourceSaver.save(filename, mesh) [/codeblock] + To use [EditorImportPlugin], register it using the [method EditorPlugin.add_import_plugin] method first. https://docs.godotengine.org/en/3.4/tutorials/plugins/editor/import_plugins.html diff --git a/doc/classes/EditorInspectorPlugin.xml b/doc/classes/EditorInspectorPlugin.xml index 04f427148f1..74f927eb13b 100644 --- a/doc/classes/EditorInspectorPlugin.xml +++ b/doc/classes/EditorInspectorPlugin.xml @@ -4,13 +4,13 @@ Plugin for adding custom property editors on inspector. - These plugins allow adding custom property editors to [EditorInspector]. - Plugins are registered via [method EditorPlugin.add_inspector_plugin]. + [EditorInspectorPlugin] allows adding custom property editors to [EditorInspector]. When an object is edited, the [method can_handle] function is called and must return [code]true[/code] if the object type is supported. If supported, the function [method parse_begin] will be called, allowing to place custom controls at the beginning of the class. Subsequently, the [method parse_category] and [method parse_property] are called for every category and property. They offer the ability to add custom controls to the inspector too. Finally, [method parse_end] will be called. On each of these calls, the "add" functions can be called. + To use [EditorInspectorPlugin], register it using the [method EditorPlugin.add_inspector_plugin] method first. https://docs.godotengine.org/en/3.4/tutorials/plugins/editor/inspector_plugins.html diff --git a/doc/classes/EditorSceneImporter.xml b/doc/classes/EditorSceneImporter.xml index be7fb344371..465aac0c3d9 100644 --- a/doc/classes/EditorSceneImporter.xml +++ b/doc/classes/EditorSceneImporter.xml @@ -4,6 +4,8 @@ Imports scenes from third-parties' 3D files. + [EditorSceneImporter] allows to define an importer script for a third-party 3D format. + To use [EditorSceneImporter], register it using the [method EditorPlugin.add_scene_import_plugin] method first. diff --git a/doc/classes/EditorSpatialGizmoPlugin.xml b/doc/classes/EditorSpatialGizmoPlugin.xml index db00d904873..b6928a2783c 100644 --- a/doc/classes/EditorSpatialGizmoPlugin.xml +++ b/doc/classes/EditorSpatialGizmoPlugin.xml @@ -4,7 +4,8 @@ Used by the editor to define Spatial gizmo types. - EditorSpatialGizmoPlugin allows you to define a new type of Gizmo. There are two main ways to do so: extending [EditorSpatialGizmoPlugin] for the simpler gizmos, or creating a new [EditorSpatialGizmo] type. See the tutorial in the documentation for more info. + [EditorSpatialGizmoPlugin] allows you to define a new type of Gizmo. There are two main ways to do so: extending [EditorSpatialGizmoPlugin] for the simpler gizmos, or creating a new [EditorSpatialGizmo] type. See the tutorial in the documentation for more info. + To use [EditorSpatialGizmoPlugin], register it using the [method EditorPlugin.add_spatial_gizmo_plugin] method first. https://docs.godotengine.org/en/3.4/tutorials/plugins/editor/spatial_gizmos.html