EditorSpatialGizmoPlugin.xml 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="EditorSpatialGizmoPlugin" inherits="Resource" category="Core" version="3.1.2">
  3. <brief_description>
  4. Used by the editor to define Spatial gizmo types.
  5. </brief_description>
  6. <description>
  7. 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.
  8. </description>
  9. <tutorials>
  10. <link>https://docs.godotengine.org/en/3.1/tutorials/plugins/editor/spatial_gizmos.html</link>
  11. </tutorials>
  12. <methods>
  13. <method name="add_material">
  14. <return type="void">
  15. </return>
  16. <argument index="0" name="name" type="String">
  17. </argument>
  18. <argument index="1" name="material" type="SpatialMaterial">
  19. </argument>
  20. <description>
  21. 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.
  22. </description>
  23. </method>
  24. <method name="can_be_hidden" qualifiers="virtual">
  25. <return type="bool">
  26. </return>
  27. <description>
  28. Override this method to define whether the gizmo can be hidden or not. Defaults to [code]true[/code].
  29. </description>
  30. </method>
  31. <method name="commit_handle" qualifiers="virtual">
  32. <return type="void">
  33. </return>
  34. <argument index="0" name="gizmo" type="EditorSpatialGizmo">
  35. </argument>
  36. <argument index="1" name="index" type="int">
  37. </argument>
  38. <argument index="2" name="restore" type="Variant">
  39. </argument>
  40. <argument index="3" name="cancel" type="bool" default="false">
  41. </argument>
  42. <description>
  43. Override this method to commit gizmo handles. Called for this plugin's active gizmos.
  44. </description>
  45. </method>
  46. <method name="create_gizmo" qualifiers="virtual">
  47. <return type="EditorSpatialGizmo">
  48. </return>
  49. <argument index="0" name="spatial" type="Spatial">
  50. </argument>
  51. <description>
  52. 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])
  53. </description>
  54. </method>
  55. <method name="create_handle_material">
  56. <return type="void">
  57. </return>
  58. <argument index="0" name="name" type="String">
  59. </argument>
  60. <argument index="1" name="billboard" type="bool" default="false">
  61. </argument>
  62. <description>
  63. 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.
  64. </description>
  65. </method>
  66. <method name="create_icon_material">
  67. <return type="void">
  68. </return>
  69. <argument index="0" name="name" type="String">
  70. </argument>
  71. <argument index="1" name="texture" type="Texture">
  72. </argument>
  73. <argument index="2" name="on_top" type="bool" default="false">
  74. </argument>
  75. <argument index="3" name="color" type="Color" default="Color( 1, 1, 1, 1 )">
  76. </argument>
  77. <description>
  78. 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.
  79. </description>
  80. </method>
  81. <method name="create_material">
  82. <return type="void">
  83. </return>
  84. <argument index="0" name="name" type="String">
  85. </argument>
  86. <argument index="1" name="color" type="Color">
  87. </argument>
  88. <argument index="2" name="billboard" type="bool" default="false">
  89. </argument>
  90. <argument index="3" name="on_top" type="bool" default="false">
  91. </argument>
  92. <argument index="4" name="use_vertex_color" type="bool" default="false">
  93. </argument>
  94. <description>
  95. 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.
  96. </description>
  97. </method>
  98. <method name="get_handle_name" qualifiers="virtual">
  99. <return type="String">
  100. </return>
  101. <argument index="0" name="gizmo" type="EditorSpatialGizmo">
  102. </argument>
  103. <argument index="1" name="index" type="int">
  104. </argument>
  105. <description>
  106. Override this method to provide gizmo's handle names. Called for this plugin's active gizmos.
  107. </description>
  108. </method>
  109. <method name="get_handle_value" qualifiers="virtual">
  110. <return type="Variant">
  111. </return>
  112. <argument index="0" name="gizmo" type="EditorSpatialGizmo">
  113. </argument>
  114. <argument index="1" name="index" type="int">
  115. </argument>
  116. <description>
  117. Get actual value of a handle from gizmo. Called for this plugin's active gizmos.
  118. </description>
  119. </method>
  120. <method name="get_material">
  121. <return type="SpatialMaterial">
  122. </return>
  123. <argument index="0" name="name" type="String">
  124. </argument>
  125. <argument index="1" name="gizmo" type="EditorSpatialGizmo">
  126. </argument>
  127. <description>
  128. 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).
  129. </description>
  130. </method>
  131. <method name="get_name" qualifiers="virtual">
  132. <return type="String">
  133. </return>
  134. <description>
  135. Override this method to provide the name that will appear in the gizmo visibility menu.
  136. </description>
  137. </method>
  138. <method name="get_priority" qualifiers="virtual">
  139. <return type="String">
  140. </return>
  141. <description>
  142. </description>
  143. </method>
  144. <method name="has_gizmo" qualifiers="virtual">
  145. <return type="bool">
  146. </return>
  147. <argument index="0" name="spatial" type="Spatial">
  148. </argument>
  149. <description>
  150. 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.
  151. </description>
  152. </method>
  153. <method name="is_handle_highlighted" qualifiers="virtual">
  154. <return type="bool">
  155. </return>
  156. <argument index="0" name="gizmo" type="EditorSpatialGizmo">
  157. </argument>
  158. <argument index="1" name="index" type="int">
  159. </argument>
  160. <description>
  161. Get whether a handle is highlighted or not. Called for this plugin's active gizmos.
  162. </description>
  163. </method>
  164. <method name="is_selectable_when_hidden" qualifiers="virtual">
  165. <return type="bool">
  166. </return>
  167. <description>
  168. Override this method to define whether Spatial with this gizmo should be selecteble even when the gizmo is hidden.
  169. </description>
  170. </method>
  171. <method name="redraw" qualifiers="virtual">
  172. <return type="void">
  173. </return>
  174. <argument index="0" name="gizmo" type="EditorSpatialGizmo">
  175. </argument>
  176. <description>
  177. Callback to redraw the provided gizmo. Called for this plugin's active gizmos.
  178. </description>
  179. </method>
  180. <method name="set_handle" qualifiers="virtual">
  181. <return type="void">
  182. </return>
  183. <argument index="0" name="gizmo" type="EditorSpatialGizmo">
  184. </argument>
  185. <argument index="1" name="index" type="int">
  186. </argument>
  187. <argument index="2" name="camera" type="Camera">
  188. </argument>
  189. <argument index="3" name="point" type="Vector2">
  190. </argument>
  191. <description>
  192. Update the value of a handle after it has been updated. Called for this plugin's active gizmos.
  193. </description>
  194. </method>
  195. </methods>
  196. <constants>
  197. </constants>
  198. </class>