EditorSpatialGizmoPlugin

    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 for the simpler gizmos, or creating a new type. See the tutorial in the documentation for more info.

    Adds a new material to the internal material list for the plugin. It can then be accessed with . Should not be overridden.


    Override this method to define whether the gizmo can be hidden or not. Returns true if not overridden.


    Override this method to commit gizmo handles. Called for this plugin’s active gizmos.


    Override this method to return a custom EditorSpatialGizmo for the spatial nodes of your choice, return for the rest of nodes. See also .


    • void create_handle_material ( String name, billboard=false )

    • void create_icon_material ( String name, texture, bool on_top=false, color=Color( 1, 1, 1, 1 ) )

    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 get_material and used in . Should not be overridden.


    • void create_material ( String name, color, bool billboard=false, on_top=false, bool use_vertex_color=false )

    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 and used in EditorSpatialGizmo.add_mesh and . Should not be overridden.


    • String get_handle_name ( gizmo, int index ) virtual

    Override this method to provide gizmo’s handle names. Called for this plugin’s active gizmos.


    Gets actual value of a handle from gizmo. Called for this plugin’s active gizmos.


    • get_material ( String name, gizmo=null )

    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).


    • get_name ( ) virtual

    Override this method to provide the name that will appear in the gizmo visibility menu.


    • int get_priority ( ) virtual

    All built-in editor gizmos return a priority of -1. If not overridden, this method will return , which means custom gizmos will automatically override built-in gizmos.


    • has_gizmo ( Spatial spatial ) virtual

    Override this method to define which Spatial nodes have a gizmo from this plugin. Whenever a node is added to a scene this method is called, if it returns true the node gets a generic EditorSpatialGizmo assigned and is added to this plugin’s list of active gizmos.


    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 Spatial with this gizmo should be selecteble even when the gizmo is hidden.


    Callback to redraw the provided gizmo. Called for this plugin’s active gizmos.


    • void set_handle ( gizmo, int index, camera, Vector2 point ) virtual

    Update the value of a handle after it has been updated. Called for this plugin’s active gizmos.