summaryrefslogtreecommitdiff
path: root/doc/classes/EditorNode3DGizmoPlugin.xml
blob: 41c94cbbc69ac8495379d77d04b79ff4318fc351 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<?xml version="1.0" encoding="UTF-8" ?>
<class name="EditorNode3DGizmoPlugin" inherits="Resource" version="4.0">
	<brief_description>
		Used by the editor to define Node3D gizmo types.
	</brief_description>
	<description>
		EditorNode3DGizmoPlugin allows you to define a new type of Gizmo. There are two main ways to do so: extending [EditorNode3DGizmoPlugin] for the simpler gizmos, or creating a new [EditorNode3DGizmo] type. See the tutorial in the documentation for more info.
	</description>
	<tutorials>
		<link title="Spatial gizmo plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/spatial_gizmos.html</link>
	</tutorials>
	<methods>
		<method name="_can_be_hidden" qualifiers="virtual">
			<return type="bool">
			</return>
			<description>
				Override this method to define whether the gizmo can be hidden or not. Returns [code]true[/code] if not overridden.
			</description>
		</method>
		<method name="_commit_handle" qualifiers="virtual">
			<return type="void">
			</return>
			<argument index="0" name="gizmo" type="EditorNode3DGizmo">
			</argument>
			<argument index="1" name="index" type="int">
			</argument>
			<argument index="2" name="restore" type="Variant">
			</argument>
			<argument index="3" name="cancel" type="bool" default="false">
			</argument>
			<description>
				Override this method to commit gizmo handles. Called for this plugin's active gizmos.
			</description>
		</method>
		<method name="_create_gizmo" qualifiers="virtual">
			<return type="EditorNode3DGizmo">
			</return>
			<argument index="0" name="spatial" type="Node3D">
			</argument>
			<description>
				Override this method to return a custom [EditorNode3DGizmo] for the spatial nodes of your choice, return [code]null[/code] for the rest of nodes. See also [method _has_gizmo].
			</description>
		</method>
		<method name="_get_gizmo_name" qualifiers="virtual">
			<return type="String">
			</return>
			<description>
				Override this method to provide the name that will appear in the gizmo visibility menu.
			</description>
		</method>
		<method name="_get_handle_name" qualifiers="virtual">
			<return type="String">
			</return>
			<argument index="0" name="gizmo" type="EditorNode3DGizmo">
			</argument>
			<argument index="1" name="index" type="int">
			</argument>
			<description>
				Override this method to provide gizmo's handle names. Called for this plugin's active gizmos.
			</description>
		</method>
		<method name="_get_handle_value" qualifiers="virtual">
			<return type="Variant">
			</return>
			<argument index="0" name="gizmo" type="EditorNode3DGizmo">
			</argument>
			<argument index="1" name="index" type="int">
			</argument>
			<description>
				Gets actual value of a handle from gizmo. Called for this plugin's active gizmos.
			</description>
		</method>
		<method name="_get_priority" qualifiers="virtual">
			<return type="int">
			</return>
			<description>
				Override this method to set the gizmo's priority. Higher values correspond to higher priority. If a gizmo with higher priority conflicts with another gizmo, only the gizmo with higher priority will be used.
				All built-in editor gizmos return a priority of [code]-1[/code]. If not overridden, this method will return [code]0[/code], which means custom gizmos will automatically override built-in gizmos.
			</description>
		</method>
		<method name="_has_gizmo" qualifiers="virtual">
			<return type="bool">
			</return>
			<argument index="0" name="spatial" type="Node3D">
			</argument>
			<description>
				Override this method to define which Node3D nodes have a gizmo from this plugin. Whenever a [Node3D] node is added to a scene this method is called, if it returns [code]true[/code] the node gets a generic [EditorNode3DGizmo] assigned and is added to this plugin's list of active gizmos.
			</description>
		</method>
		<method name="_is_handle_highlighted" qualifiers="virtual">
			<return type="bool">
			</return>
			<argument index="0" name="gizmo" type="EditorNode3DGizmo">
			</argument>
			<argument index="1" name="index" type="int">
			</argument>
			<description>
				Gets whether a handle is highlighted or not. Called for this plugin's active gizmos.
			</description>
		</method>
		<method name="_is_selectable_when_hidden" qualifiers="virtual">
			<return type="bool">
			</return>
			<description>
				Override this method to define whether Node3D with this gizmo should be selectable even when the gizmo is hidden.
			</description>
		</method>
		<method name="_redraw" qualifiers="virtual">
			<return type="void">
			</return>
			<argument index="0" name="gizmo" type="EditorNode3DGizmo">
			</argument>
			<description>
				Callback to redraw the provided gizmo. Called for this plugin's active gizmos.
			</description>
		</method>
		<method name="_set_handle" qualifiers="virtual">
			<return type="void">
			</return>
			<argument index="0" name="gizmo" type="EditorNode3DGizmo">
			</argument>
			<argument index="1" name="index" type="int">
			</argument>
			<argument index="2" name="camera" type="Camera3D">
			</argument>
			<argument index="3" name="point" type="Vector2">
			</argument>
			<description>
				Update the value of a handle after it has been updated. Called for this plugin's active gizmos.
			</description>
		</method>
		<method name="add_material">
			<return type="void">
			</return>
			<argument index="0" name="name" type="String">
			</argument>
			<argument index="1" name="material" type="StandardMaterial3D">
			</argument>
			<description>
				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.
			</description>
		</method>
		<method name="create_handle_material">
			<return type="void">
			</return>
			<argument index="0" name="name" type="String">
			</argument>
			<argument index="1" name="billboard" type="bool" default="false">
			</argument>
			<argument index="2" name="texture" type="Texture2D" default="null">
			</argument>
			<description>
				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 EditorNode3DGizmo.add_handles]. Should not be overridden.
				You can optionally provide a texture to use instead of the default icon.
			</description>
		</method>
		<method name="create_icon_material">
			<return type="void">
			</return>
			<argument index="0" name="name" type="String">
			</argument>
			<argument index="1" name="texture" type="Texture2D">
			</argument>
			<argument index="2" name="on_top" type="bool" default="false">
			</argument>
			<argument index="3" name="color" type="Color" default="Color(1, 1, 1, 1)">
			</argument>
			<description>
				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 EditorNode3DGizmo.add_unscaled_billboard]. Should not be overridden.
			</description>
		</method>
		<method name="create_material">
			<return type="void">
			</return>
			<argument index="0" name="name" type="String">
			</argument>
			<argument index="1" name="color" type="Color">
			</argument>
			<argument index="2" name="billboard" type="bool" default="false">
			</argument>
			<argument index="3" name="on_top" type="bool" default="false">
			</argument>
			<argument index="4" name="use_vertex_color" type="bool" default="false">
			</argument>
			<description>
				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 EditorNode3DGizmo.add_mesh] and [method EditorNode3DGizmo.add_lines]. Should not be overridden.
			</description>
		</method>
		<method name="get_material">
			<return type="StandardMaterial3D">
			</return>
			<argument index="0" name="name" type="String">
			</argument>
			<argument index="1" name="gizmo" type="EditorNode3DGizmo" default="null">
			</argument>
			<description>
				Gets material from the internal list of materials. If an [EditorNode3DGizmo] is provided, it will try to get the corresponding variant (selected and/or editable).
			</description>
		</method>
	</methods>
	<constants>
	</constants>
</class>