|
@@ -14,7 +14,7 @@ EditorSpatialGizmoPlugin
|
|
Brief Description
|
|
Brief Description
|
|
-----------------
|
|
-----------------
|
|
|
|
|
|
-
|
|
|
|
|
|
+Used by the editor to define Spatial gizmo types.
|
|
|
|
|
|
Methods
|
|
Methods
|
|
-------
|
|
-------
|
|
@@ -44,7 +44,7 @@ Methods
|
|
+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`has_gizmo<class_EditorSpatialGizmoPlugin_method_has_gizmo>` **(** :ref:`Spatial<class_Spatial>` spatial **)** virtual |
|
|
| :ref:`bool<class_bool>` | :ref:`has_gizmo<class_EditorSpatialGizmoPlugin_method_has_gizmo>` **(** :ref:`Spatial<class_Spatial>` spatial **)** virtual |
|
|
+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
-| :ref:`bool<class_bool>` | :ref:`is_gizmo_handle_highlighted<class_EditorSpatialGizmoPlugin_method_is_gizmo_handle_highlighted>` **(** :ref:`EditorSpatialGizmo<class_EditorSpatialGizmo>` gizmo, :ref:`int<class_int>` index **)** virtual |
|
|
|
|
|
|
+| :ref:`bool<class_bool>` | :ref:`is_handle_highlighted<class_EditorSpatialGizmoPlugin_method_is_handle_highlighted>` **(** :ref:`EditorSpatialGizmo<class_EditorSpatialGizmo>` gizmo, :ref:`int<class_int>` index **)** virtual |
|
|
+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_selectable_when_hidden<class_EditorSpatialGizmoPlugin_method_is_selectable_when_hidden>` **(** **)** virtual |
|
|
| :ref:`bool<class_bool>` | :ref:`is_selectable_when_hidden<class_EditorSpatialGizmoPlugin_method_is_selectable_when_hidden>` **(** **)** virtual |
|
|
+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
@@ -53,6 +53,16 @@ Methods
|
|
| void | :ref:`set_handle<class_EditorSpatialGizmoPlugin_method_set_handle>` **(** :ref:`EditorSpatialGizmo<class_EditorSpatialGizmo>` gizmo, :ref:`int<class_int>` index, :ref:`Camera<class_Camera>` camera, :ref:`Vector2<class_Vector2>` point **)** virtual |
|
|
| void | :ref:`set_handle<class_EditorSpatialGizmoPlugin_method_set_handle>` **(** :ref:`EditorSpatialGizmo<class_EditorSpatialGizmo>` gizmo, :ref:`int<class_int>` index, :ref:`Camera<class_Camera>` camera, :ref:`Vector2<class_Vector2>` point **)** virtual |
|
|
+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
+-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
|
|
|
|
+Description
|
|
|
|
+-----------
|
|
|
|
+
|
|
|
|
+EditorSpatialGizmoPlugin allows you to define a new type of Gizmo. There are two main ways to do so: extending :ref:`EditorSpatialGizmoPlugin<class_EditorSpatialGizmoPlugin>` for the simpler gizmos, or creating a new :ref:`EditorSpatialGizmo<class_EditorSpatialGizmo>` type. See the tutorial in the documentation for more info.
|
|
|
|
+
|
|
|
|
+Tutorials
|
|
|
|
+---------
|
|
|
|
+
|
|
|
|
+- :doc:`../tutorials/plugins/editor/spatial_gizmos`
|
|
|
|
+
|
|
Method Descriptions
|
|
Method Descriptions
|
|
-------------------
|
|
-------------------
|
|
|
|
|
|
@@ -60,63 +70,95 @@ Method Descriptions
|
|
|
|
|
|
- void **add_material** **(** :ref:`String<class_String>` name, :ref:`SpatialMaterial<class_SpatialMaterial>` material **)**
|
|
- void **add_material** **(** :ref:`String<class_String>` name, :ref:`SpatialMaterial<class_SpatialMaterial>` material **)**
|
|
|
|
|
|
|
|
+Adds a new material to the internal material list for the plugin. It can then be accessed with :ref:`get_material<class_EditorSpatialGizmoPlugin_method_get_material>`. Should not be overridden.
|
|
|
|
+
|
|
.. _class_EditorSpatialGizmoPlugin_method_can_be_hidden:
|
|
.. _class_EditorSpatialGizmoPlugin_method_can_be_hidden:
|
|
|
|
|
|
- :ref:`bool<class_bool>` **can_be_hidden** **(** **)** virtual
|
|
- :ref:`bool<class_bool>` **can_be_hidden** **(** **)** virtual
|
|
|
|
|
|
|
|
+Override this method to define whether the gizmo can be hidden or not. Defaults to true.
|
|
|
|
+
|
|
.. _class_EditorSpatialGizmoPlugin_method_commit_handle:
|
|
.. _class_EditorSpatialGizmoPlugin_method_commit_handle:
|
|
|
|
|
|
- void **commit_handle** **(** :ref:`EditorSpatialGizmo<class_EditorSpatialGizmo>` gizmo, :ref:`int<class_int>` index, :ref:`Variant<class_Variant>` restore, :ref:`bool<class_bool>` cancel=false **)** virtual
|
|
- void **commit_handle** **(** :ref:`EditorSpatialGizmo<class_EditorSpatialGizmo>` gizmo, :ref:`int<class_int>` index, :ref:`Variant<class_Variant>` restore, :ref:`bool<class_bool>` cancel=false **)** virtual
|
|
|
|
|
|
|
|
+Override this method to commit gizmo handles. Called for this plugin's active gizmos.
|
|
|
|
+
|
|
.. _class_EditorSpatialGizmoPlugin_method_create_gizmo:
|
|
.. _class_EditorSpatialGizmoPlugin_method_create_gizmo:
|
|
|
|
|
|
- :ref:`EditorSpatialGizmo<class_EditorSpatialGizmo>` **create_gizmo** **(** :ref:`Spatial<class_Spatial>` spatial **)** virtual
|
|
- :ref:`EditorSpatialGizmo<class_EditorSpatialGizmo>` **create_gizmo** **(** :ref:`Spatial<class_Spatial>` spatial **)** virtual
|
|
|
|
|
|
|
|
+Override this method to return a custom :ref:`EditorSpatialGizmo<class_EditorSpatialGizmo>` for the spatial nodes of your choice, return ``null`` for the rest of nodes. (See also :ref:`has_gizmo<class_EditorSpatialGizmoPlugin_method_has_gizmo>`)
|
|
|
|
+
|
|
.. _class_EditorSpatialGizmoPlugin_method_create_handle_material:
|
|
.. _class_EditorSpatialGizmoPlugin_method_create_handle_material:
|
|
|
|
|
|
- void **create_handle_material** **(** :ref:`String<class_String>` name, :ref:`bool<class_bool>` billboard=false **)**
|
|
- void **create_handle_material** **(** :ref:`String<class_String>` name, :ref:`bool<class_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 :ref:`get_material<class_EditorSpatialGizmoPlugin_method_get_material>` and used in :ref:`EditorSpatialGizmo.add_handles<class_EditorSpatialGizmo_method_add_handles>`. Should not be overridden.
|
|
|
|
+
|
|
.. _class_EditorSpatialGizmoPlugin_method_create_icon_material:
|
|
.. _class_EditorSpatialGizmoPlugin_method_create_icon_material:
|
|
|
|
|
|
- void **create_icon_material** **(** :ref:`String<class_String>` name, :ref:`Texture<class_Texture>` texture, :ref:`bool<class_bool>` on_top=false, :ref:`Color<class_Color>` color=Color( 1, 1, 1, 1 ) **)**
|
|
- void **create_icon_material** **(** :ref:`String<class_String>` name, :ref:`Texture<class_Texture>` texture, :ref:`bool<class_bool>` on_top=false, :ref:`Color<class_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 :ref:`get_material<class_EditorSpatialGizmoPlugin_method_get_material>` and used in :ref:`EditorSpatialGizmo.add_unscaled_billboard<class_EditorSpatialGizmo_method_add_unscaled_billboard>`. Should not be overridden.
|
|
|
|
+
|
|
.. _class_EditorSpatialGizmoPlugin_method_create_material:
|
|
.. _class_EditorSpatialGizmoPlugin_method_create_material:
|
|
|
|
|
|
- void **create_material** **(** :ref:`String<class_String>` name, :ref:`Color<class_Color>` color, :ref:`bool<class_bool>` billboard=false, :ref:`bool<class_bool>` on_top=false, :ref:`bool<class_bool>` use_vertex_color=false **)**
|
|
- void **create_material** **(** :ref:`String<class_String>` name, :ref:`Color<class_Color>` color, :ref:`bool<class_bool>` billboard=false, :ref:`bool<class_bool>` on_top=false, :ref:`bool<class_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 :ref:`get_material<class_EditorSpatialGizmoPlugin_method_get_material>` and used in :ref:`EditorSpatialGizmo.add_mesh<class_EditorSpatialGizmo_method_add_mesh>` and :ref:`EditorSpatialGizmo.add_lines<class_EditorSpatialGizmo_method_add_lines>`. Should not be overridden.
|
|
|
|
+
|
|
.. _class_EditorSpatialGizmoPlugin_method_get_handle_name:
|
|
.. _class_EditorSpatialGizmoPlugin_method_get_handle_name:
|
|
|
|
|
|
- :ref:`String<class_String>` **get_handle_name** **(** :ref:`EditorSpatialGizmo<class_EditorSpatialGizmo>` gizmo, :ref:`int<class_int>` index **)** virtual
|
|
- :ref:`String<class_String>` **get_handle_name** **(** :ref:`EditorSpatialGizmo<class_EditorSpatialGizmo>` gizmo, :ref:`int<class_int>` index **)** virtual
|
|
|
|
|
|
|
|
+Override this method to provide gizmo's handle names. Called for this plugin's active gizmos.
|
|
|
|
+
|
|
.. _class_EditorSpatialGizmoPlugin_method_get_handle_value:
|
|
.. _class_EditorSpatialGizmoPlugin_method_get_handle_value:
|
|
|
|
|
|
- :ref:`Variant<class_Variant>` **get_handle_value** **(** :ref:`EditorSpatialGizmo<class_EditorSpatialGizmo>` gizmo, :ref:`int<class_int>` index **)** virtual
|
|
- :ref:`Variant<class_Variant>` **get_handle_value** **(** :ref:`EditorSpatialGizmo<class_EditorSpatialGizmo>` gizmo, :ref:`int<class_int>` index **)** virtual
|
|
|
|
|
|
|
|
+Get actual value of a handle from gizmo. Called for this plugin's active gizmos.
|
|
|
|
+
|
|
.. _class_EditorSpatialGizmoPlugin_method_get_material:
|
|
.. _class_EditorSpatialGizmoPlugin_method_get_material:
|
|
|
|
|
|
- :ref:`SpatialMaterial<class_SpatialMaterial>` **get_material** **(** :ref:`String<class_String>` name, :ref:`EditorSpatialGizmo<class_EditorSpatialGizmo>` gizmo **)**
|
|
- :ref:`SpatialMaterial<class_SpatialMaterial>` **get_material** **(** :ref:`String<class_String>` name, :ref:`EditorSpatialGizmo<class_EditorSpatialGizmo>` gizmo **)**
|
|
|
|
|
|
|
|
+Get material from the internal list of materials. If an :ref:`EditorSpatialGizmo<class_EditorSpatialGizmo>` is provided it will try to get the corresponding variant (selected and/or editable).
|
|
|
|
+
|
|
.. _class_EditorSpatialGizmoPlugin_method_get_name:
|
|
.. _class_EditorSpatialGizmoPlugin_method_get_name:
|
|
|
|
|
|
- :ref:`String<class_String>` **get_name** **(** **)** virtual
|
|
- :ref:`String<class_String>` **get_name** **(** **)** virtual
|
|
|
|
|
|
|
|
+Override this method to provide the name that will appear in teh gizmo visibility menu.
|
|
|
|
+
|
|
.. _class_EditorSpatialGizmoPlugin_method_has_gizmo:
|
|
.. _class_EditorSpatialGizmoPlugin_method_has_gizmo:
|
|
|
|
|
|
- :ref:`bool<class_bool>` **has_gizmo** **(** :ref:`Spatial<class_Spatial>` spatial **)** virtual
|
|
- :ref:`bool<class_bool>` **has_gizmo** **(** :ref:`Spatial<class_Spatial>` spatial **)** virtual
|
|
|
|
|
|
-.. _class_EditorSpatialGizmoPlugin_method_is_gizmo_handle_highlighted:
|
|
|
|
|
|
+Override this method to define which Spatial nodes have a gizmo from this plugin. Whenever a :ref:`Spatial<class_Spatial>` node is added to a scene this method is called, if it returns ``true`` the node gets a generic :ref:`EditorSpatialGizmo<class_EditorSpatialGizmo>` assigned and is added to this plugin's list of active gizmos.
|
|
|
|
|
|
-- :ref:`bool<class_bool>` **is_gizmo_handle_highlighted** **(** :ref:`EditorSpatialGizmo<class_EditorSpatialGizmo>` gizmo, :ref:`int<class_int>` index **)** virtual
|
|
|
|
|
|
+.. _class_EditorSpatialGizmoPlugin_method_is_handle_highlighted:
|
|
|
|
+
|
|
|
|
+- :ref:`bool<class_bool>` **is_handle_highlighted** **(** :ref:`EditorSpatialGizmo<class_EditorSpatialGizmo>` gizmo, :ref:`int<class_int>` index **)** virtual
|
|
|
|
+
|
|
|
|
+Get whether a handle is highlighted or not. Called for this plugin's active gizmos.
|
|
|
|
|
|
.. _class_EditorSpatialGizmoPlugin_method_is_selectable_when_hidden:
|
|
.. _class_EditorSpatialGizmoPlugin_method_is_selectable_when_hidden:
|
|
|
|
|
|
- :ref:`bool<class_bool>` **is_selectable_when_hidden** **(** **)** virtual
|
|
- :ref:`bool<class_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.
|
|
|
|
+
|
|
.. _class_EditorSpatialGizmoPlugin_method_redraw:
|
|
.. _class_EditorSpatialGizmoPlugin_method_redraw:
|
|
|
|
|
|
- void **redraw** **(** :ref:`EditorSpatialGizmo<class_EditorSpatialGizmo>` gizmo **)** virtual
|
|
- void **redraw** **(** :ref:`EditorSpatialGizmo<class_EditorSpatialGizmo>` gizmo **)** virtual
|
|
|
|
|
|
|
|
+Callback to redraw the provided gizmo. Called for this plugin's active gizmos.
|
|
|
|
+
|
|
.. _class_EditorSpatialGizmoPlugin_method_set_handle:
|
|
.. _class_EditorSpatialGizmoPlugin_method_set_handle:
|
|
|
|
|
|
- void **set_handle** **(** :ref:`EditorSpatialGizmo<class_EditorSpatialGizmo>` gizmo, :ref:`int<class_int>` index, :ref:`Camera<class_Camera>` camera, :ref:`Vector2<class_Vector2>` point **)** virtual
|
|
- void **set_handle** **(** :ref:`EditorSpatialGizmo<class_EditorSpatialGizmo>` gizmo, :ref:`int<class_int>` index, :ref:`Camera<class_Camera>` camera, :ref:`Vector2<class_Vector2>` point **)** virtual
|
|
|
|
|
|
|
|
+Update the value of a handle after it has been updated. Called for this plugin's active gizmos.
|
|
|
|
+
|