register_scene_types.cpp 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218
  1. /*************************************************************************/
  2. /* register_scene_types.cpp */
  3. /*************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /*************************************************************************/
  8. /* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
  9. /* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
  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/extension/native_extension_manager.h"
  33. #include "core/object/class_db.h"
  34. #include "core/os/os.h"
  35. #include "scene/2d/animated_sprite_2d.h"
  36. #include "scene/2d/area_2d.h"
  37. #include "scene/2d/audio_listener_2d.h"
  38. #include "scene/2d/audio_stream_player_2d.h"
  39. #include "scene/2d/back_buffer_copy.h"
  40. #include "scene/2d/camera_2d.h"
  41. #include "scene/2d/canvas_group.h"
  42. #include "scene/2d/canvas_modulate.h"
  43. #include "scene/2d/collision_polygon_2d.h"
  44. #include "scene/2d/collision_shape_2d.h"
  45. #include "scene/2d/cpu_particles_2d.h"
  46. #include "scene/2d/gpu_particles_2d.h"
  47. #include "scene/2d/joint_2d.h"
  48. #include "scene/2d/light_2d.h"
  49. #include "scene/2d/light_occluder_2d.h"
  50. #include "scene/2d/line_2d.h"
  51. #include "scene/2d/mesh_instance_2d.h"
  52. #include "scene/2d/multimesh_instance_2d.h"
  53. #include "scene/2d/navigation_agent_2d.h"
  54. #include "scene/2d/navigation_obstacle_2d.h"
  55. #include "scene/2d/parallax_background.h"
  56. #include "scene/2d/parallax_layer.h"
  57. #include "scene/2d/path_2d.h"
  58. #include "scene/2d/physical_bone_2d.h"
  59. #include "scene/2d/physics_body_2d.h"
  60. #include "scene/2d/polygon_2d.h"
  61. #include "scene/2d/position_2d.h"
  62. #include "scene/2d/ray_cast_2d.h"
  63. #include "scene/2d/remote_transform_2d.h"
  64. #include "scene/2d/shape_cast_2d.h"
  65. #include "scene/2d/skeleton_2d.h"
  66. #include "scene/2d/sprite_2d.h"
  67. #include "scene/2d/tile_map.h"
  68. #include "scene/2d/touch_screen_button.h"
  69. #include "scene/2d/visible_on_screen_notifier_2d.h"
  70. #include "scene/animation/animation_blend_space_1d.h"
  71. #include "scene/animation/animation_blend_space_2d.h"
  72. #include "scene/animation/animation_blend_tree.h"
  73. #include "scene/animation/animation_node_state_machine.h"
  74. #include "scene/animation/animation_player.h"
  75. #include "scene/animation/animation_tree.h"
  76. #include "scene/animation/root_motion_view.h"
  77. #include "scene/animation/tween.h"
  78. #include "scene/audio/audio_stream_player.h"
  79. #include "scene/debugger/scene_debugger.h"
  80. #include "scene/gui/aspect_ratio_container.h"
  81. #include "scene/gui/box_container.h"
  82. #include "scene/gui/button.h"
  83. #include "scene/gui/center_container.h"
  84. #include "scene/gui/check_box.h"
  85. #include "scene/gui/check_button.h"
  86. #include "scene/gui/code_edit.h"
  87. #include "scene/gui/color_picker.h"
  88. #include "scene/gui/color_rect.h"
  89. #include "scene/gui/control.h"
  90. #include "scene/gui/dialogs.h"
  91. #include "scene/gui/file_dialog.h"
  92. #include "scene/gui/flow_container.h"
  93. #include "scene/gui/graph_edit.h"
  94. #include "scene/gui/graph_node.h"
  95. #include "scene/gui/grid_container.h"
  96. #include "scene/gui/item_list.h"
  97. #include "scene/gui/label.h"
  98. #include "scene/gui/line_edit.h"
  99. #include "scene/gui/link_button.h"
  100. #include "scene/gui/margin_container.h"
  101. #include "scene/gui/menu_button.h"
  102. #include "scene/gui/nine_patch_rect.h"
  103. #include "scene/gui/option_button.h"
  104. #include "scene/gui/panel.h"
  105. #include "scene/gui/panel_container.h"
  106. #include "scene/gui/popup_menu.h"
  107. #include "scene/gui/progress_bar.h"
  108. #include "scene/gui/reference_rect.h"
  109. #include "scene/gui/rich_text_effect.h"
  110. #include "scene/gui/rich_text_label.h"
  111. #include "scene/gui/scroll_bar.h"
  112. #include "scene/gui/scroll_container.h"
  113. #include "scene/gui/separator.h"
  114. #include "scene/gui/slider.h"
  115. #include "scene/gui/spin_box.h"
  116. #include "scene/gui/split_container.h"
  117. #include "scene/gui/subviewport_container.h"
  118. #include "scene/gui/tab_bar.h"
  119. #include "scene/gui/tab_container.h"
  120. #include "scene/gui/text_edit.h"
  121. #include "scene/gui/texture_button.h"
  122. #include "scene/gui/texture_progress_bar.h"
  123. #include "scene/gui/texture_rect.h"
  124. #include "scene/gui/tree.h"
  125. #include "scene/gui/video_stream_player.h"
  126. #include "scene/main/canvas_item.h"
  127. #include "scene/main/canvas_layer.h"
  128. #include "scene/main/http_request.h"
  129. #include "scene/main/instance_placeholder.h"
  130. #include "scene/main/missing_node.h"
  131. #include "scene/main/resource_preloader.h"
  132. #include "scene/main/scene_tree.h"
  133. #include "scene/main/timer.h"
  134. #include "scene/main/viewport.h"
  135. #include "scene/main/window.h"
  136. #include "scene/multiplayer/multiplayer_spawner.h"
  137. #include "scene/multiplayer/multiplayer_synchronizer.h"
  138. #include "scene/multiplayer/scene_cache_interface.h"
  139. #include "scene/multiplayer/scene_replication_interface.h"
  140. #include "scene/multiplayer/scene_rpc_interface.h"
  141. #include "scene/resources/animation_library.h"
  142. #include "scene/resources/audio_stream_sample.h"
  143. #include "scene/resources/bit_map.h"
  144. #include "scene/resources/bone_map.h"
  145. #include "scene/resources/box_shape_3d.h"
  146. #include "scene/resources/camera_effects.h"
  147. #include "scene/resources/capsule_shape_2d.h"
  148. #include "scene/resources/capsule_shape_3d.h"
  149. #include "scene/resources/circle_shape_2d.h"
  150. #include "scene/resources/concave_polygon_shape_2d.h"
  151. #include "scene/resources/concave_polygon_shape_3d.h"
  152. #include "scene/resources/convex_polygon_shape_2d.h"
  153. #include "scene/resources/convex_polygon_shape_3d.h"
  154. #include "scene/resources/cylinder_shape_3d.h"
  155. #include "scene/resources/default_theme/default_theme.h"
  156. #include "scene/resources/font.h"
  157. #include "scene/resources/gradient.h"
  158. #include "scene/resources/height_map_shape_3d.h"
  159. #include "scene/resources/immediate_mesh.h"
  160. #include "scene/resources/label_settings.h"
  161. #include "scene/resources/material.h"
  162. #include "scene/resources/mesh.h"
  163. #include "scene/resources/mesh_data_tool.h"
  164. #include "scene/resources/navigation_mesh.h"
  165. #include "scene/resources/packed_scene.h"
  166. #include "scene/resources/particles_material.h"
  167. #include "scene/resources/physics_material.h"
  168. #include "scene/resources/polygon_path_finder.h"
  169. #include "scene/resources/primitive_meshes.h"
  170. #include "scene/resources/rectangle_shape_2d.h"
  171. #include "scene/resources/resource_format_text.h"
  172. #include "scene/resources/segment_shape_2d.h"
  173. #include "scene/resources/separation_ray_shape_2d.h"
  174. #include "scene/resources/separation_ray_shape_3d.h"
  175. #include "scene/resources/shader_include.h"
  176. #include "scene/resources/skeleton_modification_2d.h"
  177. #include "scene/resources/skeleton_modification_2d_ccdik.h"
  178. #include "scene/resources/skeleton_modification_2d_fabrik.h"
  179. #include "scene/resources/skeleton_modification_2d_jiggle.h"
  180. #include "scene/resources/skeleton_modification_2d_lookat.h"
  181. #include "scene/resources/skeleton_modification_2d_physicalbones.h"
  182. #include "scene/resources/skeleton_modification_2d_stackholder.h"
  183. #include "scene/resources/skeleton_modification_2d_twoboneik.h"
  184. #include "scene/resources/skeleton_modification_3d.h"
  185. #include "scene/resources/skeleton_modification_3d_ccdik.h"
  186. #include "scene/resources/skeleton_modification_3d_fabrik.h"
  187. #include "scene/resources/skeleton_modification_3d_jiggle.h"
  188. #include "scene/resources/skeleton_modification_3d_lookat.h"
  189. #include "scene/resources/skeleton_modification_3d_stackholder.h"
  190. #include "scene/resources/skeleton_modification_3d_twoboneik.h"
  191. #include "scene/resources/skeleton_modification_stack_2d.h"
  192. #include "scene/resources/skeleton_modification_stack_3d.h"
  193. #include "scene/resources/skeleton_profile.h"
  194. #include "scene/resources/sky.h"
  195. #include "scene/resources/sky_material.h"
  196. #include "scene/resources/sphere_shape_3d.h"
  197. #include "scene/resources/surface_tool.h"
  198. #include "scene/resources/syntax_highlighter.h"
  199. #include "scene/resources/text_file.h"
  200. #include "scene/resources/text_line.h"
  201. #include "scene/resources/text_paragraph.h"
  202. #include "scene/resources/texture.h"
  203. #include "scene/resources/tile_set.h"
  204. #include "scene/resources/video_stream.h"
  205. #include "scene/resources/visual_shader.h"
  206. #include "scene/resources/visual_shader_nodes.h"
  207. #include "scene/resources/visual_shader_particle_nodes.h"
  208. #include "scene/resources/visual_shader_sdf_nodes.h"
  209. #include "scene/resources/world_2d.h"
  210. #include "scene/resources/world_3d.h"
  211. #include "scene/resources/world_boundary_shape_2d.h"
  212. #include "scene/resources/world_boundary_shape_3d.h"
  213. #include "scene/scene_string_names.h"
  214. #include "scene/main/shader_globals_override.h"
  215. #ifndef _3D_DISABLED
  216. #include "scene/3d/area_3d.h"
  217. #include "scene/3d/audio_listener_3d.h"
  218. #include "scene/3d/audio_stream_player_3d.h"
  219. #include "scene/3d/bone_attachment_3d.h"
  220. #include "scene/3d/camera_3d.h"
  221. #include "scene/3d/collision_polygon_3d.h"
  222. #include "scene/3d/collision_shape_3d.h"
  223. #include "scene/3d/cpu_particles_3d.h"
  224. #include "scene/3d/decal.h"
  225. #include "scene/3d/fog_volume.h"
  226. #include "scene/3d/gpu_particles_3d.h"
  227. #include "scene/3d/gpu_particles_collision_3d.h"
  228. #include "scene/3d/importer_mesh_instance_3d.h"
  229. #include "scene/3d/joint_3d.h"
  230. #include "scene/3d/label_3d.h"
  231. #include "scene/3d/light_3d.h"
  232. #include "scene/3d/lightmap_gi.h"
  233. #include "scene/3d/lightmap_probe.h"
  234. #include "scene/3d/mesh_instance_3d.h"
  235. #include "scene/3d/multimesh_instance_3d.h"
  236. #include "scene/3d/navigation_agent_3d.h"
  237. #include "scene/3d/navigation_obstacle_3d.h"
  238. #include "scene/3d/navigation_region_3d.h"
  239. #include "scene/3d/node_3d.h"
  240. #include "scene/3d/occluder_instance_3d.h"
  241. #include "scene/3d/path_3d.h"
  242. #include "scene/3d/physics_body_3d.h"
  243. #include "scene/3d/position_3d.h"
  244. #include "scene/3d/ray_cast_3d.h"
  245. #include "scene/3d/reflection_probe.h"
  246. #include "scene/3d/remote_transform_3d.h"
  247. #include "scene/3d/skeleton_3d.h"
  248. #include "scene/3d/skeleton_ik_3d.h"
  249. #include "scene/3d/soft_dynamic_body_3d.h"
  250. #include "scene/3d/spring_arm_3d.h"
  251. #include "scene/3d/sprite_3d.h"
  252. #include "scene/3d/vehicle_body_3d.h"
  253. #include "scene/3d/visible_on_screen_notifier_3d.h"
  254. #include "scene/3d/voxel_gi.h"
  255. #include "scene/3d/world_environment.h"
  256. #include "scene/3d/xr_nodes.h"
  257. #include "scene/resources/environment.h"
  258. #include "scene/resources/fog_material.h"
  259. #include "scene/resources/importer_mesh.h"
  260. #include "scene/resources/mesh_library.h"
  261. #endif
  262. static Ref<ResourceFormatSaverText> resource_saver_text;
  263. static Ref<ResourceFormatLoaderText> resource_loader_text;
  264. static Ref<ResourceFormatLoaderCompressedTexture2D> resource_loader_stream_texture;
  265. static Ref<ResourceFormatLoaderCompressedTextureLayered> resource_loader_texture_layered;
  266. static Ref<ResourceFormatLoaderCompressedTexture3D> resource_loader_texture_3d;
  267. static Ref<ResourceFormatSaverShader> resource_saver_shader;
  268. static Ref<ResourceFormatLoaderShader> resource_loader_shader;
  269. static Ref<ResourceFormatSaverShaderInclude> resource_saver_shader_include;
  270. static Ref<ResourceFormatLoaderShaderInclude> resource_loader_shader_include;
  271. void register_scene_types() {
  272. SceneStringNames::create();
  273. OS::get_singleton()->yield(); // may take time to init
  274. Node::init_node_hrcr();
  275. resource_loader_stream_texture.instantiate();
  276. ResourceLoader::add_resource_format_loader(resource_loader_stream_texture);
  277. resource_loader_texture_layered.instantiate();
  278. ResourceLoader::add_resource_format_loader(resource_loader_texture_layered);
  279. resource_loader_texture_3d.instantiate();
  280. ResourceLoader::add_resource_format_loader(resource_loader_texture_3d);
  281. resource_saver_text.instantiate();
  282. ResourceSaver::add_resource_format_saver(resource_saver_text, true);
  283. resource_loader_text.instantiate();
  284. ResourceLoader::add_resource_format_loader(resource_loader_text, true);
  285. resource_saver_shader.instantiate();
  286. ResourceSaver::add_resource_format_saver(resource_saver_shader, true);
  287. resource_loader_shader.instantiate();
  288. ResourceLoader::add_resource_format_loader(resource_loader_shader, true);
  289. resource_saver_shader_include.instantiate();
  290. ResourceSaver::add_resource_format_saver(resource_saver_shader_include, true);
  291. resource_loader_shader_include.instantiate();
  292. ResourceLoader::add_resource_format_loader(resource_loader_shader_include, true);
  293. OS::get_singleton()->yield(); // may take time to init
  294. GDREGISTER_CLASS(Object);
  295. GDREGISTER_CLASS(Node);
  296. GDREGISTER_VIRTUAL_CLASS(MissingNode);
  297. GDREGISTER_ABSTRACT_CLASS(InstancePlaceholder);
  298. GDREGISTER_ABSTRACT_CLASS(Viewport);
  299. GDREGISTER_CLASS(SubViewport);
  300. GDREGISTER_CLASS(ViewportTexture);
  301. GDREGISTER_CLASS(HTTPRequest);
  302. GDREGISTER_CLASS(MultiplayerSpawner);
  303. GDREGISTER_CLASS(MultiplayerSynchronizer);
  304. GDREGISTER_CLASS(Timer);
  305. GDREGISTER_CLASS(CanvasLayer);
  306. GDREGISTER_CLASS(CanvasModulate);
  307. GDREGISTER_CLASS(ResourcePreloader);
  308. GDREGISTER_CLASS(Window);
  309. /* REGISTER GUI */
  310. GDREGISTER_CLASS(ButtonGroup);
  311. GDREGISTER_VIRTUAL_CLASS(BaseButton);
  312. OS::get_singleton()->yield(); // may take time to init
  313. GDREGISTER_CLASS(Control);
  314. GDREGISTER_CLASS(Button);
  315. GDREGISTER_CLASS(Label);
  316. GDREGISTER_ABSTRACT_CLASS(ScrollBar);
  317. GDREGISTER_CLASS(HScrollBar);
  318. GDREGISTER_CLASS(VScrollBar);
  319. GDREGISTER_CLASS(ProgressBar);
  320. GDREGISTER_ABSTRACT_CLASS(Slider);
  321. GDREGISTER_CLASS(HSlider);
  322. GDREGISTER_CLASS(VSlider);
  323. GDREGISTER_CLASS(Popup);
  324. GDREGISTER_CLASS(PopupPanel);
  325. GDREGISTER_CLASS(MenuButton);
  326. GDREGISTER_CLASS(CheckBox);
  327. GDREGISTER_CLASS(CheckButton);
  328. GDREGISTER_CLASS(LinkButton);
  329. GDREGISTER_CLASS(Panel);
  330. GDREGISTER_VIRTUAL_CLASS(Range);
  331. OS::get_singleton()->yield(); // may take time to init
  332. GDREGISTER_CLASS(TextureRect);
  333. GDREGISTER_CLASS(ColorRect);
  334. GDREGISTER_CLASS(NinePatchRect);
  335. GDREGISTER_CLASS(ReferenceRect);
  336. GDREGISTER_CLASS(AspectRatioContainer);
  337. GDREGISTER_CLASS(TabContainer);
  338. GDREGISTER_CLASS(TabBar);
  339. GDREGISTER_ABSTRACT_CLASS(Separator);
  340. GDREGISTER_CLASS(HSeparator);
  341. GDREGISTER_CLASS(VSeparator);
  342. GDREGISTER_CLASS(TextureButton);
  343. GDREGISTER_CLASS(Container);
  344. GDREGISTER_ABSTRACT_CLASS(BoxContainer);
  345. GDREGISTER_CLASS(HBoxContainer);
  346. GDREGISTER_CLASS(VBoxContainer);
  347. GDREGISTER_CLASS(GridContainer);
  348. GDREGISTER_CLASS(CenterContainer);
  349. GDREGISTER_CLASS(ScrollContainer);
  350. GDREGISTER_CLASS(PanelContainer);
  351. GDREGISTER_ABSTRACT_CLASS(FlowContainer);
  352. GDREGISTER_CLASS(HFlowContainer);
  353. GDREGISTER_CLASS(VFlowContainer);
  354. OS::get_singleton()->yield(); // may take time to init
  355. GDREGISTER_CLASS(TextureProgressBar);
  356. GDREGISTER_CLASS(ItemList);
  357. GDREGISTER_CLASS(LineEdit);
  358. GDREGISTER_CLASS(VideoStreamPlayer);
  359. #ifndef ADVANCED_GUI_DISABLED
  360. GDREGISTER_CLASS(FileDialog);
  361. GDREGISTER_CLASS(PopupMenu);
  362. GDREGISTER_CLASS(Tree);
  363. GDREGISTER_CLASS(TextEdit);
  364. GDREGISTER_CLASS(CodeEdit);
  365. GDREGISTER_CLASS(SyntaxHighlighter);
  366. GDREGISTER_CLASS(CodeHighlighter);
  367. GDREGISTER_ABSTRACT_CLASS(TreeItem);
  368. GDREGISTER_CLASS(OptionButton);
  369. GDREGISTER_CLASS(SpinBox);
  370. GDREGISTER_CLASS(ColorPicker);
  371. GDREGISTER_CLASS(ColorPickerButton);
  372. GDREGISTER_CLASS(RichTextLabel);
  373. GDREGISTER_CLASS(RichTextEffect);
  374. GDREGISTER_CLASS(CharFXTransform);
  375. GDREGISTER_CLASS(AcceptDialog);
  376. GDREGISTER_CLASS(ConfirmationDialog);
  377. GDREGISTER_CLASS(MarginContainer);
  378. GDREGISTER_CLASS(SubViewportContainer);
  379. GDREGISTER_ABSTRACT_CLASS(SplitContainer);
  380. GDREGISTER_CLASS(HSplitContainer);
  381. GDREGISTER_CLASS(VSplitContainer);
  382. GDREGISTER_CLASS(GraphNode);
  383. GDREGISTER_CLASS(GraphEdit);
  384. OS::get_singleton()->yield(); // may take time to init
  385. bool swap_cancel_ok = false;
  386. if (DisplayServer::get_singleton()) {
  387. swap_cancel_ok = GLOBAL_DEF_NOVAL("gui/common/swap_cancel_ok", bool(DisplayServer::get_singleton()->get_swap_cancel_ok()));
  388. }
  389. AcceptDialog::set_swap_cancel_ok(swap_cancel_ok);
  390. #endif
  391. /* REGISTER ANIMATION */
  392. GDREGISTER_CLASS(AnimationPlayer);
  393. GDREGISTER_CLASS(Tween);
  394. GDREGISTER_ABSTRACT_CLASS(Tweener);
  395. GDREGISTER_CLASS(PropertyTweener);
  396. GDREGISTER_CLASS(IntervalTweener);
  397. GDREGISTER_CLASS(CallbackTweener);
  398. GDREGISTER_CLASS(MethodTweener);
  399. GDREGISTER_CLASS(AnimationTree);
  400. GDREGISTER_CLASS(AnimationNode);
  401. GDREGISTER_CLASS(AnimationRootNode);
  402. GDREGISTER_CLASS(AnimationNodeBlendTree);
  403. GDREGISTER_CLASS(AnimationNodeBlendSpace1D);
  404. GDREGISTER_CLASS(AnimationNodeBlendSpace2D);
  405. GDREGISTER_CLASS(AnimationNodeStateMachine);
  406. GDREGISTER_CLASS(AnimationNodeStateMachinePlayback);
  407. GDREGISTER_CLASS(AnimationNodeSync);
  408. GDREGISTER_CLASS(AnimationNodeStateMachineTransition);
  409. GDREGISTER_CLASS(AnimationNodeOutput);
  410. GDREGISTER_CLASS(AnimationNodeOneShot);
  411. GDREGISTER_CLASS(AnimationNodeAnimation);
  412. GDREGISTER_CLASS(AnimationNodeAdd2);
  413. GDREGISTER_CLASS(AnimationNodeAdd3);
  414. GDREGISTER_CLASS(AnimationNodeBlend2);
  415. GDREGISTER_CLASS(AnimationNodeBlend3);
  416. GDREGISTER_CLASS(AnimationNodeTimeScale);
  417. GDREGISTER_CLASS(AnimationNodeTimeSeek);
  418. GDREGISTER_CLASS(AnimationNodeTransition);
  419. GDREGISTER_CLASS(ShaderGlobalsOverride); // can be used in any shader
  420. OS::get_singleton()->yield(); // may take time to init
  421. /* REGISTER 3D */
  422. #ifndef _3D_DISABLED
  423. GDREGISTER_CLASS(Node3D);
  424. GDREGISTER_ABSTRACT_CLASS(Node3DGizmo);
  425. GDREGISTER_CLASS(Skin);
  426. GDREGISTER_ABSTRACT_CLASS(SkinReference);
  427. GDREGISTER_CLASS(Skeleton3D);
  428. GDREGISTER_CLASS(ImporterMesh);
  429. GDREGISTER_CLASS(ImporterMeshInstance3D);
  430. GDREGISTER_VIRTUAL_CLASS(VisualInstance3D);
  431. GDREGISTER_VIRTUAL_CLASS(GeometryInstance3D);
  432. GDREGISTER_CLASS(Camera3D);
  433. GDREGISTER_CLASS(AudioListener3D);
  434. GDREGISTER_CLASS(XRCamera3D);
  435. GDREGISTER_ABSTRACT_CLASS(XRNode3D);
  436. GDREGISTER_CLASS(XRController3D);
  437. GDREGISTER_CLASS(XRAnchor3D);
  438. GDREGISTER_CLASS(XROrigin3D);
  439. GDREGISTER_CLASS(MeshInstance3D);
  440. GDREGISTER_CLASS(OccluderInstance3D);
  441. GDREGISTER_ABSTRACT_CLASS(Occluder3D);
  442. GDREGISTER_CLASS(ArrayOccluder3D);
  443. GDREGISTER_CLASS(QuadOccluder3D);
  444. GDREGISTER_CLASS(BoxOccluder3D);
  445. GDREGISTER_CLASS(SphereOccluder3D);
  446. GDREGISTER_CLASS(PolygonOccluder3D);
  447. GDREGISTER_ABSTRACT_CLASS(SpriteBase3D);
  448. GDREGISTER_CLASS(Sprite3D);
  449. GDREGISTER_CLASS(AnimatedSprite3D);
  450. GDREGISTER_CLASS(Label3D);
  451. GDREGISTER_ABSTRACT_CLASS(Light3D);
  452. GDREGISTER_CLASS(DirectionalLight3D);
  453. GDREGISTER_CLASS(OmniLight3D);
  454. GDREGISTER_CLASS(SpotLight3D);
  455. GDREGISTER_CLASS(ReflectionProbe);
  456. GDREGISTER_CLASS(Decal);
  457. GDREGISTER_CLASS(VoxelGI);
  458. GDREGISTER_CLASS(VoxelGIData);
  459. GDREGISTER_CLASS(LightmapGI);
  460. GDREGISTER_CLASS(LightmapGIData);
  461. GDREGISTER_CLASS(LightmapProbe);
  462. GDREGISTER_ABSTRACT_CLASS(Lightmapper);
  463. GDREGISTER_CLASS(GPUParticles3D);
  464. GDREGISTER_ABSTRACT_CLASS(GPUParticlesCollision3D);
  465. GDREGISTER_CLASS(GPUParticlesCollisionBox3D);
  466. GDREGISTER_CLASS(GPUParticlesCollisionSphere3D);
  467. GDREGISTER_CLASS(GPUParticlesCollisionSDF3D);
  468. GDREGISTER_CLASS(GPUParticlesCollisionHeightField3D);
  469. GDREGISTER_ABSTRACT_CLASS(GPUParticlesAttractor3D);
  470. GDREGISTER_CLASS(GPUParticlesAttractorBox3D);
  471. GDREGISTER_CLASS(GPUParticlesAttractorSphere3D);
  472. GDREGISTER_CLASS(GPUParticlesAttractorVectorField3D);
  473. GDREGISTER_CLASS(CPUParticles3D);
  474. GDREGISTER_CLASS(Position3D);
  475. GDREGISTER_CLASS(RootMotionView);
  476. ClassDB::set_class_enabled("RootMotionView", false); // disabled by default, enabled by editor
  477. OS::get_singleton()->yield(); // may take time to init
  478. GDREGISTER_ABSTRACT_CLASS(CollisionObject3D);
  479. GDREGISTER_ABSTRACT_CLASS(PhysicsBody3D);
  480. GDREGISTER_CLASS(StaticBody3D);
  481. GDREGISTER_CLASS(AnimatableBody3D);
  482. GDREGISTER_CLASS(RigidDynamicBody3D);
  483. GDREGISTER_CLASS(KinematicCollision3D);
  484. GDREGISTER_CLASS(CharacterBody3D);
  485. GDREGISTER_CLASS(SpringArm3D);
  486. GDREGISTER_CLASS(PhysicalBone3D);
  487. GDREGISTER_CLASS(SoftDynamicBody3D);
  488. GDREGISTER_CLASS(SkeletonIK3D);
  489. GDREGISTER_CLASS(BoneAttachment3D);
  490. GDREGISTER_CLASS(VehicleBody3D);
  491. GDREGISTER_CLASS(VehicleWheel3D);
  492. GDREGISTER_CLASS(Area3D);
  493. GDREGISTER_CLASS(CollisionShape3D);
  494. GDREGISTER_CLASS(CollisionPolygon3D);
  495. GDREGISTER_CLASS(RayCast3D);
  496. GDREGISTER_CLASS(MultiMeshInstance3D);
  497. GDREGISTER_CLASS(Curve3D);
  498. GDREGISTER_CLASS(Path3D);
  499. GDREGISTER_CLASS(PathFollow3D);
  500. GDREGISTER_CLASS(VisibleOnScreenNotifier3D);
  501. GDREGISTER_CLASS(VisibleOnScreenEnabler3D);
  502. GDREGISTER_CLASS(WorldEnvironment);
  503. GDREGISTER_CLASS(FogVolume);
  504. GDREGISTER_CLASS(FogMaterial);
  505. GDREGISTER_CLASS(RemoteTransform3D);
  506. GDREGISTER_ABSTRACT_CLASS(Joint3D);
  507. GDREGISTER_CLASS(PinJoint3D);
  508. GDREGISTER_CLASS(HingeJoint3D);
  509. GDREGISTER_CLASS(SliderJoint3D);
  510. GDREGISTER_CLASS(ConeTwistJoint3D);
  511. GDREGISTER_CLASS(Generic6DOFJoint3D);
  512. GDREGISTER_CLASS(NavigationRegion3D);
  513. GDREGISTER_CLASS(NavigationAgent3D);
  514. GDREGISTER_CLASS(NavigationObstacle3D);
  515. OS::get_singleton()->yield(); // may take time to init
  516. #endif
  517. /* REGISTER SHADER */
  518. GDREGISTER_CLASS(Shader);
  519. GDREGISTER_CLASS(VisualShader);
  520. GDREGISTER_CLASS(ShaderInclude);
  521. GDREGISTER_ABSTRACT_CLASS(VisualShaderNode);
  522. GDREGISTER_CLASS(VisualShaderNodeCustom);
  523. GDREGISTER_CLASS(VisualShaderNodeInput);
  524. GDREGISTER_ABSTRACT_CLASS(VisualShaderNodeOutput);
  525. GDREGISTER_ABSTRACT_CLASS(VisualShaderNodeResizableBase);
  526. GDREGISTER_ABSTRACT_CLASS(VisualShaderNodeGroupBase);
  527. GDREGISTER_ABSTRACT_CLASS(VisualShaderNodeConstant);
  528. GDREGISTER_ABSTRACT_CLASS(VisualShaderNodeVectorBase);
  529. GDREGISTER_CLASS(VisualShaderNodeComment);
  530. GDREGISTER_CLASS(VisualShaderNodeFloatConstant);
  531. GDREGISTER_CLASS(VisualShaderNodeIntConstant);
  532. GDREGISTER_CLASS(VisualShaderNodeBooleanConstant);
  533. GDREGISTER_CLASS(VisualShaderNodeColorConstant);
  534. GDREGISTER_CLASS(VisualShaderNodeVec2Constant);
  535. GDREGISTER_CLASS(VisualShaderNodeVec3Constant);
  536. GDREGISTER_CLASS(VisualShaderNodeVec4Constant);
  537. GDREGISTER_CLASS(VisualShaderNodeTransformConstant);
  538. GDREGISTER_CLASS(VisualShaderNodeFloatOp);
  539. GDREGISTER_CLASS(VisualShaderNodeIntOp);
  540. GDREGISTER_CLASS(VisualShaderNodeVectorOp);
  541. GDREGISTER_CLASS(VisualShaderNodeColorOp);
  542. GDREGISTER_CLASS(VisualShaderNodeTransformOp);
  543. GDREGISTER_CLASS(VisualShaderNodeTransformVecMult);
  544. GDREGISTER_CLASS(VisualShaderNodeFloatFunc);
  545. GDREGISTER_CLASS(VisualShaderNodeIntFunc);
  546. GDREGISTER_CLASS(VisualShaderNodeVectorFunc);
  547. GDREGISTER_CLASS(VisualShaderNodeColorFunc);
  548. GDREGISTER_CLASS(VisualShaderNodeTransformFunc);
  549. GDREGISTER_CLASS(VisualShaderNodeUVFunc);
  550. GDREGISTER_CLASS(VisualShaderNodeDotProduct);
  551. GDREGISTER_CLASS(VisualShaderNodeVectorLen);
  552. GDREGISTER_CLASS(VisualShaderNodeDeterminant);
  553. GDREGISTER_CLASS(VisualShaderNodeDerivativeFunc);
  554. GDREGISTER_CLASS(VisualShaderNodeClamp);
  555. GDREGISTER_CLASS(VisualShaderNodeFaceForward);
  556. GDREGISTER_CLASS(VisualShaderNodeOuterProduct);
  557. GDREGISTER_CLASS(VisualShaderNodeSmoothStep);
  558. GDREGISTER_CLASS(VisualShaderNodeStep);
  559. GDREGISTER_CLASS(VisualShaderNodeVectorDistance);
  560. GDREGISTER_CLASS(VisualShaderNodeVectorRefract);
  561. GDREGISTER_CLASS(VisualShaderNodeMix);
  562. GDREGISTER_CLASS(VisualShaderNodeVectorCompose);
  563. GDREGISTER_CLASS(VisualShaderNodeTransformCompose);
  564. GDREGISTER_CLASS(VisualShaderNodeVectorDecompose);
  565. GDREGISTER_CLASS(VisualShaderNodeTransformDecompose);
  566. GDREGISTER_CLASS(VisualShaderNodeTexture);
  567. GDREGISTER_CLASS(VisualShaderNodeCurveTexture);
  568. GDREGISTER_CLASS(VisualShaderNodeCurveXYZTexture);
  569. GDREGISTER_ABSTRACT_CLASS(VisualShaderNodeSample3D);
  570. GDREGISTER_CLASS(VisualShaderNodeTexture2DArray);
  571. GDREGISTER_CLASS(VisualShaderNodeTexture3D);
  572. GDREGISTER_CLASS(VisualShaderNodeCubemap);
  573. GDREGISTER_ABSTRACT_CLASS(VisualShaderNodeUniform);
  574. GDREGISTER_CLASS(VisualShaderNodeUniformRef);
  575. GDREGISTER_CLASS(VisualShaderNodeFloatUniform);
  576. GDREGISTER_CLASS(VisualShaderNodeIntUniform);
  577. GDREGISTER_CLASS(VisualShaderNodeBooleanUniform);
  578. GDREGISTER_CLASS(VisualShaderNodeColorUniform);
  579. GDREGISTER_CLASS(VisualShaderNodeVec2Uniform);
  580. GDREGISTER_CLASS(VisualShaderNodeVec3Uniform);
  581. GDREGISTER_CLASS(VisualShaderNodeVec4Uniform);
  582. GDREGISTER_CLASS(VisualShaderNodeTransformUniform);
  583. GDREGISTER_CLASS(VisualShaderNodeTextureUniform);
  584. GDREGISTER_CLASS(VisualShaderNodeTextureUniformTriplanar);
  585. GDREGISTER_CLASS(VisualShaderNodeTexture2DArrayUniform);
  586. GDREGISTER_CLASS(VisualShaderNodeTexture3DUniform);
  587. GDREGISTER_CLASS(VisualShaderNodeCubemapUniform);
  588. GDREGISTER_CLASS(VisualShaderNodeIf);
  589. GDREGISTER_CLASS(VisualShaderNodeSwitch);
  590. GDREGISTER_CLASS(VisualShaderNodeFresnel);
  591. GDREGISTER_CLASS(VisualShaderNodeExpression);
  592. GDREGISTER_CLASS(VisualShaderNodeGlobalExpression);
  593. GDREGISTER_CLASS(VisualShaderNodeIs);
  594. GDREGISTER_CLASS(VisualShaderNodeCompare);
  595. GDREGISTER_CLASS(VisualShaderNodeMultiplyAdd);
  596. GDREGISTER_CLASS(VisualShaderNodeBillboard);
  597. GDREGISTER_ABSTRACT_CLASS(VisualShaderNodeVarying);
  598. GDREGISTER_CLASS(VisualShaderNodeVaryingSetter);
  599. GDREGISTER_CLASS(VisualShaderNodeVaryingGetter);
  600. GDREGISTER_CLASS(VisualShaderNodeSDFToScreenUV);
  601. GDREGISTER_CLASS(VisualShaderNodeScreenUVToSDF);
  602. GDREGISTER_CLASS(VisualShaderNodeTextureSDF);
  603. GDREGISTER_CLASS(VisualShaderNodeTextureSDFNormal);
  604. GDREGISTER_CLASS(VisualShaderNodeSDFRaymarch);
  605. GDREGISTER_CLASS(VisualShaderNodeParticleOutput);
  606. GDREGISTER_ABSTRACT_CLASS(VisualShaderNodeParticleEmitter);
  607. GDREGISTER_CLASS(VisualShaderNodeParticleSphereEmitter);
  608. GDREGISTER_CLASS(VisualShaderNodeParticleBoxEmitter);
  609. GDREGISTER_CLASS(VisualShaderNodeParticleRingEmitter);
  610. GDREGISTER_CLASS(VisualShaderNodeParticleMeshEmitter);
  611. GDREGISTER_CLASS(VisualShaderNodeParticleMultiplyByAxisAngle);
  612. GDREGISTER_CLASS(VisualShaderNodeParticleConeVelocity);
  613. GDREGISTER_CLASS(VisualShaderNodeParticleRandomness);
  614. GDREGISTER_CLASS(VisualShaderNodeParticleAccelerator);
  615. GDREGISTER_CLASS(VisualShaderNodeParticleEmit);
  616. GDREGISTER_CLASS(ShaderMaterial);
  617. GDREGISTER_ABSTRACT_CLASS(CanvasItem);
  618. GDREGISTER_CLASS(CanvasTexture);
  619. GDREGISTER_CLASS(CanvasItemMaterial);
  620. SceneTree::add_idle_callback(CanvasItemMaterial::flush_changes);
  621. CanvasItemMaterial::init_shaders();
  622. /* REGISTER 2D */
  623. GDREGISTER_CLASS(Node2D);
  624. GDREGISTER_CLASS(CanvasGroup);
  625. GDREGISTER_CLASS(CPUParticles2D);
  626. GDREGISTER_CLASS(GPUParticles2D);
  627. GDREGISTER_CLASS(Sprite2D);
  628. GDREGISTER_CLASS(SpriteFrames);
  629. GDREGISTER_CLASS(AnimatedSprite2D);
  630. GDREGISTER_CLASS(Position2D);
  631. GDREGISTER_CLASS(Line2D);
  632. GDREGISTER_CLASS(MeshInstance2D);
  633. GDREGISTER_CLASS(MultiMeshInstance2D);
  634. GDREGISTER_ABSTRACT_CLASS(CollisionObject2D);
  635. GDREGISTER_ABSTRACT_CLASS(PhysicsBody2D);
  636. GDREGISTER_CLASS(StaticBody2D);
  637. GDREGISTER_CLASS(AnimatableBody2D);
  638. GDREGISTER_CLASS(RigidDynamicBody2D);
  639. GDREGISTER_CLASS(CharacterBody2D);
  640. GDREGISTER_CLASS(KinematicCollision2D);
  641. GDREGISTER_CLASS(Area2D);
  642. GDREGISTER_CLASS(CollisionShape2D);
  643. GDREGISTER_CLASS(CollisionPolygon2D);
  644. GDREGISTER_CLASS(RayCast2D);
  645. GDREGISTER_CLASS(ShapeCast2D);
  646. GDREGISTER_CLASS(VisibleOnScreenNotifier2D);
  647. GDREGISTER_CLASS(VisibleOnScreenEnabler2D);
  648. GDREGISTER_CLASS(Polygon2D);
  649. GDREGISTER_CLASS(Skeleton2D);
  650. GDREGISTER_CLASS(Bone2D);
  651. GDREGISTER_ABSTRACT_CLASS(Light2D);
  652. GDREGISTER_CLASS(PointLight2D);
  653. GDREGISTER_CLASS(DirectionalLight2D);
  654. GDREGISTER_CLASS(LightOccluder2D);
  655. GDREGISTER_CLASS(OccluderPolygon2D);
  656. GDREGISTER_CLASS(BackBufferCopy);
  657. OS::get_singleton()->yield(); // may take time to init
  658. GDREGISTER_CLASS(Camera2D);
  659. GDREGISTER_CLASS(AudioListener2D);
  660. GDREGISTER_ABSTRACT_CLASS(Joint2D);
  661. GDREGISTER_CLASS(PinJoint2D);
  662. GDREGISTER_CLASS(GrooveJoint2D);
  663. GDREGISTER_CLASS(DampedSpringJoint2D);
  664. GDREGISTER_CLASS(TileSet);
  665. GDREGISTER_ABSTRACT_CLASS(TileSetSource);
  666. GDREGISTER_CLASS(TileSetAtlasSource);
  667. GDREGISTER_CLASS(TileSetScenesCollectionSource);
  668. GDREGISTER_CLASS(TileMapPattern);
  669. GDREGISTER_CLASS(TileData);
  670. GDREGISTER_CLASS(TileMap);
  671. GDREGISTER_CLASS(ParallaxBackground);
  672. GDREGISTER_CLASS(ParallaxLayer);
  673. GDREGISTER_CLASS(TouchScreenButton);
  674. GDREGISTER_CLASS(RemoteTransform2D);
  675. GDREGISTER_CLASS(SkeletonModificationStack2D);
  676. GDREGISTER_CLASS(SkeletonModification2D);
  677. GDREGISTER_CLASS(SkeletonModification2DLookAt);
  678. GDREGISTER_CLASS(SkeletonModification2DCCDIK);
  679. GDREGISTER_CLASS(SkeletonModification2DFABRIK);
  680. GDREGISTER_CLASS(SkeletonModification2DJiggle);
  681. GDREGISTER_CLASS(SkeletonModification2DTwoBoneIK);
  682. GDREGISTER_CLASS(SkeletonModification2DStackHolder);
  683. GDREGISTER_CLASS(PhysicalBone2D);
  684. GDREGISTER_CLASS(SkeletonModification2DPhysicalBones);
  685. OS::get_singleton()->yield(); // may take time to init
  686. /* REGISTER RESOURCES */
  687. GDREGISTER_ABSTRACT_CLASS(Shader);
  688. GDREGISTER_CLASS(ParticlesMaterial);
  689. SceneTree::add_idle_callback(ParticlesMaterial::flush_changes);
  690. ParticlesMaterial::init_shaders();
  691. GDREGISTER_CLASS(ProceduralSkyMaterial);
  692. GDREGISTER_CLASS(PanoramaSkyMaterial);
  693. GDREGISTER_CLASS(PhysicalSkyMaterial);
  694. GDREGISTER_VIRTUAL_CLASS(Mesh);
  695. GDREGISTER_CLASS(ArrayMesh);
  696. GDREGISTER_CLASS(PlaceholderMesh);
  697. GDREGISTER_CLASS(ImmediateMesh);
  698. GDREGISTER_CLASS(MultiMesh);
  699. GDREGISTER_CLASS(SurfaceTool);
  700. GDREGISTER_CLASS(MeshDataTool);
  701. #ifndef _3D_DISABLED
  702. GDREGISTER_VIRTUAL_CLASS(PrimitiveMesh);
  703. GDREGISTER_CLASS(BoxMesh);
  704. GDREGISTER_CLASS(CapsuleMesh);
  705. GDREGISTER_CLASS(CylinderMesh);
  706. GDREGISTER_CLASS(PlaneMesh);
  707. GDREGISTER_CLASS(PrismMesh);
  708. GDREGISTER_CLASS(QuadMesh);
  709. GDREGISTER_CLASS(SphereMesh);
  710. GDREGISTER_CLASS(TextMesh);
  711. GDREGISTER_CLASS(TubeTrailMesh);
  712. GDREGISTER_CLASS(RibbonTrailMesh);
  713. GDREGISTER_CLASS(PointMesh);
  714. GDREGISTER_VIRTUAL_CLASS(Material);
  715. GDREGISTER_ABSTRACT_CLASS(BaseMaterial3D);
  716. GDREGISTER_CLASS(StandardMaterial3D);
  717. GDREGISTER_CLASS(ORMMaterial3D);
  718. GDREGISTER_CLASS(PlaceholderMaterial);
  719. SceneTree::add_idle_callback(BaseMaterial3D::flush_changes);
  720. BaseMaterial3D::init_shaders();
  721. GDREGISTER_CLASS(MeshLibrary);
  722. OS::get_singleton()->yield(); // may take time to init
  723. GDREGISTER_ABSTRACT_CLASS(Shape3D);
  724. GDREGISTER_CLASS(SeparationRayShape3D);
  725. GDREGISTER_CLASS(SphereShape3D);
  726. GDREGISTER_CLASS(BoxShape3D);
  727. GDREGISTER_CLASS(CapsuleShape3D);
  728. GDREGISTER_CLASS(CylinderShape3D);
  729. GDREGISTER_CLASS(HeightMapShape3D);
  730. GDREGISTER_CLASS(WorldBoundaryShape3D);
  731. GDREGISTER_CLASS(ConvexPolygonShape3D);
  732. GDREGISTER_CLASS(ConcavePolygonShape3D);
  733. ClassDB::register_class<SkeletonModificationStack3D>();
  734. ClassDB::register_class<SkeletonModification3D>();
  735. ClassDB::register_class<SkeletonModification3DLookAt>();
  736. ClassDB::register_class<SkeletonModification3DCCDIK>();
  737. ClassDB::register_class<SkeletonModification3DFABRIK>();
  738. ClassDB::register_class<SkeletonModification3DJiggle>();
  739. ClassDB::register_class<SkeletonModification3DTwoBoneIK>();
  740. ClassDB::register_class<SkeletonModification3DStackHolder>();
  741. OS::get_singleton()->yield(); // may take time to init
  742. GDREGISTER_CLASS(VelocityTracker3D);
  743. #endif
  744. GDREGISTER_CLASS(PhysicsMaterial);
  745. GDREGISTER_CLASS(World3D);
  746. GDREGISTER_CLASS(Environment);
  747. GDREGISTER_CLASS(CameraEffects);
  748. GDREGISTER_CLASS(World2D);
  749. GDREGISTER_VIRTUAL_CLASS(Texture);
  750. GDREGISTER_VIRTUAL_CLASS(Texture2D);
  751. GDREGISTER_CLASS(Sky);
  752. GDREGISTER_CLASS(CompressedTexture2D);
  753. GDREGISTER_CLASS(PortableCompressedTexture2D);
  754. GDREGISTER_CLASS(ImageTexture);
  755. GDREGISTER_CLASS(AtlasTexture);
  756. GDREGISTER_CLASS(MeshTexture);
  757. GDREGISTER_CLASS(CurveTexture);
  758. GDREGISTER_CLASS(CurveXYZTexture);
  759. GDREGISTER_CLASS(GradientTexture1D);
  760. GDREGISTER_CLASS(GradientTexture2D);
  761. GDREGISTER_CLASS(ProxyTexture);
  762. GDREGISTER_CLASS(AnimatedTexture);
  763. GDREGISTER_CLASS(CameraTexture);
  764. GDREGISTER_VIRTUAL_CLASS(TextureLayered);
  765. GDREGISTER_ABSTRACT_CLASS(ImageTextureLayered);
  766. GDREGISTER_VIRTUAL_CLASS(Texture3D);
  767. GDREGISTER_CLASS(ImageTexture3D);
  768. GDREGISTER_CLASS(CompressedTexture3D);
  769. GDREGISTER_CLASS(Cubemap);
  770. GDREGISTER_CLASS(CubemapArray);
  771. GDREGISTER_CLASS(Texture2DArray);
  772. GDREGISTER_ABSTRACT_CLASS(CompressedTextureLayered);
  773. GDREGISTER_CLASS(CompressedCubemap);
  774. GDREGISTER_CLASS(CompressedCubemapArray);
  775. GDREGISTER_CLASS(CompressedTexture2DArray);
  776. GDREGISTER_CLASS(PlaceholderTexture2D);
  777. GDREGISTER_CLASS(PlaceholderTexture3D);
  778. GDREGISTER_ABSTRACT_CLASS(PlaceholderTextureLayered);
  779. GDREGISTER_CLASS(PlaceholderTexture2DArray);
  780. GDREGISTER_CLASS(PlaceholderCubemap);
  781. GDREGISTER_CLASS(PlaceholderCubemapArray);
  782. GDREGISTER_CLASS(Animation);
  783. GDREGISTER_CLASS(AnimationLibrary);
  784. GDREGISTER_ABSTRACT_CLASS(Font);
  785. GDREGISTER_CLASS(FontFile);
  786. GDREGISTER_CLASS(FontVariation);
  787. GDREGISTER_CLASS(Curve);
  788. GDREGISTER_CLASS(LabelSettings);
  789. GDREGISTER_CLASS(SceneReplicationConfig);
  790. GDREGISTER_CLASS(TextLine);
  791. GDREGISTER_CLASS(TextParagraph);
  792. GDREGISTER_VIRTUAL_CLASS(StyleBox);
  793. GDREGISTER_CLASS(StyleBoxEmpty);
  794. GDREGISTER_CLASS(StyleBoxTexture);
  795. GDREGISTER_CLASS(StyleBoxFlat);
  796. GDREGISTER_CLASS(StyleBoxLine);
  797. GDREGISTER_CLASS(Theme);
  798. GDREGISTER_CLASS(PolygonPathFinder);
  799. GDREGISTER_CLASS(BitMap);
  800. GDREGISTER_CLASS(Gradient);
  801. GDREGISTER_CLASS(SkeletonProfile);
  802. GDREGISTER_CLASS(SkeletonProfileHumanoid);
  803. GDREGISTER_CLASS(BoneMap);
  804. OS::get_singleton()->yield(); // may take time to init
  805. GDREGISTER_CLASS(AudioStreamPlayer);
  806. GDREGISTER_CLASS(AudioStreamPlayer2D);
  807. #ifndef _3D_DISABLED
  808. GDREGISTER_CLASS(AudioStreamPlayer3D);
  809. #endif
  810. GDREGISTER_ABSTRACT_CLASS(VideoStream);
  811. GDREGISTER_CLASS(AudioStreamSample);
  812. OS::get_singleton()->yield(); // may take time to init
  813. GDREGISTER_ABSTRACT_CLASS(Shape2D);
  814. GDREGISTER_CLASS(WorldBoundaryShape2D);
  815. GDREGISTER_CLASS(SegmentShape2D);
  816. GDREGISTER_CLASS(SeparationRayShape2D);
  817. GDREGISTER_CLASS(CircleShape2D);
  818. GDREGISTER_CLASS(RectangleShape2D);
  819. GDREGISTER_CLASS(CapsuleShape2D);
  820. GDREGISTER_CLASS(ConvexPolygonShape2D);
  821. GDREGISTER_CLASS(ConcavePolygonShape2D);
  822. GDREGISTER_CLASS(Curve2D);
  823. GDREGISTER_CLASS(Path2D);
  824. GDREGISTER_CLASS(PathFollow2D);
  825. GDREGISTER_CLASS(NavigationMesh);
  826. GDREGISTER_CLASS(NavigationPolygon);
  827. GDREGISTER_CLASS(NavigationRegion2D);
  828. GDREGISTER_CLASS(NavigationAgent2D);
  829. GDREGISTER_CLASS(NavigationObstacle2D);
  830. OS::get_singleton()->yield(); // may take time to init
  831. GDREGISTER_ABSTRACT_CLASS(SceneState);
  832. GDREGISTER_CLASS(PackedScene);
  833. GDREGISTER_CLASS(SceneTree);
  834. GDREGISTER_ABSTRACT_CLASS(SceneTreeTimer); // sorry, you can't create it
  835. #ifndef DISABLE_DEPRECATED
  836. // Dropped in 4.0, near approximation.
  837. ClassDB::add_compatibility_class("AnimationTreePlayer", "AnimationTree");
  838. ClassDB::add_compatibility_class("BakedLightmap", "LightmapGI");
  839. ClassDB::add_compatibility_class("BakedLightmapData", "LightmapGIData");
  840. ClassDB::add_compatibility_class("BitmapFont", "FontFile");
  841. ClassDB::add_compatibility_class("DynamicFont", "FontFile");
  842. ClassDB::add_compatibility_class("DynamicFontData", "FontFile");
  843. ClassDB::add_compatibility_class("Navigation3D", "Node3D");
  844. ClassDB::add_compatibility_class("Navigation2D", "Node2D");
  845. ClassDB::add_compatibility_class("OpenSimplexNoise", "FastNoiseLite");
  846. ClassDB::add_compatibility_class("ToolButton", "Button");
  847. ClassDB::add_compatibility_class("YSort", "Node2D");
  848. // Portal and room occlusion was replaced by raster occlusion (OccluderInstance3D node).
  849. ClassDB::add_compatibility_class("Portal", "Node3D");
  850. ClassDB::add_compatibility_class("Room", "Node3D");
  851. ClassDB::add_compatibility_class("RoomManager", "Node3D");
  852. ClassDB::add_compatibility_class("RoomGroup", "Node3D");
  853. ClassDB::add_compatibility_class("Occluder", "Node3D");
  854. // The OccluderShapeSphere resource (used in the old Occluder node) is not present anymore.
  855. ClassDB::add_compatibility_class("OccluderShapeSphere", "Resource");
  856. // Renamed in 4.0.
  857. // Keep alphabetical ordering to easily locate classes and avoid duplicates.
  858. ClassDB::add_compatibility_class("AnimatedSprite", "AnimatedSprite2D");
  859. ClassDB::add_compatibility_class("Area", "Area3D");
  860. ClassDB::add_compatibility_class("ARVRCamera", "XRCamera3D");
  861. ClassDB::add_compatibility_class("ARVRController", "XRController3D");
  862. ClassDB::add_compatibility_class("ARVRAnchor", "XRAnchor3D");
  863. ClassDB::add_compatibility_class("ARVRInterface", "XRInterface");
  864. ClassDB::add_compatibility_class("ARVROrigin", "XROrigin3D");
  865. ClassDB::add_compatibility_class("ARVRPositionalTracker", "XRPositionalTracker");
  866. ClassDB::add_compatibility_class("ARVRServer", "XRServer");
  867. ClassDB::add_compatibility_class("AStar", "AStar3D");
  868. ClassDB::add_compatibility_class("BoneAttachment", "BoneAttachment3D");
  869. ClassDB::add_compatibility_class("BoxShape", "BoxShape3D");
  870. ClassDB::add_compatibility_class("Camera", "Camera3D");
  871. ClassDB::add_compatibility_class("CapsuleShape", "CapsuleShape3D");
  872. ClassDB::add_compatibility_class("ClippedCamera", "ClippedCamera3D");
  873. ClassDB::add_compatibility_class("CollisionObject", "CollisionObject3D");
  874. ClassDB::add_compatibility_class("CollisionPolygon", "CollisionPolygon3D");
  875. ClassDB::add_compatibility_class("CollisionShape", "CollisionShape3D");
  876. ClassDB::add_compatibility_class("ConcavePolygonShape", "ConcavePolygonShape3D");
  877. ClassDB::add_compatibility_class("ConeTwistJoint", "ConeTwistJoint3D");
  878. ClassDB::add_compatibility_class("ConvexPolygonShape", "ConvexPolygonShape3D");
  879. ClassDB::add_compatibility_class("CPUParticles", "CPUParticles3D");
  880. ClassDB::add_compatibility_class("CSGBox", "CSGBox3D");
  881. ClassDB::add_compatibility_class("CSGCombiner", "CSGCombiner3D");
  882. ClassDB::add_compatibility_class("CSGCylinder", "CSGCylinder3D");
  883. ClassDB::add_compatibility_class("CSGMesh", "CSGMesh3D");
  884. ClassDB::add_compatibility_class("CSGPolygon", "CSGPolygon3D");
  885. ClassDB::add_compatibility_class("CSGPrimitive", "CSGPrimitive3D");
  886. ClassDB::add_compatibility_class("CSGShape", "CSGShape3D");
  887. ClassDB::add_compatibility_class("CSGSphere", "CSGSphere3D");
  888. ClassDB::add_compatibility_class("CSGTorus", "CSGTorus3D");
  889. ClassDB::add_compatibility_class("CubeMesh", "BoxMesh");
  890. ClassDB::add_compatibility_class("CylinderShape", "CylinderShape3D");
  891. ClassDB::add_compatibility_class("DirectionalLight", "DirectionalLight3D");
  892. ClassDB::add_compatibility_class("EditorSpatialGizmo", "EditorNode3DGizmo");
  893. ClassDB::add_compatibility_class("EditorSpatialGizmoPlugin", "EditorNode3DGizmoPlugin");
  894. ClassDB::add_compatibility_class("Generic6DOFJoint", "Generic6DOFJoint3D");
  895. ClassDB::add_compatibility_class("GIProbe", "VoxelGI");
  896. ClassDB::add_compatibility_class("GIProbeData", "VoxelGIData");
  897. ClassDB::add_compatibility_class("GradientTexture", "GradientTexture1D");
  898. ClassDB::add_compatibility_class("HeightMapShape", "HeightMapShape3D");
  899. ClassDB::add_compatibility_class("HingeJoint", "HingeJoint3D");
  900. ClassDB::add_compatibility_class("Joint", "Joint3D");
  901. ClassDB::add_compatibility_class("KinematicBody", "CharacterBody3D");
  902. ClassDB::add_compatibility_class("KinematicBody2D", "CharacterBody2D");
  903. ClassDB::add_compatibility_class("KinematicCollision", "KinematicCollision3D");
  904. ClassDB::add_compatibility_class("Light", "Light3D");
  905. ClassDB::add_compatibility_class("Light2D", "PointLight2D");
  906. ClassDB::add_compatibility_class("LineShape2D", "WorldBoundaryShape2D");
  907. ClassDB::add_compatibility_class("Listener", "AudioListener3D");
  908. ClassDB::add_compatibility_class("MeshInstance", "MeshInstance3D");
  909. ClassDB::add_compatibility_class("MultiMeshInstance", "MultiMeshInstance3D");
  910. ClassDB::add_compatibility_class("NavigationAgent", "NavigationAgent3D");
  911. ClassDB::add_compatibility_class("NavigationMeshInstance", "NavigationRegion3D");
  912. ClassDB::add_compatibility_class("NavigationObstacle", "NavigationObstacle3D");
  913. ClassDB::add_compatibility_class("NavigationPolygonInstance", "NavigationRegion2D");
  914. ClassDB::add_compatibility_class("NavigationRegion", "NavigationRegion3D");
  915. ClassDB::add_compatibility_class("Navigation2DServer", "NavigationServer2D");
  916. ClassDB::add_compatibility_class("NavigationServer", "NavigationServer3D");
  917. ClassDB::add_compatibility_class("OmniLight", "OmniLight3D");
  918. ClassDB::add_compatibility_class("PanoramaSky", "Sky");
  919. ClassDB::add_compatibility_class("Particles", "GPUParticles3D");
  920. ClassDB::add_compatibility_class("Particles2D", "GPUParticles2D");
  921. ClassDB::add_compatibility_class("Path", "Path3D");
  922. ClassDB::add_compatibility_class("PathFollow", "PathFollow3D");
  923. ClassDB::add_compatibility_class("PhysicalBone", "PhysicalBone3D");
  924. ClassDB::add_compatibility_class("Physics2DDirectBodyState", "PhysicsDirectBodyState2D");
  925. ClassDB::add_compatibility_class("Physics2DDirectSpaceState", "PhysicsDirectSpaceState2D");
  926. ClassDB::add_compatibility_class("Physics2DServer", "PhysicsServer2D");
  927. ClassDB::add_compatibility_class("Physics2DShapeQueryParameters", "PhysicsShapeQueryParameters2D");
  928. ClassDB::add_compatibility_class("Physics2DTestMotionResult", "PhysicsTestMotionResult2D");
  929. ClassDB::add_compatibility_class("PhysicsBody", "PhysicsBody3D");
  930. ClassDB::add_compatibility_class("PhysicsDirectBodyState", "PhysicsDirectBodyState3D");
  931. ClassDB::add_compatibility_class("PhysicsDirectSpaceState", "PhysicsDirectSpaceState3D");
  932. ClassDB::add_compatibility_class("PhysicsServer", "PhysicsServer3D");
  933. ClassDB::add_compatibility_class("PhysicsShapeQueryParameters", "PhysicsShapeQueryParameters3D");
  934. ClassDB::add_compatibility_class("PinJoint", "PinJoint3D");
  935. ClassDB::add_compatibility_class("PlaneShape", "WorldBoundaryShape3D");
  936. ClassDB::add_compatibility_class("ProceduralSky", "Sky");
  937. ClassDB::add_compatibility_class("RayCast", "RayCast3D");
  938. ClassDB::add_compatibility_class("RayShape", "SeparationRayShape3D");
  939. ClassDB::add_compatibility_class("RayShape2D", "SeparationRayShape2D");
  940. ClassDB::add_compatibility_class("RemoteTransform", "RemoteTransform3D");
  941. ClassDB::add_compatibility_class("RigidBody", "RigidDynamicBody3D");
  942. ClassDB::add_compatibility_class("RigidBody2D", "RigidDynamicBody2D");
  943. ClassDB::add_compatibility_class("Shape", "Shape3D");
  944. ClassDB::add_compatibility_class("ShortCut", "Shortcut");
  945. ClassDB::add_compatibility_class("Skeleton", "Skeleton3D");
  946. ClassDB::add_compatibility_class("SkeletonIK", "SkeletonIK3D");
  947. ClassDB::add_compatibility_class("SliderJoint", "SliderJoint3D");
  948. ClassDB::add_compatibility_class("SoftBody", "SoftDynamicBody3D");
  949. ClassDB::add_compatibility_class("Spatial", "Node3D");
  950. ClassDB::add_compatibility_class("SpatialGizmo", "Node3DGizmo");
  951. ClassDB::add_compatibility_class("SpatialMaterial", "StandardMaterial3D");
  952. ClassDB::add_compatibility_class("SpatialVelocityTracker", "VelocityTracker3D");
  953. ClassDB::add_compatibility_class("SphereShape", "SphereShape3D");
  954. ClassDB::add_compatibility_class("SpotLight", "SpotLight3D");
  955. ClassDB::add_compatibility_class("SpringArm", "SpringArm3D");
  956. ClassDB::add_compatibility_class("Sprite", "Sprite2D");
  957. ClassDB::add_compatibility_class("StaticBody", "StaticBody3D");
  958. ClassDB::add_compatibility_class("StreamTexture", "CompressedTexture2D");
  959. ClassDB::add_compatibility_class("TextureProgress", "TextureProgressBar");
  960. ClassDB::add_compatibility_class("VehicleBody", "VehicleBody3D");
  961. ClassDB::add_compatibility_class("VehicleWheel", "VehicleWheel3D");
  962. ClassDB::add_compatibility_class("VideoPlayer", "VideoStreamPlayer");
  963. ClassDB::add_compatibility_class("ViewportContainer", "SubViewportContainer");
  964. ClassDB::add_compatibility_class("Viewport", "SubViewport");
  965. ClassDB::add_compatibility_class("VisibilityEnabler", "VisibleOnScreenEnabler3D");
  966. ClassDB::add_compatibility_class("VisibilityNotifier", "VisibleOnScreenNotifier3D");
  967. ClassDB::add_compatibility_class("VisibilityNotifier2D", "VisibleOnScreenNotifier2D");
  968. ClassDB::add_compatibility_class("VisibilityNotifier3D", "VisibleOnScreenNotifier3D");
  969. ClassDB::add_compatibility_class("VisualServer", "RenderingServer");
  970. ClassDB::add_compatibility_class("VisualShaderNodeScalarConstant", "VisualShaderNodeFloatConstant");
  971. ClassDB::add_compatibility_class("VisualShaderNodeScalarFunc", "VisualShaderNodeFloatFunc");
  972. ClassDB::add_compatibility_class("VisualShaderNodeScalarOp", "VisualShaderNodeFloatOp");
  973. ClassDB::add_compatibility_class("VisualShaderNodeScalarUniform", "VisualShaderNodeFloatUniform");
  974. ClassDB::add_compatibility_class("VisualShaderNodeScalarClamp", "VisualShaderNodeClamp");
  975. ClassDB::add_compatibility_class("VisualShaderNodeVectorClamp", "VisualShaderNodeClamp");
  976. ClassDB::add_compatibility_class("VisualShaderNodeScalarInterp", "VisualShaderNodeMix");
  977. ClassDB::add_compatibility_class("VisualShaderNodeVectorInterp", "VisualShaderNodeMix");
  978. ClassDB::add_compatibility_class("VisualShaderNodeVectorScalarMix", "VisualShaderNodeMix");
  979. ClassDB::add_compatibility_class("VisualShaderNodeScalarSmoothStep", "VisualShaderNodeSmoothStep");
  980. ClassDB::add_compatibility_class("VisualShaderNodeVectorSmoothStep", "VisualShaderNodeSmoothStep");
  981. ClassDB::add_compatibility_class("VisualShaderNodeVectorScalarSmoothStep", "VisualShaderNodeSmoothStep");
  982. ClassDB::add_compatibility_class("VisualShaderNodeVectorScalarStep", "VisualShaderNodeStep");
  983. ClassDB::add_compatibility_class("VisualShaderNodeScalarSwitch", "VisualShaderNodeSwitch");
  984. ClassDB::add_compatibility_class("VisualShaderNodeScalarTransformMult", "VisualShaderNodeTransformOp");
  985. ClassDB::add_compatibility_class("VisualShaderNodeScalarDerivativeFunc", "VisualShaderNodeDerivativeFunc");
  986. ClassDB::add_compatibility_class("VisualShaderNodeVectorDerivativeFunc", "VisualShaderNodeDerivativeFunc");
  987. ClassDB::add_compatibility_class("World", "World3D");
  988. // Renamed during 4.0 alpha, added to ease transition between alphas.
  989. ClassDB::add_compatibility_class("StreamCubemap", "CompressedCubemap");
  990. ClassDB::add_compatibility_class("StreamCubemapArray", "CompressedCubemapArray");
  991. ClassDB::add_compatibility_class("StreamTexture2D", "CompressedTexture2D");
  992. ClassDB::add_compatibility_class("StreamTexture2DArray", "CompressedTexture2DArray");
  993. ClassDB::add_compatibility_class("StreamTexture3D", "CompressedTexture3D");
  994. ClassDB::add_compatibility_class("StreamTextureLayered", "CompressedTextureLayered");
  995. #endif /* DISABLE_DEPRECATED */
  996. OS::get_singleton()->yield(); // may take time to init
  997. for (int i = 0; i < 20; i++) {
  998. GLOBAL_DEF_BASIC(vformat("%s/layer_%d", PNAME("layer_names/2d_render"), i + 1), "");
  999. GLOBAL_DEF_BASIC(vformat("%s/layer_%d", PNAME("layer_names/3d_render"), i + 1), "");
  1000. }
  1001. for (int i = 0; i < 32; i++) {
  1002. GLOBAL_DEF_BASIC(vformat("%s/layer_%d", PNAME("layer_names/2d_physics"), i + 1), "");
  1003. GLOBAL_DEF_BASIC(vformat("%s/layer_%d", PNAME("layer_names/2d_navigation"), i + 1), "");
  1004. GLOBAL_DEF_BASIC(vformat("%s/layer_%d", PNAME("layer_names/3d_physics"), i + 1), "");
  1005. GLOBAL_DEF_BASIC(vformat("%s/layer_%d", PNAME("layer_names/3d_navigation"), i + 1), "");
  1006. }
  1007. if (RenderingServer::get_singleton()) {
  1008. ColorPicker::init_shaders(); // RenderingServer needs to exist for this to succeed.
  1009. }
  1010. SceneDebugger::initialize();
  1011. SceneReplicationInterface::make_default();
  1012. SceneRPCInterface::make_default();
  1013. SceneCacheInterface::make_default();
  1014. }
  1015. void initialize_theme() {
  1016. // Allow creating the default theme at a different scale to suit higher/lower base resolutions.
  1017. float default_theme_scale = GLOBAL_DEF("gui/theme/default_theme_scale", 1.0);
  1018. ProjectSettings::get_singleton()->set_custom_property_info("gui/theme/default_theme_scale", PropertyInfo(Variant::FLOAT, "gui/theme/default_theme_scale", PROPERTY_HINT_RANGE, "0.5,8,0.01", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED));
  1019. String theme_path = GLOBAL_DEF_RST("gui/theme/custom", "");
  1020. ProjectSettings::get_singleton()->set_custom_property_info("gui/theme/custom", PropertyInfo(Variant::STRING, "gui/theme/custom", PROPERTY_HINT_FILE, "*.tres,*.res,*.theme", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED));
  1021. String font_path = GLOBAL_DEF_RST("gui/theme/custom_font", "");
  1022. ProjectSettings::get_singleton()->set_custom_property_info("gui/theme/custom_font", PropertyInfo(Variant::STRING, "gui/theme/custom_font", PROPERTY_HINT_FILE, "*.tres,*.res", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED));
  1023. bool font_antialiased = (bool)GLOBAL_DEF_RST("gui/theme/default_font_antialiased", true);
  1024. ProjectSettings::get_singleton()->set_custom_property_info("gui/theme/default_font_antialiased", PropertyInfo(Variant::BOOL, "gui/theme/default_font_antialiased", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED));
  1025. TextServer::Hinting font_hinting = (TextServer::Hinting)(int)GLOBAL_DEF_RST("gui/theme/default_font_hinting", TextServer::HINTING_LIGHT);
  1026. ProjectSettings::get_singleton()->set_custom_property_info("gui/theme/default_font_hinting", PropertyInfo(Variant::INT, "gui/theme/default_font_hinting", PROPERTY_HINT_ENUM, "None,Light,Normal", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED));
  1027. TextServer::SubpixelPositioning font_subpixel_positioning = (TextServer::SubpixelPositioning)(int)GLOBAL_DEF_RST("gui/theme/default_font_subpixel_positioning", TextServer::SUBPIXEL_POSITIONING_AUTO);
  1028. ProjectSettings::get_singleton()->set_custom_property_info("gui/theme/default_font_subpixel_positioning", PropertyInfo(Variant::INT, "gui/theme/default_font_subpixel_positioning", PROPERTY_HINT_ENUM, "Disabled,Auto,One half of a pixel,One quarter of a pixel", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED));
  1029. const bool font_msdf = GLOBAL_DEF_RST("gui/theme/default_font_multichannel_signed_distance_field", false);
  1030. const bool font_generate_mipmaps = GLOBAL_DEF_RST("gui/theme/default_font_generate_mipmaps", false);
  1031. Ref<Font> font;
  1032. if (!font_path.is_empty()) {
  1033. font = ResourceLoader::load(font_path);
  1034. if (!font.is_valid()) {
  1035. ERR_PRINT("Error loading custom font '" + font_path + "'");
  1036. }
  1037. }
  1038. // Always make the default theme to avoid invalid default font/icon/style in the given theme.
  1039. if (RenderingServer::get_singleton()) {
  1040. make_default_theme(default_theme_scale, font, font_subpixel_positioning, font_hinting, font_antialiased, font_msdf, font_generate_mipmaps);
  1041. }
  1042. if (!theme_path.is_empty()) {
  1043. Ref<Theme> theme = ResourceLoader::load(theme_path);
  1044. if (theme.is_valid()) {
  1045. Theme::set_project_default(theme);
  1046. if (font.is_valid()) {
  1047. Theme::set_fallback_font(font);
  1048. }
  1049. } else {
  1050. ERR_PRINT("Error loading custom theme '" + theme_path + "'");
  1051. }
  1052. }
  1053. }
  1054. void unregister_scene_types() {
  1055. SceneDebugger::deinitialize();
  1056. clear_default_theme();
  1057. ResourceLoader::remove_resource_format_loader(resource_loader_texture_layered);
  1058. resource_loader_texture_layered.unref();
  1059. ResourceLoader::remove_resource_format_loader(resource_loader_texture_3d);
  1060. resource_loader_texture_3d.unref();
  1061. ResourceLoader::remove_resource_format_loader(resource_loader_stream_texture);
  1062. resource_loader_stream_texture.unref();
  1063. ResourceSaver::remove_resource_format_saver(resource_saver_text);
  1064. resource_saver_text.unref();
  1065. ResourceLoader::remove_resource_format_loader(resource_loader_text);
  1066. resource_loader_text.unref();
  1067. ResourceSaver::remove_resource_format_saver(resource_saver_shader);
  1068. resource_saver_shader.unref();
  1069. ResourceLoader::remove_resource_format_loader(resource_loader_shader);
  1070. resource_loader_shader.unref();
  1071. ResourceSaver::remove_resource_format_saver(resource_saver_shader_include);
  1072. resource_saver_shader_include.unref();
  1073. ResourceLoader::remove_resource_format_loader(resource_loader_shader_include);
  1074. resource_loader_shader_include.unref();
  1075. // StandardMaterial3D is not initialised when 3D is disabled, so it shouldn't be cleaned up either
  1076. #ifndef _3D_DISABLED
  1077. BaseMaterial3D::finish_shaders();
  1078. #endif // _3D_DISABLED
  1079. PhysicalSkyMaterial::cleanup_shader();
  1080. PanoramaSkyMaterial::cleanup_shader();
  1081. ProceduralSkyMaterial::cleanup_shader();
  1082. ParticlesMaterial::finish_shaders();
  1083. CanvasItemMaterial::finish_shaders();
  1084. ColorPicker::finish_shaders();
  1085. SceneStringNames::free();
  1086. }