Welcome to the Godot Reference Fork and the Godot Proposals Fork alternatives. Why?

EditorSpatialGizmoPlugin

0 0 vote
Article Rating

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.

Methods

voidadd_material ( String name, SpatialMaterial material )
boolcan_be_hidden ( ) virtual
voidcommit_handle ( EditorSpatialGizmo gizmo, int index, Variant restore, bool cancel=false ) virtual
EditorSpatialGizmocreate_gizmo ( Spatial spatial ) virtual
voidcreate_handle_material ( String name, bool billboard=false )
voidcreate_icon_material ( String name, Texture texture, bool on_top=false, Color color=Color( 1, 1, 1, 1 ) )
voidcreate_material ( String name, Color color, bool billboard=false, bool on_top=false, bool use_vertex_color=false )
Stringget_handle_name ( EditorSpatialGizmo gizmo, int index ) virtual
Variantget_handle_value ( EditorSpatialGizmo gizmo, int index ) virtual
SpatialMaterialget_material ( String name, EditorSpatialGizmo gizmo )
Stringget_name ( ) virtual
Stringget_priority ( ) virtual
boolhas_gizmo ( Spatial spatial ) virtual
boolis_handle_highlighted ( EditorSpatialGizmo gizmo, int index ) virtual
boolis_selectable_when_hidden ( ) virtual
voidredraw ( EditorSpatialGizmo gizmo ) virtual
voidset_handle ( EditorSpatialGizmo gizmo, int index, Camera camera, Vector2 point ) virtual

Method Descriptions

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


  • bool can_be_hidden ( ) virtual

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 null for the rest of nodes. See also has_gizmo.


  • void create_handle_material ( String 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 get_material and used in EditorSpatialGizmo.add_handles. Should not be overridden.


  • void create_icon_material ( String name, Texture texture, bool 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 get_material and used in EditorSpatialGizmo.add_unscaled_billboard. Should not be overridden.


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


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.


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


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


  • String get_priority ( ) 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 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.


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

Doc ID missing

Disclaimer: This page has been automaticaly and directly extracted from the official Godot Docs website, the 1970-01-01 at 00:00:00. It’s the English Stable version because it’s what most Godot users should use. The Copyright owners are Juan Linietsky, Ariel Manzur and the Godot community. CC-BY 3.0. Thanks for your patience and generosity.

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x