From e28fd07b2bbe78db0f286604a6eb469d8a0664be Mon Sep 17 00:00:00 2001 From: Lightning_A Date: Thu, 17 Jun 2021 16:03:09 -0600 Subject: Rename `instance()`->`instantiate()` when it's a verb --- editor/action_map_editor.cpp | 12 +-- editor/animation_track_editor.cpp | 4 +- editor/audio_stream_preview.cpp | 2 +- editor/create_dialog.cpp | 12 +-- editor/debugger/editor_debugger_node.cpp | 2 +- editor/debugger/editor_debugger_server.cpp | 2 +- editor/debugger/editor_profiler.cpp | 4 +- editor/debugger/editor_visual_profiler.cpp | 4 +- editor/doc_tools.cpp | 6 +- editor/editor_atlas_packer.cpp | 2 +- editor/editor_audio_buses.cpp | 6 +- editor/editor_autoload_settings.cpp | 4 +- editor/editor_data.cpp | 8 +- editor/editor_export.cpp | 8 +- editor/editor_feature_profile.cpp | 10 +- editor/editor_file_dialog.cpp | 2 +- editor/editor_file_system.cpp | 6 +- editor/editor_folding.cpp | 8 +- editor/editor_fonts.cpp | 44 ++++----- editor/editor_inspector.cpp | 6 +- editor/editor_inspector.h | 6 +- editor/editor_layouts_dialog.cpp | 2 +- editor/editor_log.cpp | 4 +- editor/editor_node.cpp | 108 ++++++++++----------- editor/editor_node.h | 6 +- editor/editor_plugin_settings.cpp | 2 +- editor/editor_properties.cpp | 2 +- editor/editor_properties_array_dict.cpp | 6 +- editor/editor_resource_picker.cpp | 8 +- editor/editor_resource_preview.cpp | 10 +- editor/editor_run_native.cpp | 2 +- editor/editor_settings.cpp | 12 +-- editor/editor_spin_slider.cpp | 2 +- editor/editor_themes.cpp | 4 +- editor/fileserver/editor_file_server.cpp | 2 +- editor/filesystem_dock.cpp | 4 +- editor/import/editor_import_collada.cpp | 2 +- editor/import/resource_importer_bitmask.cpp | 4 +- .../import/resource_importer_csv_translation.cpp | 2 +- .../import/resource_importer_layered_texture.cpp | 4 +- editor/import/resource_importer_obj.cpp | 8 +- editor/import/resource_importer_scene.cpp | 4 +- editor/import/resource_importer_shader_file.cpp | 2 +- editor/import/resource_importer_texture.cpp | 6 +- editor/import/resource_importer_texture_atlas.cpp | 16 +-- editor/import/resource_importer_wav.cpp | 2 +- editor/import/scene_import_settings.cpp | 10 +- editor/import/scene_importer_mesh.cpp | 10 +- editor/import_dock.cpp | 10 +- editor/node_3d_editor_gizmos.cpp | 4 +- editor/plugins/animation_blend_space_1d_editor.cpp | 6 +- editor/plugins/animation_blend_space_2d_editor.cpp | 6 +- .../plugins/animation_blend_tree_editor_plugin.cpp | 4 +- editor/plugins/animation_player_editor_plugin.cpp | 4 +- editor/plugins/animation_state_machine_editor.cpp | 8 +- editor/plugins/animation_tree_editor_plugin.cpp | 2 +- editor/plugins/asset_library_editor_plugin.cpp | 8 +- editor/plugins/canvas_item_editor_plugin.cpp | 42 ++++---- .../plugins/collision_polygon_3d_editor_plugin.cpp | 2 +- editor/plugins/cpu_particles_2d_editor_plugin.cpp | 2 +- editor/plugins/curve_editor_plugin.cpp | 4 +- editor/plugins/editor_preview_plugins.cpp | 12 +-- editor/plugins/font_editor_plugin.cpp | 4 +- editor/plugins/gpu_particles_2d_editor_plugin.cpp | 14 +-- editor/plugins/gpu_particles_3d_editor_plugin.cpp | 4 +- .../gpu_particles_collision_sdf_editor_plugin.cpp | 2 +- editor/plugins/gradient_editor_plugin.cpp | 2 +- editor/plugins/material_editor_plugin.cpp | 34 +++---- editor/plugins/mesh_editor_plugin.cpp | 4 +- editor/plugins/mesh_library_editor_plugin.cpp | 2 +- editor/plugins/node_3d_editor_plugin.cpp | 76 +++++++-------- editor/plugins/node_3d_editor_plugin.h | 2 +- editor/plugins/ot_features_plugin.cpp | 2 +- editor/plugins/path_3d_editor_plugin.cpp | 2 +- editor/plugins/polygon_2d_editor_plugin.cpp | 4 +- editor/plugins/script_editor_plugin.cpp | 6 +- editor/plugins/script_editor_plugin.h | 2 +- editor/plugins/script_text_editor.cpp | 4 +- editor/plugins/shader_editor_plugin.cpp | 2 +- editor/plugins/shader_file_editor_plugin.cpp | 2 +- editor/plugins/skeleton_3d_editor_plugin.cpp | 2 +- editor/plugins/sprite_2d_editor_plugin.cpp | 6 +- editor/plugins/sprite_frames_editor_plugin.cpp | 2 +- editor/plugins/style_box_editor_plugin.cpp | 2 +- editor/plugins/text_editor.cpp | 4 +- editor/plugins/texture_3d_editor_plugin.cpp | 6 +- editor/plugins/texture_editor_plugin.cpp | 2 +- editor/plugins/texture_layered_editor_plugin.cpp | 10 +- editor/plugins/theme_editor_preview.cpp | 4 +- editor/plugins/tiles/tile_map_editor.cpp | 8 +- .../plugins/tiles/tile_set_atlas_source_editor.cpp | 2 +- editor/plugins/visual_shader_editor_plugin.cpp | 20 ++-- editor/project_manager.cpp | 4 +- editor/property_editor.cpp | 18 ++-- editor/scene_tree_dock.cpp | 104 ++++++++++---------- editor/scene_tree_dock.h | 8 +- editor/scene_tree_editor.cpp | 2 +- 97 files changed, 444 insertions(+), 444 deletions(-) (limited to 'editor') diff --git a/editor/action_map_editor.cpp b/editor/action_map_editor.cpp index b0b79ca069..af70772ada 100644 --- a/editor/action_map_editor.cpp +++ b/editor/action_map_editor.cpp @@ -310,7 +310,7 @@ void InputEventConfigurationDialog::_update_input_list() { MouseButton mouse_buttons[9] = { MOUSE_BUTTON_LEFT, MOUSE_BUTTON_RIGHT, MOUSE_BUTTON_MIDDLE, MOUSE_BUTTON_WHEEL_UP, MOUSE_BUTTON_WHEEL_DOWN, MOUSE_BUTTON_WHEEL_LEFT, MOUSE_BUTTON_WHEEL_RIGHT, MOUSE_BUTTON_XBUTTON1, MOUSE_BUTTON_XBUTTON2 }; for (int i = 0; i < 9; i++) { Ref mb; - mb.instance(); + mb.instantiate(); mb->set_button_index(mouse_buttons[i]); String desc = get_event_text(mb); @@ -333,7 +333,7 @@ void InputEventConfigurationDialog::_update_input_list() { for (int i = 0; i < JOY_BUTTON_MAX; i++) { Ref joyb; - joyb.instance(); + joyb.instantiate(); joyb->set_button_index(i); String desc = get_event_text(joyb); @@ -358,7 +358,7 @@ void InputEventConfigurationDialog::_update_input_list() { int axis = i / 2; int direction = (i & 1) ? 1 : -1; Ref joym; - joym.instance(); + joym.instantiate(); joym->set_axis(axis); joym->set_axis_value(direction); String desc = get_event_text(joym); @@ -458,7 +458,7 @@ void InputEventConfigurationDialog::_input_list_item_selected() { case InputEventConfigurationDialog::INPUT_KEY: { int kc = selected->get_meta("__keycode"); Ref k; - k.instance(); + k.instantiate(); if (physical_key_checkbox->is_pressed()) { k->set_physical_keycode(kc); @@ -481,7 +481,7 @@ void InputEventConfigurationDialog::_input_list_item_selected() { case InputEventConfigurationDialog::INPUT_MOUSE_BUTTON: { int idx = selected->get_meta("__index"); Ref mb; - mb.instance(); + mb.instantiate(); mb->set_button_index(idx); // Maintain modifier state from checkboxes mb->set_alt_pressed(mod_checkboxes[MOD_ALT]->is_pressed()); @@ -503,7 +503,7 @@ void InputEventConfigurationDialog::_input_list_item_selected() { int value = selected->get_meta("__value"); Ref jm; - jm.instance(); + jm.instantiate(); jm->set_axis(axis); jm->set_axis_value(value); _set_event(jm); diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 4196bc8940..f61fb6bab3 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -3760,7 +3760,7 @@ Ref AnimationTrackEditor::_create_and_get_reset_animation() { return player->get_animation("RESET"); } else { Ref reset_anim; - reset_anim.instance(); + reset_anim.instantiate(); reset_anim->set_length(ANIM_MIN_LENGTH); undo_redo->add_do_method(player, "add_animation", "RESET", reset_anim); undo_redo->add_do_method(AnimationPlayerEditor::singleton, "_animation_player_changed", player); @@ -5983,7 +5983,7 @@ AnimationTrackEditor::AnimationTrackEditor() { //default plugins Ref def_plugin; - def_plugin.instance(); + def_plugin.instantiate(); add_track_edit_plugin(def_plugin); //dialogs diff --git a/editor/audio_stream_preview.cpp b/editor/audio_stream_preview.cpp index 539657afd7..ad6e3ac1dc 100644 --- a/editor/audio_stream_preview.cpp +++ b/editor/audio_stream_preview.cpp @@ -192,7 +192,7 @@ Ref AudioStreamPreviewGenerator::generate_preview(const Ref< } } - preview->preview.instance(); + preview->preview.instantiate(); preview->preview->preview = maxmin; preview->preview->length = len_s; diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 968b24893c..027cee3f1c 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -130,7 +130,7 @@ bool CreateDialog::_should_hide_type(const String &p_type) const { } if (ClassDB::class_exists(p_type)) { - if (!ClassDB::can_instance(p_type)) { + if (!ClassDB::can_instantiate(p_type)) { return true; // Can't create abstract class. } @@ -234,8 +234,8 @@ void CreateDialog::_configure_search_option_item(TreeItem *r_item, const String r_item->set_text(0, p_type); } - bool can_instance = (p_cpp_type && ClassDB::can_instance(p_type)) || !p_cpp_type; - if (!can_instance) { + bool can_instantiate = (p_cpp_type && ClassDB::can_instantiate(p_type)) || !p_cpp_type; + if (!can_instantiate) { r_item->set_custom_color(0, search_options->get_theme_color("disabled_font_color", "Editor")); r_item->set_icon(0, EditorNode::get_singleton()->get_class_icon(p_type, "NodeDisabled")); r_item->set_selectable(0, false); @@ -247,7 +247,7 @@ void CreateDialog::_configure_search_option_item(TreeItem *r_item, const String r_item->set_collapsed(false); } else { // Don't collapse the root node or an abstract node on the first tree level. - bool should_collapse = p_type != base_type && (r_item->get_parent()->get_text(0) != base_type || can_instance); + bool should_collapse = p_type != base_type && (r_item->get_parent()->get_text(0) != base_type || can_instantiate); if (should_collapse && bool(EditorSettings::get_singleton()->get("docks/scene_tree/start_create_dialog_fully_expanded"))) { should_collapse = false; // Collapse all nodes anyway. @@ -432,7 +432,7 @@ Variant CreateDialog::instance_selected() { obj = EditorNode::get_editor_data().instance_custom_type(selected->get_text(0), custom); } } else { - obj = ClassDB::instance(selected->get_text(0)); + obj = ClassDB::instantiate(selected->get_text(0)); } // Check if any Object-type property should be instantiated. @@ -442,7 +442,7 @@ Variant CreateDialog::instance_selected() { for (List::Element *E = pinfo.front(); E; E = E->next()) { PropertyInfo pi = E->get(); if (pi.type == Variant::OBJECT && pi.usage & PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT) { - Object *prop = ClassDB::instance(pi.class_name); + Object *prop = ClassDB::instantiate(pi.class_name); ((Object *)obj)->set(pi.name, prop); } } diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp index ded0ee3aa7..5f90680115 100644 --- a/editor/debugger/editor_debugger_node.cpp +++ b/editor/debugger/editor_debugger_node.cpp @@ -65,7 +65,7 @@ EditorDebuggerNode::EditorDebuggerNode() { add_child(tabs); Ref empty; - empty.instance(); + empty.instantiate(); tabs->add_theme_style_override("panel", empty); auto_switch_remote_scene_tree = EDITOR_DEF("debugger/auto_switch_to_remote_scene_tree", false); diff --git a/editor/debugger/editor_debugger_server.cpp b/editor/debugger/editor_debugger_server.cpp index 662f247062..e8524e0702 100644 --- a/editor/debugger/editor_debugger_server.cpp +++ b/editor/debugger/editor_debugger_server.cpp @@ -60,7 +60,7 @@ EditorDebuggerServer *EditorDebuggerServerTCP::create(const String &p_protocol) } EditorDebuggerServerTCP::EditorDebuggerServerTCP() { - server.instance(); + server.instantiate(); } Error EditorDebuggerServerTCP::start() { diff --git a/editor/debugger/editor_profiler.cpp b/editor/debugger/editor_profiler.cpp index d60e2783ec..1bfef67e8c 100644 --- a/editor/debugger/editor_profiler.cpp +++ b/editor/debugger/editor_profiler.cpp @@ -305,12 +305,12 @@ void EditorProfiler::_update_plot() { } Ref img; - img.instance(); + img.instantiate(); img->create(w, h, false, Image::FORMAT_RGBA8, graph_image); if (reset_texture) { if (graph_texture.is_null()) { - graph_texture.instance(); + graph_texture.instantiate(); } graph_texture->create_from_image(img); } diff --git a/editor/debugger/editor_visual_profiler.cpp b/editor/debugger/editor_visual_profiler.cpp index 5bb10b3794..cc2e00d021 100644 --- a/editor/debugger/editor_visual_profiler.cpp +++ b/editor/debugger/editor_visual_profiler.cpp @@ -299,12 +299,12 @@ void EditorVisualProfiler::_update_plot() { } Ref img; - img.instance(); + img.instantiate(); img->create(w, h, false, Image::FORMAT_RGBA8, graph_image); if (reset_texture) { if (graph_texture.is_null()) { - graph_texture.instance(); + graph_texture.instantiate(); } graph_texture->create_from_image(img); } diff --git a/editor/doc_tools.cpp b/editor/doc_tools.cpp index d3df4d91a6..befafec6cb 100644 --- a/editor/doc_tools.cpp +++ b/editor/doc_tools.cpp @@ -206,14 +206,14 @@ static Variant get_documentation_default_value(const StringName &p_class_name, c Variant default_value = Variant(); r_default_value_valid = false; - if (ClassDB::can_instance(p_class_name)) { + if (ClassDB::can_instantiate(p_class_name)) { default_value = ClassDB::class_get_default_property_value(p_class_name, p_property_name, &r_default_value_valid); } else { - // Cannot get default value of classes that can't be instanced + // Cannot get default value of classes that can't be instantiated List inheriting_classes; ClassDB::get_direct_inheriters_from_class(p_class_name, &inheriting_classes); for (List::Element *E2 = inheriting_classes.front(); E2; E2 = E2->next()) { - if (ClassDB::can_instance(E2->get())) { + if (ClassDB::can_instantiate(E2->get())) { default_value = ClassDB::class_get_default_property_value(E2->get(), p_property_name, &r_default_value_valid); if (r_default_value_valid) { break; diff --git a/editor/editor_atlas_packer.cpp b/editor/editor_atlas_packer.cpp index 1b4a505edb..85541c093a 100644 --- a/editor/editor_atlas_packer.cpp +++ b/editor/editor_atlas_packer.cpp @@ -105,7 +105,7 @@ void EditorAtlasPacker::chart_pack(Vector &charts, int &r_width, int &r_h } Ref src_bitmap; - src_bitmap.instance(); + src_bitmap.instantiate(); src_bitmap->create(aabb.size / divide_by); int w = src_bitmap->get_size().width; diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index e08334c00e..3e3428ad93 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -525,7 +525,7 @@ void EditorAudioBus::_effect_add(int p_which) { StringName name = effect_options->get_item_metadata(p_which); - Object *fx = ClassDB::instance(name); + Object *fx = ClassDB::instantiate(name); ERR_FAIL_COND(!fx); AudioEffect *afx = Object::cast_to(fx); ERR_FAIL_COND(!afx); @@ -921,7 +921,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) { ClassDB::get_inheriters_from_class("AudioEffect", &effects); effects.sort_custom(); for (List::Element *E = effects.front(); E; E = E->next()) { - if (!ClassDB::can_instance(E->get())) { + if (!ClassDB::can_instantiate(E->get())) { continue; } @@ -1238,7 +1238,7 @@ void EditorAudioBuses::_file_dialog_callback(const String &p_string) { } else if (file_dialog->get_file_mode() == EditorFileDialog::FILE_MODE_SAVE_FILE) { if (new_layout) { Ref empty_state; - empty_state.instance(); + empty_state.instantiate(); AudioServer::get_singleton()->set_bus_layout(empty_state); } diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp index 304c2fe532..dbb23d8603 100644 --- a/editor/editor_autoload_settings.cpp +++ b/editor/editor_autoload_settings.cpp @@ -349,14 +349,14 @@ Node *EditorAutoloadSettings::_create_autoload(const String &p_path) { Node *n = nullptr; if (res->is_class("PackedScene")) { Ref ps = res; - n = ps->instance(); + n = ps->instantiate(); } else if (res->is_class("Script")) { Ref