2018-10-29 18:30:28 +08:00
<?xml version="1.0" encoding="UTF-8" ?>
2020-02-01 09:03:48 +08:00
<class name= "EditorSpatialGizmoPlugin" inherits= "Resource" version= "4.0" >
2018-10-29 18:30:28 +08:00
<brief_description >
2019-01-25 19:57:32 +08:00
Used by the editor to define Spatial gizmo types.
2018-10-29 18:30:28 +08:00
</brief_description>
<description >
2019-01-25 19:57:32 +08: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.
2018-10-29 18:30:28 +08:00
</description>
<tutorials >
2019-01-25 19:57:32 +08:00
<link > https://docs.godotengine.org/en/latest/tutorials/plugins/editor/spatial_gizmos.html</link>
2018-10-29 18:30:28 +08:00
</tutorials>
<methods >
<method name= "add_material" >
<return type= "void" >
</return>
<argument index= "0" name= "name" type= "String" >
</argument>
2020-02-12 16:59:06 +08:00
<argument index= "1" name= "material" type= "StandardMaterial3D" >
2018-10-29 18:30:28 +08:00
</argument>
<description >
2019-01-25 19:57:32 +08: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 18:30:28 +08:00
</description>
</method>
<method name= "can_be_hidden" qualifiers= "virtual" >
<return type= "bool" >
</return>
<description >
2019-06-29 21:24:23 +08:00
Override this method to define whether the gizmo can be hidden or not. Returns [code]true[/code] if not overridden.
2018-10-29 18:30:28 +08:00
</description>
</method>
<method name= "commit_handle" qualifiers= "virtual" >
<return type= "void" >
</return>
<argument index= "0" name= "gizmo" type= "EditorSpatialGizmo" >
</argument>
<argument index= "1" name= "index" type= "int" >
</argument>
<argument index= "2" name= "restore" type= "Variant" >
</argument>
<argument index= "3" name= "cancel" type= "bool" default= "false" >
</argument>
<description >
2019-01-25 19:57:32 +08:00
Override this method to commit gizmo handles. Called for this plugin's active gizmos.
2018-10-29 18:30:28 +08:00
</description>
</method>
<method name= "create_gizmo" qualifiers= "virtual" >
<return type= "EditorSpatialGizmo" >
</return>
<argument index= "0" name= "spatial" type= "Spatial" >
</argument>
<description >
2020-01-23 18:14:14 +08: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 18:30:28 +08:00
</description>
</method>
<method name= "create_handle_material" >
<return type= "void" >
</return>
<argument index= "0" name= "name" type= "String" >
</argument>
<argument index= "1" name= "billboard" type= "bool" default= "false" >
</argument>
<description >
2019-01-25 19:57:32 +08: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.
2018-10-29 18:30:28 +08:00
</description>
</method>
<method name= "create_icon_material" >
<return type= "void" >
</return>
<argument index= "0" name= "name" type= "String" >
</argument>
2020-02-12 16:59:06 +08:00
<argument index= "1" name= "texture" type= "Texture2D" >
2018-10-29 18:30:28 +08:00
</argument>
<argument index= "2" name= "on_top" type= "bool" default= "false" >
</argument>
<argument index= "3" name= "color" type= "Color" default= "Color( 1, 1, 1, 1 )" >
</argument>
<description >
2019-01-25 19:57:32 +08: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 18:30:28 +08:00
</description>
</method>
<method name= "create_material" >
<return type= "void" >
</return>
<argument index= "0" name= "name" type= "String" >
</argument>
<argument index= "1" name= "color" type= "Color" >
</argument>
<argument index= "2" name= "billboard" type= "bool" default= "false" >
</argument>
<argument index= "3" name= "on_top" type= "bool" default= "false" >
</argument>
<argument index= "4" name= "use_vertex_color" type= "bool" default= "false" >
</argument>
<description >
2019-01-25 19:57:32 +08: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 18:30:28 +08:00
</description>
</method>
<method name= "get_handle_name" qualifiers= "virtual" >
<return type= "String" >
</return>
<argument index= "0" name= "gizmo" type= "EditorSpatialGizmo" >
</argument>
<argument index= "1" name= "index" type= "int" >
</argument>
<description >
2019-01-25 19:57:32 +08:00
Override this method to provide gizmo's handle names. Called for this plugin's active gizmos.
2018-10-29 18:30:28 +08:00
</description>
</method>
<method name= "get_handle_value" qualifiers= "virtual" >
<return type= "Variant" >
</return>
<argument index= "0" name= "gizmo" type= "EditorSpatialGizmo" >
</argument>
<argument index= "1" name= "index" type= "int" >
</argument>
<description >
2019-06-22 07:04:47 +08:00
Gets actual value of a handle from gizmo. Called for this plugin's active gizmos.
2018-10-29 18:30:28 +08:00
</description>
</method>
<method name= "get_material" >
2020-02-12 16:59:06 +08:00
<return type= "StandardMaterial3D" >
2018-10-29 18:30:28 +08:00
</return>
<argument index= "0" name= "name" type= "String" >
</argument>
<argument index= "1" name= "gizmo" type= "EditorSpatialGizmo" >
</argument>
<description >
2019-06-22 07:04:47 +08: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 18:30:28 +08:00
</description>
</method>
<method name= "get_name" qualifiers= "virtual" >
<return type= "String" >
</return>
<description >
2019-02-13 16:23:29 +08:00
Override this method to provide the name that will appear in the gizmo visibility menu.
2018-10-29 18:30:28 +08:00
</description>
</method>
2019-03-13 00:03:35 +08:00
<method name= "get_priority" qualifiers= "virtual" >
<return type= "String" >
</return>
<description >
</description>
</method>
2018-10-29 18:30:28 +08:00
<method name= "has_gizmo" qualifiers= "virtual" >
<return type= "bool" >
</return>
<argument index= "0" name= "spatial" type= "Spatial" >
</argument>
<description >
2019-01-25 19:57:32 +08: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 18:30:28 +08:00
</description>
</method>
2019-01-25 19:57:32 +08:00
<method name= "is_handle_highlighted" qualifiers= "virtual" >
2018-10-29 18:30:28 +08:00
<return type= "bool" >
</return>
<argument index= "0" name= "gizmo" type= "EditorSpatialGizmo" >
</argument>
<argument index= "1" name= "index" type= "int" >
</argument>
<description >
2019-06-22 07:04:47 +08:00
Gets whether a handle is highlighted or not. Called for this plugin's active gizmos.
2018-10-29 18:30:28 +08:00
</description>
</method>
<method name= "is_selectable_when_hidden" qualifiers= "virtual" >
<return type= "bool" >
</return>
<description >
2019-01-25 19:57:32 +08:00
Override this method to define whether Spatial with this gizmo should be selecteble even when the gizmo is hidden.
2018-10-29 18:30:28 +08:00
</description>
</method>
<method name= "redraw" qualifiers= "virtual" >
<return type= "void" >
</return>
<argument index= "0" name= "gizmo" type= "EditorSpatialGizmo" >
</argument>
<description >
2019-01-25 19:57:32 +08:00
Callback to redraw the provided gizmo. Called for this plugin's active gizmos.
2018-10-29 18:30:28 +08:00
</description>
</method>
<method name= "set_handle" qualifiers= "virtual" >
<return type= "void" >
</return>
<argument index= "0" name= "gizmo" type= "EditorSpatialGizmo" >
</argument>
<argument index= "1" name= "index" type= "int" >
</argument>
<argument index= "2" name= "camera" type= "Camera" >
</argument>
<argument index= "3" name= "point" type= "Vector2" >
</argument>
<description >
2019-01-25 19:57:32 +08:00
Update the value of a handle after it has been updated. Called for this plugin's active gizmos.
2018-10-29 18:30:28 +08:00
</description>
</method>
</methods>
<constants >
</constants>
</class>