2018-10-29 11:30:28 +01:00
<?xml version="1.0" encoding="UTF-8" ?>
2021-11-05 15:02:42 +01:00
<class name= "EditorSpatialGizmoPlugin" inherits= "Resource" version= "3.5" >
2018-10-29 11:30:28 +01:00
<brief_description >
2019-01-25 12:57:32 +01:00
Used by the editor to define Spatial gizmo types.
2018-10-29 11:30:28 +01:00
</brief_description>
<description >
2021-12-25 16:55:03 +01:00
[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.
2018-10-29 11:30:28 +01:00
</description>
<tutorials >
2021-11-15 17:11:20 +01:00
<link > $DOCS_URL/tutorials/plugins/editor/spatial_gizmos.html</link>
2018-10-29 11:30:28 +01:00
</tutorials>
<methods >
<method name= "add_material" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "name" type= "String" />
<argument index= "1" name= "material" type= "SpatialMaterial" />
2018-10-29 11:30:28 +01:00
<description >
2019-01-25 12:57:32 +01:00
Adds a new material to the internal material list for the plugin. It can then be accessed with [method get_material]. Should not be overridden.
2018-10-29 11:30:28 +01:00
</description>
</method>
<method name= "can_be_hidden" qualifiers= "virtual" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
2018-10-29 11:30:28 +01:00
<description >
2019-06-29 15:24:23 +02:00
Override this method to define whether the gizmo can be hidden or not. Returns [code]true[/code] if not overridden.
2018-10-29 11:30:28 +01:00
</description>
</method>
<method name= "commit_handle" qualifiers= "virtual" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "gizmo" type= "EditorSpatialGizmo" />
<argument index= "1" name= "index" type= "int" />
<argument index= "2" name= "restore" type= "Variant" />
<argument index= "3" name= "cancel" type= "bool" default= "false" />
2018-10-29 11:30:28 +01:00
<description >
2019-01-25 12:57:32 +01:00
Override this method to commit gizmo handles. Called for this plugin's active gizmos.
2018-10-29 11:30:28 +01:00
</description>
</method>
<method name= "create_gizmo" qualifiers= "virtual" >
2021-07-30 15:28:05 +02:00
<return type= "EditorSpatialGizmo" />
<argument index= "0" name= "spatial" type= "Spatial" />
2018-10-29 11:30:28 +01:00
<description >
2020-01-23 11:14:14 +01:00
Override this method to return a custom [EditorSpatialGizmo] for the spatial nodes of your choice, return [code]null[/code] for the rest of nodes. See also [method has_gizmo].
2018-10-29 11:30:28 +01:00
</description>
</method>
<method name= "create_handle_material" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "name" type= "String" />
<argument index= "1" name= "billboard" type= "bool" default= "false" />
2021-08-05 16:44:43 +02:00
<argument index= "2" name= "texture" type= "Texture" default= "null" />
2018-10-29 11:30:28 +01:00
<description >
2019-01-25 12:57:32 +01:00
Creates a handle material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with [method get_material] and used in [method EditorSpatialGizmo.add_handles]. Should not be overridden.
2021-08-05 16:44:43 +02:00
You can optionally provide a texture to use instead of the default icon.
2018-10-29 11:30:28 +01:00
</description>
</method>
<method name= "create_icon_material" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "name" type= "String" />
<argument index= "1" name= "texture" type= "Texture" />
<argument index= "2" name= "on_top" type= "bool" default= "false" />
<argument index= "3" name= "color" type= "Color" default= "Color( 1, 1, 1, 1 )" />
2018-10-29 11:30:28 +01:00
<description >
2019-01-25 12:57:32 +01:00
Creates an icon material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with [method get_material] and used in [method EditorSpatialGizmo.add_unscaled_billboard]. Should not be overridden.
2018-10-29 11:30:28 +01:00
</description>
</method>
<method name= "create_material" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "name" type= "String" />
<argument index= "1" name= "color" type= "Color" />
<argument index= "2" name= "billboard" type= "bool" default= "false" />
<argument index= "3" name= "on_top" type= "bool" default= "false" />
<argument index= "4" name= "use_vertex_color" type= "bool" default= "false" />
2018-10-29 11:30:28 +01:00
<description >
2019-01-25 12:57:32 +01:00
Creates an unshaded material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with [method get_material] and used in [method EditorSpatialGizmo.add_mesh] and [method EditorSpatialGizmo.add_lines]. Should not be overridden.
2018-10-29 11:30:28 +01:00
</description>
</method>
<method name= "get_handle_name" qualifiers= "virtual" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
<argument index= "0" name= "gizmo" type= "EditorSpatialGizmo" />
<argument index= "1" name= "index" type= "int" />
2018-10-29 11:30:28 +01:00
<description >
2019-01-25 12:57:32 +01:00
Override this method to provide gizmo's handle names. Called for this plugin's active gizmos.
2018-10-29 11:30:28 +01:00
</description>
</method>
<method name= "get_handle_value" qualifiers= "virtual" >
2021-07-30 15:28:05 +02:00
<return type= "Variant" />
<argument index= "0" name= "gizmo" type= "EditorSpatialGizmo" />
<argument index= "1" name= "index" type= "int" />
2018-10-29 11:30:28 +01:00
<description >
2019-06-22 01:04:47 +02:00
Gets actual value of a handle from gizmo. Called for this plugin's active gizmos.
2018-10-29 11:30:28 +01:00
</description>
</method>
<method name= "get_material" >
2021-07-30 15:28:05 +02:00
<return type= "SpatialMaterial" />
<argument index= "0" name= "name" type= "String" />
<argument index= "1" name= "gizmo" type= "EditorSpatialGizmo" default= "null" />
2018-10-29 11:30:28 +01:00
<description >
2019-06-22 01:04:47 +02:00
Gets material from the internal list of materials. If an [EditorSpatialGizmo] is provided, it will try to get the corresponding variant (selected and/or editable).
2018-10-29 11:30:28 +01:00
</description>
</method>
<method name= "get_name" qualifiers= "virtual" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
2018-10-29 11:30:28 +01:00
<description >
2019-02-13 09:23:29 +01:00
Override this method to provide the name that will appear in the gizmo visibility menu.
2018-10-29 11:30:28 +01:00
</description>
</method>
2019-03-12 17:03:35 +01:00
<method name= "get_priority" qualifiers= "virtual" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2019-03-12 17:03:35 +01:00
<description >
2020-07-18 17:17:00 +02:00
Override this method to set the gizmo's priority. Higher values correspond to higher priority. If a gizmo with higher priority conflicts with another gizmo, only the gizmo with higher priority will be used.
All built-in editor gizmos return a priority of [code]-1[/code]. If not overridden, this method will return [code]0[/code], which means custom gizmos will automatically override built-in gizmos.
2019-03-12 17:03:35 +01:00
</description>
</method>
2018-10-29 11:30:28 +01:00
<method name= "has_gizmo" qualifiers= "virtual" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
<argument index= "0" name= "spatial" type= "Spatial" />
2018-10-29 11:30:28 +01:00
<description >
2019-01-25 12:57:32 +01:00
Override this method to define which Spatial nodes have a gizmo from this plugin. Whenever a [Spatial] node is added to a scene this method is called, if it returns [code]true[/code] the node gets a generic [EditorSpatialGizmo] assigned and is added to this plugin's list of active gizmos.
2018-10-29 11:30:28 +01:00
</description>
</method>
2019-01-25 12:57:32 +01:00
<method name= "is_handle_highlighted" qualifiers= "virtual" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
<argument index= "0" name= "gizmo" type= "EditorSpatialGizmo" />
<argument index= "1" name= "index" type= "int" />
2018-10-29 11:30:28 +01:00
<description >
2019-06-22 01:04:47 +02:00
Gets whether a handle is highlighted or not. Called for this plugin's active gizmos.
2018-10-29 11:30:28 +01:00
</description>
</method>
<method name= "is_selectable_when_hidden" qualifiers= "virtual" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
2018-10-29 11:30:28 +01:00
<description >
2021-03-18 12:04:28 +01:00
Override this method to define whether a Spatial with this gizmo should be selectable even when the gizmo is hidden.
2018-10-29 11:30:28 +01:00
</description>
</method>
<method name= "redraw" qualifiers= "virtual" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "gizmo" type= "EditorSpatialGizmo" />
2018-10-29 11:30:28 +01:00
<description >
2019-01-25 12:57:32 +01:00
Callback to redraw the provided gizmo. Called for this plugin's active gizmos.
2018-10-29 11:30:28 +01:00
</description>
</method>
<method name= "set_handle" qualifiers= "virtual" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "gizmo" type= "EditorSpatialGizmo" />
<argument index= "1" name= "index" type= "int" />
<argument index= "2" name= "camera" type= "Camera" />
<argument index= "3" name= "point" type= "Vector2" />
2018-10-29 11:30:28 +01:00
<description >
2019-01-25 12:57:32 +01:00
Update the value of a handle after it has been updated. Called for this plugin's active gizmos.
2018-10-29 11:30:28 +01:00
</description>
</method>
</methods>
<constants >
</constants>
</class>