register_scene_types.cpp 61 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492
  1. /**************************************************************************/
  2. /* register_scene_types.cpp */
  3. /**************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /**************************************************************************/
  8. /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
  9. /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /**************************************************************************/
  30. #include "register_scene_types.h"
  31. #include "core/config/project_settings.h"
  32. #include "core/object/class_db.h"
  33. #include "core/os/os.h"
  34. #include "scene/animation/animation_blend_space_1d.h"
  35. #include "scene/animation/animation_blend_space_2d.h"
  36. #include "scene/animation/animation_blend_tree.h"
  37. #include "scene/animation/animation_mixer.h"
  38. #include "scene/animation/animation_node_extension.h"
  39. #include "scene/animation/animation_node_state_machine.h"
  40. #include "scene/animation/animation_player.h"
  41. #include "scene/animation/animation_tree.h"
  42. #include "scene/animation/tween.h"
  43. #include "scene/audio/audio_stream_player.h"
  44. #include "scene/debugger/scene_debugger.h"
  45. #include "scene/gui/aspect_ratio_container.h"
  46. #include "scene/gui/box_container.h"
  47. #include "scene/gui/button.h"
  48. #include "scene/gui/center_container.h"
  49. #include "scene/gui/check_box.h"
  50. #include "scene/gui/check_button.h"
  51. #include "scene/gui/code_edit.h"
  52. #include "scene/gui/color_picker.h"
  53. #include "scene/gui/color_picker_shape.h"
  54. #include "scene/gui/color_rect.h"
  55. #include "scene/gui/control.h"
  56. #include "scene/gui/dialogs.h"
  57. #include "scene/gui/file_dialog.h"
  58. #include "scene/gui/flow_container.h"
  59. #include "scene/gui/foldable_container.h"
  60. #include "scene/gui/graph_edit.h"
  61. #include "scene/gui/graph_frame.h"
  62. #include "scene/gui/graph_node.h"
  63. #include "scene/gui/grid_container.h"
  64. #include "scene/gui/item_list.h"
  65. #include "scene/gui/label.h"
  66. #include "scene/gui/line_edit.h"
  67. #include "scene/gui/link_button.h"
  68. #include "scene/gui/margin_container.h"
  69. #include "scene/gui/menu_bar.h"
  70. #include "scene/gui/menu_button.h"
  71. #include "scene/gui/nine_patch_rect.h"
  72. #include "scene/gui/option_button.h"
  73. #include "scene/gui/panel.h"
  74. #include "scene/gui/panel_container.h"
  75. #include "scene/gui/popup_menu.h"
  76. #include "scene/gui/progress_bar.h"
  77. #include "scene/gui/reference_rect.h"
  78. #include "scene/gui/rich_text_effect.h"
  79. #include "scene/gui/rich_text_label.h"
  80. #include "scene/gui/scroll_bar.h"
  81. #include "scene/gui/scroll_container.h"
  82. #include "scene/gui/separator.h"
  83. #include "scene/gui/slider.h"
  84. #include "scene/gui/spin_box.h"
  85. #include "scene/gui/split_container.h"
  86. #include "scene/gui/subviewport_container.h"
  87. #include "scene/gui/tab_bar.h"
  88. #include "scene/gui/tab_container.h"
  89. #include "scene/gui/text_edit.h"
  90. #include "scene/gui/texture_button.h"
  91. #include "scene/gui/texture_progress_bar.h"
  92. #include "scene/gui/texture_rect.h"
  93. #include "scene/gui/tree.h"
  94. #include "scene/gui/video_stream_player.h"
  95. #include "scene/gui/virtual_joystick.h"
  96. #include "scene/main/canvas_item.h"
  97. #include "scene/main/canvas_layer.h"
  98. #include "scene/main/http_request.h"
  99. #include "scene/main/instance_placeholder.h"
  100. #include "scene/main/missing_node.h"
  101. #include "scene/main/multiplayer_api.h"
  102. #include "scene/main/resource_preloader.h"
  103. #include "scene/main/scene_tree.h"
  104. #include "scene/main/shader_globals_override.h"
  105. #include "scene/main/status_indicator.h"
  106. #include "scene/main/timer.h"
  107. #include "scene/main/viewport.h"
  108. #include "scene/main/window.h"
  109. #include "scene/resources/animation_library.h"
  110. #include "scene/resources/atlas_texture.h"
  111. #include "scene/resources/audio_stream_polyphonic.h"
  112. #include "scene/resources/audio_stream_wav.h"
  113. #include "scene/resources/bit_map.h"
  114. #include "scene/resources/bone_map.h"
  115. #include "scene/resources/camera_attributes.h"
  116. #include "scene/resources/camera_texture.h"
  117. #include "scene/resources/canvas_item_material.h"
  118. #include "scene/resources/color_palette.h"
  119. #include "scene/resources/compositor.h"
  120. #include "scene/resources/compressed_texture.h"
  121. #include "scene/resources/curve_texture.h"
  122. #include "scene/resources/environment.h"
  123. #include "scene/resources/external_texture.h"
  124. #include "scene/resources/font.h"
  125. #include "scene/resources/gradient.h"
  126. #include "scene/resources/gradient_texture.h"
  127. #include "scene/resources/image_texture.h"
  128. #include "scene/resources/immediate_mesh.h"
  129. #include "scene/resources/label_settings.h"
  130. #include "scene/resources/material.h"
  131. #include "scene/resources/mesh_data_tool.h"
  132. #include "scene/resources/mesh_texture.h"
  133. #include "scene/resources/multimesh.h"
  134. #if !defined(NAVIGATION_2D_DISABLED) || !defined(NAVIGATION_3D_DISABLED)
  135. #include "scene/resources/navigation_mesh.h"
  136. #endif // !defined(NAVIGATION_2D_DISABLED) || !defined(NAVIGATION_3D_DISABLED)
  137. #include "scene/resources/dpi_texture.h"
  138. #include "scene/resources/packed_scene.h"
  139. #include "scene/resources/particle_process_material.h"
  140. #include "scene/resources/placeholder_textures.h"
  141. #include "scene/resources/portable_compressed_texture.h"
  142. #include "scene/resources/resource_format_text.h"
  143. #include "scene/resources/shader_include.h"
  144. #include "scene/resources/skeleton_profile.h"
  145. #include "scene/resources/sky.h"
  146. #include "scene/resources/style_box.h"
  147. #include "scene/resources/style_box_flat.h"
  148. #include "scene/resources/style_box_line.h"
  149. #include "scene/resources/style_box_texture.h"
  150. #include "scene/resources/surface_tool.h"
  151. #include "scene/resources/syntax_highlighter.h"
  152. #include "scene/resources/text_line.h"
  153. #include "scene/resources/text_paragraph.h"
  154. #include "scene/resources/texture.h"
  155. #include "scene/resources/texture_rd.h"
  156. #include "scene/resources/theme.h"
  157. #include "scene/resources/video_stream.h"
  158. #include "scene/resources/visual_shader.h"
  159. #include "scene/resources/visual_shader_nodes.h"
  160. #include "scene/resources/visual_shader_particle_nodes.h"
  161. #include "scene/resources/visual_shader_sdf_nodes.h"
  162. #include "scene/theme/theme_db.h"
  163. #ifndef DISABLE_DEPRECATED
  164. #include "scene/resources/animated_texture.h"
  165. #endif
  166. // 2D
  167. #include "scene/2d/animated_sprite_2d.h"
  168. #include "scene/2d/audio_listener_2d.h"
  169. #include "scene/2d/audio_stream_player_2d.h"
  170. #include "scene/2d/back_buffer_copy.h"
  171. #include "scene/2d/camera_2d.h"
  172. #include "scene/2d/canvas_group.h"
  173. #include "scene/2d/canvas_modulate.h"
  174. #include "scene/2d/cpu_particles_2d.h"
  175. #include "scene/2d/gpu_particles_2d.h"
  176. #include "scene/2d/light_2d.h"
  177. #include "scene/2d/light_occluder_2d.h"
  178. #include "scene/2d/line_2d.h"
  179. #include "scene/2d/marker_2d.h"
  180. #include "scene/2d/mesh_instance_2d.h"
  181. #include "scene/2d/multimesh_instance_2d.h"
  182. #include "scene/2d/parallax_2d.h"
  183. #include "scene/2d/path_2d.h"
  184. #include "scene/2d/polygon_2d.h"
  185. #include "scene/2d/remote_transform_2d.h"
  186. #include "scene/2d/skeleton_2d.h"
  187. #include "scene/2d/sprite_2d.h"
  188. #include "scene/2d/tile_map_layer.h"
  189. #include "scene/2d/visible_on_screen_notifier_2d.h"
  190. #include "scene/resources/2d/polygon_path_finder.h"
  191. #include "scene/resources/2d/skeleton/skeleton_modification_2d.h"
  192. #include "scene/resources/2d/skeleton/skeleton_modification_2d_ccdik.h"
  193. #include "scene/resources/2d/skeleton/skeleton_modification_2d_fabrik.h"
  194. #include "scene/resources/2d/skeleton/skeleton_modification_2d_lookat.h"
  195. #include "scene/resources/2d/skeleton/skeleton_modification_2d_stackholder.h"
  196. #include "scene/resources/2d/skeleton/skeleton_modification_2d_twoboneik.h"
  197. #include "scene/resources/2d/skeleton/skeleton_modification_stack_2d.h"
  198. #include "scene/resources/2d/tile_set.h"
  199. #include "scene/resources/world_2d.h"
  200. #ifndef DISABLE_DEPRECATED
  201. #include "scene/2d/parallax_background.h"
  202. #include "scene/2d/parallax_layer.h"
  203. #include "scene/2d/tile_map.h"
  204. #endif
  205. #ifndef NAVIGATION_2D_DISABLED
  206. #include "scene/2d/navigation/navigation_agent_2d.h"
  207. #include "scene/2d/navigation/navigation_link_2d.h"
  208. #include "scene/2d/navigation/navigation_obstacle_2d.h"
  209. #include "scene/2d/navigation/navigation_region_2d.h"
  210. #include "scene/resources/2d/navigation_mesh_source_geometry_data_2d.h"
  211. #include "scene/resources/2d/navigation_polygon.h"
  212. #endif // NAVIGATION_2D_DISABLED
  213. #ifndef _3D_DISABLED
  214. #include "scene/3d/aim_modifier_3d.h"
  215. #include "scene/3d/audio_listener_3d.h"
  216. #include "scene/3d/audio_stream_player_3d.h"
  217. #include "scene/3d/bone_attachment_3d.h"
  218. #include "scene/3d/bone_constraint_3d.h"
  219. #include "scene/3d/bone_twist_disperser_3d.h"
  220. #include "scene/3d/camera_3d.h"
  221. #include "scene/3d/ccd_ik_3d.h"
  222. #include "scene/3d/chain_ik_3d.h"
  223. #include "scene/3d/convert_transform_modifier_3d.h"
  224. #include "scene/3d/copy_transform_modifier_3d.h"
  225. #include "scene/3d/cpu_particles_3d.h"
  226. #include "scene/3d/decal.h"
  227. #include "scene/3d/fabr_ik_3d.h"
  228. #include "scene/3d/fog_volume.h"
  229. #include "scene/3d/gpu_particles_3d.h"
  230. #include "scene/3d/gpu_particles_collision_3d.h"
  231. #include "scene/3d/ik_modifier_3d.h"
  232. #include "scene/3d/importer_mesh_instance_3d.h"
  233. #include "scene/3d/iterate_ik_3d.h"
  234. #include "scene/3d/jacobian_ik_3d.h"
  235. #include "scene/3d/label_3d.h"
  236. #include "scene/3d/light_3d.h"
  237. #include "scene/3d/lightmap_gi.h"
  238. #include "scene/3d/lightmap_probe.h"
  239. #include "scene/3d/limit_angular_velocity_modifier_3d.h"
  240. #include "scene/3d/look_at_modifier_3d.h"
  241. #include "scene/3d/marker_3d.h"
  242. #include "scene/3d/mesh_instance_3d.h"
  243. #include "scene/3d/modifier_bone_target_3d.h"
  244. #include "scene/3d/multimesh_instance_3d.h"
  245. #include "scene/3d/node_3d.h"
  246. #include "scene/3d/occluder_instance_3d.h"
  247. #include "scene/3d/path_3d.h"
  248. #include "scene/3d/reflection_probe.h"
  249. #include "scene/3d/remote_transform_3d.h"
  250. #include "scene/3d/retarget_modifier_3d.h"
  251. #include "scene/3d/skeleton_3d.h"
  252. #include "scene/3d/skeleton_modifier_3d.h"
  253. #include "scene/3d/spline_ik_3d.h"
  254. #include "scene/3d/spring_bone_collision_3d.h"
  255. #include "scene/3d/spring_bone_collision_capsule_3d.h"
  256. #include "scene/3d/spring_bone_collision_plane_3d.h"
  257. #include "scene/3d/spring_bone_collision_sphere_3d.h"
  258. #include "scene/3d/spring_bone_simulator_3d.h"
  259. #include "scene/3d/sprite_3d.h"
  260. #include "scene/3d/two_bone_ik_3d.h"
  261. #include "scene/3d/visible_on_screen_notifier_3d.h"
  262. #include "scene/3d/voxel_gi.h"
  263. #include "scene/3d/world_environment.h"
  264. #include "scene/animation/root_motion_view.h"
  265. #include "scene/resources/3d/fog_material.h"
  266. #include "scene/resources/3d/importer_mesh.h"
  267. #include "scene/resources/3d/joint_limitation_3d.h"
  268. #include "scene/resources/3d/joint_limitation_cone_3d.h"
  269. #include "scene/resources/3d/mesh_library.h"
  270. #include "scene/resources/3d/navigation_mesh_source_geometry_data_3d.h"
  271. #include "scene/resources/3d/primitive_meshes.h"
  272. #include "scene/resources/3d/sky_material.h"
  273. #include "scene/resources/3d/world_3d.h"
  274. #ifndef NAVIGATION_3D_DISABLED
  275. #include "scene/3d/navigation/navigation_agent_3d.h"
  276. #include "scene/3d/navigation/navigation_link_3d.h"
  277. #include "scene/3d/navigation/navigation_obstacle_3d.h"
  278. #include "scene/3d/navigation/navigation_region_3d.h"
  279. #include "scene/resources/3d/navigation_mesh_source_geometry_data_3d.h"
  280. #endif // NAVIGATION_3D_DISABLED
  281. #ifndef XR_DISABLED
  282. #include "scene/3d/xr/xr_body_modifier_3d.h"
  283. #include "scene/3d/xr/xr_face_modifier_3d.h"
  284. #include "scene/3d/xr/xr_hand_modifier_3d.h"
  285. #include "scene/3d/xr/xr_nodes.h"
  286. #endif // XR_DISABLED
  287. #ifndef DISABLE_DEPRECATED
  288. #include "scene/3d/skeleton_ik_3d.h"
  289. #endif
  290. #endif // _3D_DISABLED
  291. #if !defined(PHYSICS_2D_DISABLED) || !defined(PHYSICS_3D_DISABLED)
  292. #include "scene/resources/physics_material.h"
  293. #endif // !defined(PHYSICS_2D_DISABLED) || !defined(PHYSICS_3D_DISABLED)
  294. #ifndef PHYSICS_2D_DISABLED
  295. #include "scene/2d/physics/animatable_body_2d.h"
  296. #include "scene/2d/physics/area_2d.h"
  297. #include "scene/2d/physics/character_body_2d.h"
  298. #include "scene/2d/physics/collision_polygon_2d.h"
  299. #include "scene/2d/physics/collision_shape_2d.h"
  300. #include "scene/2d/physics/joints/damped_spring_joint_2d.h"
  301. #include "scene/2d/physics/joints/groove_joint_2d.h"
  302. #include "scene/2d/physics/joints/joint_2d.h"
  303. #include "scene/2d/physics/joints/pin_joint_2d.h"
  304. #include "scene/2d/physics/kinematic_collision_2d.h"
  305. #include "scene/2d/physics/physical_bone_2d.h"
  306. #include "scene/2d/physics/physics_body_2d.h"
  307. #include "scene/2d/physics/ray_cast_2d.h"
  308. #include "scene/2d/physics/rigid_body_2d.h"
  309. #include "scene/2d/physics/shape_cast_2d.h"
  310. #include "scene/2d/physics/static_body_2d.h"
  311. #include "scene/2d/physics/touch_screen_button.h"
  312. #include "scene/resources/2d/capsule_shape_2d.h"
  313. #include "scene/resources/2d/circle_shape_2d.h"
  314. #include "scene/resources/2d/concave_polygon_shape_2d.h"
  315. #include "scene/resources/2d/convex_polygon_shape_2d.h"
  316. #include "scene/resources/2d/rectangle_shape_2d.h"
  317. #include "scene/resources/2d/segment_shape_2d.h"
  318. #include "scene/resources/2d/separation_ray_shape_2d.h"
  319. #include "scene/resources/2d/shape_2d.h"
  320. #include "scene/resources/2d/skeleton/skeleton_modification_2d_jiggle.h"
  321. #include "scene/resources/2d/skeleton/skeleton_modification_2d_physicalbones.h"
  322. #include "scene/resources/2d/world_boundary_shape_2d.h"
  323. #endif // PHYSICS_2D_DISABLED
  324. #ifndef PHYSICS_3D_DISABLED
  325. #include "scene/3d/physics/animatable_body_3d.h"
  326. #include "scene/3d/physics/area_3d.h"
  327. #include "scene/3d/physics/character_body_3d.h"
  328. #include "scene/3d/physics/collision_polygon_3d.h"
  329. #include "scene/3d/physics/collision_shape_3d.h"
  330. #include "scene/3d/physics/joints/cone_twist_joint_3d.h"
  331. #include "scene/3d/physics/joints/generic_6dof_joint_3d.h"
  332. #include "scene/3d/physics/joints/hinge_joint_3d.h"
  333. #include "scene/3d/physics/joints/joint_3d.h"
  334. #include "scene/3d/physics/joints/pin_joint_3d.h"
  335. #include "scene/3d/physics/joints/slider_joint_3d.h"
  336. #include "scene/3d/physics/kinematic_collision_3d.h"
  337. #include "scene/3d/physics/physical_bone_3d.h"
  338. #include "scene/3d/physics/physical_bone_simulator_3d.h"
  339. #include "scene/3d/physics/physics_body_3d.h"
  340. #include "scene/3d/physics/ray_cast_3d.h"
  341. #include "scene/3d/physics/rigid_body_3d.h"
  342. #include "scene/3d/physics/shape_cast_3d.h"
  343. #include "scene/3d/physics/soft_body_3d.h"
  344. #include "scene/3d/physics/spring_arm_3d.h"
  345. #include "scene/3d/physics/static_body_3d.h"
  346. #include "scene/3d/physics/vehicle_body_3d.h"
  347. #include "scene/resources/3d/box_shape_3d.h"
  348. #include "scene/resources/3d/capsule_shape_3d.h"
  349. #include "scene/resources/3d/concave_polygon_shape_3d.h"
  350. #include "scene/resources/3d/convex_polygon_shape_3d.h"
  351. #include "scene/resources/3d/cylinder_shape_3d.h"
  352. #include "scene/resources/3d/height_map_shape_3d.h"
  353. #include "scene/resources/3d/importer_mesh.h"
  354. #include "scene/resources/3d/mesh_library.h"
  355. #include "scene/resources/3d/navigation_mesh_source_geometry_data_3d.h"
  356. #include "scene/resources/3d/primitive_meshes.h"
  357. #include "scene/resources/3d/separation_ray_shape_3d.h"
  358. #include "scene/resources/3d/sphere_shape_3d.h"
  359. #include "scene/resources/3d/world_boundary_shape_3d.h"
  360. #endif // PHYSICS_3D_DISABLED
  361. static Ref<ResourceFormatSaverText> resource_saver_text;
  362. static Ref<ResourceFormatLoaderText> resource_loader_text;
  363. static Ref<ResourceFormatLoaderCompressedTexture2D> resource_loader_stream_texture;
  364. static Ref<ResourceFormatLoaderCompressedTextureLayered> resource_loader_texture_layered;
  365. static Ref<ResourceFormatLoaderCompressedTexture3D> resource_loader_texture_3d;
  366. static Ref<ResourceFormatSaverShader> resource_saver_shader;
  367. static Ref<ResourceFormatLoaderShader> resource_loader_shader;
  368. static Ref<ResourceFormatSaverShaderInclude> resource_saver_shader_include;
  369. static Ref<ResourceFormatLoaderShaderInclude> resource_loader_shader_include;
  370. void register_scene_types() {
  371. OS::get_singleton()->benchmark_begin_measure("Scene", "Register Types");
  372. SceneStringNames::create();
  373. OS::get_singleton()->yield(); // may take time to init
  374. Node::init_node_hrcr();
  375. if constexpr (GD_IS_CLASS_ENABLED(CompressedTexture2D)) {
  376. resource_loader_stream_texture.instantiate();
  377. ResourceLoader::add_resource_format_loader(resource_loader_stream_texture);
  378. }
  379. if constexpr (GD_IS_CLASS_ENABLED(TextureLayered)) {
  380. resource_loader_texture_layered.instantiate();
  381. ResourceLoader::add_resource_format_loader(resource_loader_texture_layered);
  382. }
  383. if constexpr (GD_IS_CLASS_ENABLED(Texture3D)) {
  384. resource_loader_texture_3d.instantiate();
  385. ResourceLoader::add_resource_format_loader(resource_loader_texture_3d);
  386. }
  387. resource_saver_text.instantiate();
  388. ResourceSaver::add_resource_format_saver(resource_saver_text, true);
  389. resource_loader_text.instantiate();
  390. ResourceLoader::add_resource_format_loader(resource_loader_text, true);
  391. if constexpr (GD_IS_CLASS_ENABLED(Shader)) {
  392. resource_saver_shader.instantiate();
  393. ResourceSaver::add_resource_format_saver(resource_saver_shader, true);
  394. resource_loader_shader.instantiate();
  395. ResourceLoader::add_resource_format_loader(resource_loader_shader, true);
  396. }
  397. if constexpr (GD_IS_CLASS_ENABLED(ShaderInclude)) {
  398. resource_saver_shader_include.instantiate();
  399. ResourceSaver::add_resource_format_saver(resource_saver_shader_include, true);
  400. resource_loader_shader_include.instantiate();
  401. ResourceLoader::add_resource_format_loader(resource_loader_shader_include, true);
  402. }
  403. OS::get_singleton()->yield(); // may take time to init
  404. GDREGISTER_CLASS(Node);
  405. GDREGISTER_CLASS(MissingNode);
  406. GDREGISTER_ABSTRACT_CLASS(InstancePlaceholder);
  407. GDREGISTER_ABSTRACT_CLASS(CanvasItem);
  408. GDREGISTER_VIRTUAL_CLASS(Texture);
  409. GDREGISTER_VIRTUAL_CLASS(Texture2D);
  410. GDREGISTER_VIRTUAL_CLASS(Material);
  411. GDREGISTER_CLASS(PlaceholderMaterial);
  412. GDREGISTER_ABSTRACT_CLASS(Viewport);
  413. GDREGISTER_CLASS(SubViewport);
  414. GDREGISTER_CLASS(ViewportTexture);
  415. GDREGISTER_VIRTUAL_CLASS(CompositorEffect);
  416. GDREGISTER_ABSTRACT_CLASS(MultiplayerPeer);
  417. GDREGISTER_CLASS(MultiplayerPeerExtension);
  418. GDREGISTER_ABSTRACT_CLASS(MultiplayerAPI);
  419. GDREGISTER_CLASS(MultiplayerAPIExtension);
  420. GDREGISTER_CLASS(HTTPRequest);
  421. GDREGISTER_CLASS(Timer);
  422. GDREGISTER_CLASS(CanvasLayer);
  423. GDREGISTER_CLASS(ResourcePreloader);
  424. GDREGISTER_CLASS(Window);
  425. GDREGISTER_CLASS(StatusIndicator);
  426. /* REGISTER GUI */
  427. OS::get_singleton()->yield(); // may take time to init
  428. GDREGISTER_CLASS(Control);
  429. GDREGISTER_VIRTUAL_CLASS(BaseButton);
  430. GDREGISTER_CLASS(Button);
  431. GDREGISTER_CLASS(Label);
  432. GDREGISTER_VIRTUAL_CLASS(Range);
  433. GDREGISTER_ABSTRACT_CLASS(ScrollBar);
  434. GDREGISTER_CLASS(HScrollBar);
  435. GDREGISTER_CLASS(VScrollBar);
  436. GDREGISTER_CLASS(ProgressBar);
  437. GDREGISTER_ABSTRACT_CLASS(Slider);
  438. GDREGISTER_CLASS(HSlider);
  439. GDREGISTER_CLASS(VSlider);
  440. GDREGISTER_CLASS(Popup);
  441. GDREGISTER_CLASS(PopupPanel);
  442. GDREGISTER_CLASS(CheckBox);
  443. GDREGISTER_CLASS(CheckButton);
  444. GDREGISTER_CLASS(LinkButton);
  445. GDREGISTER_CLASS(Panel);
  446. GDREGISTER_CLASS(ButtonGroup);
  447. OS::get_singleton()->yield(); // may take time to init
  448. GDREGISTER_CLASS(Container);
  449. GDREGISTER_CLASS(TextureRect);
  450. GDREGISTER_CLASS(ColorRect);
  451. GDREGISTER_CLASS(NinePatchRect);
  452. GDREGISTER_CLASS(ReferenceRect);
  453. GDREGISTER_CLASS(AspectRatioContainer);
  454. GDREGISTER_CLASS(TabContainer);
  455. GDREGISTER_CLASS(TabBar);
  456. GDREGISTER_ABSTRACT_CLASS(Separator);
  457. GDREGISTER_CLASS(HSeparator);
  458. GDREGISTER_CLASS(VSeparator);
  459. GDREGISTER_CLASS(TextureButton);
  460. GDREGISTER_CLASS(BoxContainer);
  461. GDREGISTER_CLASS(HBoxContainer);
  462. GDREGISTER_CLASS(VBoxContainer);
  463. GDREGISTER_CLASS(GridContainer);
  464. GDREGISTER_CLASS(CenterContainer);
  465. GDREGISTER_CLASS(ScrollContainer);
  466. GDREGISTER_CLASS(PanelContainer);
  467. GDREGISTER_CLASS(FlowContainer);
  468. GDREGISTER_CLASS(HFlowContainer);
  469. GDREGISTER_CLASS(VFlowContainer);
  470. GDREGISTER_CLASS(MarginContainer);
  471. OS::get_singleton()->yield(); // may take time to init
  472. GDREGISTER_CLASS(TextureProgressBar);
  473. GDREGISTER_CLASS(ItemList);
  474. GDREGISTER_CLASS(LineEdit);
  475. GDREGISTER_CLASS(VideoStreamPlayer);
  476. GDREGISTER_VIRTUAL_CLASS(VideoStreamPlayback);
  477. GDREGISTER_VIRTUAL_CLASS(VideoStream);
  478. #ifndef ADVANCED_GUI_DISABLED
  479. GDREGISTER_CLASS(AcceptDialog);
  480. GDREGISTER_CLASS(ConfirmationDialog);
  481. GDREGISTER_CLASS(FileDialog);
  482. GDREGISTER_CLASS(PopupMenu);
  483. GDREGISTER_CLASS(Tree);
  484. GDREGISTER_CLASS(TextEdit);
  485. GDREGISTER_CLASS(CodeEdit);
  486. GDREGISTER_CLASS(SyntaxHighlighter);
  487. GDREGISTER_CLASS(CodeHighlighter);
  488. GDREGISTER_ABSTRACT_CLASS(TreeItem);
  489. GDREGISTER_CLASS(MenuBar);
  490. GDREGISTER_CLASS(MenuButton);
  491. GDREGISTER_CLASS(OptionButton);
  492. GDREGISTER_CLASS(SpinBox);
  493. GDREGISTER_CLASS(ColorPicker);
  494. GDREGISTER_CLASS(ColorPickerButton);
  495. GDREGISTER_CLASS(RichTextLabel);
  496. GDREGISTER_CLASS(RichTextEffect);
  497. GDREGISTER_CLASS(CharFXTransform);
  498. GDREGISTER_CLASS(SubViewportContainer);
  499. GDREGISTER_CLASS(SplitContainer);
  500. GDREGISTER_CLASS(HSplitContainer);
  501. GDREGISTER_CLASS(VSplitContainer);
  502. GDREGISTER_CLASS(GraphElement);
  503. GDREGISTER_CLASS(GraphNode);
  504. GDREGISTER_CLASS(GraphFrame);
  505. GDREGISTER_CLASS(GraphEdit);
  506. GDREGISTER_CLASS(FoldableGroup);
  507. GDREGISTER_CLASS(FoldableContainer);
  508. GDREGISTER_CLASS(VirtualJoystick);
  509. OS::get_singleton()->yield(); // may take time to init
  510. int swap_cancel_ok = GLOBAL_DEF(PropertyInfo(Variant::INT, "gui/common/swap_cancel_ok", PROPERTY_HINT_ENUM, "Auto,Cancel First,OK First"), 0);
  511. if (DisplayServer::get_singleton() && swap_cancel_ok == 0) {
  512. swap_cancel_ok = DisplayServer::get_singleton()->get_swap_cancel_ok() ? 2 : 1;
  513. }
  514. AcceptDialog::set_swap_cancel_ok(swap_cancel_ok == 2);
  515. #endif
  516. int root_dir = GLOBAL_GET("internationalization/rendering/root_node_layout_direction");
  517. Control::set_root_layout_direction(root_dir);
  518. Window::set_root_layout_direction(root_dir);
  519. /* REGISTER ANIMATION */
  520. GDREGISTER_CLASS(Tween);
  521. GDREGISTER_ABSTRACT_CLASS(Tweener);
  522. GDREGISTER_CLASS(PropertyTweener);
  523. GDREGISTER_CLASS(IntervalTweener);
  524. GDREGISTER_CLASS(CallbackTweener);
  525. GDREGISTER_CLASS(MethodTweener);
  526. GDREGISTER_CLASS(SubtweenTweener);
  527. GDREGISTER_ABSTRACT_CLASS(AnimationMixer);
  528. GDREGISTER_CLASS(AnimationPlayer);
  529. GDREGISTER_CLASS(AnimationTree);
  530. GDREGISTER_CLASS(AnimationNode);
  531. GDREGISTER_CLASS(AnimationRootNode);
  532. GDREGISTER_CLASS(AnimationNodeBlendTree);
  533. GDREGISTER_CLASS(AnimationNodeBlendSpace1D);
  534. GDREGISTER_CLASS(AnimationNodeBlendSpace2D);
  535. GDREGISTER_CLASS(AnimationNodeStateMachine);
  536. GDREGISTER_CLASS(AnimationNodeStateMachinePlayback);
  537. GDREGISTER_VIRTUAL_CLASS(AnimationNodeExtension);
  538. GDREGISTER_CLASS(AnimationNodeSync);
  539. GDREGISTER_CLASS(AnimationNodeStateMachineTransition);
  540. GDREGISTER_CLASS(AnimationNodeOutput);
  541. GDREGISTER_CLASS(AnimationNodeOneShot);
  542. GDREGISTER_CLASS(AnimationNodeAnimation);
  543. GDREGISTER_CLASS(AnimationNodeAdd2);
  544. GDREGISTER_CLASS(AnimationNodeAdd3);
  545. GDREGISTER_CLASS(AnimationNodeBlend2);
  546. GDREGISTER_CLASS(AnimationNodeBlend3);
  547. GDREGISTER_CLASS(AnimationNodeSub2);
  548. GDREGISTER_CLASS(AnimationNodeTimeScale);
  549. GDREGISTER_CLASS(AnimationNodeTimeSeek);
  550. GDREGISTER_CLASS(AnimationNodeTransition);
  551. GDREGISTER_CLASS(ShaderGlobalsOverride); // can be used in any shader
  552. OS::get_singleton()->yield(); // may take time to init
  553. /* REGISTER 3D */
  554. #ifndef _3D_DISABLED
  555. GDREGISTER_CLASS(Node3D);
  556. GDREGISTER_ABSTRACT_CLASS(Node3DGizmo);
  557. GDREGISTER_CLASS(Skin);
  558. GDREGISTER_ABSTRACT_CLASS(SkinReference);
  559. GDREGISTER_CLASS(Skeleton3D);
  560. GDREGISTER_CLASS(ImporterMesh);
  561. GDREGISTER_CLASS(ImporterMeshInstance3D);
  562. GDREGISTER_VIRTUAL_CLASS(VisualInstance3D);
  563. GDREGISTER_VIRTUAL_CLASS(GeometryInstance3D);
  564. GDREGISTER_CLASS(Camera3D);
  565. GDREGISTER_CLASS(AudioListener3D);
  566. GDREGISTER_CLASS(MeshInstance3D);
  567. #ifndef DISABLE_DEPRECATED
  568. MeshInstance3D::use_parent_skeleton_compat = GLOBAL_GET("animation/compatibility/default_parent_skeleton_in_mesh_instance_3d");
  569. #endif
  570. GDREGISTER_CLASS(OccluderInstance3D);
  571. GDREGISTER_ABSTRACT_CLASS(Occluder3D);
  572. GDREGISTER_CLASS(ArrayOccluder3D);
  573. GDREGISTER_CLASS(QuadOccluder3D);
  574. GDREGISTER_CLASS(BoxOccluder3D);
  575. GDREGISTER_CLASS(SphereOccluder3D);
  576. GDREGISTER_CLASS(PolygonOccluder3D);
  577. GDREGISTER_ABSTRACT_CLASS(SpriteBase3D);
  578. GDREGISTER_CLASS(Sprite3D);
  579. GDREGISTER_CLASS(AnimatedSprite3D);
  580. GDREGISTER_CLASS(Label3D);
  581. GDREGISTER_ABSTRACT_CLASS(Light3D);
  582. GDREGISTER_CLASS(DirectionalLight3D);
  583. GDREGISTER_CLASS(OmniLight3D);
  584. GDREGISTER_CLASS(SpotLight3D);
  585. GDREGISTER_CLASS(ReflectionProbe);
  586. GDREGISTER_CLASS(Decal);
  587. GDREGISTER_CLASS(VoxelGI);
  588. GDREGISTER_CLASS(VoxelGIData);
  589. GDREGISTER_CLASS(LightmapGI);
  590. GDREGISTER_CLASS(LightmapGIData);
  591. GDREGISTER_CLASS(LightmapProbe);
  592. GDREGISTER_ABSTRACT_CLASS(Lightmapper);
  593. GDREGISTER_CLASS(GPUParticles3D);
  594. GDREGISTER_ABSTRACT_CLASS(GPUParticlesCollision3D);
  595. GDREGISTER_CLASS(GPUParticlesCollisionBox3D);
  596. GDREGISTER_CLASS(GPUParticlesCollisionSphere3D);
  597. GDREGISTER_CLASS(GPUParticlesCollisionSDF3D);
  598. GDREGISTER_CLASS(GPUParticlesCollisionHeightField3D);
  599. GDREGISTER_ABSTRACT_CLASS(GPUParticlesAttractor3D);
  600. GDREGISTER_CLASS(GPUParticlesAttractorBox3D);
  601. GDREGISTER_CLASS(GPUParticlesAttractorSphere3D);
  602. GDREGISTER_CLASS(GPUParticlesAttractorVectorField3D);
  603. GDREGISTER_CLASS(CPUParticles3D);
  604. GDREGISTER_CLASS(Marker3D);
  605. GDREGISTER_CLASS(RootMotionView);
  606. GDREGISTER_VIRTUAL_CLASS(SkeletonModifier3D);
  607. GDREGISTER_CLASS(ModifierBoneTarget3D);
  608. GDREGISTER_CLASS(RetargetModifier3D);
  609. GDREGISTER_VIRTUAL_CLASS(JointLimitation3D);
  610. GDREGISTER_CLASS(JointLimitationCone3D);
  611. GDREGISTER_CLASS(SpringBoneSimulator3D);
  612. GDREGISTER_VIRTUAL_CLASS(SpringBoneCollision3D);
  613. GDREGISTER_CLASS(SpringBoneCollisionSphere3D);
  614. GDREGISTER_CLASS(SpringBoneCollisionCapsule3D);
  615. GDREGISTER_CLASS(SpringBoneCollisionPlane3D);
  616. GDREGISTER_VIRTUAL_CLASS(BoneConstraint3D);
  617. GDREGISTER_CLASS(CopyTransformModifier3D);
  618. GDREGISTER_CLASS(ConvertTransformModifier3D);
  619. GDREGISTER_CLASS(AimModifier3D);
  620. GDREGISTER_ABSTRACT_CLASS(IKModifier3D);
  621. GDREGISTER_CLASS(TwoBoneIK3D);
  622. GDREGISTER_ABSTRACT_CLASS(ChainIK3D);
  623. GDREGISTER_CLASS(SplineIK3D);
  624. GDREGISTER_ABSTRACT_CLASS(IterateIK3D);
  625. GDREGISTER_CLASS(FABRIK3D);
  626. GDREGISTER_CLASS(CCDIK3D);
  627. GDREGISTER_CLASS(JacobianIK3D);
  628. GDREGISTER_CLASS(LimitAngularVelocityModifier3D);
  629. GDREGISTER_CLASS(BoneTwistDisperser3D);
  630. #ifndef XR_DISABLED
  631. GDREGISTER_CLASS(XRCamera3D);
  632. GDREGISTER_CLASS(XRNode3D);
  633. GDREGISTER_CLASS(XRController3D);
  634. GDREGISTER_CLASS(XRAnchor3D);
  635. GDREGISTER_CLASS(XROrigin3D);
  636. GDREGISTER_CLASS(XRBodyModifier3D);
  637. GDREGISTER_CLASS(XRHandModifier3D);
  638. GDREGISTER_CLASS(XRFaceModifier3D);
  639. #endif // XR_DISABLED
  640. OS::get_singleton()->yield(); // may take time to init
  641. #ifndef PHYSICS_3D_DISABLED
  642. GDREGISTER_ABSTRACT_CLASS(CollisionObject3D);
  643. GDREGISTER_ABSTRACT_CLASS(PhysicsBody3D);
  644. GDREGISTER_CLASS(StaticBody3D);
  645. GDREGISTER_CLASS(AnimatableBody3D);
  646. GDREGISTER_CLASS(RigidBody3D);
  647. GDREGISTER_CLASS(KinematicCollision3D);
  648. GDREGISTER_CLASS(CharacterBody3D);
  649. GDREGISTER_CLASS(SpringArm3D);
  650. GDREGISTER_CLASS(PhysicalBoneSimulator3D);
  651. GDREGISTER_CLASS(PhysicalBone3D);
  652. GDREGISTER_CLASS(SoftBody3D);
  653. #endif // PHYSICS_3D_DISABLED
  654. GDREGISTER_CLASS(BoneAttachment3D);
  655. GDREGISTER_CLASS(LookAtModifier3D);
  656. #ifndef DISABLE_DEPRECATED
  657. GDREGISTER_CLASS(SkeletonIK3D);
  658. #endif
  659. #ifndef PHYSICS_3D_DISABLED
  660. GDREGISTER_CLASS(VehicleBody3D);
  661. GDREGISTER_CLASS(VehicleWheel3D);
  662. GDREGISTER_CLASS(Area3D);
  663. GDREGISTER_CLASS(CollisionShape3D);
  664. GDREGISTER_CLASS(CollisionPolygon3D);
  665. GDREGISTER_CLASS(RayCast3D);
  666. GDREGISTER_CLASS(ShapeCast3D);
  667. #endif // PHYSICS_3D_DISABLED
  668. GDREGISTER_CLASS(MultiMeshInstance3D);
  669. GDREGISTER_CLASS(Curve3D);
  670. GDREGISTER_CLASS(Path3D);
  671. GDREGISTER_CLASS(PathFollow3D);
  672. GDREGISTER_CLASS(VisibleOnScreenNotifier3D);
  673. GDREGISTER_CLASS(VisibleOnScreenEnabler3D);
  674. GDREGISTER_CLASS(WorldEnvironment);
  675. GDREGISTER_CLASS(FogVolume);
  676. GDREGISTER_CLASS(FogMaterial);
  677. GDREGISTER_CLASS(RemoteTransform3D);
  678. #ifndef PHYSICS_3D_DISABLED
  679. GDREGISTER_ABSTRACT_CLASS(Joint3D);
  680. GDREGISTER_CLASS(PinJoint3D);
  681. GDREGISTER_CLASS(HingeJoint3D);
  682. GDREGISTER_CLASS(SliderJoint3D);
  683. GDREGISTER_CLASS(ConeTwistJoint3D);
  684. GDREGISTER_CLASS(Generic6DOFJoint3D);
  685. #endif // PHYSICS_3D_DISABLED
  686. #ifndef NAVIGATION_3D_DISABLED
  687. GDREGISTER_CLASS(NavigationMeshSourceGeometryData3D);
  688. GDREGISTER_CLASS(NavigationRegion3D);
  689. GDREGISTER_CLASS(NavigationAgent3D);
  690. GDREGISTER_CLASS(NavigationObstacle3D);
  691. GDREGISTER_CLASS(NavigationLink3D);
  692. #endif // NAVIGATION_3D_DISABLED
  693. OS::get_singleton()->yield(); // may take time to init
  694. #endif // _3D_DISABLED
  695. /* REGISTER SHADER */
  696. GDREGISTER_CLASS(Shader);
  697. GDREGISTER_CLASS(VisualShader);
  698. GDREGISTER_CLASS(ShaderInclude);
  699. GDREGISTER_ABSTRACT_CLASS(VisualShaderNode);
  700. GDREGISTER_CLASS(VisualShaderNodeCustom);
  701. GDREGISTER_CLASS(VisualShaderNodeInput);
  702. GDREGISTER_ABSTRACT_CLASS(VisualShaderNodeOutput);
  703. GDREGISTER_ABSTRACT_CLASS(VisualShaderNodeResizableBase);
  704. GDREGISTER_ABSTRACT_CLASS(VisualShaderNodeGroupBase);
  705. GDREGISTER_ABSTRACT_CLASS(VisualShaderNodeConstant);
  706. GDREGISTER_ABSTRACT_CLASS(VisualShaderNodeVectorBase);
  707. GDREGISTER_CLASS(VisualShaderNodeFrame);
  708. #ifndef DISABLE_DEPRECATED
  709. GDREGISTER_CLASS(VisualShaderNodeComment); // Deprecated, just for compatibility.
  710. #endif
  711. GDREGISTER_CLASS(VisualShaderNodeFloatConstant);
  712. GDREGISTER_CLASS(VisualShaderNodeIntConstant);
  713. GDREGISTER_CLASS(VisualShaderNodeUIntConstant);
  714. GDREGISTER_CLASS(VisualShaderNodeBooleanConstant);
  715. GDREGISTER_CLASS(VisualShaderNodeColorConstant);
  716. GDREGISTER_CLASS(VisualShaderNodeVec2Constant);
  717. GDREGISTER_CLASS(VisualShaderNodeVec3Constant);
  718. GDREGISTER_CLASS(VisualShaderNodeVec4Constant);
  719. GDREGISTER_CLASS(VisualShaderNodeTransformConstant);
  720. GDREGISTER_CLASS(VisualShaderNodeFloatOp);
  721. GDREGISTER_CLASS(VisualShaderNodeIntOp);
  722. GDREGISTER_CLASS(VisualShaderNodeUIntOp);
  723. GDREGISTER_CLASS(VisualShaderNodeVectorOp);
  724. GDREGISTER_CLASS(VisualShaderNodeColorOp);
  725. GDREGISTER_CLASS(VisualShaderNodeTransformOp);
  726. GDREGISTER_CLASS(VisualShaderNodeTransformVecMult);
  727. GDREGISTER_CLASS(VisualShaderNodeFloatFunc);
  728. GDREGISTER_CLASS(VisualShaderNodeIntFunc);
  729. GDREGISTER_CLASS(VisualShaderNodeUIntFunc);
  730. GDREGISTER_CLASS(VisualShaderNodeVectorFunc);
  731. GDREGISTER_CLASS(VisualShaderNodeColorFunc);
  732. GDREGISTER_CLASS(VisualShaderNodeTransformFunc);
  733. GDREGISTER_CLASS(VisualShaderNodeUVFunc);
  734. GDREGISTER_CLASS(VisualShaderNodeUVPolarCoord);
  735. GDREGISTER_CLASS(VisualShaderNodeDotProduct);
  736. GDREGISTER_CLASS(VisualShaderNodeVectorLen);
  737. GDREGISTER_CLASS(VisualShaderNodeDeterminant);
  738. GDREGISTER_CLASS(VisualShaderNodeDerivativeFunc);
  739. GDREGISTER_CLASS(VisualShaderNodeClamp);
  740. GDREGISTER_CLASS(VisualShaderNodeFaceForward);
  741. GDREGISTER_CLASS(VisualShaderNodeOuterProduct);
  742. GDREGISTER_CLASS(VisualShaderNodeSmoothStep);
  743. GDREGISTER_CLASS(VisualShaderNodeStep);
  744. GDREGISTER_CLASS(VisualShaderNodeVectorDistance);
  745. GDREGISTER_CLASS(VisualShaderNodeVectorRefract);
  746. GDREGISTER_CLASS(VisualShaderNodeMix);
  747. GDREGISTER_CLASS(VisualShaderNodeVectorCompose);
  748. GDREGISTER_CLASS(VisualShaderNodeTransformCompose);
  749. GDREGISTER_CLASS(VisualShaderNodeVectorDecompose);
  750. GDREGISTER_CLASS(VisualShaderNodeTransformDecompose);
  751. GDREGISTER_CLASS(VisualShaderNodeTexture);
  752. GDREGISTER_CLASS(VisualShaderNodeCurveTexture);
  753. GDREGISTER_CLASS(VisualShaderNodeCurveXYZTexture);
  754. GDREGISTER_ABSTRACT_CLASS(VisualShaderNodeSample3D);
  755. GDREGISTER_CLASS(VisualShaderNodeTexture2DArray);
  756. GDREGISTER_CLASS(VisualShaderNodeTexture3D);
  757. GDREGISTER_CLASS(VisualShaderNodeCubemap);
  758. GDREGISTER_ABSTRACT_CLASS(VisualShaderNodeParameter);
  759. GDREGISTER_CLASS(VisualShaderNodeParameterRef);
  760. GDREGISTER_CLASS(VisualShaderNodeFloatParameter);
  761. GDREGISTER_CLASS(VisualShaderNodeIntParameter);
  762. GDREGISTER_CLASS(VisualShaderNodeUIntParameter);
  763. GDREGISTER_CLASS(VisualShaderNodeBooleanParameter);
  764. GDREGISTER_CLASS(VisualShaderNodeColorParameter);
  765. GDREGISTER_CLASS(VisualShaderNodeVec2Parameter);
  766. GDREGISTER_CLASS(VisualShaderNodeVec3Parameter);
  767. GDREGISTER_CLASS(VisualShaderNodeVec4Parameter);
  768. GDREGISTER_CLASS(VisualShaderNodeTransformParameter);
  769. GDREGISTER_ABSTRACT_CLASS(VisualShaderNodeTextureParameter);
  770. GDREGISTER_CLASS(VisualShaderNodeTexture2DParameter);
  771. GDREGISTER_CLASS(VisualShaderNodeTextureParameterTriplanar);
  772. GDREGISTER_CLASS(VisualShaderNodeTexture2DArrayParameter);
  773. GDREGISTER_CLASS(VisualShaderNodeTexture3DParameter);
  774. GDREGISTER_CLASS(VisualShaderNodeCubemapParameter);
  775. GDREGISTER_CLASS(VisualShaderNodeLinearSceneDepth);
  776. GDREGISTER_CLASS(VisualShaderNodeWorldPositionFromDepth);
  777. GDREGISTER_CLASS(VisualShaderNodeScreenNormalWorldSpace);
  778. GDREGISTER_CLASS(VisualShaderNodeIf);
  779. GDREGISTER_CLASS(VisualShaderNodeSwitch);
  780. GDREGISTER_CLASS(VisualShaderNodeFresnel);
  781. GDREGISTER_CLASS(VisualShaderNodeExpression);
  782. GDREGISTER_CLASS(VisualShaderNodeGlobalExpression);
  783. GDREGISTER_CLASS(VisualShaderNodeIs);
  784. GDREGISTER_CLASS(VisualShaderNodeCompare);
  785. GDREGISTER_CLASS(VisualShaderNodeMultiplyAdd);
  786. GDREGISTER_CLASS(VisualShaderNodeBillboard);
  787. GDREGISTER_CLASS(VisualShaderNodeDistanceFade);
  788. GDREGISTER_CLASS(VisualShaderNodeProximityFade);
  789. GDREGISTER_CLASS(VisualShaderNodeRandomRange);
  790. GDREGISTER_CLASS(VisualShaderNodeRemap);
  791. GDREGISTER_CLASS(VisualShaderNodeRotationByAxis);
  792. GDREGISTER_ABSTRACT_CLASS(VisualShaderNodeVarying);
  793. GDREGISTER_CLASS(VisualShaderNodeVaryingSetter);
  794. GDREGISTER_CLASS(VisualShaderNodeVaryingGetter);
  795. GDREGISTER_CLASS(VisualShaderNodeReroute);
  796. GDREGISTER_CLASS(VisualShaderNodeSDFToScreenUV);
  797. GDREGISTER_CLASS(VisualShaderNodeScreenUVToSDF);
  798. GDREGISTER_CLASS(VisualShaderNodeTextureSDF);
  799. GDREGISTER_CLASS(VisualShaderNodeTextureSDFNormal);
  800. GDREGISTER_CLASS(VisualShaderNodeSDFRaymarch);
  801. GDREGISTER_CLASS(VisualShaderNodeParticleOutput);
  802. GDREGISTER_ABSTRACT_CLASS(VisualShaderNodeParticleEmitter);
  803. GDREGISTER_CLASS(VisualShaderNodeParticleSphereEmitter);
  804. GDREGISTER_CLASS(VisualShaderNodeParticleBoxEmitter);
  805. GDREGISTER_CLASS(VisualShaderNodeParticleRingEmitter);
  806. GDREGISTER_CLASS(VisualShaderNodeParticleMeshEmitter);
  807. GDREGISTER_CLASS(VisualShaderNodeParticleMultiplyByAxisAngle);
  808. GDREGISTER_CLASS(VisualShaderNodeParticleConeVelocity);
  809. GDREGISTER_CLASS(VisualShaderNodeParticleRandomness);
  810. GDREGISTER_CLASS(VisualShaderNodeParticleAccelerator);
  811. GDREGISTER_CLASS(VisualShaderNodeParticleEmit);
  812. GDREGISTER_CLASS(ShaderMaterial);
  813. GDREGISTER_CLASS(CanvasTexture);
  814. GDREGISTER_CLASS(CanvasItemMaterial);
  815. SceneTree::add_idle_callback(CanvasItemMaterial::flush_changes);
  816. CanvasItemMaterial::init_shaders();
  817. /* REGISTER 2D */
  818. GDREGISTER_CLASS(Node2D);
  819. GDREGISTER_CLASS(CanvasGroup);
  820. GDREGISTER_CLASS(CPUParticles2D);
  821. GDREGISTER_CLASS(GPUParticles2D);
  822. GDREGISTER_CLASS(Sprite2D);
  823. GDREGISTER_CLASS(SpriteFrames);
  824. GDREGISTER_CLASS(AnimatedSprite2D);
  825. GDREGISTER_CLASS(Marker2D);
  826. GDREGISTER_CLASS(Line2D);
  827. GDREGISTER_CLASS(MeshInstance2D);
  828. GDREGISTER_CLASS(MultiMeshInstance2D);
  829. #ifndef PHYSICS_2D_DISABLED
  830. GDREGISTER_ABSTRACT_CLASS(CollisionObject2D);
  831. GDREGISTER_ABSTRACT_CLASS(PhysicsBody2D);
  832. GDREGISTER_CLASS(StaticBody2D);
  833. GDREGISTER_CLASS(AnimatableBody2D);
  834. GDREGISTER_CLASS(RigidBody2D);
  835. GDREGISTER_CLASS(CharacterBody2D);
  836. GDREGISTER_CLASS(KinematicCollision2D);
  837. GDREGISTER_CLASS(Area2D);
  838. GDREGISTER_CLASS(CollisionShape2D);
  839. GDREGISTER_CLASS(CollisionPolygon2D);
  840. GDREGISTER_CLASS(RayCast2D);
  841. GDREGISTER_CLASS(ShapeCast2D);
  842. #endif // PHYSICS_2D_DISABLED
  843. GDREGISTER_CLASS(VisibleOnScreenNotifier2D);
  844. GDREGISTER_CLASS(VisibleOnScreenEnabler2D);
  845. GDREGISTER_CLASS(Polygon2D);
  846. GDREGISTER_CLASS(Skeleton2D);
  847. GDREGISTER_CLASS(Bone2D);
  848. GDREGISTER_ABSTRACT_CLASS(Light2D);
  849. GDREGISTER_CLASS(PointLight2D);
  850. GDREGISTER_CLASS(DirectionalLight2D);
  851. GDREGISTER_CLASS(LightOccluder2D);
  852. GDREGISTER_CLASS(OccluderPolygon2D);
  853. GDREGISTER_CLASS(BackBufferCopy);
  854. GDREGISTER_CLASS(CanvasModulate);
  855. OS::get_singleton()->yield(); // may take time to init
  856. GDREGISTER_CLASS(Camera2D);
  857. GDREGISTER_CLASS(AudioListener2D);
  858. #ifndef PHYSICS_2D_DISABLED
  859. GDREGISTER_ABSTRACT_CLASS(Joint2D);
  860. GDREGISTER_CLASS(PinJoint2D);
  861. GDREGISTER_CLASS(GrooveJoint2D);
  862. GDREGISTER_CLASS(DampedSpringJoint2D);
  863. GDREGISTER_CLASS(TouchScreenButton);
  864. #endif // PHYSICS_2D_DISABLED
  865. GDREGISTER_CLASS(TileSet);
  866. GDREGISTER_ABSTRACT_CLASS(TileSetSource);
  867. GDREGISTER_CLASS(TileSetAtlasSource);
  868. GDREGISTER_CLASS(TileSetScenesCollectionSource);
  869. GDREGISTER_CLASS(TileMapPattern);
  870. GDREGISTER_CLASS(TileData);
  871. GDREGISTER_CLASS(TileMapLayer);
  872. GDREGISTER_CLASS(Parallax2D);
  873. GDREGISTER_CLASS(RemoteTransform2D);
  874. #ifndef DISABLE_DEPRECATED
  875. GDREGISTER_CLASS(ParallaxBackground);
  876. GDREGISTER_CLASS(ParallaxLayer);
  877. GDREGISTER_CLASS(TileMap);
  878. #endif
  879. GDREGISTER_CLASS(SkeletonModificationStack2D);
  880. GDREGISTER_CLASS(SkeletonModification2D);
  881. GDREGISTER_CLASS(SkeletonModification2DLookAt);
  882. GDREGISTER_CLASS(SkeletonModification2DCCDIK);
  883. GDREGISTER_CLASS(SkeletonModification2DFABRIK);
  884. GDREGISTER_CLASS(SkeletonModification2DTwoBoneIK);
  885. GDREGISTER_CLASS(SkeletonModification2DStackHolder);
  886. #ifndef PHYSICS_2D_DISABLED
  887. GDREGISTER_CLASS(PhysicalBone2D);
  888. GDREGISTER_CLASS(SkeletonModification2DJiggle);
  889. GDREGISTER_CLASS(SkeletonModification2DPhysicalBones);
  890. #endif // PHYSICS_2D_DISABLED
  891. OS::get_singleton()->yield(); // may take time to init
  892. /* REGISTER RESOURCES */
  893. GDREGISTER_ABSTRACT_CLASS(Shader);
  894. GDREGISTER_CLASS(ParticleProcessMaterial);
  895. SceneTree::add_idle_callback(ParticleProcessMaterial::flush_changes);
  896. ParticleProcessMaterial::init_shaders();
  897. GDREGISTER_VIRTUAL_CLASS(Mesh);
  898. GDREGISTER_CLASS(MeshConvexDecompositionSettings);
  899. GDREGISTER_CLASS(ArrayMesh);
  900. GDREGISTER_CLASS(PlaceholderMesh);
  901. GDREGISTER_CLASS(ImmediateMesh);
  902. GDREGISTER_CLASS(MultiMesh);
  903. GDREGISTER_CLASS(SurfaceTool);
  904. GDREGISTER_CLASS(MeshDataTool);
  905. #ifndef _3D_DISABLED
  906. GDREGISTER_CLASS(AudioStreamPlayer3D);
  907. GDREGISTER_VIRTUAL_CLASS(PrimitiveMesh);
  908. GDREGISTER_CLASS(BoxMesh);
  909. GDREGISTER_CLASS(CapsuleMesh);
  910. GDREGISTER_CLASS(CylinderMesh);
  911. GDREGISTER_CLASS(PlaneMesh);
  912. GDREGISTER_CLASS(PrismMesh);
  913. GDREGISTER_CLASS(QuadMesh);
  914. GDREGISTER_CLASS(SphereMesh);
  915. GDREGISTER_CLASS(TextMesh);
  916. GDREGISTER_CLASS(TorusMesh);
  917. GDREGISTER_CLASS(TubeTrailMesh);
  918. GDREGISTER_CLASS(RibbonTrailMesh);
  919. GDREGISTER_CLASS(PointMesh);
  920. GDREGISTER_ABSTRACT_CLASS(BaseMaterial3D);
  921. GDREGISTER_CLASS(StandardMaterial3D);
  922. GDREGISTER_CLASS(ORMMaterial3D);
  923. GDREGISTER_CLASS(ProceduralSkyMaterial);
  924. GDREGISTER_CLASS(PanoramaSkyMaterial);
  925. GDREGISTER_CLASS(PhysicalSkyMaterial);
  926. SceneTree::add_idle_callback(BaseMaterial3D::flush_changes);
  927. BaseMaterial3D::init_shaders();
  928. GDREGISTER_CLASS(MeshLibrary);
  929. OS::get_singleton()->yield(); // may take time to init
  930. #ifndef PHYSICS_3D_DISABLED
  931. GDREGISTER_ABSTRACT_CLASS(Shape3D);
  932. GDREGISTER_CLASS(SeparationRayShape3D);
  933. GDREGISTER_CLASS(SphereShape3D);
  934. GDREGISTER_CLASS(BoxShape3D);
  935. GDREGISTER_CLASS(CapsuleShape3D);
  936. GDREGISTER_CLASS(CylinderShape3D);
  937. GDREGISTER_CLASS(HeightMapShape3D);
  938. GDREGISTER_CLASS(WorldBoundaryShape3D);
  939. GDREGISTER_CLASS(ConvexPolygonShape3D);
  940. GDREGISTER_CLASS(ConcavePolygonShape3D);
  941. #endif // PHYSICS_3D_DISABLED
  942. GDREGISTER_CLASS(World3D);
  943. OS::get_singleton()->yield(); // may take time to init
  944. #endif // _3D_DISABLED
  945. #if !defined(PHYSICS_2D_DISABLED) || !defined(PHYSICS_3D_DISABLED)
  946. GDREGISTER_CLASS(PhysicsMaterial);
  947. #endif // !defined(PHYSICS_2D_DISABLED) || !defined(PHYSICS_3D_DISABLED)
  948. GDREGISTER_CLASS(Compositor);
  949. GDREGISTER_CLASS(Environment);
  950. GDREGISTER_VIRTUAL_CLASS(CameraAttributes);
  951. GDREGISTER_CLASS(CameraAttributesPhysical);
  952. GDREGISTER_CLASS(CameraAttributesPractical);
  953. GDREGISTER_CLASS(World2D);
  954. GDREGISTER_CLASS(Sky);
  955. GDREGISTER_CLASS(CompressedTexture2D);
  956. GDREGISTER_CLASS(PortableCompressedTexture2D);
  957. GDREGISTER_CLASS(ImageTexture);
  958. GDREGISTER_CLASS(AtlasTexture);
  959. GDREGISTER_CLASS(MeshTexture);
  960. GDREGISTER_CLASS(CurveTexture);
  961. GDREGISTER_CLASS(CurveXYZTexture);
  962. GDREGISTER_CLASS(GradientTexture1D);
  963. GDREGISTER_CLASS(GradientTexture2D);
  964. GDREGISTER_CLASS(CameraTexture);
  965. GDREGISTER_CLASS(ExternalTexture);
  966. GDREGISTER_VIRTUAL_CLASS(TextureLayered);
  967. GDREGISTER_ABSTRACT_CLASS(ImageTextureLayered);
  968. GDREGISTER_VIRTUAL_CLASS(Texture3D);
  969. GDREGISTER_CLASS(ImageTexture3D);
  970. GDREGISTER_CLASS(CompressedTexture3D);
  971. GDREGISTER_CLASS(Cubemap);
  972. GDREGISTER_CLASS(CubemapArray);
  973. GDREGISTER_CLASS(Texture2DArray);
  974. GDREGISTER_ABSTRACT_CLASS(CompressedTextureLayered);
  975. GDREGISTER_CLASS(CompressedCubemap);
  976. GDREGISTER_CLASS(CompressedCubemapArray);
  977. GDREGISTER_CLASS(CompressedTexture2DArray);
  978. GDREGISTER_CLASS(PlaceholderTexture2D);
  979. GDREGISTER_CLASS(PlaceholderTexture3D);
  980. GDREGISTER_ABSTRACT_CLASS(PlaceholderTextureLayered);
  981. GDREGISTER_CLASS(PlaceholderTexture2DArray);
  982. GDREGISTER_CLASS(PlaceholderCubemap);
  983. GDREGISTER_CLASS(PlaceholderCubemapArray);
  984. GDREGISTER_CLASS(DPITexture);
  985. #ifndef DISABLE_DEPRECATED
  986. GDREGISTER_CLASS(AnimatedTexture);
  987. #endif
  988. // These classes are part of renderer_rd
  989. GDREGISTER_CLASS(Texture2DRD);
  990. GDREGISTER_ABSTRACT_CLASS(TextureLayeredRD);
  991. GDREGISTER_CLASS(Texture2DArrayRD);
  992. GDREGISTER_CLASS(TextureCubemapRD);
  993. GDREGISTER_CLASS(TextureCubemapArrayRD);
  994. GDREGISTER_CLASS(Texture3DRD);
  995. GDREGISTER_CLASS(Animation);
  996. GDREGISTER_CLASS(AnimationLibrary);
  997. GDREGISTER_ABSTRACT_CLASS(Font);
  998. GDREGISTER_CLASS(FontFile);
  999. GDREGISTER_CLASS(FontVariation);
  1000. GDREGISTER_CLASS(SystemFont);
  1001. GDREGISTER_CLASS(ColorPalette);
  1002. GDREGISTER_CLASS(Curve);
  1003. GDREGISTER_CLASS(LabelSettings);
  1004. GDREGISTER_CLASS(TextLine);
  1005. GDREGISTER_CLASS(TextParagraph);
  1006. GDREGISTER_VIRTUAL_CLASS(StyleBox);
  1007. GDREGISTER_CLASS(StyleBoxEmpty);
  1008. GDREGISTER_CLASS(StyleBoxTexture);
  1009. GDREGISTER_CLASS(StyleBoxFlat);
  1010. GDREGISTER_CLASS(StyleBoxLine);
  1011. GDREGISTER_CLASS(Theme);
  1012. GDREGISTER_CLASS(BitMap);
  1013. GDREGISTER_CLASS(Gradient);
  1014. GDREGISTER_CLASS(SkeletonProfile);
  1015. GDREGISTER_CLASS(SkeletonProfileHumanoid);
  1016. GDREGISTER_CLASS(BoneMap);
  1017. OS::get_singleton()->yield(); // may take time to init
  1018. GDREGISTER_CLASS(AudioStreamPlayer);
  1019. GDREGISTER_CLASS(AudioStreamWAV);
  1020. GDREGISTER_CLASS(AudioStreamPolyphonic);
  1021. GDREGISTER_ABSTRACT_CLASS(AudioStreamPlaybackPolyphonic);
  1022. OS::get_singleton()->yield(); // may take time to init
  1023. GDREGISTER_CLASS(AudioStreamPlayer2D);
  1024. GDREGISTER_CLASS(Curve2D);
  1025. GDREGISTER_CLASS(Path2D);
  1026. GDREGISTER_CLASS(PathFollow2D);
  1027. #ifndef PHYSICS_2D_DISABLED
  1028. GDREGISTER_ABSTRACT_CLASS(Shape2D);
  1029. GDREGISTER_CLASS(WorldBoundaryShape2D);
  1030. GDREGISTER_CLASS(SegmentShape2D);
  1031. GDREGISTER_CLASS(SeparationRayShape2D);
  1032. GDREGISTER_CLASS(CircleShape2D);
  1033. GDREGISTER_CLASS(RectangleShape2D);
  1034. GDREGISTER_CLASS(CapsuleShape2D);
  1035. GDREGISTER_CLASS(ConvexPolygonShape2D);
  1036. GDREGISTER_CLASS(ConcavePolygonShape2D);
  1037. #endif // PHYSICS_2D_DISABLED
  1038. #if !defined(NAVIGATION_2D_DISABLED) || !defined(NAVIGATION_3D_DISABLED)
  1039. GDREGISTER_CLASS(NavigationMesh);
  1040. #endif // !defined(NAVIGATION_2D_DISABLED) || !defined(NAVIGATION_3D_DISABLED)
  1041. #ifndef NAVIGATION_2D_DISABLED
  1042. GDREGISTER_CLASS(NavigationMeshSourceGeometryData2D);
  1043. GDREGISTER_CLASS(NavigationPolygon);
  1044. GDREGISTER_CLASS(NavigationRegion2D);
  1045. GDREGISTER_CLASS(NavigationAgent2D);
  1046. GDREGISTER_CLASS(NavigationObstacle2D);
  1047. GDREGISTER_CLASS(NavigationLink2D);
  1048. GDREGISTER_CLASS(PolygonPathFinder);
  1049. OS::get_singleton()->yield(); // may take time to init
  1050. // 2D nodes that support navmesh baking need to server register their source geometry parsers.
  1051. MeshInstance2D::navmesh_parse_init();
  1052. MultiMeshInstance2D::navmesh_parse_init();
  1053. NavigationObstacle2D::navmesh_parse_init();
  1054. Polygon2D::navmesh_parse_init();
  1055. #ifndef DISABLE_DEPRECATED
  1056. TileMap::navmesh_parse_init();
  1057. #endif
  1058. TileMapLayer::navmesh_parse_init();
  1059. #ifndef PHYSICS_2D_DISABLED
  1060. StaticBody2D::navmesh_parse_init();
  1061. #endif // PHYSICS_2D_DISABLED
  1062. #endif // NAVIGATION_2D_DISABLED
  1063. #ifndef NAVIGATION_3D_DISABLED
  1064. // 3D nodes that support navmesh baking need to server register their source geometry parsers.
  1065. MeshInstance3D::navmesh_parse_init();
  1066. MultiMeshInstance3D::navmesh_parse_init();
  1067. NavigationObstacle3D::navmesh_parse_init();
  1068. #ifndef PHYSICS_3D_DISABLED
  1069. StaticBody3D::navmesh_parse_init();
  1070. #endif // PHYSICS_3D_DISABLED
  1071. #endif // NAVIGATION_3D_DISABLED
  1072. #if !defined(NAVIGATION_2D_DISABLED) || !defined(NAVIGATION_3D_DISABLED)
  1073. OS::get_singleton()->yield(); // may take time to init
  1074. #endif // !defined(NAVIGATION_2D_DISABLED) || !defined(NAVIGATION_3D_DISABLED)
  1075. GDREGISTER_ABSTRACT_CLASS(SceneState);
  1076. GDREGISTER_CLASS(PackedScene);
  1077. GDREGISTER_CLASS(SceneTree);
  1078. GDREGISTER_ABSTRACT_CLASS(SceneTreeTimer); // sorry, you can't create it
  1079. #ifndef DISABLE_DEPRECATED
  1080. // Dropped in 4.0, near approximation.
  1081. ClassDB::add_compatibility_class("AnimationTreePlayer", "AnimationTree");
  1082. ClassDB::add_compatibility_class("BakedLightmap", "LightmapGI");
  1083. ClassDB::add_compatibility_class("BakedLightmapData", "LightmapGIData");
  1084. ClassDB::add_compatibility_class("BitmapFont", "FontFile");
  1085. ClassDB::add_compatibility_class("DynamicFont", "FontFile");
  1086. ClassDB::add_compatibility_class("DynamicFontData", "FontFile");
  1087. #ifndef NAVIGATION_3D_DISABLED
  1088. ClassDB::add_compatibility_class("Navigation3D", "Node3D");
  1089. ClassDB::add_compatibility_class("Navigation2D", "Node2D");
  1090. #endif // NAVIGATION_3D_DISABLED
  1091. ClassDB::add_compatibility_class("OpenSimplexNoise", "FastNoiseLite");
  1092. ClassDB::add_compatibility_class("ProximityGroup", "Node3D");
  1093. ClassDB::add_compatibility_class("ToolButton", "Button");
  1094. ClassDB::add_compatibility_class("YSort", "Node2D");
  1095. // Portal and room occlusion was replaced by raster occlusion (OccluderInstance3D node).
  1096. ClassDB::add_compatibility_class("Portal", "Node3D");
  1097. ClassDB::add_compatibility_class("Room", "Node3D");
  1098. ClassDB::add_compatibility_class("RoomManager", "Node3D");
  1099. ClassDB::add_compatibility_class("RoomGroup", "Node3D");
  1100. ClassDB::add_compatibility_class("Occluder", "Node3D");
  1101. // The OccluderShapeSphere resource (used in the old Occluder node) is not present anymore.
  1102. ClassDB::add_compatibility_class("OccluderShapeSphere", "Resource");
  1103. // Renamed in 4.0.
  1104. // Keep alphabetical ordering to easily locate classes and avoid duplicates.
  1105. ClassDB::add_compatibility_class("AnimatedSprite", "AnimatedSprite2D");
  1106. ClassDB::add_compatibility_class("ARVRCamera", "XRCamera3D");
  1107. ClassDB::add_compatibility_class("ARVRController", "XRController3D");
  1108. ClassDB::add_compatibility_class("ARVRAnchor", "XRAnchor3D");
  1109. ClassDB::add_compatibility_class("ARVRInterface", "XRInterface");
  1110. ClassDB::add_compatibility_class("ARVROrigin", "XROrigin3D");
  1111. ClassDB::add_compatibility_class("ARVRPositionalTracker", "XRPositionalTracker");
  1112. ClassDB::add_compatibility_class("ARVRServer", "XRServer");
  1113. ClassDB::add_compatibility_class("AStar", "AStar3D");
  1114. ClassDB::add_compatibility_class("BoneAttachment", "BoneAttachment3D");
  1115. ClassDB::add_compatibility_class("Camera", "Camera3D");
  1116. ClassDB::add_compatibility_class("ClippedCamera", "ClippedCamera3D");
  1117. ClassDB::add_compatibility_class("CSGBox", "CSGBox3D");
  1118. ClassDB::add_compatibility_class("CSGCombiner", "CSGCombiner3D");
  1119. ClassDB::add_compatibility_class("CSGCylinder", "CSGCylinder3D");
  1120. ClassDB::add_compatibility_class("CSGMesh", "CSGMesh3D");
  1121. ClassDB::add_compatibility_class("CSGPolygon", "CSGPolygon3D");
  1122. ClassDB::add_compatibility_class("CSGPrimitive", "CSGPrimitive3D");
  1123. ClassDB::add_compatibility_class("CSGShape", "CSGShape3D");
  1124. ClassDB::add_compatibility_class("CSGSphere", "CSGSphere3D");
  1125. ClassDB::add_compatibility_class("CSGTorus", "CSGTorus3D");
  1126. ClassDB::add_compatibility_class("CubeMesh", "BoxMesh");
  1127. ClassDB::add_compatibility_class("GIProbe", "VoxelGI");
  1128. ClassDB::add_compatibility_class("GIProbeData", "VoxelGIData");
  1129. ClassDB::add_compatibility_class("GradientTexture", "GradientTexture1D");
  1130. ClassDB::add_compatibility_class("Light", "Light3D");
  1131. ClassDB::add_compatibility_class("Light2D", "PointLight2D");
  1132. ClassDB::add_compatibility_class("LineShape2D", "WorldBoundaryShape2D");
  1133. ClassDB::add_compatibility_class("Listener", "AudioListener3D");
  1134. ClassDB::add_compatibility_class("MeshInstance", "MeshInstance3D");
  1135. ClassDB::add_compatibility_class("MultiMeshInstance", "MultiMeshInstance3D");
  1136. #ifndef NAVIGATION_3D_DISABLED
  1137. ClassDB::add_compatibility_class("NavigationAgent", "NavigationAgent3D");
  1138. ClassDB::add_compatibility_class("NavigationMeshInstance", "NavigationRegion3D");
  1139. ClassDB::add_compatibility_class("NavigationObstacle", "NavigationObstacle3D");
  1140. ClassDB::add_compatibility_class("NavigationRegion", "NavigationRegion3D");
  1141. ClassDB::add_compatibility_class("NavigationServer", "NavigationServer3D");
  1142. #endif // NAVIGATION_3D_DISABLED
  1143. #ifndef NAVIGATION_2D_DISABLED
  1144. ClassDB::add_compatibility_class("NavigationPolygonInstance", "NavigationRegion2D");
  1145. ClassDB::add_compatibility_class("Navigation2DServer", "NavigationServer2D");
  1146. #endif // NAVIGATION_2D_DISABLED
  1147. ClassDB::add_compatibility_class("OmniLight", "OmniLight3D");
  1148. ClassDB::add_compatibility_class("PanoramaSky", "Sky");
  1149. ClassDB::add_compatibility_class("Particles", "GPUParticles3D");
  1150. ClassDB::add_compatibility_class("Particles2D", "GPUParticles2D");
  1151. ClassDB::add_compatibility_class("ParticlesMaterial", "ParticleProcessMaterial");
  1152. ClassDB::add_compatibility_class("Path", "Path3D");
  1153. ClassDB::add_compatibility_class("PathFollow", "PathFollow3D");
  1154. ClassDB::add_compatibility_class("Position2D", "Marker2D");
  1155. ClassDB::add_compatibility_class("Position3D", "Marker3D");
  1156. ClassDB::add_compatibility_class("ProceduralSky", "Sky");
  1157. ClassDB::add_compatibility_class("RemoteTransform", "RemoteTransform3D");
  1158. ClassDB::add_compatibility_class("ShortCut", "Shortcut");
  1159. ClassDB::add_compatibility_class("Skeleton", "Skeleton3D");
  1160. ClassDB::add_compatibility_class("SkeletonIK", "SkeletonIK3D");
  1161. ClassDB::add_compatibility_class("Spatial", "Node3D");
  1162. ClassDB::add_compatibility_class("SpatialGizmo", "Node3DGizmo");
  1163. ClassDB::add_compatibility_class("SpatialMaterial", "StandardMaterial3D");
  1164. ClassDB::add_compatibility_class("SpotLight", "SpotLight3D");
  1165. ClassDB::add_compatibility_class("Sprite", "Sprite2D");
  1166. ClassDB::add_compatibility_class("StaticBody", "StaticBody3D");
  1167. ClassDB::add_compatibility_class("StreamTexture", "CompressedTexture2D");
  1168. ClassDB::add_compatibility_class("TextureProgress", "TextureProgressBar");
  1169. ClassDB::add_compatibility_class("VideoPlayer", "VideoStreamPlayer");
  1170. ClassDB::add_compatibility_class("ViewportContainer", "SubViewportContainer");
  1171. ClassDB::add_compatibility_class("Viewport", "SubViewport");
  1172. ClassDB::add_compatibility_class("VisibilityEnabler", "VisibleOnScreenEnabler3D");
  1173. ClassDB::add_compatibility_class("VisibilityNotifier", "VisibleOnScreenNotifier3D");
  1174. ClassDB::add_compatibility_class("VisibilityNotifier2D", "VisibleOnScreenNotifier2D");
  1175. ClassDB::add_compatibility_class("VisibilityNotifier3D", "VisibleOnScreenNotifier3D");
  1176. ClassDB::add_compatibility_class("VisualServer", "RenderingServer");
  1177. ClassDB::add_compatibility_class("World", "World3D");
  1178. #ifndef PHYSICS_2D_DISABLED
  1179. ClassDB::add_compatibility_class("Physics2DDirectBodyState", "PhysicsDirectBodyState2D");
  1180. ClassDB::add_compatibility_class("Physics2DDirectSpaceState", "PhysicsDirectSpaceState2D");
  1181. ClassDB::add_compatibility_class("Physics2DServer", "PhysicsServer2D");
  1182. ClassDB::add_compatibility_class("Physics2DShapeQueryParameters", "PhysicsShapeQueryParameters2D");
  1183. ClassDB::add_compatibility_class("Physics2DTestMotionResult", "PhysicsTestMotionResult2D");
  1184. ClassDB::add_compatibility_class("RayShape2D", "SeparationRayShape2D");
  1185. #endif // PHYSICS_2D_DISABLED
  1186. #ifndef PHYSICS_3D_DISABLED
  1187. ClassDB::add_compatibility_class("Area", "Area3D");
  1188. ClassDB::add_compatibility_class("BoxShape", "BoxShape3D");
  1189. ClassDB::add_compatibility_class("CapsuleShape", "CapsuleShape3D");
  1190. ClassDB::add_compatibility_class("CollisionObject", "CollisionObject3D");
  1191. ClassDB::add_compatibility_class("CollisionPolygon", "CollisionPolygon3D");
  1192. ClassDB::add_compatibility_class("CollisionShape", "CollisionShape3D");
  1193. ClassDB::add_compatibility_class("ConcavePolygonShape", "ConcavePolygonShape3D");
  1194. ClassDB::add_compatibility_class("ConeTwistJoint", "ConeTwistJoint3D");
  1195. ClassDB::add_compatibility_class("ConvexPolygonShape", "ConvexPolygonShape3D");
  1196. ClassDB::add_compatibility_class("CPUParticles", "CPUParticles3D");
  1197. ClassDB::add_compatibility_class("CylinderShape", "CylinderShape3D");
  1198. ClassDB::add_compatibility_class("DirectionalLight", "DirectionalLight3D");
  1199. ClassDB::add_compatibility_class("EditorSpatialGizmo", "EditorNode3DGizmo");
  1200. ClassDB::add_compatibility_class("EditorSpatialGizmoPlugin", "EditorNode3DGizmoPlugin");
  1201. ClassDB::add_compatibility_class("Generic6DOFJoint", "Generic6DOFJoint3D");
  1202. ClassDB::add_compatibility_class("HeightMapShape", "HeightMapShape3D");
  1203. ClassDB::add_compatibility_class("HingeJoint", "HingeJoint3D");
  1204. ClassDB::add_compatibility_class("Joint", "Joint3D");
  1205. ClassDB::add_compatibility_class("KinematicBody", "CharacterBody3D");
  1206. ClassDB::add_compatibility_class("KinematicBody2D", "CharacterBody2D");
  1207. ClassDB::add_compatibility_class("KinematicCollision", "KinematicCollision3D");
  1208. ClassDB::add_compatibility_class("PhysicsBody", "PhysicsBody3D");
  1209. ClassDB::add_compatibility_class("PhysicalBone", "PhysicalBone3D");
  1210. ClassDB::add_compatibility_class("PhysicsDirectBodyState", "PhysicsDirectBodyState3D");
  1211. ClassDB::add_compatibility_class("PhysicsDirectSpaceState", "PhysicsDirectSpaceState3D");
  1212. ClassDB::add_compatibility_class("PhysicsServer", "PhysicsServer3D");
  1213. ClassDB::add_compatibility_class("PhysicsShapeQueryParameters", "PhysicsShapeQueryParameters3D");
  1214. ClassDB::add_compatibility_class("PinJoint", "PinJoint3D");
  1215. ClassDB::add_compatibility_class("PlaneShape", "WorldBoundaryShape3D");
  1216. ClassDB::add_compatibility_class("RayCast", "RayCast3D");
  1217. ClassDB::add_compatibility_class("RayShape", "SeparationRayShape3D");
  1218. ClassDB::add_compatibility_class("RigidBody", "RigidBody3D");
  1219. ClassDB::add_compatibility_class("RigidDynamicBody2D", "RigidBody2D");
  1220. ClassDB::add_compatibility_class("RigidDynamicBody3D", "RigidBody3D");
  1221. ClassDB::add_compatibility_class("Shape", "Shape3D");
  1222. ClassDB::add_compatibility_class("SliderJoint", "SliderJoint3D");
  1223. ClassDB::add_compatibility_class("SoftBody", "SoftBody3D");
  1224. ClassDB::add_compatibility_class("SoftDynamicBody3D", "SoftBody3D");
  1225. ClassDB::add_compatibility_class("SphereShape", "SphereShape3D");
  1226. ClassDB::add_compatibility_class("SpringArm", "SpringArm3D");
  1227. ClassDB::add_compatibility_class("VehicleBody", "VehicleBody3D");
  1228. ClassDB::add_compatibility_class("VehicleWheel", "VehicleWheel3D");
  1229. #endif // PHYSICS_3D_DISABLED
  1230. // VisualShader classes.
  1231. ClassDB::add_compatibility_class("VisualShaderNodeScalarConstant", "VisualShaderNodeFloatConstant");
  1232. ClassDB::add_compatibility_class("VisualShaderNodeScalarFunc", "VisualShaderNodeFloatFunc");
  1233. ClassDB::add_compatibility_class("VisualShaderNodeScalarOp", "VisualShaderNodeFloatOp");
  1234. ClassDB::add_compatibility_class("VisualShaderNodeScalarClamp", "VisualShaderNodeClamp");
  1235. ClassDB::add_compatibility_class("VisualShaderNodeVectorClamp", "VisualShaderNodeClamp");
  1236. ClassDB::add_compatibility_class("VisualShaderNodeScalarInterp", "VisualShaderNodeMix");
  1237. ClassDB::add_compatibility_class("VisualShaderNodeVectorInterp", "VisualShaderNodeMix");
  1238. ClassDB::add_compatibility_class("VisualShaderNodeVectorScalarMix", "VisualShaderNodeMix");
  1239. ClassDB::add_compatibility_class("VisualShaderNodeScalarSmoothStep", "VisualShaderNodeSmoothStep");
  1240. ClassDB::add_compatibility_class("VisualShaderNodeVectorSmoothStep", "VisualShaderNodeSmoothStep");
  1241. ClassDB::add_compatibility_class("VisualShaderNodeVectorScalarSmoothStep", "VisualShaderNodeSmoothStep");
  1242. ClassDB::add_compatibility_class("VisualShaderNodeVectorScalarStep", "VisualShaderNodeStep");
  1243. ClassDB::add_compatibility_class("VisualShaderNodeScalarSwitch", "VisualShaderNodeSwitch");
  1244. ClassDB::add_compatibility_class("VisualShaderNodeScalarTransformMult", "VisualShaderNodeTransformOp");
  1245. ClassDB::add_compatibility_class("VisualShaderNodeScalarDerivativeFunc", "VisualShaderNodeDerivativeFunc");
  1246. ClassDB::add_compatibility_class("VisualShaderNodeVectorDerivativeFunc", "VisualShaderNodeDerivativeFunc");
  1247. ClassDB::add_compatibility_class("VisualShaderNodeBooleanUniform", "VisualShaderNodeBooleanParameter");
  1248. ClassDB::add_compatibility_class("VisualShaderNodeColorUniform", "VisualShaderNodeColorParameter");
  1249. ClassDB::add_compatibility_class("VisualShaderNodeScalarUniform", "VisualShaderNodeFloatParameter");
  1250. ClassDB::add_compatibility_class("VisualShaderNodeCubeMapUniform", "VisualShaderNodeCubeMapParameter");
  1251. ClassDB::add_compatibility_class("VisualShaderNodeTextureUniform", "VisualShaderNodeTexture2DParameter");
  1252. ClassDB::add_compatibility_class("VisualShaderNodeTextureUniformTriplanar", "VisualShaderNodeTextureParameterTriplanar");
  1253. ClassDB::add_compatibility_class("VisualShaderNodeTransformUniform", "VisualShaderNodeTransformParameter");
  1254. ClassDB::add_compatibility_class("VisualShaderNodeVec3Uniform", "VisualShaderNodeVec3Parameter");
  1255. ClassDB::add_compatibility_class("VisualShaderNodeUniform", "VisualShaderNodeParameter");
  1256. ClassDB::add_compatibility_class("VisualShaderNodeUniformRef", "VisualShaderNodeParameterRef");
  1257. // Renamed during 4.0 alpha, added to ease transition between alphas.
  1258. ClassDB::add_compatibility_class("AudioStreamOGGVorbis", "AudioStreamOggVorbis");
  1259. ClassDB::add_compatibility_class("AudioStreamSample", "AudioStreamWAV");
  1260. ClassDB::add_compatibility_class("OGGPacketSequence", "OggPacketSequence");
  1261. ClassDB::add_compatibility_class("StreamCubemap", "CompressedCubemap");
  1262. ClassDB::add_compatibility_class("StreamCubemapArray", "CompressedCubemapArray");
  1263. ClassDB::add_compatibility_class("StreamTexture2D", "CompressedTexture2D");
  1264. ClassDB::add_compatibility_class("StreamTexture2DArray", "CompressedTexture2DArray");
  1265. ClassDB::add_compatibility_class("StreamTexture3D", "CompressedTexture3D");
  1266. ClassDB::add_compatibility_class("StreamTextureLayered", "CompressedTextureLayered");
  1267. ClassDB::add_compatibility_class("VisualShaderNodeFloatUniform", "VisualShaderNodeFloatParameter");
  1268. #endif /* DISABLE_DEPRECATED */
  1269. OS::get_singleton()->yield(); // may take time to init
  1270. for (int i = 0; i < 20; i++) {
  1271. GLOBAL_DEF_BASIC(vformat("%s/layer_%d", PNAME("layer_names/2d_render"), i + 1), "");
  1272. GLOBAL_DEF_BASIC(vformat("%s/layer_%d", PNAME("layer_names/3d_render"), i + 1), "");
  1273. }
  1274. for (int i = 0; i < 32; i++) {
  1275. GLOBAL_DEF_BASIC(vformat("%s/layer_%d", PNAME("layer_names/2d_physics"), i + 1), "");
  1276. #ifndef NAVIGATION_2D_DISABLED
  1277. GLOBAL_DEF_BASIC(vformat("%s/layer_%d", PNAME("layer_names/2d_navigation"), i + 1), "");
  1278. #endif // NAVIGATION_2D_DISABLED
  1279. GLOBAL_DEF_BASIC(vformat("%s/layer_%d", PNAME("layer_names/3d_physics"), i + 1), "");
  1280. #ifndef NAVIGATION_3D_DISABLED
  1281. GLOBAL_DEF_BASIC(vformat("%s/layer_%d", PNAME("layer_names/3d_navigation"), i + 1), "");
  1282. #endif // NAVIGATION_3D_DISABLED
  1283. }
  1284. for (int i = 0; i < 32; i++) {
  1285. GLOBAL_DEF_BASIC(vformat("%s/layer_%d", PNAME("layer_names/avoidance"), i + 1), "");
  1286. }
  1287. if (RenderingServer::get_singleton()) {
  1288. // RenderingServer needs to exist for this to succeed.
  1289. ColorPickerShape::init_shaders();
  1290. GraphEdit::init_shaders();
  1291. }
  1292. SceneDebugger::initialize();
  1293. OS::get_singleton()->benchmark_end_measure("Scene", "Register Types");
  1294. }
  1295. void unregister_scene_types() {
  1296. OS::get_singleton()->benchmark_begin_measure("Scene", "Unregister Types");
  1297. SceneDebugger::deinitialize();
  1298. if constexpr (GD_IS_CLASS_ENABLED(TextureLayered)) {
  1299. ResourceLoader::remove_resource_format_loader(resource_loader_texture_layered);
  1300. resource_loader_texture_layered.unref();
  1301. }
  1302. if constexpr (GD_IS_CLASS_ENABLED(Texture3D)) {
  1303. ResourceLoader::remove_resource_format_loader(resource_loader_texture_3d);
  1304. resource_loader_texture_3d.unref();
  1305. }
  1306. if constexpr (GD_IS_CLASS_ENABLED(CompressedTexture2D)) {
  1307. ResourceLoader::remove_resource_format_loader(resource_loader_stream_texture);
  1308. resource_loader_stream_texture.unref();
  1309. }
  1310. ResourceSaver::remove_resource_format_saver(resource_saver_text);
  1311. resource_saver_text.unref();
  1312. ResourceLoader::remove_resource_format_loader(resource_loader_text);
  1313. resource_loader_text.unref();
  1314. if constexpr (GD_IS_CLASS_ENABLED(Shader)) {
  1315. ResourceSaver::remove_resource_format_saver(resource_saver_shader);
  1316. resource_saver_shader.unref();
  1317. ResourceLoader::remove_resource_format_loader(resource_loader_shader);
  1318. resource_loader_shader.unref();
  1319. }
  1320. if constexpr (GD_IS_CLASS_ENABLED(ShaderInclude)) {
  1321. ResourceSaver::remove_resource_format_saver(resource_saver_shader_include);
  1322. resource_saver_shader_include.unref();
  1323. ResourceLoader::remove_resource_format_loader(resource_loader_shader_include);
  1324. resource_loader_shader_include.unref();
  1325. }
  1326. // StandardMaterial3D is not initialized when 3D is disabled, so it shouldn't be cleaned up either
  1327. #ifndef _3D_DISABLED
  1328. BaseMaterial3D::finish_shaders();
  1329. PhysicalSkyMaterial::cleanup_shader();
  1330. PanoramaSkyMaterial::cleanup_shader();
  1331. ProceduralSkyMaterial::cleanup_shader();
  1332. FogMaterial::cleanup_shader();
  1333. #endif // _3D_DISABLED
  1334. ParticleProcessMaterial::finish_shaders();
  1335. CanvasItemMaterial::finish_shaders();
  1336. ColorPickerShape::finish_shaders();
  1337. GraphEdit::finish_shaders();
  1338. SceneStringNames::free();
  1339. OS::get_singleton()->benchmark_end_measure("Scene", "Unregister Types");
  1340. }
  1341. void register_scene_singletons() {
  1342. OS::get_singleton()->benchmark_begin_measure("Scene", "Register Singletons");
  1343. GDREGISTER_CLASS(ThemeDB);
  1344. Engine::get_singleton()->add_singleton(Engine::Singleton("ThemeDB", ThemeDB::get_singleton()));
  1345. OS::get_singleton()->benchmark_end_measure("Scene", "Register Singletons");
  1346. }