EditorSpatialGizmoPlugin
Inherits: Resource < Reference < Object Used by the editor to define Spatial gizmo types.
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, register it using the EditorPlugin.add_spatial_gizmo_plugin method first.
Tutorials
- Spatial gizmo plugins
Methods
Method Descriptions
- add_material ( String name, SpatialMaterial material ) get_material. Should not be overridden.
- bool can_be_hidden ( ) virtual
trueif not overridden.
- commit_handle ( EditorSpatialGizmo gizmo, int index, Variant restore, bool cancel=false ) virtual Override this method to commit gizmo handles. Called for this plugin’s active gizmos.
- EditorSpatialGizmo create_gizmo ( Spatial spatial ) virtual
EditorSpatialGizmo for the spatial nodes of your choice, return
nullfor the rest of nodes. See also has_gizmo.
- create_handle_material ( String name, bool billboard=false, Texture texture=null ) get_material and used in EditorSpatialGizmo.add_handles. Should not be overridden. You can optionally provide a texture to use instead of the default icon.
- create_icon_material ( String name, Texture texture, bool on_top=false, Color color=Color( 1, 1, 1, 1 ) ) get_material and used in EditorSpatialGizmo.add_unscaled_billboard. Should not be overridden.
- create_material ( String name, Color color, bool billboard=false, bool on_top=false, bool use_vertex_color=false ) get_material and used in EditorSpatialGizmo.add_mesh and EditorSpatialGizmo.add_lines. Should not be overridden.
- String get_handle_name ( EditorSpatialGizmo gizmo, int index ) virtual Override this method to provide gizmo’s handle names. Called for this plugin’s active gizmos.
- Variant get_handle_value ( EditorSpatialGizmo gizmo, int index ) virtual Gets actual value of a handle from gizmo. Called for this plugin’s active gizmos.
- SpatialMaterial get_material ( String name, EditorSpatialGizmo gizmo=null ) EditorSpatialGizmo is provided, it will try to get the corresponding variant (selected and/or editable).
- String get_name ( ) virtual Override this method to provide the name that will appear in the gizmo visibility menu.
- int get_priority ( ) virtual
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.
-1. If not overridden, this method will return0, which means custom gizmos will automatically override built-in gizmos.
- bool has_gizmo ( Spatial spatial ) virtual
Spatial node is added to a scene this method is called, if it returns
truethe node gets a generic EditorSpatialGizmo assigned and is added to this plugin’s list of active gizmos.
- bool is_handle_highlighted ( EditorSpatialGizmo gizmo, int index ) virtual Gets whether a handle is highlighted or not. Called for this plugin’s active gizmos.
- bool is_selectable_when_hidden ( ) virtual Override this method to define whether a Spatial with this gizmo should be selectable even when the gizmo is hidden.
- redraw ( EditorSpatialGizmo gizmo ) virtual Callback to redraw the provided gizmo. Called for this plugin’s active gizmos.
- set_handle ( EditorSpatialGizmo gizmo, int index, Camera camera, Vector2 point ) virtual Update the value of a handle after it has been updated. Called for this plugin’s active gizmos.
