:github_url: hide .. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the EditorSpatialGizmo.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _class_EditorSpatialGizmo: EditorSpatialGizmo ================== **Inherits:** :ref:`SpatialGizmo` **<** :ref:`Reference` **<** :ref:`Object` **Category:** Core Brief Description ----------------- Custom gizmo for editing Spatial objects. Methods ------- +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_collision_segments` **(** :ref:`PoolVector3Array` segments **)** | +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_collision_triangles` **(** :ref:`TriangleMesh` triangles **)** | +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_handles` **(** :ref:`PoolVector3Array` handles, :ref:`Material` material, :ref:`bool` billboard=false, :ref:`bool` secondary=false **)** | +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_lines` **(** :ref:`PoolVector3Array` lines, :ref:`Material` material, :ref:`bool` billboard=false **)** | +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_mesh` **(** :ref:`ArrayMesh` mesh, :ref:`bool` billboard=false, :ref:`RID` skeleton, :ref:`Material` material=null **)** | +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_unscaled_billboard` **(** :ref:`Material` material, :ref:`float` default_scale=1 **)** | +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear` **(** **)** | +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`commit_handle` **(** :ref:`int` index, :ref:`Variant` restore, :ref:`bool` cancel=false **)** virtual | +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_handle_name` **(** :ref:`int` index **)** virtual | +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`get_handle_value` **(** :ref:`int` index **)** virtual | +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`EditorSpatialGizmoPlugin` | :ref:`get_plugin` **(** **)** const | +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Spatial` | :ref:`get_spatial_node` **(** **)** const | +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_handle_highlighted` **(** :ref:`int` index **)** virtual | +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`redraw` **(** **)** virtual | +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_handle` **(** :ref:`int` index, :ref:`Camera` camera, :ref:`Vector2` point **)** virtual | +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_hidden` **(** :ref:`bool` hidden **)** | +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_spatial_node` **(** :ref:`Node` node **)** | +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Description ----------- Custom gizmo that is used for providing custom visualization and editing (handles) for 3D Spatial objects. See :ref:`EditorSpatialGizmoPlugin` for more information. Method Descriptions ------------------- .. _class_EditorSpatialGizmo_method_add_collision_segments: - void **add_collision_segments** **(** :ref:`PoolVector3Array` segments **)** .. _class_EditorSpatialGizmo_method_add_collision_triangles: - void **add_collision_triangles** **(** :ref:`TriangleMesh` triangles **)** Adds collision triangles to the gizmo for picking. A :ref:`TriangleMesh` can be generated from a regular :ref:`Mesh` too. Call this function during :ref:`redraw`. .. _class_EditorSpatialGizmo_method_add_handles: - void **add_handles** **(** :ref:`PoolVector3Array` handles, :ref:`Material` material, :ref:`bool` billboard=false, :ref:`bool` secondary=false **)** Adds a list of handles (points) which can be used to deform the object being edited. There are virtual functions which will be called upon editing of these handles. Call this function during :ref:`redraw`. .. _class_EditorSpatialGizmo_method_add_lines: - void **add_lines** **(** :ref:`PoolVector3Array` lines, :ref:`Material` material, :ref:`bool` billboard=false **)** Adds lines to the gizmo (as sets of 2 points), with a given material. The lines are used for visualizing the gizmo. Call this function during :ref:`redraw`. .. _class_EditorSpatialGizmo_method_add_mesh: - void **add_mesh** **(** :ref:`ArrayMesh` mesh, :ref:`bool` billboard=false, :ref:`RID` skeleton, :ref:`Material` material=null **)** .. _class_EditorSpatialGizmo_method_add_unscaled_billboard: - void **add_unscaled_billboard** **(** :ref:`Material` material, :ref:`float` default_scale=1 **)** Adds an unscaled billboard for visualization. Call this function during :ref:`redraw`. .. _class_EditorSpatialGizmo_method_clear: - void **clear** **(** **)** .. _class_EditorSpatialGizmo_method_commit_handle: - void **commit_handle** **(** :ref:`int` index, :ref:`Variant` restore, :ref:`bool` cancel=false **)** virtual Commit a handle being edited (handles must have been previously added by :ref:`add_handles`). If the ``cancel`` parameter is ``true``, an option to restore the edited value to the original is provided. .. _class_EditorSpatialGizmo_method_get_handle_name: - :ref:`String` **get_handle_name** **(** :ref:`int` index **)** virtual Gets the name of an edited handle (handles must have been previously added by :ref:`add_handles`). Handles can be named for reference to the user when editing. .. _class_EditorSpatialGizmo_method_get_handle_value: - :ref:`Variant` **get_handle_value** **(** :ref:`int` index **)** virtual Gets actual value of a handle. This value can be anything and used for eventually undoing the motion when calling :ref:`commit_handle`. .. _class_EditorSpatialGizmo_method_get_plugin: - :ref:`EditorSpatialGizmoPlugin` **get_plugin** **(** **)** const Returns the :ref:`EditorSpatialGizmoPlugin` that owns this gizmo. It's useful to retrieve materials using :ref:`EditorSpatialGizmoPlugin.get_material`. .. _class_EditorSpatialGizmo_method_get_spatial_node: - :ref:`Spatial` **get_spatial_node** **(** **)** const Returns the Spatial node associated with this gizmo. .. _class_EditorSpatialGizmo_method_is_handle_highlighted: - :ref:`bool` **is_handle_highlighted** **(** :ref:`int` index **)** virtual Gets whether a handle is highlighted or not. .. _class_EditorSpatialGizmo_method_redraw: - void **redraw** **(** **)** virtual This function is called when the Spatial this gizmo refers to changes (the :ref:`Spatial.update_gizmo` is called). .. _class_EditorSpatialGizmo_method_set_handle: - void **set_handle** **(** :ref:`int` index, :ref:`Camera` camera, :ref:`Vector2` point **)** virtual This function is used when the user drags a gizmo handle (previously added with :ref:`add_handles`) in screen coordinates. The :ref:`Camera` is also provided so screen coordinates can be converted to raycasts. .. _class_EditorSpatialGizmo_method_set_hidden: - void **set_hidden** **(** :ref:`bool` hidden **)** .. _class_EditorSpatialGizmo_method_set_spatial_node: - void **set_spatial_node** **(** :ref:`Node` node **)**