From e90fb5b0ab511d259436184a2e90c295445645db Mon Sep 17 00:00:00 2001 From: JFonS Date: Fri, 25 Jan 2019 12:57:32 +0100 Subject: Minor fixes and documentation for Spatial Gizmos --- doc/classes/EditorSpatialGizmo.xml | 27 +++++++++++++++++++++++++-- doc/classes/EditorSpatialGizmoPlugin.xml | 21 ++++++++++++++++++++- 2 files changed, 45 insertions(+), 3 deletions(-) (limited to 'doc/classes') diff --git a/doc/classes/EditorSpatialGizmo.xml b/doc/classes/EditorSpatialGizmo.xml index c3ecd3c3b7..45b92276f1 100644 --- a/doc/classes/EditorSpatialGizmo.xml +++ b/doc/classes/EditorSpatialGizmo.xml @@ -4,7 +4,7 @@ Custom gizmo for editing Spatial objects. - Custom gizmo that is used for providing custom visualization and editing (handles) for 3D Spatial objects. These are created by [method EditorSpatialGizmoPlugin.create_gizmo]. + Custom gizmo that is used for providing custom visualization and editing (handles) for 3D Spatial objects. See [EditorSpatialGizmoPlugin] for more information. @@ -116,7 +116,30 @@ - Get actual value of a handle. This value can be anything and used for eventually undoing the motion when calling [method commit_handle] + Get actual value of a handle. This value can be anything and used for eventually undoing the motion when calling [method commit_handle]. + + + + + + + Return the [EditorSpatialGizmoPlugin] that owns this gizmo. It's useful to retrieve materials using [method EditorSpatialGizmoPlugin.get_material]. + + + + + + + Returns the Spatial node associated with this gizmo. + + + + + + + + + Get whether a handle is highlighted or not. diff --git a/doc/classes/EditorSpatialGizmoPlugin.xml b/doc/classes/EditorSpatialGizmoPlugin.xml index 521ec748b3..a62b23ead8 100644 --- a/doc/classes/EditorSpatialGizmoPlugin.xml +++ b/doc/classes/EditorSpatialGizmoPlugin.xml @@ -1,10 +1,13 @@ + 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 [EditorSpatialGizmoPlugin] for the simpler gizmos, or creating a new [EditorSpatialGizmo] type. See the tutorial in the documentation for more info. + https://docs.godotengine.org/en/latest/tutorials/plugins/editor/spatial_gizmos.html @@ -17,12 +20,14 @@ + Adds a new material to the internal material list for the plugin. It can then be accessed with [method get_material]. Should not be overridden. + Override this method to define whether the gizmo can be hidden or not. Defaults to true. @@ -37,6 +42,7 @@ + Override this method to commit gizmo handles. Called for this plugin's active gizmos. @@ -45,6 +51,7 @@ + Override this method to return a custom [EditorSpatialGizmo] for the spatial nodes of your choice, return [code]null[/code] for the rest of nodes. (See also [method has_gizmo]) @@ -55,6 +62,7 @@ + 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 [method get_material] and used in [method EditorSpatialGizmo.add_handles]. Should not be overridden. @@ -69,6 +77,7 @@ + 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 [method get_material] and used in [method EditorSpatialGizmo.add_unscaled_billboard]. Should not be overridden. @@ -85,6 +94,7 @@ + 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 [method get_material] and used in [method EditorSpatialGizmo.add_mesh] and [method EditorSpatialGizmo.add_lines]. Should not be overridden. @@ -95,6 +105,7 @@ + Override this method to provide gizmo's handle names. Called for this plugin's active gizmos. @@ -105,6 +116,7 @@ + Get actual value of a handle from gizmo. Called for this plugin's active gizmos. @@ -115,12 +127,14 @@ + Get 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 teh gizmo visibility menu. @@ -129,9 +143,10 @@ + 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 [code]true[/code] the node gets a generic [EditorSpatialGizmo] assigned and is added to this plugin's list of active gizmos. - + @@ -139,12 +154,14 @@ + Get whether a handle is highlighted or not. Called for this plugin's active gizmos. + Override this method to define whether Spatial with this gizmo should be selecteble even when the gizmo is hidden. @@ -153,6 +170,7 @@ + Callback to redraw the provided gizmo. Called for this plugin's active gizmos. @@ -167,6 +185,7 @@ + Update the value of a handle after it has been updated. Called for this plugin's active gizmos. -- cgit v1.2.3