EditorSpatialGizmoPlugin

    Category: Core

    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 EditorSpatialGizmo type. See the tutorial in the documentation for more info.

    • void add_material ( String name, material )

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


    Override this method to define whether the gizmo can be hidden or not. Defaults to .


    • void commit_handle ( gizmo, int index, restore, bool cancel=false ) virtual

    • create_gizmo ( Spatial spatial ) virtual

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


    • void create_handle_material ( name, bool billboard=false )

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


    • void create_icon_material ( name, Texture texture, on_top=false, Color 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 and used in EditorSpatialGizmo.add_unscaled_billboard. Should not be overridden.


    • void create_material ( name, Color color, billboard=false, bool on_top=false, 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 get_material and used in and EditorSpatialGizmo.add_lines. Should not be overridden.


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


    • Variant get_handle_value ( gizmo, int index ) virtual

    Get material from the internal list of materials. If an is provided it will try to get the corresponding variant (selected and/or editable).


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


    • get_priority ( ) virtual

    • bool has_gizmo ( spatial ) virtual

    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 the node gets a generic assigned and is added to this plugin’s list of active gizmos.


    • bool is_handle_highlighted ( gizmo, int index ) virtual

    Get whether a handle is highlighted or not. Called for this plugin’s active gizmos.


    • is_selectable_when_hidden ( ) virtual

    Override this method to define whether Spatial with this gizmo should be selecteble even when the gizmo is hidden.



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