Skip to content

Commit

Permalink
Merge pull request #56241 from KoBeWi/r3gist3r_b3for3_us3
Browse files Browse the repository at this point in the history
[3.x] Improve docs about plugin registration
  • Loading branch information
mhilbrunner authored Jan 2, 2022
2 parents 7fcfde9 + 4fc7951 commit 40f7dcb
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion doc/classes/EditorExportPlugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
A script that is executed when exporting the project.
</brief_description>
<description>
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.
</description>
<tutorials>
</tutorials>
Expand Down
3 changes: 2 additions & 1 deletion doc/classes/EditorImportPlugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
</brief_description>
<description>
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]
Expand Down Expand Up @@ -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.
</description>
<tutorials>
<link>$DOCS_URL/tutorials/plugins/editor/import_plugins.html</link>
Expand Down
4 changes: 2 additions & 2 deletions doc/classes/EditorInspectorPlugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
Plugin for adding custom property editors on inspector.
</brief_description>
<description>
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.
</description>
<tutorials>
<link title="Inspector plugins">$DOCS_URL/tutorials/plugins/editor/inspector_plugins.html</link>
Expand Down
2 changes: 2 additions & 0 deletions doc/classes/EditorSceneImporter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
Imports scenes from third-parties' 3D files.
</brief_description>
<description>
[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.
</description>
<tutorials>
</tutorials>
Expand Down
3 changes: 2 additions & 1 deletion doc/classes/EditorSpatialGizmoPlugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
Used by the editor to define Spatial gizmo types.
</brief_description>
<description>
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.
</description>
<tutorials>
<link>$DOCS_URL/tutorials/plugins/editor/spatial_gizmos.html</link>
Expand Down

0 comments on commit 40f7dcb

Please sign in to comment.