diff options
author | Lightning_A <aaronjrecord@gmail.com> | 2021-06-17 16:03:09 -0600 |
---|---|---|
committer | Lightning_A <aaronjrecord@gmail.com> | 2021-06-19 20:49:18 -0600 |
commit | e28fd07b2bbe78db0f286604a6eb469d8a0664be (patch) | |
tree | d10b935e7a77774960fefd93ac306db447cc2bfd | |
parent | 60dcc4f39c0e6289dba691225c002cd6e77be6ba (diff) |
Rename `instance()`->`instantiate()` when it's a verb
371 files changed, 1318 insertions, 1318 deletions
diff --git a/core/core_bind.cpp b/core/core_bind.cpp index 912c89a9d2..85fdcaee12 100644 --- a/core/core_bind.cpp +++ b/core/core_bind.cpp @@ -1850,12 +1850,12 @@ bool _ClassDB::is_parent_class(const StringName &p_class, const StringName &p_in return ClassDB::is_parent_class(p_class, p_inherits); } -bool _ClassDB::can_instance(const StringName &p_class) const { - return ClassDB::can_instance(p_class); +bool _ClassDB::can_instantiate(const StringName &p_class) const { + return ClassDB::can_instantiate(p_class); } -Variant _ClassDB::instance(const StringName &p_class) const { - Object *obj = ClassDB::instance(p_class); +Variant _ClassDB::instantiate(const StringName &p_class) const { + Object *obj = ClassDB::instantiate(p_class); if (!obj) { return Variant(); } @@ -1984,8 +1984,8 @@ void _ClassDB::_bind_methods() { ClassDB::bind_method(D_METHOD("get_parent_class", "class"), &_ClassDB::get_parent_class); ClassDB::bind_method(D_METHOD("class_exists", "class"), &_ClassDB::class_exists); ClassDB::bind_method(D_METHOD("is_parent_class", "class", "inherits"), &_ClassDB::is_parent_class); - ClassDB::bind_method(D_METHOD("can_instance", "class"), &_ClassDB::can_instance); - ClassDB::bind_method(D_METHOD("instance", "class"), &_ClassDB::instance); + ClassDB::bind_method(D_METHOD("can_instantiate", "class"), &_ClassDB::can_instantiate); + ClassDB::bind_method(D_METHOD("instantiate", "class"), &_ClassDB::instantiate); ClassDB::bind_method(D_METHOD("class_has_signal", "class", "signal"), &_ClassDB::has_signal); ClassDB::bind_method(D_METHOD("class_get_signal", "class", "signal"), &_ClassDB::get_signal); diff --git a/core/core_bind.h b/core/core_bind.h index 74b6a5b26f..c01a149f58 100644 --- a/core/core_bind.h +++ b/core/core_bind.h @@ -585,8 +585,8 @@ public: StringName get_parent_class(const StringName &p_class) const; bool class_exists(const StringName &p_class) const; bool is_parent_class(const StringName &p_class, const StringName &p_inherits) const; - bool can_instance(const StringName &p_class) const; - Variant instance(const StringName &p_class) const; + bool can_instantiate(const StringName &p_class) const; + Variant instantiate(const StringName &p_class) const; bool has_signal(StringName p_class, StringName p_signal) const; Dictionary get_signal(StringName p_class, StringName p_signal) const; diff --git a/core/debugger/remote_debugger_peer.cpp b/core/debugger/remote_debugger_peer.cpp index 39113eda14..ea5e32203c 100644 --- a/core/debugger/remote_debugger_peer.cpp +++ b/core/debugger/remote_debugger_peer.cpp @@ -84,7 +84,7 @@ RemoteDebuggerPeerTCP::RemoteDebuggerPeerTCP(Ref<StreamPeerTCP> p_tcp) { thread.start(_thread_func, this); #endif } else { - tcp_client.instance(); + tcp_client.instantiate(); } } diff --git a/core/input/input.cpp b/core/input/input.cpp index 6e98b596d7..be536aa730 100644 --- a/core/input/input.cpp +++ b/core/input/input.cpp @@ -500,7 +500,7 @@ void Input::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool p_is_em if (event_dispatch_function && emulate_touch_from_mouse && !p_is_emulated && mb->get_button_index() == 1) { Ref<InputEventScreenTouch> touch_event; - touch_event.instance(); + touch_event.instantiate(); touch_event->set_pressed(mb->is_pressed()); touch_event->set_position(mb->get_position()); event_dispatch_function(touch_event); @@ -517,7 +517,7 @@ void Input::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool p_is_em if (event_dispatch_function && emulate_touch_from_mouse && !p_is_emulated && mm->get_button_mask() & 1) { Ref<InputEventScreenDrag> drag_event; - drag_event.instance(); + drag_event.instantiate(); drag_event->set_position(mm->get_position()); drag_event->set_relative(mm->get_relative()); @@ -555,7 +555,7 @@ void Input::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool p_is_em if (translate) { Ref<InputEventMouseButton> button_event; - button_event.instance(); + button_event.instantiate(); button_event->set_device(InputEvent::DEVICE_ID_TOUCH_MOUSE); button_event->set_position(st->get_position()); @@ -582,7 +582,7 @@ void Input::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool p_is_em if (emulate_mouse_from_touch && sd->get_index() == mouse_from_touch_index) { Ref<InputEventMouseMotion> motion_event; - motion_event.instance(); + motion_event.instantiate(); motion_event->set_device(InputEvent::DEVICE_ID_TOUCH_MOUSE); motion_event->set_position(sd->get_position()); @@ -787,7 +787,7 @@ void Input::ensure_touch_mouse_raised() { mouse_from_touch_index = -1; Ref<InputEventMouseButton> button_event; - button_event.instance(); + button_event.instantiate(); button_event->set_device(InputEvent::DEVICE_ID_TOUCH_MOUSE); button_event->set_position(mouse_pos); @@ -821,7 +821,7 @@ void Input::set_default_cursor_shape(CursorShape p_shape) { // The default shape is set in Viewport::_gui_input_event. To instantly // see the shape in the viewport we need to trigger a mouse motion event. Ref<InputEventMouseMotion> mm; - mm.instance(); + mm.instantiate(); mm->set_position(mouse_pos); mm->set_global_position(mouse_pos); parse_input_event(mm); @@ -1031,7 +1031,7 @@ void Input::joy_hat(int p_device, int p_val) { void Input::_button_event(int p_device, int p_index, bool p_pressed) { Ref<InputEventJoypadButton> ievent; - ievent.instance(); + ievent.instantiate(); ievent->set_device(p_device); ievent->set_button_index(p_index); ievent->set_pressed(p_pressed); @@ -1041,7 +1041,7 @@ void Input::_button_event(int p_device, int p_index, bool p_pressed) { void Input::_axis_event(int p_device, int p_axis, float p_value) { Ref<InputEventJoypadMotion> ievent; - ievent.instance(); + ievent.instantiate(); ievent->set_device(p_device); ievent->set_axis(p_axis); ievent->set_axis_value(p_value); diff --git a/core/input/input_event.cpp b/core/input/input_event.cpp index 72fb409b63..14762f955c 100644 --- a/core/input/input_event.cpp +++ b/core/input/input_event.cpp @@ -375,7 +375,7 @@ String InputEventKey::to_string() { Ref<InputEventKey> InputEventKey::create_reference(uint32_t p_keycode) { Ref<InputEventKey> ie; - ie.instance(); + ie.instantiate(); ie->set_keycode(p_keycode & KEY_CODE_MASK); ie->set_unicode(p_keycode & KEY_CODE_MASK); @@ -545,7 +545,7 @@ Ref<InputEvent> InputEventMouseButton::xformed_by(const Transform2D &p_xform, co Vector2 l = p_xform.xform(get_position() + p_local_ofs); Ref<InputEventMouseButton> mb; - mb.instance(); + mb.instantiate(); mb->set_device(get_device()); mb->set_window_id(get_window_id()); @@ -731,7 +731,7 @@ Ref<InputEvent> InputEventMouseMotion::xformed_by(const Transform2D &p_xform, co Vector2 s = p_xform.basis_xform(get_speed()); Ref<InputEventMouseMotion> mm; - mm.instance(); + mm.instantiate(); mm->set_device(get_device()); mm->set_window_id(get_window_id()); @@ -1048,7 +1048,7 @@ String InputEventJoypadButton::to_string() { Ref<InputEventJoypadButton> InputEventJoypadButton::create_reference(int p_btn_index) { Ref<InputEventJoypadButton> ie; - ie.instance(); + ie.instantiate(); ie->set_button_index(p_btn_index); return ie; @@ -1097,7 +1097,7 @@ bool InputEventScreenTouch::is_pressed() const { Ref<InputEvent> InputEventScreenTouch::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const { Ref<InputEventScreenTouch> st; - st.instance(); + st.instantiate(); st->set_device(get_device()); st->set_window_id(get_window_id()); st->set_index(index); @@ -1170,7 +1170,7 @@ Vector2 InputEventScreenDrag::get_speed() const { Ref<InputEvent> InputEventScreenDrag::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const { Ref<InputEventScreenDrag> sd; - sd.instance(); + sd.instantiate(); sd->set_device(get_device()); sd->set_window_id(get_window_id()); @@ -1325,7 +1325,7 @@ real_t InputEventMagnifyGesture::get_factor() const { Ref<InputEvent> InputEventMagnifyGesture::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const { Ref<InputEventMagnifyGesture> ev; - ev.instance(); + ev.instantiate(); ev->set_device(get_device()); ev->set_window_id(get_window_id()); @@ -1365,7 +1365,7 @@ Vector2 InputEventPanGesture::get_delta() const { Ref<InputEvent> InputEventPanGesture::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const { Ref<InputEventPanGesture> ev; - ev.instance(); + ev.instantiate(); ev->set_device(get_device()); ev->set_window_id(get_window_id()); diff --git a/core/io/file_access_network.cpp b/core/io/file_access_network.cpp index 63a8f9c5b6..9ee3876c2f 100644 --- a/core/io/file_access_network.cpp +++ b/core/io/file_access_network.cpp @@ -210,7 +210,7 @@ FileAccessNetworkClient *FileAccessNetworkClient::singleton = nullptr; FileAccessNetworkClient::FileAccessNetworkClient() { singleton = this; - client.instance(); + client.instantiate(); } FileAccessNetworkClient::~FileAccessNetworkClient() { diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index 449ebaa6ee..78f04e57d3 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -730,7 +730,7 @@ int HTTPClient::get_read_chunk_size() const { } HTTPClient::HTTPClient() { - tcp_connection.instance(); + tcp_connection.instantiate(); } HTTPClient::~HTTPClient() {} diff --git a/core/io/image.cpp b/core/io/image.cpp index 9cd0ea7b5d..25d9eab3fe 100644 --- a/core/io/image.cpp +++ b/core/io/image.cpp @@ -1945,7 +1945,7 @@ Error Image::generate_mipmap_roughness(RoughnessChannel p_roughness_channel, con memcpy(wr.ptr(), ptr, size); wr = uint8_t*(); Ref<Image> im; - im.instance(); + im.instantiate(); im->create(w, h, false, format, imgdata); im->save_png("res://mipmap_" + itos(i) + ".png"); } @@ -3280,7 +3280,7 @@ Ref<Image> Image::rgbe_to_srgb() { ERR_FAIL_COND_V(format != FORMAT_RGBE9995, Ref<Image>()); Ref<Image> new_image; - new_image.instance(); + new_image.instantiate(); new_image->create(width, height, false, Image::FORMAT_RGB8); for (int row = 0; row < height; row++) { @@ -3310,7 +3310,7 @@ Ref<Image> Image::get_image_from_mipmap(int p_mipamp) const { } Ref<Image> image; - image.instance(); + image.instantiate(); image->width = w; image->height = h; image->format = format; @@ -3627,7 +3627,7 @@ Image::Image(const uint8_t *p_mem_png_jpg, int p_len) { Ref<Resource> Image::duplicate(bool p_subresources) const { Ref<Image> copy; - copy.instance(); + copy.instantiate(); copy->_copy_internals_from(*this); return copy; } diff --git a/core/io/image_loader.cpp b/core/io/image_loader.cpp index 7de038e6fe..b45e9d26b1 100644 --- a/core/io/image_loader.cpp +++ b/core/io/image_loader.cpp @@ -163,7 +163,7 @@ RES ResourceFormatLoaderImage::load(const String &p_path, const String &p_origin } Ref<Image> image; - image.instance(); + image.instantiate(); Error err = ImageLoader::loader[idx]->load_image(image, f, false, 1.0); diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index c447e11ee7..f342db2dad 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -547,7 +547,7 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int r_variant = (Object *)nullptr; } else { Ref<EncodedObjectAsID> obj_as_id; - obj_as_id.instance(); + obj_as_id.instantiate(); obj_as_id->set_object_id(val); r_variant = obj_as_id; @@ -565,7 +565,7 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int if (str == String()) { r_variant = (Object *)nullptr; } else { - Object *obj = ClassDB::instance(str); + Object *obj = ClassDB::instantiate(str); ERR_FAIL_COND_V(!obj, ERR_UNAVAILABLE); ERR_FAIL_COND_V(len < 4, ERR_INVALID_DATA); diff --git a/core/io/resource.cpp b/core/io/resource.cpp index b970e85c99..efa622d976 100644 --- a/core/io/resource.cpp +++ b/core/io/resource.cpp @@ -164,7 +164,7 @@ Ref<Resource> Resource::duplicate_for_local_scene(Node *p_for_scene, Map<Ref<Res List<PropertyInfo> plist; get_property_list(&plist); - Ref<Resource> r = Object::cast_to<Resource>(ClassDB::instance(get_class())); + Ref<Resource> r = Object::cast_to<Resource>(ClassDB::instantiate(get_class())); ERR_FAIL_COND_V(r.is_null(), Ref<Resource>()); r->local_scene = p_for_scene; @@ -224,7 +224,7 @@ Ref<Resource> Resource::duplicate(bool p_subresources) const { List<PropertyInfo> plist; get_property_list(&plist); - Ref<Resource> r = (Resource *)ClassDB::instance(get_class()); + Ref<Resource> r = (Resource *)ClassDB::instantiate(get_class()); ERR_FAIL_COND_V(r.is_null(), Ref<Resource>()); for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) { diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index f83ba30514..0e9815245f 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -704,7 +704,7 @@ Error ResourceLoaderBinary::load() { if (res.is_null()) { //did not replace - Object *obj = ClassDB::instance(t); + Object *obj = ClassDB::instantiate(t); if (!obj) { error = ERR_FILE_CORRUPT; ERR_FAIL_V_MSG(ERR_FILE_CORRUPT, local_path + ":Resource of unrecognized type in file: " + t + "."); diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index 1700766cbf..c5dfe1f2b0 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -1045,7 +1045,7 @@ bool ResourceLoader::add_custom_resource_format_loader(String script_path) { bool valid_type = ClassDB::is_parent_class(ibt, "ResourceFormatLoader"); ERR_FAIL_COND_V_MSG(!valid_type, false, "Script does not inherit a CustomResourceLoader: " + script_path + "."); - Object *obj = ClassDB::instance(ibt); + Object *obj = ClassDB::instantiate(ibt); ERR_FAIL_COND_V_MSG(obj == nullptr, false, "Cannot instance script as custom resource loader, expected 'ResourceFormatLoader' inheritance, got: " + String(ibt) + "."); diff --git a/core/io/resource_saver.cpp b/core/io/resource_saver.cpp index 389a4fdbbd..80cb85fba3 100644 --- a/core/io/resource_saver.cpp +++ b/core/io/resource_saver.cpp @@ -210,7 +210,7 @@ bool ResourceSaver::add_custom_resource_format_saver(String script_path) { bool valid_type = ClassDB::is_parent_class(ibt, "ResourceFormatSaver"); ERR_FAIL_COND_V_MSG(!valid_type, false, "Script does not inherit a CustomResourceSaver: " + script_path + "."); - Object *obj = ClassDB::instance(ibt); + Object *obj = ClassDB::instantiate(ibt); ERR_FAIL_COND_V_MSG(obj == nullptr, false, "Cannot instance script as custom resource saver, expected 'ResourceFormatSaver' inheritance, got: " + String(ibt) + "."); diff --git a/core/io/stream_peer.cpp b/core/io/stream_peer.cpp index ee5e9eca0c..27f8d4e88f 100644 --- a/core/io/stream_peer.cpp +++ b/core/io/stream_peer.cpp @@ -512,7 +512,7 @@ void StreamPeerBuffer::clear() { Ref<StreamPeerBuffer> StreamPeerBuffer::duplicate() const { Ref<StreamPeerBuffer> spb; - spb.instance(); + spb.instantiate(); spb->data = data; return spb; } diff --git a/core/object/class_db.cpp b/core/object/class_db.cpp index 5bf874ccae..df36587662 100644 --- a/core/object/class_db.cpp +++ b/core/object/class_db.cpp @@ -516,7 +516,7 @@ void ClassDB::instance_get_native_extension_data(ObjectNativeExtension **r_exten } } -Object *ClassDB::instance(const StringName &p_class) { +Object *ClassDB::instantiate(const StringName &p_class) { ClassInfo *ti; { OBJTYPE_RLOCK; @@ -544,7 +544,7 @@ Object *ClassDB::instance(const StringName &p_class) { return ti->creation_func(); } -bool ClassDB::can_instance(const StringName &p_class) { +bool ClassDB::can_instantiate(const StringName &p_class) { OBJTYPE_RLOCK; ClassInfo *ti = classes.getptr(p_class); @@ -1522,8 +1522,8 @@ Variant ClassDB::class_get_default_property_value(const StringName &p_class, con if (Engine::get_singleton()->has_singleton(p_class)) { c = Engine::get_singleton()->get_singleton_object(p_class); cleanup_c = false; - } else if (ClassDB::can_instance(p_class)) { - c = ClassDB::instance(p_class); + } else if (ClassDB::can_instantiate(p_class)) { + c = ClassDB::instantiate(p_class); cleanup_c = true; } diff --git a/core/object/class_db.h b/core/object/class_db.h index 4355c9b0ea..a4af535149 100644 --- a/core/object/class_db.h +++ b/core/object/class_db.h @@ -230,8 +230,8 @@ public: static StringName get_compatibility_remapped_class(const StringName &p_class); static bool class_exists(const StringName &p_class); static bool is_parent_class(const StringName &p_class, const StringName &p_inherits); - static bool can_instance(const StringName &p_class); - static Object *instance(const StringName &p_class); + static bool can_instantiate(const StringName &p_class); + static Object *instantiate(const StringName &p_class); static void instance_get_native_extension_data(ObjectNativeExtension **r_extension, void **r_extension_instance); static APIType get_api_type(const StringName &p_class); diff --git a/core/object/object.cpp b/core/object/object.cpp index 799e63a512..bad40f14d9 100644 --- a/core/object/object.cpp +++ b/core/object/object.cpp @@ -871,7 +871,7 @@ void Object::set_script(const Variant &p_script) { Ref<Script> s = script; if (!s.is_null()) { - if (s->can_instance()) { + if (s->can_instantiate()) { OBJ_DEBUG_LOCK script_instance = s->instance_create(this); } else if (Engine::get_singleton()->is_editor_hint()) { diff --git a/core/object/ref_counted.h b/core/object/ref_counted.h index 3dd7cc456b..61780eb061 100644 --- a/core/object/ref_counted.h +++ b/core/object/ref_counted.h @@ -213,7 +213,7 @@ public: inline bool is_null() const { return reference == nullptr; } void unref() { - //TODO this should be moved to mutexes, since this engine does not really + // TODO: this should be moved to mutexes, since this engine does not really // do a lot of referencing on references and stuff // mutexes will avoid more crashes? @@ -223,7 +223,7 @@ public: reference = nullptr; } - void instance() { + void instantiate() { ref(memnew(T)); } diff --git a/core/object/script_language.cpp b/core/object/script_language.cpp index dd6bc09abb..626a7413e7 100644 --- a/core/object/script_language.cpp +++ b/core/object/script_language.cpp @@ -100,7 +100,7 @@ Dictionary Script::_get_script_constant_map() { } void Script::_bind_methods() { - ClassDB::bind_method(D_METHOD("can_instance"), &Script::can_instance); + ClassDB::bind_method(D_METHOD("can_instantiate"), &Script::can_instantiate); //ClassDB::bind_method(D_METHOD("instance_create","base_object"),&Script::instance_create); ClassDB::bind_method(D_METHOD("instance_has", "base_object"), &Script::instance_has); ClassDB::bind_method(D_METHOD("has_source_code"), &Script::has_source_code); diff --git a/core/object/script_language.h b/core/object/script_language.h index 5d1f6a0deb..2cbaa0f52e 100644 --- a/core/object/script_language.h +++ b/core/object/script_language.h @@ -115,7 +115,7 @@ protected: Dictionary _get_script_constant_map(); public: - virtual bool can_instance() const = 0; + virtual bool can_instantiate() const = 0; virtual Ref<Script> get_base_script() const = 0; //for script inheritance diff --git a/core/os/midi_driver.cpp b/core/os/midi_driver.cpp index a8be84c56c..a33bc6b4c3 100644 --- a/core/os/midi_driver.cpp +++ b/core/os/midi_driver.cpp @@ -45,7 +45,7 @@ void MIDIDriver::set_singleton() { void MIDIDriver::receive_input_packet(uint64_t timestamp, uint8_t *data, uint32_t length) { Ref<InputEventMIDI> event; - event.instance(); + event.instantiate(); uint32_t param_position = 1; if (length >= 1) { diff --git a/core/register_core_types.cpp b/core/register_core_types.cpp index fc8ab72e1a..a81f8ce8d1 100644 --- a/core/register_core_types.cpp +++ b/core/register_core_types.cpp @@ -113,18 +113,18 @@ void register_core_types() { CoreStringNames::create(); - resource_format_po.instance(); + resource_format_po.instantiate(); ResourceLoader::add_resource_format_loader(resource_format_po); - resource_saver_binary.instance(); + resource_saver_binary.instantiate(); ResourceSaver::add_resource_format_saver(resource_saver_binary); - resource_loader_binary.instance(); + resource_loader_binary.instantiate(); ResourceLoader::add_resource_format_loader(resource_loader_binary); - resource_format_importer.instance(); + resource_format_importer.instantiate(); ResourceLoader::add_resource_format_loader(resource_format_importer); - resource_format_image.instance(); + resource_format_image.instantiate(); ResourceLoader::add_resource_format_loader(resource_format_image); ClassDB::register_class<Object>(); @@ -171,9 +171,9 @@ void register_core_types() { ClassDB::register_custom_instance_class<Crypto>(); ClassDB::register_custom_instance_class<StreamPeerSSL>(); - resource_format_saver_crypto.instance(); + resource_format_saver_crypto.instantiate(); ResourceSaver::add_resource_format_saver(resource_format_saver_crypto); - resource_format_loader_crypto.instance(); + resource_format_loader_crypto.instantiate(); ResourceLoader::add_resource_format_loader(resource_format_loader_crypto); ClassDB::register_virtual_class<IP>(); diff --git a/core/string/translation_po.cpp b/core/string/translation_po.cpp index d6b84cabc9..f9b4e661e4 100644 --- a/core/string/translation_po.cpp +++ b/core/string/translation_po.cpp @@ -188,7 +188,7 @@ void TranslationPO::set_plural_rule(const String &p_plural_rule) { plural_rule = plural_rule.replacen("(", ""); plural_rule = plural_rule.replacen(")", ""); _cache_plural_tests(plural_rule); - expr.instance(); + expr.instantiate(); input_name.push_back("n"); } diff --git a/core/variant/variant_parser.cpp b/core/variant/variant_parser.cpp index 28930a19e2..e61ce1eeaa 100644 --- a/core/variant/variant_parser.cpp +++ b/core/variant/variant_parser.cpp @@ -738,10 +738,10 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream, String type = token.value; - Object *obj = ClassDB::instance(type); + Object *obj = ClassDB::instantiate(type); if (!obj) { - r_err_str = "Can't instance Object() of type: " + type; + r_err_str = "Can't instantiate Object() of type: " + type; return ERR_PARSE_ERROR; } diff --git a/doc/classes/ClassDB.xml b/doc/classes/ClassDB.xml index 860bdc7c8f..028781d313 100644 --- a/doc/classes/ClassDB.xml +++ b/doc/classes/ClassDB.xml @@ -9,7 +9,7 @@ <tutorials> </tutorials> <methods> - <method name="can_instance" qualifiers="const"> + <method name="can_instantiate" qualifiers="const"> <return type="bool"> </return> <argument index="0" name="class" type="StringName"> @@ -187,7 +187,7 @@ Returns the parent class of [code]class[/code]. </description> </method> - <method name="instance" qualifiers="const"> + <method name="instantiate" qualifiers="const"> <return type="Variant"> </return> <argument index="0" name="class" type="StringName"> diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index 9015caa0b4..9addd5965a 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -201,14 +201,14 @@ [codeblocks] [gdscript] func _make_custom_tooltip(for_text): - var tooltip = preload("res://SomeTooltipScene.tscn").instance() + var tooltip = preload("res://SomeTooltipScene.tscn").instantiate() tooltip.get_node("Label").text = for_text return tooltip [/gdscript] [csharp] public override Godot.Control _MakeCustomTooltip(String forText) { - Node tooltip = ResourceLoader.Load<PackedScene>("res://SomeTooltipScene.tscn").Instance(); + Node tooltip = ResourceLoader.Load<PackedScene>("res://SomeTooltipScene.tscn").Instantiate(); tooltip.GetNode<Label>("Label").Text = forText; return tooltip; } @@ -1158,7 +1158,7 @@ <member name="rect_scale" type="Vector2" setter="set_scale" getter="get_scale" default="Vector2(1, 1)"> The node's scale, relative to its [member rect_size]. Change this property to scale the node around its [member rect_pivot_offset]. The Control's [member hint_tooltip] will also scale according to this value. [b]Note:[/b] This property is mainly intended to be used for animation purposes. Text inside the Control will look pixelated or blurry when the Control is scaled. To support multiple resolutions in your project, use an appropriate viewport stretch mode as described in the [url=https://docs.godotengine.org/en/latest/tutorials/viewports/multiple_resolutions.html]documentation[/url] instead of scaling Controls individually. - [b]Note:[/b] If the Control node is a child of a [Container] node, the scale will be reset to [code]Vector2(1, 1)[/code] when the scene is instanced. To set the Control's scale when it's instanced, wait for one frame using [code]yield(get_tree(), "idle_frame")[/code] then set its [member rect_scale] property. + [b]Note:[/b] If the Control node is a child of a [Container] node, the scale will be reset to [code]Vector2(1, 1)[/code] when the scene is instantiated. To set the Control's scale when it's instantiated, wait for one frame using [code]yield(get_tree(), "idle_frame")[/code] then set its [member rect_scale] property. </member> <member name="rect_size" type="Vector2" setter="_set_size" getter="get_size" default="Vector2(0, 0)"> The size of the node's bounding rectangle, in pixels. [Container] nodes update this property automatically. diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml index 0c0439e9d3..a02d318f70 100644 --- a/doc/classes/EditorPlugin.xml +++ b/doc/classes/EditorPlugin.xml @@ -404,7 +404,7 @@ </argument> <description> Adds a custom type, which will appear in the list of nodes or resources. An icon can be optionally passed. - When given node or resource is selected, the base type will be instanced (e.g. "Node3D", "Control", "Resource"), then the script will be loaded and set to this object. + When given node or resource is selected, the base type will be instantiated (e.g. "Node3D", "Control", "Resource"), then the script will be loaded and set to this object. You can use the virtual method [method _handles] to check if your custom object is being edited by checking the script or using the [code]is[/code] keyword. During run-time, this will be a simple object with a script so this function does not need to be called then. </description> diff --git a/doc/classes/InstancePlaceholder.xml b/doc/classes/InstancePlaceholder.xml index defd23afb1..934764b461 100644 --- a/doc/classes/InstancePlaceholder.xml +++ b/doc/classes/InstancePlaceholder.xml @@ -4,7 +4,7 @@ Placeholder for the root [Node] of a [PackedScene]. </brief_description> <description> - Turning on the option [b]Load As Placeholder[/b] for an instanced scene in the editor causes it to be replaced by an [InstancePlaceholder] when running the game. This makes it possible to delay actually loading the scene until calling [method create_instance]. This is useful to avoid loading large scenes all at once by loading parts of it selectively. + Turning on the option [b]Load As Placeholder[/b] for an instantiated scene in the editor causes it to be replaced by an [InstancePlaceholder] when running the game. This makes it possible to delay actually loading the scene until calling [method create_instance]. This is useful to avoid loading large scenes all at once by loading parts of it selectively. The [InstancePlaceholder] does not have a transform. This causes any child nodes to be positioned relatively to the [Viewport] from point (0,0), rather than their parent as displayed in the editor. Replacing the placeholder with a scene with a transform will transform children relatively to their parent again. </description> <tutorials> diff --git a/doc/classes/Light3D.xml b/doc/classes/Light3D.xml index 84abf57cb6..815d20223d 100644 --- a/doc/classes/Light3D.xml +++ b/doc/classes/Light3D.xml @@ -4,7 +4,7 @@ Provides a base class for different kinds of light nodes. </brief_description> <description> - Light3D is the [i]abstract[/i] base class for light nodes. As it can't be instanced, it shouldn't be used directly. Other types of light nodes inherit from it. Light3D contains the common variables and parameters used for lighting. + Light3D is the [i]abstract[/i] base class for light nodes. As it can't be instantiated, it shouldn't be used directly. Other types of light nodes inherit from it. Light3D contains the common variables and parameters used for lighting. </description> <tutorials> <link title="3D lights and shadows">https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link> diff --git a/doc/classes/MeshInstance3D.xml b/doc/classes/MeshInstance3D.xml index b5ab296bd0..7c4e75793e 100644 --- a/doc/classes/MeshInstance3D.xml +++ b/doc/classes/MeshInstance3D.xml @@ -4,7 +4,7 @@ Node that instances meshes into a scenario. </brief_description> <description> - MeshInstance3D is a node that takes a [Mesh] resource and adds it to the current scenario by creating an instance of it. This is the class most often used render 3D geometry and can be used to instance a single [Mesh] in many places. This allows reuse of geometry which can save on resources. When a [Mesh] has to be instanced more than thousands of times at close proximity, consider using a [MultiMesh] in a [MultiMeshInstance3D] instead. + MeshInstance3D is a node that takes a [Mesh] resource and adds it to the current scenario by creating an instance of it. This is the class most often used render 3D geometry and can be used to instance a single [Mesh] in many places. This allows reuse of geometry which can save on resources. When a [Mesh] has to be instantiated more than thousands of times at close proximity, consider using a [MultiMesh] in a [MultiMeshInstance3D] instead. </description> <tutorials> <link title="3D Material Testers Demo">https://godotengine.org/asset-library/asset/123</link> diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 87dcfe18cf..21f3f1fcc0 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -5,13 +5,13 @@ </brief_description> <description> Nodes are Godot's building blocks. They can be assigned as the child of another node, resulting in a tree arrangement. A given node can contain any number of nodes as children with the requirement that all siblings (direct children of a node) should have unique names. - A tree of nodes is called a [i]scene[/i]. Scenes can be saved to the disk and then instanced into other scenes. This allows for very high flexibility in the architecture and data model of Godot projects. + A tree of nodes is called a [i]scene[/i]. Scenes can be saved to the disk and then instantiated into other scenes. This allows for very high flexibility in the architecture and data model of Godot projects. [b]Scene tree:[/b] The [SceneTree] contains the active tree of nodes. When a node is added to the scene tree, it receives the [constant NOTIFICATION_ENTER_TREE] notification and its [method _enter_tree] callback is triggered. Child nodes are always added [i]after[/i] their parent node, i.e. the [method _enter_tree] callback of a parent node will be triggered before its child's. Once all nodes have been added in the scene tree, they receive the [constant NOTIFICATION_READY] notification and their respective [method _ready] callbacks are triggered. For groups of nodes, the [method _ready] callback is called in reverse order, starting with the children and moving up to the parent nodes. This means that when adding a node to the scene tree, the following order will be used for the callbacks: [method _enter_tree] of the parent, [method _enter_tree] of the children, [method _ready] of the children and finally [method _ready] of the parent (recursively for the entire scene tree). [b]Processing:[/b] Nodes can override the "process" state, so that they receive a callback on each frame requesting them to process (do something). Normal processing (callback [method _process], toggled with [method set_process]) happens as fast as possible and is dependent on the frame rate, so the processing time [i]delta[/i] (in seconds) is passed as an argument. Physics processing (callback [method _physics_process], toggled with [method set_physics_process]) happens a fixed number of times per second (60 by default) and is useful for code related to the physics engine. Nodes can also process input events. When present, the [method _input] function will be called for each input that the program receives. In many cases, this can be overkill (unless used for simple projects), and the [method _unhandled_input] function might be preferred; it is called when the input event was not handled by anyone else (typically, GUI [Control] nodes), ensuring that the node only receives the events that were meant for it. - To keep track of the scene hierarchy (especially when instancing scenes into other scenes), an "owner" can be set for the node with the [member owner] property. This keeps track of who instanced what. This is mostly useful when writing editors and tools, though. + To keep track of the scene hierarchy (especially when instancing scenes into other scenes), an "owner" can be set for the node with the [member owner] property. This keeps track of who instantiated what. This is mostly useful when writing editors and tools, though. Finally, when a node is freed with [method Object.free] or [method queue_free], it will also free all its children. [b]Groups:[/b] Nodes can be added to as many groups as you want to be easy to manage, you could create groups like "enemies" or "collectables" for example, depending on your game. See [method add_to_group], [method is_in_group] and [method remove_from_group]. You can then retrieve all nodes in these groups, iterate them and even call methods on groups via the methods on [SceneTree]. [b]Networking with nodes:[/b] After connecting to a server (or making one, see [NetworkedMultiplayerENet]), it is possible to use the built-in RPC (remote procedure call) system to communicate over the network. By calling [method rpc] with a method name, it will be called locally and in all connected peers (peers = clients and the server that accepts connections). To identify which node receives the RPC call, Godot will use its [NodePath] (make sure node names are the same on all peers). Also, take a look at the high-level networking tutorial and corresponding demos. @@ -128,7 +128,7 @@ </argument> <description> Adds a child node. Nodes can have any number of children, but every child must have a unique name. Child nodes are automatically deleted when the parent node is deleted, so an entire scene can be removed by deleting its topmost node. - If [code]legible_unique_name[/code] is [code]true[/code], the child node will have a human-readable name based on the name of the node being instanced instead of its type. + If [code]legible_unique_name[/code] is [code]true[/code], the child node will have a human-readable name based on the name of the node being instantiated instead of its type. [b]Note:[/b] If the child node already has a parent, the function will fail. Use [method remove_child] first to remove the node from its current parent. For example: [codeblocks] [gdscript] @@ -159,7 +159,7 @@ </argument> <description> Adds a [code]sibling[/code] node to current's node parent, at the same level as that node, right below it. - If [code]legible_unique_name[/code] is [code]true[/code], the child node will have a human-readable name based on the name of the node being instanced instead of its type. + If [code]legible_unique_name[/code] is [code]true[/code], the child node will have a human-readable name based on the name of the node being instantiated instead of its type. Use [method add_child] instead of this method if you don't need the child node to be added below a specific node in the list of children. </description> </method> @@ -805,7 +805,7 @@ The override to the default [MultiplayerAPI]. Set to [code]null[/code] to use the default [SceneTree] one. </member> <member name="filename" type="String" setter="set_filename" getter="get_filename"> - When a scene is instanced from a file, its topmost node contains the filename from which it was loaded. + When a scene is instantiated from a file, its topmost node contains the filename from which it was loaded. </member> <member name="multiplayer" type="MultiplayerAPI" setter="" getter="get_multiplayer"> The [MultiplayerAPI] instance associated with this node. Either the [member custom_multiplayer], or the default SceneTree one (if inside tree). @@ -884,7 +884,7 @@ Notification received when a node is unparented (parent removed it from the list of children). </constant> <constant name="NOTIFICATION_INSTANCED" value="20"> - Notification received when the node is instanced. + Notification received when the node is instantiated. </constant> <constant name="NOTIFICATION_DRAG_BEGIN" value="21"> Notification received when a drag begins. diff --git a/doc/classes/PackedScene.xml b/doc/classes/PackedScene.xml index 5887238a32..f39cae8be5 100644 --- a/doc/classes/PackedScene.xml +++ b/doc/classes/PackedScene.xml @@ -11,13 +11,13 @@ [codeblocks] [gdscript] # Use load() instead of preload() if the path isn't known at compile-time. - var scene = preload("res://scene.tscn").instance() + var scene = preload("res://scene.tscn").instantiate() # Add the node as a child of the node the script is attached to. add_child(scene) [/gdscript] [csharp] // C# has no preload, so you have to always use ResourceLoader.Load<PackedScene>(). - var scene = ResourceLoader.Load<PackedScene>("res://scene.tscn").Instance(); + var scene = ResourceLoader.Load<PackedScene>("res://scene.tscn").Instantiate(); // Add the node as a child of the node the script is attached to. AddChild(scene); [/csharp] @@ -76,7 +76,7 @@ <link title="2D Role Playing Game Demo">https://godotengine.org/asset-library/asset/520</link> </tutorials> <methods> - <method name="can_instance" qualifiers="const"> + <method name="can_instantiate" qualifiers="const"> <return type="bool"> </return> <description> @@ -90,7 +90,7 @@ Returns the [code]SceneState[/code] representing the scene file contents. </description> </method> - <method name="instance" qualifiers="const"> + <method name="instantiate" qualifiers="const"> <return type="Node"> </return> <argument index="0" name="edit_state" type="int" enum="PackedScene.GenEditState" default="0"> @@ -117,14 +117,14 @@ </members> <constants> <constant name="GEN_EDIT_STATE_DISABLED" value="0" enum="GenEditState"> - If passed to [method instance], blocks edits to the scene state. + If passed to [method instantiate], blocks edits to the scene state. </constant> <constant name="GEN_EDIT_STATE_INSTANCE" value="1" enum="GenEditState"> - If passed to [method instance], provides local scene resources to the local scene. + If passed to [method instantiate], provides local scene resources to the local scene. [b]Note:[/b] Only available in editor builds. </constant> <constant name="GEN_EDIT_STATE_MAIN" value="2" enum="GenEditState"> - If passed to [method instance], provides local scene resources to the local scene. Only the main scene should receive the main edit state. + If passed to [method instantiate], provides local scene resources to the local scene. Only the main scene should receive the main edit state. [b]Note:[/b] Only available in editor builds. </constant> </constants> diff --git a/doc/classes/Performance.xml b/doc/classes/Performance.xml index ff73844803..b6013fa83e 100644 --- a/doc/classes/Performance.xml +++ b/doc/classes/Performance.xml @@ -157,13 +157,13 @@ Largest amount of memory the message queue buffer has used, in bytes. The message queue is used for deferred functions calls and notifications. </constant> <constant name="OBJECT_COUNT" value="6" enum="Monitor"> - Number of objects currently instanced (including nodes). + Number of objects currently instantiated (including nodes). </constant> <constant name="OBJECT_RESOURCE_COUNT" value="7" enum="Monitor"> Number of resources currently used. </constant> <constant name="OBJECT_NODE_COUNT" value="8" enum="Monitor"> - Number of nodes currently instanced in the scene tree. This also includes the root node. + Number of nodes currently instantiated in the scene tree. This also includes the root node. </constant> <constant name="OBJECT_ORPHAN_NODE_COUNT" value="9" enum="Monitor"> Number of orphan nodes, i.e. nodes which are not parented to a node of the scene tree. diff --git a/doc/classes/Resource.xml b/doc/classes/Resource.xml index 6edb3b1a11..c8800a3c25 100644 --- a/doc/classes/Resource.xml +++ b/doc/classes/Resource.xml @@ -4,7 +4,7 @@ Base class for all resources. </brief_description> <description> - Resource is the base class for all Godot-specific resource types, serving primarily as data containers. Since they inherit from [RefCounted], resources are reference-counted and freed when no longer in use. They are also cached once loaded from disk, so that any further attempts to load a resource from a given path will return the same reference (all this in contrast to a [Node], which is not reference-counted and can be instanced from disk as many times as desired). Resources can be saved externally on disk or bundled into another object, such as a [Node] or another resource. + Resource is the base class for all Godot-specific resource types, serving primarily as data containers. Since they inherit from [RefCounted], resources are reference-counted and freed when no longer in use. They are also cached once loaded from disk, so that any further attempts to load a resource from a given path will return the same reference (all this in contrast to a [Node], which is not reference-counted and can be instantiated from disk as many times as desired). Resources can be saved externally on disk or bundled into another object, such as a [Node] or another resource. [b]Note:[/b] In C#, resources will not be freed instantly after they are no longer in use. Instead, garbage collection will run periodically and will free resources that are no longer in use. This means that unused resources will linger on for a while before being removed. </description> <tutorials> diff --git a/doc/classes/SceneState.xml b/doc/classes/SceneState.xml index f9e0ef76b9..6d804cc697 100644 --- a/doc/classes/SceneState.xml +++ b/doc/classes/SceneState.xml @@ -95,7 +95,7 @@ <argument index="0" name="idx" type="int"> </argument> <description> - Returns the node's index, which is its position relative to its siblings. This is only relevant and saved in scenes for cases where new nodes are added to an instanced or inherited scene among siblings from the base scene. Despite the name, this index is not related to the [code]idx[/code] argument used here and in other methods. + Returns the node's index, which is its position relative to its siblings. This is only relevant and saved in scenes for cases where new nodes are added to an instantiated or inherited scene among siblings from the base scene. Despite the name, this index is not related to the [code]idx[/code] argument used here and in other methods. </description> </method> <method name="get_node_instance" qualifiers="const"> @@ -199,14 +199,14 @@ </methods> <constants> <constant name="GEN_EDIT_STATE_DISABLED" value="0" enum="GenEditState"> - If passed to [method PackedScene.instance], blocks edits to the scene state. + If passed to [method PackedScene.instantiate], blocks edits to the scene state. </constant> <constant name="GEN_EDIT_STATE_INSTANCE" value="1" enum="GenEditState"> - If passed to [method PackedScene.instance], provides inherited scene resources to the local scene. + If passed to [method PackedScene.instantiate], provides inherited scene resources to the local scene. [b]Note:[/b] Only available in editor builds. </constant> <constant name="GEN_EDIT_STATE_MAIN" value="2" enum="GenEditState"> - If passed to [method PackedScene.instance], provides local scene resources to the local scene. Only the main scene should receive the main edit state. + If passed to [method PackedScene.instantiate], provides local scene resources to the local scene. Only the main scene should receive the main edit state. [b]Note:[/b] Only available in editor builds. </constant> </constants> diff --git a/doc/classes/Script.xml b/doc/classes/Script.xml index 56272760bd..e7527d73e2 100644 --- a/doc/classes/Script.xml +++ b/doc/classes/Script.xml @@ -11,11 +11,11 @@ <link title="Scripting">https://docs.godotengine.org/en/latest/getting_started/step_by_step/scripting.html</link> </tutorials> <methods> - <method name="can_instance" qualifiers="const"> + <method name="can_instantiate" qualifiers="const"> <return type="bool"> </return> <description> - Returns [code]true[/code] if the script can be instanced. + Returns [code]true[/code] if the script can be instantiated. </description> </method> <method name="get_base_script" qualifiers="const"> diff --git a/doc/classes/WorldEnvironment.xml b/doc/classes/WorldEnvironment.xml index c1cf639ec0..6aa2db00b4 100644 --- a/doc/classes/WorldEnvironment.xml +++ b/doc/classes/WorldEnvironment.xml @@ -5,7 +5,7 @@ </brief_description> <description> The [WorldEnvironment] node is used to configure the default [Environment] for the scene. - The parameters defined in the [WorldEnvironment] can be overridden by an [Environment] node set on the current [Camera3D]. Additionally, only one [WorldEnvironment] may be instanced in a given scene at a time. + The parameters defined in the [WorldEnvironment] can be overridden by an [Environment] node set on the current [Camera3D]. Additionally, only one [WorldEnvironment] may be instantiated in a given scene at a time. The [WorldEnvironment] allows the user to specify default lighting parameters (e.g. ambient lighting), various post-processing effects (e.g. SSAO, DOF, Tonemapping), and how to draw the background (e.g. solid color, skybox). Usually, these are added in order to improve the realism/color balance of the scene. </description> <tutorials> diff --git a/doc/translations/ar.po b/doc/translations/ar.po index 77a3d39f27..4199bca6c7 100644 --- a/doc/translations/ar.po +++ b/doc/translations/ar.po @@ -701,7 +701,7 @@ msgid "" "the FileSystem dock into the script.\n" "[codeblock]\n" "# Instance a scene.\n" -"var diamond = preload(\"res://diamond.tscn\").instance()\n" +"var diamond = preload(\"res://diamond.tscn\").instantiate()\n" "[/codeblock]" msgstr "" @@ -13825,7 +13825,7 @@ msgid "" "Example of usage with custom scene instance:\n" "[codeblock]\n" "func _make_custom_tooltip(for_text):\n" -" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n" +" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n" " tooltip.get_node(\"Label\").text = for_text\n" " return tooltip\n" "[/codeblock]" @@ -34691,7 +34691,7 @@ msgid "" "[codeblock]\n" "# Use `load()` instead of `preload()` if the path isn't known at compile-" "time.\n" -"var scene = preload(\"res://scene.tscn\").instance()\n" +"var scene = preload(\"res://scene.tscn\").instantiate()\n" "# Add the node as a child of the node the script is attached to.\n" "add_child(scene)\n" "[/codeblock]\n" diff --git a/doc/translations/ca.po b/doc/translations/ca.po index 8ea801181d..c72cba18bc 100644 --- a/doc/translations/ca.po +++ b/doc/translations/ca.po @@ -732,7 +732,7 @@ msgid "" "the FileSystem dock into the script.\n" "[codeblock]\n" "# Instance a scene.\n" -"var diamond = preload(\"res://diamond.tscn\").instance()\n" +"var diamond = preload(\"res://diamond.tscn\").instantiate()\n" "[/codeblock]" msgstr "" @@ -13856,7 +13856,7 @@ msgid "" "Example of usage with custom scene instance:\n" "[codeblock]\n" "func _make_custom_tooltip(for_text):\n" -" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n" +" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n" " tooltip.get_node(\"Label\").text = for_text\n" " return tooltip\n" "[/codeblock]" @@ -34722,7 +34722,7 @@ msgid "" "[codeblock]\n" "# Use `load()` instead of `preload()` if the path isn't known at compile-" "time.\n" -"var scene = preload(\"res://scene.tscn\").instance()\n" +"var scene = preload(\"res://scene.tscn\").instantiate()\n" "# Add the node as a child of the node the script is attached to.\n" "add_child(scene)\n" "[/codeblock]\n" diff --git a/doc/translations/classes.pot b/doc/translations/classes.pot index f138276364..321e67f759 100644 --- a/doc/translations/classes.pot +++ b/doc/translations/classes.pot @@ -702,7 +702,7 @@ msgid "" "the FileSystem dock into the script.\n" "[codeblock]\n" "# Instance a scene.\n" -"var diamond = preload(\"res://diamond.tscn\").instance()\n" +"var diamond = preload(\"res://diamond.tscn\").instantiate()\n" "[/codeblock]" msgstr "" @@ -13826,7 +13826,7 @@ msgid "" "Example of usage with custom scene instance:\n" "[codeblock]\n" "func _make_custom_tooltip(for_text):\n" -" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n" +" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n" " tooltip.get_node(\"Label\").text = for_text\n" " return tooltip\n" "[/codeblock]" @@ -34692,7 +34692,7 @@ msgid "" "[codeblock]\n" "# Use `load()` instead of `preload()` if the path isn't known at compile-" "time.\n" -"var scene = preload(\"res://scene.tscn\").instance()\n" +"var scene = preload(\"res://scene.tscn\").instantiate()\n" "# Add the node as a child of the node the script is attached to.\n" "add_child(scene)\n" "[/codeblock]\n" diff --git a/doc/translations/cs.po b/doc/translations/cs.po index a267656497..3584fc5062 100644 --- a/doc/translations/cs.po +++ b/doc/translations/cs.po @@ -1058,7 +1058,7 @@ msgid "" "the FileSystem dock into the script.\n" "[codeblock]\n" "# Instance a scene.\n" -"var diamond = preload(\"res://diamond.tscn\").instance()\n" +"var diamond = preload(\"res://diamond.tscn\").instantiate()\n" "[/codeblock]" msgstr "" @@ -14318,7 +14318,7 @@ msgid "" "Example of usage with custom scene instance:\n" "[codeblock]\n" "func _make_custom_tooltip(for_text):\n" -" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n" +" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n" " tooltip.get_node(\"Label\").text = for_text\n" " return tooltip\n" "[/codeblock]" @@ -35192,7 +35192,7 @@ msgid "" "[codeblock]\n" "# Use `load()` instead of `preload()` if the path isn't known at compile-" "time.\n" -"var scene = preload(\"res://scene.tscn\").instance()\n" +"var scene = preload(\"res://scene.tscn\").instantiate()\n" "# Add the node as a child of the node the script is attached to.\n" "add_child(scene)\n" "[/codeblock]\n" diff --git a/doc/translations/de.po b/doc/translations/de.po index 181d64d525..76eff809ff 100644 --- a/doc/translations/de.po +++ b/doc/translations/de.po @@ -992,7 +992,7 @@ msgid "" "the FileSystem dock into the script.\n" "[codeblock]\n" "# Instance a scene.\n" -"var diamond = preload(\"res://diamond.tscn\").instance()\n" +"var diamond = preload(\"res://diamond.tscn\").instantiate()\n" "[/codeblock]" msgstr "" @@ -14154,7 +14154,7 @@ msgid "" "Example of usage with custom scene instance:\n" "[codeblock]\n" "func _make_custom_tooltip(for_text):\n" -" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n" +" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n" " tooltip.get_node(\"Label\").text = for_text\n" " return tooltip\n" "[/codeblock]" @@ -35118,7 +35118,7 @@ msgid "" "[codeblock]\n" "# Use `load()` instead of `preload()` if the path isn't known at compile-" "time.\n" -"var scene = preload(\"res://scene.tscn\").instance()\n" +"var scene = preload(\"res://scene.tscn\").instantiate()\n" "# Add the node as a child of the node the script is attached to.\n" "add_child(scene)\n" "[/codeblock]\n" diff --git a/doc/translations/es.po b/doc/translations/es.po index 7df36316b7..44b3b22597 100644 --- a/doc/translations/es.po +++ b/doc/translations/es.po @@ -1119,7 +1119,7 @@ msgid "" "the FileSystem dock into the script.\n" "[codeblock]\n" "# Instance a scene.\n" -"var diamond = preload(\"res://diamond.tscn\").instance()\n" +"var diamond = preload(\"res://diamond.tscn\").instantiate()\n" "[/codeblock]" msgstr "" @@ -18123,7 +18123,7 @@ msgid "" "Example of usage with custom scene instance:\n" "[codeblock]\n" "func _make_custom_tooltip(for_text):\n" -" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n" +" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n" " tooltip.get_node(\"Label\").text = for_text\n" " return tooltip\n" "[/codeblock]" @@ -18150,7 +18150,7 @@ msgstr "" "Ejemplo de uso con una instancia de una escena personalizada<\n" "[codeblock]\n" "func _make_custom_tooltip(for_text):\n" -" var sugerencia = preload(\"algunaEscenaSugerencia.tscn\").instance()\n" +" var sugerencia = preload(\"algunaEscenaSugerencia.tscn\").instantiate()\n" " tooltip.get_node(\"etiqueta\").text = para_texto\n" " return sugerencia\n" "[/codeblock]" @@ -46659,7 +46659,7 @@ msgid "" "[codeblock]\n" "# Use `load()` instead of `preload()` if the path isn't known at compile-" "time.\n" -"var scene = preload(\"res://scene.tscn\").instance()\n" +"var scene = preload(\"res://scene.tscn\").instantiate()\n" "# Add the node as a child of the node the script is attached to.\n" "add_child(scene)\n" "[/codeblock]\n" diff --git a/doc/translations/fa.po b/doc/translations/fa.po index e440146dd3..2a185fadc5 100644 --- a/doc/translations/fa.po +++ b/doc/translations/fa.po @@ -707,7 +707,7 @@ msgid "" "the FileSystem dock into the script.\n" "[codeblock]\n" "# Instance a scene.\n" -"var diamond = preload(\"res://diamond.tscn\").instance()\n" +"var diamond = preload(\"res://diamond.tscn\").instantiate()\n" "[/codeblock]" msgstr "" @@ -13831,7 +13831,7 @@ msgid "" "Example of usage with custom scene instance:\n" "[codeblock]\n" "func _make_custom_tooltip(for_text):\n" -" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n" +" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n" " tooltip.get_node(\"Label\").text = for_text\n" " return tooltip\n" "[/codeblock]" @@ -34697,7 +34697,7 @@ msgid "" "[codeblock]\n" "# Use `load()` instead of `preload()` if the path isn't known at compile-" "time.\n" -"var scene = preload(\"res://scene.tscn\").instance()\n" +"var scene = preload(\"res://scene.tscn\").instantiate()\n" "# Add the node as a child of the node the script is attached to.\n" "add_child(scene)\n" "[/codeblock]\n" diff --git a/doc/translations/fi.po b/doc/translations/fi.po index 92ec4f29dd..a5f470c60b 100644 --- a/doc/translations/fi.po +++ b/doc/translations/fi.po @@ -720,7 +720,7 @@ msgid "" "the FileSystem dock into the script.\n" "[codeblock]\n" "# Instance a scene.\n" -"var diamond = preload(\"res://diamond.tscn\").instance()\n" +"var diamond = preload(\"res://diamond.tscn\").instantiate()\n" "[/codeblock]" msgstr "" @@ -13844,7 +13844,7 @@ msgid "" "Example of usage with custom scene instance:\n" "[codeblock]\n" "func _make_custom_tooltip(for_text):\n" -" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n" +" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n" " tooltip.get_node(\"Label\").text = for_text\n" " return tooltip\n" "[/codeblock]" @@ -34710,7 +34710,7 @@ msgid "" "[codeblock]\n" "# Use `load()` instead of `preload()` if the path isn't known at compile-" "time.\n" -"var scene = preload(\"res://scene.tscn\").instance()\n" +"var scene = preload(\"res://scene.tscn\").instantiate()\n" "# Add the node as a child of the node the script is attached to.\n" "add_child(scene)\n" "[/codeblock]\n" diff --git a/doc/translations/fr.po b/doc/translations/fr.po index 7717474c0f..2d9b1db565 100644 --- a/doc/translations/fr.po +++ b/doc/translations/fr.po @@ -1017,7 +1017,7 @@ msgid "" "the FileSystem dock into the script.\n" "[codeblock]\n" "# Instance a scene.\n" -"var diamond = preload(\"res://diamond.tscn\").instance()\n" +"var diamond = preload(\"res://diamond.tscn\").instantiate()\n" "[/codeblock]" msgstr "" @@ -14162,7 +14162,7 @@ msgid "" "Example of usage with custom scene instance:\n" "[codeblock]\n" "func _make_custom_tooltip(for_text):\n" -" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n" +" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n" " tooltip.get_node(\"Label\").text = for_text\n" " return tooltip\n" "[/codeblock]" @@ -35061,7 +35061,7 @@ msgid "" "[codeblock]\n" "# Use `load()` instead of `preload()` if the path isn't known at compile-" "time.\n" -"var scene = preload(\"res://scene.tscn\").instance()\n" +"var scene = preload(\"res://scene.tscn\").instantiate()\n" "# Add the node as a child of the node the script is attached to.\n" "add_child(scene)\n" "[/codeblock]\n" diff --git a/doc/translations/id.po b/doc/translations/id.po index edfd392f4f..cd841fc553 100644 --- a/doc/translations/id.po +++ b/doc/translations/id.po @@ -733,7 +733,7 @@ msgid "" "the FileSystem dock into the script.\n" "[codeblock]\n" "# Instance a scene.\n" -"var diamond = preload(\"res://diamond.tscn\").instance()\n" +"var diamond = preload(\"res://diamond.tscn\").instantiate()\n" "[/codeblock]" msgstr "" @@ -13857,7 +13857,7 @@ msgid "" "Example of usage with custom scene instance:\n" "[codeblock]\n" "func _make_custom_tooltip(for_text):\n" -" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n" +" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n" " tooltip.get_node(\"Label\").text = for_text\n" " return tooltip\n" "[/codeblock]" @@ -34723,7 +34723,7 @@ msgid "" "[codeblock]\n" "# Use `load()` instead of `preload()` if the path isn't known at compile-" "time.\n" -"var scene = preload(\"res://scene.tscn\").instance()\n" +"var scene = preload(\"res://scene.tscn\").instantiate()\n" "# Add the node as a child of the node the script is attached to.\n" "add_child(scene)\n" "[/codeblock]\n" diff --git a/doc/translations/it.po b/doc/translations/it.po index 353eae4116..aa085f6158 100644 --- a/doc/translations/it.po +++ b/doc/translations/it.po @@ -985,7 +985,7 @@ msgid "" "the FileSystem dock into the script.\n" "[codeblock]\n" "# Instance a scene.\n" -"var diamond = preload(\"res://diamond.tscn\").instance()\n" +"var diamond = preload(\"res://diamond.tscn\").instantiate()\n" "[/codeblock]" msgstr "" @@ -14115,7 +14115,7 @@ msgid "" "Example of usage with custom scene instance:\n" "[codeblock]\n" "func _make_custom_tooltip(for_text):\n" -" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n" +" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n" " tooltip.get_node(\"Label\").text = for_text\n" " return tooltip\n" "[/codeblock]" @@ -34990,7 +34990,7 @@ msgid "" "[codeblock]\n" "# Use `load()` instead of `preload()` if the path isn't known at compile-" "time.\n" -"var scene = preload(\"res://scene.tscn\").instance()\n" +"var scene = preload(\"res://scene.tscn\").instantiate()\n" "# Add the node as a child of the node the script is attached to.\n" "add_child(scene)\n" "[/codeblock]\n" diff --git a/doc/translations/ja.po b/doc/translations/ja.po index 1424b24153..ee900d58c2 100644 --- a/doc/translations/ja.po +++ b/doc/translations/ja.po @@ -1091,7 +1091,7 @@ msgid "" "the FileSystem dock into the script.\n" "[codeblock]\n" "# Instance a scene.\n" -"var diamond = preload(\"res://diamond.tscn\").instance()\n" +"var diamond = preload(\"res://diamond.tscn\").instantiate()\n" "[/codeblock]" msgstr "" @@ -15045,7 +15045,7 @@ msgid "" "Example of usage with custom scene instance:\n" "[codeblock]\n" "func _make_custom_tooltip(for_text):\n" -" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n" +" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n" " tooltip.get_node(\"Label\").text = for_text\n" " return tooltip\n" "[/codeblock]" @@ -35964,7 +35964,7 @@ msgid "" "[codeblock]\n" "# Use `load()` instead of `preload()` if the path isn't known at compile-" "time.\n" -"var scene = preload(\"res://scene.tscn\").instance()\n" +"var scene = preload(\"res://scene.tscn\").instantiate()\n" "# Add the node as a child of the node the script is attached to.\n" "add_child(scene)\n" "[/codeblock]\n" diff --git a/doc/translations/ko.po b/doc/translations/ko.po index 8e8aef2eaf..60416fb63c 100644 --- a/doc/translations/ko.po +++ b/doc/translations/ko.po @@ -709,7 +709,7 @@ msgid "" "the FileSystem dock into the script.\n" "[codeblock]\n" "# Instance a scene.\n" -"var diamond = preload(\"res://diamond.tscn\").instance()\n" +"var diamond = preload(\"res://diamond.tscn\").instantiate()\n" "[/codeblock]" msgstr "" @@ -13833,7 +13833,7 @@ msgid "" "Example of usage with custom scene instance:\n" "[codeblock]\n" "func _make_custom_tooltip(for_text):\n" -" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n" +" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n" " tooltip.get_node(\"Label\").text = for_text\n" " return tooltip\n" "[/codeblock]" @@ -34699,7 +34699,7 @@ msgid "" "[codeblock]\n" "# Use `load()` instead of `preload()` if the path isn't known at compile-" "time.\n" -"var scene = preload(\"res://scene.tscn\").instance()\n" +"var scene = preload(\"res://scene.tscn\").instantiate()\n" "# Add the node as a child of the node the script is attached to.\n" "add_child(scene)\n" "[/codeblock]\n" diff --git a/doc/translations/nl.po b/doc/translations/nl.po index 096e59f497..c0dc01c653 100644 --- a/doc/translations/nl.po +++ b/doc/translations/nl.po @@ -735,7 +735,7 @@ msgid "" "the FileSystem dock into the script.\n" "[codeblock]\n" "# Instance a scene.\n" -"var diamond = preload(\"res://diamond.tscn\").instance()\n" +"var diamond = preload(\"res://diamond.tscn\").instantiate()\n" "[/codeblock]" msgstr "" @@ -13859,7 +13859,7 @@ msgid "" "Example of usage with custom scene instance:\n" "[codeblock]\n" "func _make_custom_tooltip(for_text):\n" -" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n" +" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n" " tooltip.get_node(\"Label\").text = for_text\n" " return tooltip\n" "[/codeblock]" @@ -34725,7 +34725,7 @@ msgid "" "[codeblock]\n" "# Use `load()` instead of `preload()` if the path isn't known at compile-" "time.\n" -"var scene = preload(\"res://scene.tscn\").instance()\n" +"var scene = preload(\"res://scene.tscn\").instantiate()\n" "# Add the node as a child of the node the script is attached to.\n" "add_child(scene)\n" "[/codeblock]\n" diff --git a/doc/translations/pl.po b/doc/translations/pl.po index 5ef41b155a..2664f263cb 100644 --- a/doc/translations/pl.po +++ b/doc/translations/pl.po @@ -737,7 +737,7 @@ msgid "" "the FileSystem dock into the script.\n" "[codeblock]\n" "# Instance a scene.\n" -"var diamond = preload(\"res://diamond.tscn\").instance()\n" +"var diamond = preload(\"res://diamond.tscn\").instantiate()\n" "[/codeblock]" msgstr "" @@ -13877,7 +13877,7 @@ msgid "" "Example of usage with custom scene instance:\n" "[codeblock]\n" "func _make_custom_tooltip(for_text):\n" -" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n" +" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n" " tooltip.get_node(\"Label\").text = for_text\n" " return tooltip\n" "[/codeblock]" @@ -34744,7 +34744,7 @@ msgid "" "[codeblock]\n" "# Use `load()` instead of `preload()` if the path isn't known at compile-" "time.\n" -"var scene = preload(\"res://scene.tscn\").instance()\n" +"var scene = preload(\"res://scene.tscn\").instantiate()\n" "# Add the node as a child of the node the script is attached to.\n" "add_child(scene)\n" "[/codeblock]\n" diff --git a/doc/translations/pt_BR.po b/doc/translations/pt_BR.po index ef62950d51..f86bed9585 100644 --- a/doc/translations/pt_BR.po +++ b/doc/translations/pt_BR.po @@ -748,7 +748,7 @@ msgid "" "the FileSystem dock into the script.\n" "[codeblock]\n" "# Instance a scene.\n" -"var diamond = preload(\"res://diamond.tscn\").instance()\n" +"var diamond = preload(\"res://diamond.tscn\").instantiate()\n" "[/codeblock]" msgstr "" @@ -13872,7 +13872,7 @@ msgid "" "Example of usage with custom scene instance:\n" "[codeblock]\n" "func _make_custom_tooltip(for_text):\n" -" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n" +" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n" " tooltip.get_node(\"Label\").text = for_text\n" " return tooltip\n" "[/codeblock]" @@ -34738,7 +34738,7 @@ msgid "" "[codeblock]\n" "# Use `load()` instead of `preload()` if the path isn't known at compile-" "time.\n" -"var scene = preload(\"res://scene.tscn\").instance()\n" +"var scene = preload(\"res://scene.tscn\").instantiate()\n" "# Add the node as a child of the node the script is attached to.\n" "add_child(scene)\n" "[/codeblock]\n" diff --git a/doc/translations/ro.po b/doc/translations/ro.po index 5f018aa497..b25c3911cc 100644 --- a/doc/translations/ro.po +++ b/doc/translations/ro.po @@ -709,7 +709,7 @@ msgid "" "the FileSystem dock into the script.\n" "[codeblock]\n" "# Instance a scene.\n" -"var diamond = preload(\"res://diamond.tscn\").instance()\n" +"var diamond = preload(\"res://diamond.tscn\").instantiate()\n" "[/codeblock]" msgstr "" @@ -13833,7 +13833,7 @@ msgid "" "Example of usage with custom scene instance:\n" "[codeblock]\n" "func _make_custom_tooltip(for_text):\n" -" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n" +" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n" " tooltip.get_node(\"Label\").text = for_text\n" " return tooltip\n" "[/codeblock]" @@ -34699,7 +34699,7 @@ msgid "" "[codeblock]\n" "# Use `load()` instead of `preload()` if the path isn't known at compile-" "time.\n" -"var scene = preload(\"res://scene.tscn\").instance()\n" +"var scene = preload(\"res://scene.tscn\").instantiate()\n" "# Add the node as a child of the node the script is attached to.\n" "add_child(scene)\n" "[/codeblock]\n" diff --git a/doc/translations/ru.po b/doc/translations/ru.po index 0d227beff7..cf5289d7f9 100644 --- a/doc/translations/ru.po +++ b/doc/translations/ru.po @@ -1072,7 +1072,7 @@ msgid "" "the FileSystem dock into the script.\n" "[codeblock]\n" "# Instance a scene.\n" -"var diamond = preload(\"res://diamond.tscn\").instance()\n" +"var diamond = preload(\"res://diamond.tscn\").instantiate()\n" "[/codeblock]" msgstr "" @@ -14338,7 +14338,7 @@ msgid "" "Example of usage with custom scene instance:\n" "[codeblock]\n" "func _make_custom_tooltip(for_text):\n" -" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n" +" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n" " tooltip.get_node(\"Label\").text = for_text\n" " return tooltip\n" "[/codeblock]" @@ -35238,7 +35238,7 @@ msgid "" "[codeblock]\n" "# Use `load()` instead of `preload()` if the path isn't known at compile-" "time.\n" -"var scene = preload(\"res://scene.tscn\").instance()\n" +"var scene = preload(\"res://scene.tscn\").instantiate()\n" "# Add the node as a child of the node the script is attached to.\n" "add_child(scene)\n" "[/codeblock]\n" diff --git a/doc/translations/sr_Cyrl.po b/doc/translations/sr_Cyrl.po index d53711d996..06399d5e87 100644 --- a/doc/translations/sr_Cyrl.po +++ b/doc/translations/sr_Cyrl.po @@ -719,7 +719,7 @@ msgid "" "the FileSystem dock into the script.\n" "[codeblock]\n" "# Instance a scene.\n" -"var diamond = preload(\"res://diamond.tscn\").instance()\n" +"var diamond = preload(\"res://diamond.tscn\").instantiate()\n" "[/codeblock]" msgstr "" @@ -13843,7 +13843,7 @@ msgid "" "Example of usage with custom scene instance:\n" "[codeblock]\n" "func _make_custom_tooltip(for_text):\n" -" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n" +" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n" " tooltip.get_node(\"Label\").text = for_text\n" " return tooltip\n" "[/codeblock]" @@ -34709,7 +34709,7 @@ msgid "" "[codeblock]\n" "# Use `load()` instead of `preload()` if the path isn't known at compile-" "time.\n" -"var scene = preload(\"res://scene.tscn\").instance()\n" +"var scene = preload(\"res://scene.tscn\").instantiate()\n" "# Add the node as a child of the node the script is attached to.\n" "add_child(scene)\n" "[/codeblock]\n" diff --git a/doc/translations/th.po b/doc/translations/th.po index 7686e22f19..cdf1c6d7e2 100644 --- a/doc/translations/th.po +++ b/doc/translations/th.po @@ -725,7 +725,7 @@ msgid "" "the FileSystem dock into the script.\n" "[codeblock]\n" "# Instance a scene.\n" -"var diamond = preload(\"res://diamond.tscn\").instance()\n" +"var diamond = preload(\"res://diamond.tscn\").instantiate()\n" "[/codeblock]" msgstr "" @@ -13849,7 +13849,7 @@ msgid "" "Example of usage with custom scene instance:\n" "[codeblock]\n" "func _make_custom_tooltip(for_text):\n" -" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n" +" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n" " tooltip.get_node(\"Label\").text = for_text\n" " return tooltip\n" "[/codeblock]" @@ -34715,7 +34715,7 @@ msgid "" "[codeblock]\n" "# Use `load()` instead of `preload()` if the path isn't known at compile-" "time.\n" -"var scene = preload(\"res://scene.tscn\").instance()\n" +"var scene = preload(\"res://scene.tscn\").instantiate()\n" "# Add the node as a child of the node the script is attached to.\n" "add_child(scene)\n" "[/codeblock]\n" diff --git a/doc/translations/tr.po b/doc/translations/tr.po index df9897f1d6..646a3fb5b3 100644 --- a/doc/translations/tr.po +++ b/doc/translations/tr.po @@ -701,7 +701,7 @@ msgid "" "the FileSystem dock into the script.\n" "[codeblock]\n" "# Instance a scene.\n" -"var diamond = preload(\"res://diamond.tscn\").instance()\n" +"var diamond = preload(\"res://diamond.tscn\").instantiate()\n" "[/codeblock]" msgstr "" @@ -13825,7 +13825,7 @@ msgid "" "Example of usage with custom scene instance:\n" "[codeblock]\n" "func _make_custom_tooltip(for_text):\n" -" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n" +" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n" " tooltip.get_node(\"Label\").text = for_text\n" " return tooltip\n" "[/codeblock]" @@ -34691,7 +34691,7 @@ msgid "" "[codeblock]\n" "# Use `load()` instead of `preload()` if the path isn't known at compile-" "time.\n" -"var scene = preload(\"res://scene.tscn\").instance()\n" +"var scene = preload(\"res://scene.tscn\").instantiate()\n" "# Add the node as a child of the node the script is attached to.\n" "add_child(scene)\n" "[/codeblock]\n" diff --git a/doc/translations/uk.po b/doc/translations/uk.po index d1296da87a..c2232d81ab 100644 --- a/doc/translations/uk.po +++ b/doc/translations/uk.po @@ -787,7 +787,7 @@ msgid "" "the FileSystem dock into the script.\n" "[codeblock]\n" "# Instance a scene.\n" -"var diamond = preload(\"res://diamond.tscn\").instance()\n" +"var diamond = preload(\"res://diamond.tscn\").instantiate()\n" "[/codeblock]" msgstr "" @@ -13911,7 +13911,7 @@ msgid "" "Example of usage with custom scene instance:\n" "[codeblock]\n" "func _make_custom_tooltip(for_text):\n" -" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n" +" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n" " tooltip.get_node(\"Label\").text = for_text\n" " return tooltip\n" "[/codeblock]" @@ -34777,7 +34777,7 @@ msgid "" "[codeblock]\n" "# Use `load()` instead of `preload()` if the path isn't known at compile-" "time.\n" -"var scene = preload(\"res://scene.tscn\").instance()\n" +"var scene = preload(\"res://scene.tscn\").instantiate()\n" "# Add the node as a child of the node the script is attached to.\n" "add_child(scene)\n" "[/codeblock]\n" diff --git a/doc/translations/zh_Hans.po b/doc/translations/zh_Hans.po index edfb11dec1..40d1eb68bc 100644 --- a/doc/translations/zh_Hans.po +++ b/doc/translations/zh_Hans.po @@ -934,7 +934,7 @@ msgid "" "the FileSystem dock into the script.\n" "[codeblock]\n" "# Instance a scene.\n" -"var diamond = preload(\"res://diamond.tscn\").instance()\n" +"var diamond = preload(\"res://diamond.tscn\").instantiate()\n" "[/codeblock]" msgstr "" @@ -14058,7 +14058,7 @@ msgid "" "Example of usage with custom scene instance:\n" "[codeblock]\n" "func _make_custom_tooltip(for_text):\n" -" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n" +" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n" " tooltip.get_node(\"Label\").text = for_text\n" " return tooltip\n" "[/codeblock]" @@ -34928,7 +34928,7 @@ msgid "" "[codeblock]\n" "# Use `load()` instead of `preload()` if the path isn't known at compile-" "time.\n" -"var scene = preload(\"res://scene.tscn\").instance()\n" +"var scene = preload(\"res://scene.tscn\").instantiate()\n" "# Add the node as a child of the node the script is attached to.\n" "add_child(scene)\n" "[/codeblock]\n" diff --git a/doc/translations/zh_Hant.po b/doc/translations/zh_Hant.po index 3afec7ead8..13515dff67 100644 --- a/doc/translations/zh_Hant.po +++ b/doc/translations/zh_Hant.po @@ -738,7 +738,7 @@ msgid "" "the FileSystem dock into the script.\n" "[codeblock]\n" "# Instance a scene.\n" -"var diamond = preload(\"res://diamond.tscn\").instance()\n" +"var diamond = preload(\"res://diamond.tscn\").instantiate()\n" "[/codeblock]" msgstr "" @@ -13862,7 +13862,7 @@ msgid "" "Example of usage with custom scene instance:\n" "[codeblock]\n" "func _make_custom_tooltip(for_text):\n" -" var tooltip = preload(\"SomeTooltipScene.tscn\").instance()\n" +" var tooltip = preload(\"SomeTooltipScene.tscn\").instantiate()\n" " tooltip.get_node(\"Label\").text = for_text\n" " return tooltip\n" "[/codeblock]" @@ -34728,7 +34728,7 @@ msgid "" "[codeblock]\n" "# Use `load()` instead of `preload()` if the path isn't known at compile-" "time.\n" -"var scene = preload(\"res://scene.tscn\").instance()\n" +"var scene = preload(\"res://scene.tscn\").instantiate()\n" "# Add the node as a child of the node the script is attached to.\n" "add_child(scene)\n" "[/codeblock]\n" diff --git a/drivers/png/image_loader_png.cpp b/drivers/png/image_loader_png.cpp index 8cc76b01e1..f7f7f2dd22 100644 --- a/drivers/png/image_loader_png.cpp +++ b/drivers/png/image_loader_png.cpp @@ -59,7 +59,7 @@ void ImageLoaderPNG::get_recognized_extensions(List<String> *p_extensions) const Ref<Image> ImageLoaderPNG::load_mem_png(const uint8_t *p_png, int p_size) { Ref<Image> img; - img.instance(); + img.instantiate(); // the value of p_force_linear does not matter since it only applies to 16 bit Error err = PNGDriverCommon::png_to_image(p_png, p_size, false, img); diff --git a/drivers/register_driver_types.cpp b/drivers/register_driver_types.cpp index 18262c74c4..83702ea2cc 100644 --- a/drivers/register_driver_types.cpp +++ b/drivers/register_driver_types.cpp @@ -40,7 +40,7 @@ void register_core_driver_types() { image_loader_png = memnew(ImageLoaderPNG); ImageLoader::add_image_format_loader(image_loader_png); - resource_saver_png.instance(); + resource_saver_png.instantiate(); ResourceSaver::add_resource_format_saver(resource_saver_png); } 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<InputEventMouseButton> 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<InputEventJoypadButton> 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<InputEventJoypadMotion> 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<InputEventKey> 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<InputEventMouseButton> 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<InputEventJoypadMotion> 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<Animation> AnimationTrackEditor::_create_and_get_reset_animation() { return player->get_animation("RESET"); } else { Ref<Animation> 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<AnimationTrackEditDefaultPlugin> 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<AudioStreamPreview> 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<PropertyInfo>::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<StyleBoxEmpty> 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<Image> 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<Image> 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<StringName> inheriting_classes; ClassDB::get_direct_inheriters_from_class(p_class_name, &inheriting_classes); for (List<StringName>::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<Chart> &charts, int &r_width, int &r_h } Ref<BitMap> 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<AudioEffect>(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<StringName::AlphCompare>(); for (List<StringName>::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<AudioBusLayout> 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<PackedScene> ps = res; - n = ps->instance(); + n = ps->instantiate(); } else if (res->is_class("Script")) { Ref<Script> s = res; StringName ibt = s->get_instance_base_type(); bool valid_type = ClassDB::is_parent_class(ibt, "Node"); ERR_FAIL_COND_V_MSG(!valid_type, nullptr, "Script does not inherit a Node: " + p_path + "."); - Object *obj = ClassDB::instance(ibt); + Object *obj = ClassDB::instantiate(ibt); ERR_FAIL_COND_V_MSG(obj == nullptr, nullptr, "Cannot instance script for autoload, expected 'Node' inheritance, got: " + String(ibt) + "."); diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index 56c6a416af..3823d7e14f 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -476,7 +476,7 @@ Variant EditorData::instance_custom_type(const String &p_type, const String &p_i if (get_custom_types()[p_inherits][i].name == p_type) { Ref<Script> script = get_custom_types()[p_inherits][i].script; - Variant ob = ClassDB::instance(p_inherits); + Variant ob = ClassDB::instantiate(p_inherits); ERR_FAIL_COND_V(!ob, Variant()); Node *n = Object::cast_to<Node>(ob); if (n) { @@ -603,7 +603,7 @@ bool EditorData::check_and_update_scene(int p_idx) { if (must_reload) { Ref<PackedScene> pscene; - pscene.instance(); + pscene.instantiate(); EditorProgress ep("update_scene", TTR("Updating Scene"), 2); ep.step(TTR("Storing local changes..."), 0); @@ -611,7 +611,7 @@ bool EditorData::check_and_update_scene(int p_idx) { Error err = pscene->pack(edited_scene[p_idx].root); ERR_FAIL_COND_V(err != OK, false); ep.step(TTR("Updating scene..."), 1); - Node *new_scene = pscene->instance(PackedScene::GEN_EDIT_STATE_MAIN); + Node *new_scene = pscene->instantiate(PackedScene::GEN_EDIT_STATE_MAIN); ERR_FAIL_COND_V(!new_scene, false); //transfer selection @@ -908,7 +908,7 @@ StringName EditorData::script_class_get_base(const String &p_class) const { Variant EditorData::script_class_instance(const String &p_class) { if (ScriptServer::is_global_class(p_class)) { - Variant obj = ClassDB::instance(ScriptServer::get_global_class_native_base(p_class)); + Variant obj = ClassDB::instantiate(ScriptServer::get_global_class_native_base(p_class)); if (obj) { Ref<Script> script = script_class_load_script(p_class); if (script.is_valid()) { diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index 7c5a06107d..fc483b46b7 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -430,7 +430,7 @@ bool EditorExportPlatform::exists_export_template(String template_file_name, Str Ref<EditorExportPreset> EditorExportPlatform::create_preset() { Ref<EditorExportPreset> preset; - preset.instance(); + preset.instantiate(); preset->platform = Ref<EditorExportPlatform>(this); List<ExportOption> options; @@ -873,7 +873,7 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> & if (FileAccess::exists(path + ".import")) { //file is imported, replace by what it imports Ref<ConfigFile> config; - config.instance(); + config.instantiate(); err = config->load(path + ".import"); if (err != OK) { ERR_PRINT("Could not parse: '" + path + "', not exported."); @@ -1391,7 +1391,7 @@ EditorExport *EditorExport::singleton = nullptr; void EditorExport::_save() { Ref<ConfigFile> config; - config.instance(); + config.instantiate(); for (int i = 0; i < export_presets.size(); i++) { Ref<EditorExportPreset> preset = export_presets[i]; String section = "preset." + itos(i); @@ -1546,7 +1546,7 @@ void EditorExport::_notification(int p_what) { void EditorExport::load_config() { Ref<ConfigFile> config; - config.instance(); + config.instantiate(); Error err = config->load("res://export_presets.cfg"); if (err != OK) { return; diff --git a/editor/editor_feature_profile.cpp b/editor/editor_feature_profile.cpp index 4151c51b26..58d2b6e86e 100644 --- a/editor/editor_feature_profile.cpp +++ b/editor/editor_feature_profile.cpp @@ -311,7 +311,7 @@ void EditorFeatureProfileManager::_notification(int p_what) { if (p_what == NOTIFICATION_READY) { current_profile = EDITOR_GET("_default_feature_profile"); if (current_profile != String()) { - current.instance(); + current.instantiate(); Error err = current->load_from_file(EditorSettings::get_singleton()->get_feature_profiles_dir().plus_file(current_profile + ".profile")); if (err != OK) { ERR_PRINT("Error loading default feature profile: " + current_profile); @@ -473,7 +473,7 @@ void EditorFeatureProfileManager::_create_new_profile() { } Ref<EditorFeatureProfile> new_profile; - new_profile.instance(); + new_profile.instantiate(); new_profile->save_to_file(file); _update_profile_list(name); @@ -730,7 +730,7 @@ void EditorFeatureProfileManager::_update_selected_profile() { ERR_FAIL_COND(current.is_null()); //nothing selected, current should never be null } else { //reload edited, if different from current - edited.instance(); + edited.instantiate(); Error err = edited->load_from_file(EditorSettings::get_singleton()->get_feature_profiles_dir().plus_file(profile + ".profile")); ERR_FAIL_COND_MSG(err != OK, "Error when loading EditorSettings from file '" + EditorSettings::get_singleton()->get_feature_profiles_dir().plus_file(profile + ".profile") + "'."); } @@ -779,7 +779,7 @@ void EditorFeatureProfileManager::_import_profiles(const Vector<String> &p_paths //test it first for (int i = 0; i < p_paths.size(); i++) { Ref<EditorFeatureProfile> profile; - profile.instance(); + profile.instantiate(); Error err = profile->load_from_file(p_paths[i]); String basefile = p_paths[i].get_file(); if (err != OK) { @@ -798,7 +798,7 @@ void EditorFeatureProfileManager::_import_profiles(const Vector<String> &p_paths //do it second for (int i = 0; i < p_paths.size(); i++) { Ref<EditorFeatureProfile> profile; - profile.instance(); + profile.instantiate(); Error err = profile->load_from_file(p_paths[i]); ERR_CONTINUE(err != OK); String basefile = p_paths[i].get_file(); diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index f3cee7576d..fe4c6f490d 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -1544,7 +1544,7 @@ EditorFileDialog::EditorFileDialog() { pathhb->add_child(memnew(VSeparator)); Ref<ButtonGroup> view_mode_group; - view_mode_group.instance(); + view_mode_group.instantiate(); mode_thumbnails = memnew(Button); mode_thumbnails->set_flat(true); diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index 3f715c1f93..a2507f3cf2 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -1524,7 +1524,7 @@ Error EditorFileSystem::_reimport_group(const String &p_group_file, const Vector Map<String, String> base_paths; for (int i = 0; i < p_files.size(); i++) { Ref<ConfigFile> config; - config.instance(); + config.instantiate(); Error err = config->load(p_files[i] + ".import"); ERR_CONTINUE(err != OK); ERR_CONTINUE(!config->has_section_key("remap", "importer")); @@ -1706,7 +1706,7 @@ void EditorFileSystem::_reimport_file(const String &p_file, const Map<StringName //use existing if (p_custom_options == nullptr) { Ref<ConfigFile> cf; - cf.instance(); + cf.instantiate(); Error err = cf->load(p_file + ".import"); if (err == OK) { if (cf->has_section("params")) { @@ -2068,7 +2068,7 @@ void EditorFileSystem::_move_group_files(EditorFileSystemDirectory *efd, const S files[i]->import_group_file = p_new_location; Ref<ConfigFile> config; - config.instance(); + config.instantiate(); String path = efd->get_file_path(i) + ".import"; Error err = config->load(path); if (err != OK) { diff --git a/editor/editor_folding.cpp b/editor/editor_folding.cpp index 4030aecbf5..5d6c415d39 100644 --- a/editor/editor_folding.cpp +++ b/editor/editor_folding.cpp @@ -50,7 +50,7 @@ Vector<String> EditorFolding::_get_unfolds(const Object *p_object) { void EditorFolding::save_resource_folding(const RES &p_resource, const String &p_path) { Ref<ConfigFile> config; - config.instance(); + config.instantiate(); Vector<String> unfolds = _get_unfolds(p_resource.ptr()); config->set_value("folding", "sections_unfolded", unfolds); @@ -70,7 +70,7 @@ void EditorFolding::_set_unfolds(Object *p_object, const Vector<String> &p_unfol void EditorFolding::load_resource_folding(RES p_resource, const String &p_path) { Ref<ConfigFile> config; - config.instance(); + config.instantiate(); String file = p_path.get_file() + "-folding-" + p_path.md5_text() + ".cfg"; file = EditorSettings::get_singleton()->get_project_settings_dir().plus_file(file); @@ -137,7 +137,7 @@ void EditorFolding::save_scene_folding(const Node *p_scene, const String &p_path } Ref<ConfigFile> config; - config.instance(); + config.instantiate(); Array unfolds, res_unfolds; Set<RES> resources; @@ -155,7 +155,7 @@ void EditorFolding::save_scene_folding(const Node *p_scene, const String &p_path void EditorFolding::load_scene_folding(Node *p_scene, const String &p_path) { Ref<ConfigFile> config; - config.instance(); + config.instantiate(); String path = EditorSettings::get_singleton()->get_project_settings_dir(); String file = p_path.get_file() + "-folding-" + p_path.md5_text() + ".cfg"; diff --git a/editor/editor_fonts.cpp b/editor/editor_fonts.cpp index 2f5451fba3..d548196a2d 100644 --- a/editor/editor_fonts.cpp +++ b/editor/editor_fonts.cpp @@ -55,7 +55,7 @@ // the custom spacings might only work with Noto Sans #define MAKE_DEFAULT_FONT(m_name) \ Ref<Font> m_name; \ - m_name.instance(); \ + m_name.instantiate(); \ if (CustomFont.is_valid()) { \ m_name->add_data(CustomFont); \ m_name->add_data(DefaultFont); \ @@ -68,7 +68,7 @@ #define MAKE_BOLD_FONT(m_name) \ Ref<Font> m_name; \ - m_name.instance(); \ + m_name.instantiate(); \ if (CustomFontBold.is_valid()) { \ m_name->add_data(CustomFontBold); \ m_name->add_data(DefaultFontBold); \ @@ -81,7 +81,7 @@ #define MAKE_SOURCE_FONT(m_name) \ Ref<Font> m_name; \ - m_name.instance(); \ + m_name.instantiate(); \ if (CustomFontSource.is_valid()) { \ m_name->add_data(CustomFontSource); \ m_name->add_data(dfmono); \ @@ -129,7 +129,7 @@ void editor_register_fonts(Ref<Theme> p_theme) { String custom_font_path = EditorSettings::get_singleton()->get("interface/editor/main_font"); Ref<FontData> CustomFont; if (custom_font_path.length() > 0 && dir->file_exists(custom_font_path)) { - CustomFont.instance(); + CustomFont.instantiate(); CustomFont->load_resource(custom_font_path, default_font_size); CustomFont->set_antialiased(font_antialiased); CustomFont->set_hinting(font_hinting); @@ -143,7 +143,7 @@ void editor_register_fonts(Ref<Theme> p_theme) { String custom_font_path_bold = EditorSettings::get_singleton()->get("interface/editor/main_font_bold"); Ref<FontData> CustomFontBold; if (custom_font_path_bold.length() > 0 && dir->file_exists(custom_font_path_bold)) { - CustomFontBold.instance(); + CustomFontBold.instantiate(); CustomFontBold->load_resource(custom_font_path_bold, default_font_size); CustomFontBold->set_antialiased(font_antialiased); CustomFontBold->set_hinting(font_hinting); @@ -157,7 +157,7 @@ void editor_register_fonts(Ref<Theme> p_theme) { String custom_font_path_source = EditorSettings::get_singleton()->get("interface/editor/code_font"); Ref<FontData> CustomFontSource; if (custom_font_path_source.length() > 0 && dir->file_exists(custom_font_path_source)) { - CustomFontSource.instance(); + CustomFontSource.instantiate(); CustomFontSource->load_resource(custom_font_path_source, default_font_size); CustomFontSource->set_antialiased(font_antialiased); CustomFontSource->set_hinting(font_hinting); @@ -178,105 +178,105 @@ void editor_register_fonts(Ref<Theme> p_theme) { /* Droid Sans */ Ref<FontData> DefaultFont; - DefaultFont.instance(); + DefaultFont.instantiate(); DefaultFont->load_memory(_font_NotoSansUI_Regular, _font_NotoSansUI_Regular_size, "ttf", default_font_size); DefaultFont->set_antialiased(font_antialiased); DefaultFont->set_hinting(font_hinting); DefaultFont->set_force_autohinter(true); //just looks better..i think? Ref<FontData> DefaultFontBold; - DefaultFontBold.instance(); + DefaultFontBold.instantiate(); DefaultFontBold->load_memory(_font_NotoSansUI_Bold, _font_NotoSansUI_Bold_size, "ttf", default_font_size); DefaultFontBold->set_antialiased(font_antialiased); DefaultFontBold->set_hinting(font_hinting); DefaultFontBold->set_force_autohinter(true); // just looks better..i think? Ref<FontData> FontFallback; - FontFallback.instance(); + FontFallback.instantiate(); FontFallback->load_memory(_font_DroidSansFallback, _font_DroidSansFallback_size, "ttf", default_font_size); FontFallback->set_antialiased(font_antialiased); FontFallback->set_hinting(font_hinting); FontFallback->set_force_autohinter(true); //just looks better..i think? Ref<FontData> FontJapanese; - FontJapanese.instance(); + FontJapanese.instantiate(); FontJapanese->load_memory(_font_DroidSansJapanese, _font_DroidSansJapanese_size, "ttf", default_font_size); FontJapanese->set_antialiased(font_antialiased); FontJapanese->set_hinting(font_hinting); FontJapanese->set_force_autohinter(true); //just looks better..i think? Ref<FontData> FontArabic; - FontArabic.instance(); + FontArabic.instantiate(); FontArabic->load_memory(_font_NotoNaskhArabicUI_Regular, _font_NotoNaskhArabicUI_Regular_size, "ttf", default_font_size); FontArabic->set_antialiased(font_antialiased); FontArabic->set_hinting(font_hinting); FontArabic->set_force_autohinter(true); //just looks better..i think? Ref<FontData> FontBengali; - FontBengali.instance(); + FontBengali.instantiate(); FontBengali->load_memory(_font_NotoSansBengali_Regular, _font_NotoSansBengali_Regular_size, "ttf", default_font_size); FontBengali->set_antialiased(font_antialiased); FontBengali->set_hinting(font_hinting); FontBengali->set_force_autohinter(true); //just looks better..i think? Ref<FontData> FontGeorgian; - FontGeorgian.instance(); + FontGeorgian.instantiate(); FontGeorgian->load_memory(_font_NotoSansGeorgian_Regular, _font_NotoSansGeorgian_Regular_size, "ttf", default_font_size); FontGeorgian->set_antialiased(font_antialiased); FontGeorgian->set_hinting(font_hinting); FontGeorgian->set_force_autohinter(true); //just looks better..i think? Ref<FontData> FontHebrew; - FontHebrew.instance(); + FontHebrew.instantiate(); FontHebrew->load_memory(_font_NotoSansHebrew_Regular, _font_NotoSansHebrew_Regular_size, "ttf", default_font_size); FontHebrew->set_antialiased(font_antialiased); FontHebrew->set_hinting(font_hinting); FontHebrew->set_force_autohinter(true); //just looks better..i think? Ref<FontData> FontMalayalam; - FontMalayalam.instance(); + FontMalayalam.instantiate(); FontMalayalam->load_memory(_font_NotoSansMalayalamUI_Regular, _font_NotoSansMalayalamUI_Regular_size, "ttf", default_font_size); FontMalayalam->set_antialiased(font_antialiased); FontMalayalam->set_hinting(font_hinting); FontMalayalam->set_force_autohinter(true); //just looks better..i think? Ref<FontData> FontOriya; - FontOriya.instance(); + FontOriya.instantiate(); FontOriya->load_memory(_font_NotoSansOriyaUI_Regular, _font_NotoSansOriyaUI_Regular_size, "ttf", default_font_size); FontOriya->set_antialiased(font_antialiased); FontOriya->set_hinting(font_hinting); FontOriya->set_force_autohinter(true); //just looks better..i think? Ref<FontData> FontSinhala; - FontSinhala.instance(); + FontSinhala.instantiate(); FontSinhala->load_memory(_font_NotoSansSinhalaUI_Regular, _font_NotoSansSinhalaUI_Regular_size, "ttf", default_font_size); FontSinhala->set_antialiased(font_antialiased); FontSinhala->set_hinting(font_hinting); FontSinhala->set_force_autohinter(true); //just looks better..i think? Ref<FontData> FontTamil; - FontTamil.instance(); + FontTamil.instantiate(); FontTamil->load_memory(_font_NotoSansTamilUI_Regular, _font_NotoSansTamilUI_Regular_size, "ttf", default_font_size); FontTamil->set_antialiased(font_antialiased); FontTamil->set_hinting(font_hinting); FontTamil->set_force_autohinter(true); //just looks better..i think? Ref<FontData> FontTelugu; - FontTelugu.instance(); + FontTelugu.instantiate(); FontTelugu->load_memory(_font_NotoSansTeluguUI_Regular, _font_NotoSansTeluguUI_Regular_size, "ttf", default_font_size); FontTelugu->set_antialiased(font_antialiased); FontTelugu->set_hinting(font_hinting); FontTelugu->set_force_autohinter(true); //just looks better..i think? Ref<FontData> FontThai; - FontThai.instance(); + FontThai.instantiate(); FontThai->load_memory(_font_NotoSansThaiUI_Regular, _font_NotoSansThaiUI_Regular_size, "ttf", default_font_size); FontThai->set_antialiased(font_antialiased); FontThai->set_hinting(font_hinting); FontThai->set_force_autohinter(true); //just looks better..i think? Ref<FontData> FontHindi; - FontHindi.instance(); + FontHindi.instantiate(); FontHindi->load_memory(_font_NotoSansDevanagariUI_Regular, _font_NotoSansDevanagariUI_Regular_size, "ttf", default_font_size); FontHindi->set_antialiased(font_antialiased); FontHindi->set_hinting(font_hinting); @@ -285,7 +285,7 @@ void editor_register_fonts(Ref<Theme> p_theme) { /* Hack */ Ref<FontData> dfmono; - dfmono.instance(); + dfmono.instantiate(); dfmono->load_memory(_font_Hack_Regular, _font_Hack_Regular_size, "ttf", default_font_size); dfmono->set_antialiased(font_antialiased); dfmono->set_hinting(font_hinting); diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 69709315ff..cfce37ea1b 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -417,7 +417,7 @@ bool EditorPropertyRevert::may_node_be_in_instance(Node *p_node) { return might_be; // or might not be } -bool EditorPropertyRevert::get_instanced_node_original_property(Node *p_node, const StringName &p_prop, Variant &value) { +bool EditorPropertyRevert::get_instantiated_node_original_property(Node *p_node, const StringName &p_prop, Variant &value) { Node *node = p_node; Node *orig = node; @@ -524,7 +524,7 @@ bool EditorPropertyRevert::can_property_revert(Object *p_object, const StringNam if (node && EditorPropertyRevert::may_node_be_in_instance(node)) { //check for difference including instantiation Variant vorig; - if (EditorPropertyRevert::get_instanced_node_original_property(node, p_property, vorig)) { + if (EditorPropertyRevert::get_instantiated_node_original_property(node, p_property, vorig)) { Variant v = p_object->get(p_property); if (EditorPropertyRevert::is_node_property_different(node, v, vorig)) { @@ -764,7 +764,7 @@ void EditorProperty::_gui_input(const Ref<InputEvent> &p_event) { Variant vorig; Node *node = Object::cast_to<Node>(object); - if (node && EditorPropertyRevert::may_node_be_in_instance(node) && EditorPropertyRevert::get_instanced_node_original_property(node, property, vorig)) { + if (node && EditorPropertyRevert::may_node_be_in_instance(node) && EditorPropertyRevert::get_instantiated_node_original_property(node, property, vorig)) { emit_changed(property, vorig.duplicate(true)); update_property(); return; diff --git a/editor/editor_inspector.h b/editor/editor_inspector.h index e4bcab3e3f..f493290b09 100644 --- a/editor/editor_inspector.h +++ b/editor/editor_inspector.h @@ -40,7 +40,7 @@ class UndoRedo; class EditorPropertyRevert { public: static bool may_node_be_in_instance(Node *p_node); - static bool get_instanced_node_original_property(Node *p_node, const StringName &p_prop, Variant &value); + static bool get_instantiated_node_original_property(Node *p_node, const StringName &p_prop, Variant &value); static bool is_node_property_different(Node *p_node, const Variant &p_current, const Variant &p_orig); static bool can_property_revert(Object *p_object, const StringName &p_property); @@ -83,7 +83,7 @@ private: bool draw_top_bg; bool _is_property_different(const Variant &p_current, const Variant &p_orig); - bool _get_instanced_node_original_property(const StringName &p_prop, Variant &value); + bool _get_instantiated_node_original_property(const StringName &p_prop, Variant &value); void _focusable_focused(int p_index); bool selectable; @@ -271,7 +271,7 @@ class EditorInspector : public ScrollContainer { VBoxContainer *main_vbox; - //map use to cache the instanced editors + //map use to cache the instantiated editors Map<StringName, List<EditorProperty *>> editor_property_map; List<EditorInspectorSection *> sections; Set<StringName> pending; diff --git a/editor/editor_layouts_dialog.cpp b/editor/editor_layouts_dialog.cpp index 0bf1863459..437841ccc1 100644 --- a/editor/editor_layouts_dialog.cpp +++ b/editor/editor_layouts_dialog.cpp @@ -83,7 +83,7 @@ void EditorLayoutsDialog::_post_popup() { layout_names->clear(); Ref<ConfigFile> config; - config.instance(); + config.instantiate(); Error err = config->load(EditorSettings::get_singleton()->get_editor_layouts_config()); if (err != OK) { return; diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp index 35d8021394..437de97332 100644 --- a/editor/editor_log.cpp +++ b/editor/editor_log.cpp @@ -103,7 +103,7 @@ void EditorLog::_start_state_save_timer() { void EditorLog::_save_state() { Ref<ConfigFile> config; - config.instance(); + config.instantiate(); // Load and amend existing config if it exists. config->load(EditorSettings::get_singleton()->get_project_settings_dir().plus_file("editor_layout.cfg")); @@ -122,7 +122,7 @@ void EditorLog::_load_state() { is_loading_state = true; Ref<ConfigFile> config; - config.instance(); + config.instantiate(); Error err = config->load(EditorSettings::get_singleton()->get_project_settings_dir().plus_file("editor_layout.cfg")); if (err == OK) { diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 719d3120da..f8c2f2910b 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -1243,7 +1243,7 @@ void EditorNode::_get_scene_metadata(const String &p_file) { String path = EditorSettings::get_singleton()->get_project_settings_dir().plus_file(p_file.get_file() + "-editstate-" + p_file.md5_text() + ".cfg"); Ref<ConfigFile> cf; - cf.instance(); + cf.instantiate(); Error err = cf->load(path); if (err != OK || !cf->has_section("editor_states")) { @@ -1277,7 +1277,7 @@ void EditorNode::_set_scene_metadata(const String &p_file, int p_idx) { String path = EditorSettings::get_singleton()->get_project_settings_dir().plus_file(p_file.get_file() + "-editstate-" + p_file.md5_text() + ".cfg"); Ref<ConfigFile> cf; - cf.instance(); + cf.instantiate(); Dictionary md; @@ -1422,7 +1422,7 @@ void EditorNode::_save_scene_with_preview(String p_file, int p_idx) { // We cannot fallback on the 2D editor, because it may not have been used yet, // which would result in an invalid texture. if (c3d == 0 && c2d == 0) { - img.instance(); + img.instantiate(); img->create(1, 1, false, Image::FORMAT_RGB8); } else if (c3d < c2d) { Ref<ViewportTexture> viewport_texture = scene_root->get_texture(); @@ -1607,16 +1607,16 @@ void EditorNode::_save_scene(String p_file, int idx) { if (ResourceCache::has(p_file)) { // something may be referencing this resource and we are good with that. // we must update it, but also let the previous scene state go, as - // old version still work for referencing changes in instanced or inherited scenes + // old version still work for referencing changes in instantiated or inherited scenes sdata = Ref<PackedScene>(Object::cast_to<PackedScene>(ResourceCache::get(p_file))); if (sdata.is_valid()) { sdata->recreate_state(); } else { - sdata.instance(); + sdata.instantiate(); } } else { - sdata.instance(); + sdata.instantiate(); } Error err = sdata->pack(scene); @@ -1840,11 +1840,11 @@ void EditorNode::_dialog_action(String p_file) { } Ref<ConfigFile> config; - config.instance(); + config.instantiate(); Error err = config->load(EditorSettings::get_singleton()->get_editor_layouts_config()); if (err == ERR_FILE_CANT_OPEN || err == ERR_FILE_NOT_FOUND) { - config.instance(); // new config + config.instantiate(); // new config } else if (err != OK) { show_warning(TTR("An error occurred while trying to save the editor layout.\nMake sure the editor's user data path is writable.")); return; @@ -1868,7 +1868,7 @@ void EditorNode::_dialog_action(String p_file) { } Ref<ConfigFile> config; - config.instance(); + config.instantiate(); Error err = config->load(EditorSettings::get_singleton()->get_editor_layouts_config()); if (err != OK || !config->has_section(p_file)) { @@ -2073,7 +2073,7 @@ void EditorNode::_edit_current() { editable_warning = TTR("This resource belongs to a scene that was imported, so it's not editable.\nPlease read the documentation relevant to importing scenes to better understand this workflow."); } else { if ((!get_edited_scene() || get_edited_scene()->get_filename() != base_path) && ResourceLoader::get_resource_type(base_path) == "PackedScene") { - editable_warning = TTR("This resource belongs to a scene that was instanced or inherited.\nChanges to it won't be kept when saving the current scene."); + editable_warning = TTR("This resource belongs to a scene that was instantiated or inherited.\nChanges to it won't be kept when saving the current scene."); } } } else if (current_res->get_path().is_resource_file()) { @@ -3135,7 +3135,7 @@ void EditorNode::set_addon_plugin_enabled(const String &p_addon, bool p_enabled, } Ref<ConfigFile> cf; - cf.instance(); + cf.instantiate(); if (!DirAccess::exists(p_addon.get_base_dir())) { _remove_plugin_from_enabled(p_addon); WARN_PRINT("Addon '" + p_addon + "' failed to load. No directory found. Removing from enabled plugins."); @@ -3516,7 +3516,7 @@ Error EditorNode::load_scene(const String &p_scene, bool p_ignore_broken_deps, b sdata->set_path(lpath, true); //take over path } - Node *new_scene = sdata->instance(PackedScene::GEN_EDIT_STATE_MAIN); + Node *new_scene = sdata->instantiate(PackedScene::GEN_EDIT_STATE_MAIN); if (!new_scene) { sdata.unref(); @@ -3580,11 +3580,11 @@ void EditorNode::open_request(const String &p_path) { } void EditorNode::request_instance_scene(const String &p_path) { - scene_tree_dock->instance(p_path); + scene_tree_dock->instantiate(p_path); } -void EditorNode::request_instance_scenes(const Vector<String> &p_files) { - scene_tree_dock->instance_scenes(p_files); +void EditorNode::request_instantiate_scenes(const Vector<String> &p_files) { + scene_tree_dock->instantiate_scenes(p_files); } ImportDock *EditorNode::get_import_dock() { @@ -3608,8 +3608,8 @@ void EditorNode::_inherit_request(String p_file) { _dialog_action(p_file); } -void EditorNode::_instance_request(const Vector<String> &p_files) { - request_instance_scenes(p_files); +void EditorNode::_instantiate_request(const Vector<String> &p_files) { + request_instantiate_scenes(p_files); } void EditorNode::_close_messages() { @@ -4343,7 +4343,7 @@ void EditorNode::_save_docks() { return; //scanning, do not touch docks } Ref<ConfigFile> config; - config.instance(); + config.instantiate(); // Load and amend existing config if it exists. config->load(EditorSettings::get_singleton()->get_project_settings_dir().plus_file("editor_layout.cfg")); @@ -4408,7 +4408,7 @@ void EditorNode::_dock_split_dragged(int ofs) { void EditorNode::_load_docks() { Ref<ConfigFile> config; - config.instance(); + config.instantiate(); Error err = config->load(EditorSettings::get_singleton()->get_project_settings_dir().plus_file("editor_layout.cfg")); if (err != OK) { //no config @@ -4641,7 +4641,7 @@ bool EditorNode::has_scenes_in_session() { return false; } Ref<ConfigFile> config; - config.instance(); + config.instantiate(); Error err = config->load(EditorSettings::get_singleton()->get_project_settings_dir().plus_file("editor_layout.cfg")); if (err != OK) { return false; @@ -4734,7 +4734,7 @@ void EditorNode::_update_layouts_menu() { editor_layouts->add_shortcut(ED_SHORTCUT("layout/default", TTR("Default")), SETTINGS_LAYOUT_DEFAULT); Ref<ConfigFile> config; - config.instance(); + config.instantiate(); Error err = config->load(EditorSettings::get_singleton()->get_editor_layouts_config()); if (err != OK) { return; //no config @@ -4777,7 +4777,7 @@ void EditorNode::_layout_menu_option(int p_id) { } break; default: { Ref<ConfigFile> config; - config.instance(); + config.instantiate(); Error err = config->load(EditorSettings::get_singleton()->get_editor_layouts_config()); if (err != OK) { return; //no config @@ -5328,7 +5328,7 @@ void EditorNode::reload_scene(const String &p_path) { if (scene_idx == -1) { if (get_edited_scene()) { - //scene is not open, so at it might be instanced. We'll refresh the whole scene later. + //scene is not open, so at it might be instantiated. We'll refresh the whole scene later. editor_data.get_undo_redo().clear_history(); } return; @@ -5725,87 +5725,87 @@ EditorNode::EditorNode() { { //register importers at the beginning, so dialogs are created with the right extensions Ref<ResourceImporterTexture> import_texture; - import_texture.instance(); + import_texture.instantiate(); ResourceFormatImporter::get_singleton()->add_importer(import_texture); Ref<ResourceImporterLayeredTexture> import_cubemap; - import_cubemap.instance(); + import_cubemap.instantiate(); import_cubemap->set_mode(ResourceImporterLayeredTexture::MODE_CUBEMAP); ResourceFormatImporter::get_singleton()->add_importer(import_cubemap); Ref<ResourceImporterLayeredTexture> import_array; - import_array.instance(); + import_array.instantiate(); import_array->set_mode(ResourceImporterLayeredTexture::MODE_2D_ARRAY); ResourceFormatImporter::get_singleton()->add_importer(import_array); Ref<ResourceImporterLayeredTexture> import_cubemap_array; - import_cubemap_array.instance(); + import_cubemap_array.instantiate(); import_cubemap_array->set_mode(ResourceImporterLayeredTexture::MODE_CUBEMAP_ARRAY); ResourceFormatImporter::get_singleton()->add_importer(import_cubemap_array); Ref<ResourceImporterLayeredTexture> import_3d; - import_3d.instance(); + import_3d.instantiate(); import_3d->set_mode(ResourceImporterLayeredTexture::MODE_3D); ResourceFormatImporter::get_singleton()->add_importer(import_3d); Ref<ResourceImporterImage> import_image; - import_image.instance(); + import_image.instantiate(); ResourceFormatImporter::get_singleton()->add_importer(import_image); Ref<ResourceImporterTextureAtlas> import_texture_atlas; - import_texture_atlas.instance(); + import_texture_atlas.instantiate(); ResourceFormatImporter::get_singleton()->add_importer(import_texture_atlas); Ref<ResourceImporterCSVTranslation> import_csv_translation; - import_csv_translation.instance(); + import_csv_translation.instantiate(); ResourceFormatImporter::get_singleton()->add_importer(import_csv_translation); Ref<ResourceImporterWAV> import_wav; - import_wav.instance(); + import_wav.instantiate(); ResourceFormatImporter::get_singleton()->add_importer(import_wav); Ref<ResourceImporterOBJ> import_obj; - import_obj.instance(); + import_obj.instantiate(); ResourceFormatImporter::get_singleton()->add_importer(import_obj); Ref<ResourceImporterShaderFile> import_shader_file; - import_shader_file.instance(); + import_shader_file.instantiate(); ResourceFormatImporter::get_singleton()->add_importer(import_shader_file); Ref<ResourceImporterScene> import_scene; - import_scene.instance(); + import_scene.instantiate(); ResourceFormatImporter::get_singleton()->add_importer(import_scene); { Ref<EditorSceneImporterCollada> import_collada; - import_collada.instance(); + import_collada.instantiate(); import_scene->add_importer(import_collada); Ref<EditorOBJImporter> import_obj2; - import_obj2.instance(); + import_obj2.instantiate(); import_scene->add_importer(import_obj2); Ref<EditorSceneImporterESCN> import_escn; - import_escn.instance(); + import_escn.instantiate(); import_scene->add_importer(import_escn); } Ref<ResourceImporterBitMap> import_bitmap; - import_bitmap.instance(); + import_bitmap.instantiate(); ResourceFormatImporter::get_singleton()->add_importer(import_bitmap); } { Ref<EditorInspectorDefaultPlugin> eidp; - eidp.instance(); + eidp.instantiate(); EditorInspector::add_inspector_plugin(eidp); Ref<EditorInspectorRootMotionPlugin> rmp; - rmp.instance(); + rmp.instantiate(); EditorInspector::add_inspector_plugin(rmp); Ref<EditorInspectorShaderModePlugin> smp; - smp.instance(); + smp.instantiate(); EditorInspector::add_inspector_plugin(smp); } @@ -6508,7 +6508,7 @@ EditorNode::EditorNode() { filesystem_dock = memnew(FileSystemDock(this)); filesystem_dock->connect("inherit", callable_mp(this, &EditorNode::_inherit_request)); - filesystem_dock->connect("instance", callable_mp(this, &EditorNode::_instance_request)); + filesystem_dock->connect("instance", callable_mp(this, &EditorNode::_instantiate_request)); filesystem_dock->connect("display_mode_changed", callable_mp(this, &EditorNode::_save_docks)); // Scene: Top left @@ -6548,7 +6548,7 @@ EditorNode::EditorNode() { const String docks_section = "docks"; overridden_default_layout = -1; - default_layout.instance(); + default_layout.instantiate(); // Dock numbers are based on DockSlot enum value + 1 default_layout->set_value(docks_section, "dock_3", "Scene,Import"); default_layout->set_value(docks_section, "dock_4", "FileSystem"); @@ -6829,31 +6829,31 @@ EditorNode::EditorNode() { { Ref<StandardMaterial3DConversionPlugin> spatial_mat_convert; - spatial_mat_convert.instance(); + spatial_mat_convert.instantiate(); resource_conversion_plugins.push_back(spatial_mat_convert); Ref<CanvasItemMaterialConversionPlugin> canvas_item_mat_convert; - canvas_item_mat_convert.instance(); + canvas_item_mat_convert.instantiate(); resource_conversion_plugins.push_back(canvas_item_mat_convert); Ref<ParticlesMaterialConversionPlugin> particles_mat_convert; - particles_mat_convert.instance(); + particles_mat_convert.instantiate(); resource_conversion_plugins.push_back(particles_mat_convert); Ref<ProceduralSkyMaterialConversionPlugin> procedural_sky_mat_convert; - procedural_sky_mat_convert.instance(); + procedural_sky_mat_convert.instantiate(); resource_conversion_plugins.push_back(procedural_sky_mat_convert); Ref<PanoramaSkyMaterialConversionPlugin> panorama_sky_mat_convert; - panorama_sky_mat_convert.instance(); + panorama_sky_mat_convert.instantiate(); resource_conversion_plugins.push_back(panorama_sky_mat_convert); Ref<PhysicalSkyMaterialConversionPlugin> physical_sky_mat_convert; - physical_sky_mat_convert.instance(); + physical_sky_mat_convert.instantiate(); resource_conversion_plugins.push_back(physical_sky_mat_convert); Ref<VisualShaderConversionPlugin> vshader_convert; - vshader_convert.instance(); + vshader_convert.instantiate(); resource_conversion_plugins.push_back(vshader_convert); } update_spinner_step_msec = OS::get_singleton()->get_ticks_msec(); @@ -6866,12 +6866,12 @@ EditorNode::EditorNode() { editor_plugins_force_input_forwarding = memnew(EditorPluginList); Ref<EditorExportTextSceneToBinaryPlugin> export_text_to_binary_plugin; - export_text_to_binary_plugin.instance(); + export_text_to_binary_plugin.instantiate(); EditorExport::get_singleton()->add_export_plugin(export_text_to_binary_plugin); Ref<PackedSceneEditorTranslationParserPlugin> packed_scene_translation_parser_plugin; - packed_scene_translation_parser_plugin.instance(); + packed_scene_translation_parser_plugin.instantiate(); EditorTranslationParser::get_singleton()->add_parser(packed_scene_translation_parser_plugin, EditorTranslationParser::STANDARD); _edit_current(); @@ -6892,7 +6892,7 @@ EditorNode::EditorNode() { saved_version = 1; unsaved_cache = true; - _last_instanced_scene = nullptr; + _last_instantiated_scene = nullptr; quick_open = memnew(EditorQuickOpen); gui_base->add_child(quick_open); diff --git a/editor/editor_node.h b/editor/editor_node.h index 037ed263c5..9a135cfdd7 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -332,7 +332,7 @@ private: EditorNativeShaderSourceVisualizer *native_shader_source_visualizer; String defer_load_scene; - Node *_last_instanced_scene; + Node *_last_instantiated_scene; EditorLog *log; CenterContainer *tabs_center; @@ -491,7 +491,7 @@ private: void _discard_changes(const String &p_str = String()); void _inherit_request(String p_file); - void _instance_request(const Vector<String> &p_files); + void _instantiate_request(const Vector<String> &p_files); void _display_top_editors(bool p_display); void _set_top_editors(Vector<EditorPlugin *> p_editor_plugins_over); @@ -770,7 +770,7 @@ public: static VSplitContainer *get_top_split() { return singleton->top_split; } void request_instance_scene(const String &p_path); - void request_instance_scenes(const Vector<String> &p_files); + void request_instantiate_scenes(const Vector<String> &p_files); FileSystemDock *get_filesystem_dock(); ImportDock *get_import_dock(); SceneTreeDock *get_scene_tree_dock(); diff --git a/editor/editor_plugin_settings.cpp b/editor/editor_plugin_settings.cpp index 1db24bb908..67ce1ade4d 100644 --- a/editor/editor_plugin_settings.cpp +++ b/editor/editor_plugin_settings.cpp @@ -57,7 +57,7 @@ void EditorPluginSettings::update_plugins() { for (int i = 0; i < plugins.size(); i++) { Ref<ConfigFile> cf; - cf.instance(); + cf.instantiate(); const String path = plugins[i]; Error err2 = cf->load(path); diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 3feeaec070..c28a61fecd 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -2535,7 +2535,7 @@ void EditorPropertyResource::_viewport_selected(const NodePath &p_path) { } Ref<ViewportTexture> vt; - vt.instance(); + vt.instantiate(); vt->set_viewport_path_in_scene(get_tree()->get_edited_scene_root()->get_path_to(to_node)); vt->setup_local_to_scene(); diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp index 66fabcd940..5c5b5fe0ab 100644 --- a/editor/editor_properties_array_dict.cpp +++ b/editor/editor_properties_array_dict.cpp @@ -572,7 +572,7 @@ void EditorPropertyArray::_bind_methods() { } EditorPropertyArray::EditorPropertyArray() { - object.instance(); + object.instantiate(); page_len = int(EDITOR_GET("interface/inspector/max_array_dictionary_items_per_page")); edit = memnew(Button); edit->set_h_size_flags(SIZE_EXPAND_FILL); @@ -971,7 +971,7 @@ void EditorPropertyDictionary::update_property() { PanelContainer *pc = memnew(PanelContainer); vbox->add_child(pc); Ref<StyleBoxFlat> flat; - flat.instance(); + flat.instantiate(); for (int j = 0; j < 4; j++) { flat->set_default_margin(Side(j), 2 * EDSCALE); } @@ -1066,7 +1066,7 @@ void EditorPropertyDictionary::_bind_methods() { } EditorPropertyDictionary::EditorPropertyDictionary() { - object.instance(); + object.instantiate(); page_len = int(EDITOR_GET("interface/inspector/max_array_dictionary_items_per_page")); edit = memnew(Button); edit->set_h_size_flags(SIZE_EXPAND_FILL); diff --git a/editor/editor_resource_picker.cpp b/editor/editor_resource_picker.cpp index b591007a93..350fc5eccb 100644 --- a/editor/editor_resource_picker.cpp +++ b/editor/editor_resource_picker.cpp @@ -271,7 +271,7 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) { } String orig_type = edited_resource->get_class(); - Object *inst = ClassDB::instance(orig_type); + Object *inst = ClassDB::instantiate(orig_type); Ref<Resource> unique_resource = Ref<Resource>(Object::cast_to<Resource>(inst)); ERR_FAIL_COND(unique_resource.is_null()); @@ -334,7 +334,7 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) { Variant obj; if (ScriptServer::is_global_class(intype)) { - obj = ClassDB::instance(ScriptServer::get_global_class_native_base(intype)); + obj = ClassDB::instantiate(ScriptServer::get_global_class_native_base(intype)); if (obj) { Ref<Script> script = ResourceLoader::load(ScriptServer::get_global_class_path(intype)); if (script.is_valid()) { @@ -342,7 +342,7 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) { } } } else { - obj = ClassDB::instance(intype); + obj = ClassDB::instantiate(intype); } if (!obj) { @@ -395,7 +395,7 @@ void EditorResourcePicker::set_create_options(Object *p_menu_node) { } } - if (!is_custom_resource && !(ScriptServer::is_global_class(t) || ClassDB::can_instance(t))) { + if (!is_custom_resource && !(ScriptServer::is_global_class(t) || ClassDB::can_instantiate(t))) { continue; } diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp index 0f1b70936a..f904ae80a7 100644 --- a/editor/editor_resource_preview.cpp +++ b/editor/editor_resource_preview.cpp @@ -177,7 +177,7 @@ void EditorResourcePreview::_generate_preview(Ref<ImageTexture> &r_texture, Ref< Ref<Image> small_image = r_texture->get_image(); small_image = small_image->duplicate(); small_image->resize(small_thumbnail_size, small_thumbnail_size, Image::INTERPOLATE_CUBIC); - r_small_texture.instance(); + r_small_texture.instantiate(); r_small_texture->create_from_image(small_image); } @@ -293,21 +293,21 @@ void EditorResourcePreview::_thread() { if (cache_valid) { Ref<Image> img; - img.instance(); + img.instantiate(); Ref<Image> small_img; - small_img.instance(); + small_img.instantiate(); if (img->load(cache_base + ".png") != OK) { cache_valid = false; } else { - texture.instance(); + texture.instantiate(); texture->create_from_image(img); if (has_small_texture) { if (small_img->load(cache_base + "_small.png") != OK) { cache_valid = false; } else { - small_texture.instance(); + small_texture.instantiate(); small_texture->create_from_image(small_img); } } diff --git a/editor/editor_run_native.cpp b/editor/editor_run_native.cpp index 1ffa20d1ea..a604022391 100644 --- a/editor/editor_run_native.cpp +++ b/editor/editor_run_native.cpp @@ -49,7 +49,7 @@ void EditorRunNative::_notification(int p_what) { if (!im->is_empty()) { im->resize(16 * EDSCALE, 16 * EDSCALE); Ref<ImageTexture> small_icon; - small_icon.instance(); + small_icon.instantiate(); small_icon->create_from_image(im); MenuButton *mb = memnew(MenuButton); mb->get_popup()->connect("id_pressed", callable_mp(this, &EditorRunNative::_run_native), varray(i)); diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 325e0173ab..3f02b76ff6 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -79,7 +79,7 @@ bool EditorSettings::_set_only(const StringName &p_name, const Variant &p_value) Ref<InputEvent> shortcut = arr[i + 1]; Ref<Shortcut> sc; - sc.instance(); + sc.instantiate(); sc->set_shortcut(shortcut); add_shortcut(name, sc); } @@ -1476,7 +1476,7 @@ Ref<Shortcut> EditorSettings::get_shortcut(const String &p_name) const { Ref<Shortcut> sc; const Map<String, List<Ref<InputEvent>>>::Element *builtin_override = builtin_action_overrides.find(p_name); if (builtin_override) { - sc.instance(); + sc.instantiate(); sc->set_shortcut(builtin_override->get().front()->get()); sc->set_name(InputMap::get_singleton()->get_builtin_display_name(p_name)); } @@ -1485,7 +1485,7 @@ Ref<Shortcut> EditorSettings::get_shortcut(const String &p_name) const { if (sc.is_null()) { const OrderedHashMap<String, List<Ref<InputEvent>>>::ConstElement builtin_default = InputMap::get_singleton()->get_builtins().find(p_name); if (builtin_default) { - sc.instance(); + sc.instantiate(); sc->set_shortcut(builtin_default.get().front()->get()); sc->set_name(InputMap::get_singleton()->get_builtin_display_name(p_name)); } @@ -1528,7 +1528,7 @@ Ref<Shortcut> ED_SHORTCUT(const String &p_path, const String &p_name, uint32_t p Ref<InputEventKey> ie; if (p_keycode) { - ie.instance(); + ie.instantiate(); ie->set_unicode(p_keycode & KEY_CODE_MASK); ie->set_keycode(p_keycode & KEY_CODE_MASK); @@ -1540,7 +1540,7 @@ Ref<Shortcut> ED_SHORTCUT(const String &p_path, const String &p_name, uint32_t p if (!EditorSettings::get_singleton()) { Ref<Shortcut> sc; - sc.instance(); + sc.instantiate(); sc->set_name(p_name); sc->set_shortcut(ie); sc->set_meta("original", ie); @@ -1554,7 +1554,7 @@ Ref<Shortcut> ED_SHORTCUT(const String &p_path, const String &p_name, uint32_t p return sc; } - sc.instance(); + sc.instantiate(); sc->set_name(p_name); sc->set_shortcut(ie); sc->set_meta("original", ie); //to compare against changes diff --git a/editor/editor_spin_slider.cpp b/editor/editor_spin_slider.cpp index 4f0d75ecce..d8c765911c 100644 --- a/editor/editor_spin_slider.cpp +++ b/editor/editor_spin_slider.cpp @@ -373,7 +373,7 @@ void EditorSpinSlider::_evaluate_input_text() { const String text = TS->parse_number(value_input->get_text().replace(",", ".")); Ref<Expression> expr; - expr.instance(); + expr.instantiate(); Error err = expr->parse(text); if (err != OK) { return; diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index fa543b7455..131a77e52f 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -766,12 +766,12 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_stylebox("sub_inspector_bg" + itos(i), "Editor", sub_inspector_bg); Ref<StyleBoxFlat> bg_color; - bg_color.instance(); + bg_color.instantiate(); bg_color->set_bg_color(si_base_color * Color(0.7, 0.7, 0.7, 0.8)); bg_color->set_border_width_all(0); Ref<StyleBoxFlat> bg_color_selected; - bg_color_selected.instance(); + bg_color_selected.instantiate(); bg_color_selected->set_border_width_all(0); bg_color_selected->set_bg_color(si_base_color * Color(0.8, 0.8, 0.8, 0.8)); diff --git a/editor/fileserver/editor_file_server.cpp b/editor/fileserver/editor_file_server.cpp index 654915e3e5..8f019a95fd 100644 --- a/editor/fileserver/editor_file_server.cpp +++ b/editor/fileserver/editor_file_server.cpp @@ -312,7 +312,7 @@ void EditorFileServer::stop() { } EditorFileServer::EditorFileServer() { - server.instance(); + server.instantiate(); quit = false; active = false; cmd = CMD_NONE; diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index fe1fa9f9d6..cb89e5c7d0 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -945,7 +945,7 @@ void FileSystemDock::_select_file(const String &p_path, bool p_select_in_favorit } else if (fpath != "Favorites") { if (FileAccess::exists(fpath + ".import")) { Ref<ConfigFile> config; - config.instance(); + config.instantiate(); Error err = config->load(fpath + ".import"); if (err == OK) { if (config->has_section_key("remap", "importer")) { @@ -2675,7 +2675,7 @@ void FileSystemDock::_update_import_dock() { for (int i = 0; i < efiles.size(); i++) { String fpath = efiles[i]; Ref<ConfigFile> cf; - cf.instance(); + cf.instantiate(); Error err = cf->load(fpath + ".import"); if (err != OK) { imports.clear(); diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp index dc1bd38a99..89731c8b7a 100644 --- a/editor/import/editor_import_collada.cpp +++ b/editor/import/editor_import_collada.cpp @@ -850,7 +850,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<EditorSceneImpor } Ref<SurfaceTool> surftool; - surftool.instance(); + surftool.instantiate(); surftool->begin(Mesh::PRIMITIVE_TRIANGLES); for (int k = 0; k < vertex_array.size(); k++) { diff --git a/editor/import/resource_importer_bitmask.cpp b/editor/import/resource_importer_bitmask.cpp index ffef759c07..7fd9230284 100644 --- a/editor/import/resource_importer_bitmask.cpp +++ b/editor/import/resource_importer_bitmask.cpp @@ -78,7 +78,7 @@ Error ResourceImporterBitMap::import(const String &p_source_file, const String & int create_from = p_options["create_from"]; float threshold = p_options["threshold"]; Ref<Image> image; - image.instance(); + image.instantiate(); Error err = ImageLoader::load_image(p_source_file, image); if (err != OK) { return err; @@ -88,7 +88,7 @@ Error ResourceImporterBitMap::import(const String &p_source_file, const String & int h = image->get_height(); Ref<BitMap> bitmap; - bitmap.instance(); + bitmap.instantiate(); bitmap->create(Size2(w, h)); for (int i = 0; i < h; i++) { diff --git a/editor/import/resource_importer_csv_translation.cpp b/editor/import/resource_importer_csv_translation.cpp index c9e446a1a2..07647d8b6a 100644 --- a/editor/import/resource_importer_csv_translation.cpp +++ b/editor/import/resource_importer_csv_translation.cpp @@ -104,7 +104,7 @@ Error ResourceImporterCSVTranslation::import(const String &p_source_file, const locales.push_back(locale); Ref<Translation> translation; - translation.instance(); + translation.instantiate(); translation->set_locale(locale); translations.push_back(translation); } diff --git a/editor/import/resource_importer_layered_texture.cpp b/editor/import/resource_importer_layered_texture.cpp index 6d2215c379..2ac8b8bd7d 100644 --- a/editor/import/resource_importer_layered_texture.cpp +++ b/editor/import/resource_importer_layered_texture.cpp @@ -186,7 +186,7 @@ void ResourceImporterLayeredTexture::_save_tex(Vector<Ref<Image>> p_images, cons for (int i = 0; i < mm_d; i++) { Ref<Image> mm; - mm.instance(); + mm.instantiate(); mm->create(mm_w, mm_h, false, p_images[0]->get_format()); Vector3 pos; pos.z = float(i) * float(d) / float(mm_d) + 0.5; @@ -328,7 +328,7 @@ Error ResourceImporterLayeredTexture::import(const String &p_source_file, const } Ref<Image> image; - image.instance(); + image.instantiate(); Error err = ImageLoader::load_image(p_source_file, image, nullptr, false, 1.0); if (err != OK) { return err; diff --git a/editor/import/resource_importer_obj.cpp b/editor/import/resource_importer_obj.cpp index 3aa17ee581..01603c0a6a 100644 --- a/editor/import/resource_importer_obj.cpp +++ b/editor/import/resource_importer_obj.cpp @@ -57,7 +57,7 @@ static Error _parse_material_library(const String &p_path, Map<String, Ref<Stand //vertex current_name = l.replace("newmtl", "").strip_edges(); - current.instance(); + current.instantiate(); current->set_name(current_name); material_map[current_name] = current; } else if (l.begins_with("Ka ")) { @@ -207,7 +207,7 @@ static Error _parse_obj(const String &p_path, List<Ref<Mesh>> &r_meshes, bool p_ ERR_FAIL_COND_V_MSG(!f, ERR_CANT_OPEN, vformat("Couldn't open OBJ file '%s', it may not exist or not be readable.", p_path)); Ref<ArrayMesh> mesh; - mesh.instance(); + mesh.instantiate(); bool generate_tangents = p_generate_tangents; Vector3 scale_mesh = p_scale_mesh; @@ -378,7 +378,7 @@ static Error _parse_obj(const String &p_path, List<Ref<Mesh>> &r_meshes, bool p_ if (!p_single_mesh) { mesh->set_name(name); r_meshes.push_back(mesh); - mesh.instance(); + mesh.instantiate(); current_group = ""; current_material = ""; } @@ -440,7 +440,7 @@ Node *EditorOBJImporter::import_scene(const String &p_path, uint32_t p_flags, in for (List<Ref<Mesh>>::Element *E = meshes.front(); E; E = E->next()) { Ref<EditorSceneImporterMesh> mesh; - mesh.instance(); + mesh.instantiate(); Ref<Mesh> m = E->get(); for (int i = 0; i < m->get_surface_count(); i++) { mesh->add_surface(m->surface_get_primitive_type(i), m->surface_get_arrays(i), Array(), Dictionary(), m->surface_get_material(i)); diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index 08aa2fecbb..c14b948dae 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -1422,7 +1422,7 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p } if (root_type != "Node3D") { - Node *base_node = Object::cast_to<Node>(ClassDB::instance(root_type)); + Node *base_node = Object::cast_to<Node>(ClassDB::instantiate(root_type)); if (base_node) { scene->replace_by(base_node); @@ -1557,7 +1557,7 @@ Node *EditorSceneImporterESCN::import_scene(const String &p_path, uint32_t p_fla Ref<PackedScene> ps = ResourceFormatLoaderText::singleton->load(p_path, p_path, &error); ERR_FAIL_COND_V_MSG(!ps.is_valid(), nullptr, "Cannot load scene as text resource from path '" + p_path + "'."); - Node *scene = ps->instance(); + Node *scene = ps->instantiate(); ERR_FAIL_COND_V(!scene, nullptr); return scene; diff --git a/editor/import/resource_importer_shader_file.cpp b/editor/import/resource_importer_shader_file.cpp index 70119bfd1c..4d92490675 100644 --- a/editor/import/resource_importer_shader_file.cpp +++ b/editor/import/resource_importer_shader_file.cpp @@ -99,7 +99,7 @@ Error ResourceImporterShaderFile::import(const String &p_source_file, const Stri String file_txt = file->get_as_utf8_string(); Ref<RDShaderFile> shader_file; - shader_file.instance(); + shader_file.instantiate(); String base_path = p_source_file.get_base_dir(); err = shader_file->parse_versions_from_text(file_txt, "", _include_function, &base_path); diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp index 72df65a787..daf7b15794 100644 --- a/editor/import/resource_importer_texture.cpp +++ b/editor/import/resource_importer_texture.cpp @@ -88,7 +88,7 @@ void ResourceImporterTexture::update_imports() { for (Map<StringName, MakeInfo>::Element *E = make_flags.front(); E; E = E->next()) { Ref<ConfigFile> cf; - cf.instance(); + cf.instantiate(); String src_path = String(E->key()) + ".import"; Error err = cf->load(src_path); @@ -411,13 +411,13 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String Image::RoughnessChannel roughness_channel = Image::ROUGHNESS_CHANNEL_R; if (mipmaps && roughness > 1 && FileAccess::exists(normal_map)) { - normal_image.instance(); + normal_image.instantiate(); if (ImageLoader::load_image(normal_map, normal_image) == OK) { roughness_channel = Image::RoughnessChannel(roughness - 2); } } Ref<Image> image; - image.instance(); + image.instantiate(); Error err = ImageLoader::load_image(p_source_file, image, nullptr, hdr_as_srgb, scale); if (err != OK) { return err; diff --git a/editor/import/resource_importer_texture_atlas.cpp b/editor/import/resource_importer_texture_atlas.cpp index d5d1a14be3..dec1466da1 100644 --- a/editor/import/resource_importer_texture_atlas.cpp +++ b/editor/import/resource_importer_texture_atlas.cpp @@ -87,7 +87,7 @@ Error ResourceImporterTextureAtlas::import(const String &p_source_file, const St //it's a simple hack Ref<Image> broken = memnew(Image((const char **)atlas_import_failed_xpm)); Ref<ImageTexture> broken_texture; - broken_texture.instance(); + broken_texture.instantiate(); broken_texture->create_from_image(broken); String target_file = p_save_path + ".tex"; @@ -201,7 +201,7 @@ Error ResourceImporterTextureAtlas::import_group_file(const String &p_group_file const Map<StringName, Variant> &options = E->get(); Ref<Image> image; - image.instance(); + image.instantiate(); Error err = ImageLoader::load_image(source, image); ERR_CONTINUE(err != OK); @@ -240,7 +240,7 @@ Error ResourceImporterTextureAtlas::import_group_file(const String &p_group_file pack_data.is_mesh = true; Ref<BitMap> bit_map; - bit_map.instance(); + bit_map.instantiate(); bit_map->create_from_image_alpha(image); Vector<Vector<Vector2>> polygons = bit_map->clip_opaque_to_polygons(Rect2(0, 0, image->get_width(), image->get_height())); @@ -272,7 +272,7 @@ Error ResourceImporterTextureAtlas::import_group_file(const String &p_group_file //blit the atlas Ref<Image> new_atlas; - new_atlas.instance(); + new_atlas.instantiate(); new_atlas->create(atlas_width, atlas_height, false, Image::FORMAT_RGBA8); for (int i = 0; i < pack_data_files.size(); i++) { @@ -303,7 +303,7 @@ Error ResourceImporterTextureAtlas::import_group_file(const String &p_group_file cache.reference_ptr(resptr); } else { Ref<ImageTexture> res_cache; - res_cache.instance(); + res_cache.instantiate(); res_cache->create_from_image(new_atlas); res_cache->set_path(p_group_file); cache = res_cache; @@ -321,7 +321,7 @@ Error ResourceImporterTextureAtlas::import_group_file(const String &p_group_file //region Ref<AtlasTexture> atlas_texture; - atlas_texture.instance(); + atlas_texture.instantiate(); atlas_texture->set_atlas(cache); atlas_texture->set_region(Rect2(offset, pack_data.region.size)); atlas_texture->set_margin(Rect2(pack_data.region.position, Size2(pack_data.image->get_width(), pack_data.image->get_height()) - pack_data.region.size)); @@ -329,7 +329,7 @@ Error ResourceImporterTextureAtlas::import_group_file(const String &p_group_file texture = atlas_texture; } else { Ref<ArrayMesh> mesh; - mesh.instance(); + mesh.instantiate(); for (int i = 0; i < pack_data.chart_pieces.size(); i++) { const EditorAtlasPacker::Chart &chart = charts[pack_data.chart_pieces[i]]; @@ -375,7 +375,7 @@ Error ResourceImporterTextureAtlas::import_group_file(const String &p_group_file } Ref<MeshTexture> mesh_texture; - mesh_texture.instance(); + mesh_texture.instantiate(); mesh_texture->set_base_texture(cache); mesh_texture->set_image_size(pack_data.image->get_size()); mesh_texture->set_mesh(mesh); diff --git a/editor/import/resource_importer_wav.cpp b/editor/import/resource_importer_wav.cpp index e615212569..e845a90259 100644 --- a/editor/import/resource_importer_wav.cpp +++ b/editor/import/resource_importer_wav.cpp @@ -508,7 +508,7 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s } Ref<AudioStreamSample> sample; - sample.instance(); + sample.instantiate(); sample->set_data(dst_data); sample->set_format(dst_format); sample->set_mix_rate(rate); diff --git a/editor/import/scene_import_settings.cpp b/editor/import/scene_import_settings.cpp index 600f3fe2f0..cb9fd1f28e 100644 --- a/editor/import/scene_import_settings.cpp +++ b/editor/import/scene_import_settings.cpp @@ -435,7 +435,7 @@ void SceneImportSettings::open_settings(const String &p_path) { base_subresource_settings.clear(); Ref<ConfigFile> config; - config.instance(); + config.instantiate(); Error err = config->load(p_path + ".import"); if (err == OK) { List<String> keys; @@ -1105,12 +1105,12 @@ SceneImportSettings::SceneImportSettings() { { Ref<StandardMaterial3D> selection_mat; - selection_mat.instance(); + selection_mat.instantiate(); selection_mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED); selection_mat->set_albedo(Color(1, 0.8, 1.0)); Ref<SurfaceTool> st; - st.instance(); + st.instantiate(); st->begin(Mesh::PRIMITIVE_LINES); AABB base_aabb; @@ -1126,7 +1126,7 @@ SceneImportSettings::SceneImportSettings() { st->add_vertex(b.lerp(a, 0.2)); } - selection_mesh.instance(); + selection_mesh.instantiate(); st->commit(selection_mesh); selection_mesh->surface_set_material(0, selection_mat); @@ -1141,7 +1141,7 @@ SceneImportSettings::SceneImportSettings() { base_viewport->add_child(mesh_preview); mesh_preview->hide(); - material_preview.instance(); + material_preview.instantiate(); } inspector = memnew(EditorInspector); diff --git a/editor/import/scene_importer_mesh.cpp b/editor/import/scene_importer_mesh.cpp index bf17ea7bca..e37be1d435 100644 --- a/editor/import/scene_importer_mesh.cpp +++ b/editor/import/scene_importer_mesh.cpp @@ -251,7 +251,7 @@ Ref<ArrayMesh> EditorSceneImporterMesh::get_mesh(const Ref<Mesh> &p_base) { mesh = p_base; } if (mesh.is_null()) { - mesh.instance(); + mesh.instantiate(); } mesh->set_name(get_name()); if (has_meta("import_id")) { @@ -320,7 +320,7 @@ void EditorSceneImporterMesh::create_shadow_mesh() { } } - shadow_mesh.instance(); + shadow_mesh.instantiate(); for (int i = 0; i < surfaces.size(); i++) { LocalVector<int> vertex_remap; @@ -528,7 +528,7 @@ Vector<Ref<Shape3D>> EditorSceneImporterMesh::convex_decompose() const { } Ref<ConvexPolygonShape3D> shape; - shape.instance(); + shape.instantiate(); shape->set_points(convex_points); ret.push_back(shape); } @@ -587,7 +587,7 @@ Ref<NavigationMesh> EditorSceneImporterMesh::create_navigation_mesh() { } Ref<NavigationMesh> nm; - nm.instance(); + nm.instantiate(); nm->set_vertices(vertices); Vector<int> v3; @@ -733,7 +733,7 @@ Error EditorSceneImporterMesh::lightmap_unwrap_cached(const Transform3D &p_base_ for (int i = 0; i < lightmap_surfaces.size(); i++) { Ref<SurfaceTool> st; - st.instance(); + st.instantiate(); st->begin(Mesh::PRIMITIVE_TRIANGLES); st->set_material(lightmap_surfaces[i].material); st->set_meta("name", lightmap_surfaces[i].name); diff --git a/editor/import_dock.cpp b/editor/import_dock.cpp index 17c51f0f85..6fa9864830 100644 --- a/editor/import_dock.cpp +++ b/editor/import_dock.cpp @@ -91,7 +91,7 @@ public: void ImportDock::set_edit_path(const String &p_path) { Ref<ConfigFile> config; - config.instance(); + config.instantiate(); Error err = config->load(p_path + ".import"); if (err != OK) { clear(); @@ -182,7 +182,7 @@ void ImportDock::set_edit_multiple_paths(const Vector<String> &p_paths) { for (int i = 0; i < p_paths.size(); i++) { Ref<ConfigFile> config; - config.instance(); + config.instantiate(); Error err = config->load(p_paths[i] + ".import"); ERR_CONTINUE(err != OK); @@ -328,7 +328,7 @@ void ImportDock::_importer_selected(int i_idx) { Ref<ConfigFile> config; if (params->paths.size()) { - config.instance(); + config.instantiate(); Error err = config->load(params->paths[0] + ".import"); if (err != OK) { config.unref(); @@ -440,7 +440,7 @@ void ImportDock::_reimport_attempt() { } for (int i = 0; i < params->paths.size(); i++) { Ref<ConfigFile> config; - config.instance(); + config.instantiate(); Error err = config->load(params->paths[i] + ".import"); ERR_CONTINUE(err != OK); @@ -477,7 +477,7 @@ void ImportDock::_advanced_options() { void ImportDock::_reimport() { for (int i = 0; i < params->paths.size(); i++) { Ref<ConfigFile> config; - config.instance(); + config.instantiate(); Error err = config->load(params->paths[i] + ".import"); ERR_CONTINUE(err != OK); diff --git a/editor/node_3d_editor_gizmos.cpp b/editor/node_3d_editor_gizmos.cpp index 19663e46e1..4d61e982c1 100644 --- a/editor/node_3d_editor_gizmos.cpp +++ b/editor/node_3d_editor_gizmos.cpp @@ -759,7 +759,7 @@ EditorNode3DGizmo::EditorNode3DGizmo() { hidden = false; base = nullptr; selected = false; - instanced = false; + instantiated = false; spatial_node = nullptr; gizmo_plugin = nullptr; selectable_icon_size = -1.0f; @@ -3427,7 +3427,7 @@ void LightmapGIGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { array[RS::ARRAY_COLOR] = colors; Ref<ArrayMesh> mesh; - mesh.instance(); + mesh.instantiate(); mesh->add_surface_from_arrays(Mesh::PRIMITIVE_TRIANGLES, array, Array(), Dictionary(), 0); //no compression mesh->surface_set_material(0, material_probes); diff --git a/editor/plugins/animation_blend_space_1d_editor.cpp b/editor/plugins/animation_blend_space_1d_editor.cpp index f7c0ebcfaf..b6dd9474d3 100644 --- a/editor/plugins/animation_blend_space_1d_editor.cpp +++ b/editor/plugins/animation_blend_space_1d_editor.cpp @@ -386,7 +386,7 @@ void AnimationNodeBlendSpace1DEditor::_add_menu_type(int p_index) { } else { String type = menu->get_item_metadata(p_index); - Object *obj = ClassDB::instance(type); + Object *obj = ClassDB::instantiate(type); ERR_FAIL_COND(!obj); AnimationNode *an = Object::cast_to<AnimationNode>(obj); ERR_FAIL_COND(!an); @@ -413,7 +413,7 @@ void AnimationNodeBlendSpace1DEditor::_add_menu_type(int p_index) { void AnimationNodeBlendSpace1DEditor::_add_animation_type(int p_index) { Ref<AnimationNodeAnimation> anim; - anim.instance(); + anim.instantiate(); anim->set_animation(animations_to_add[p_index]); @@ -594,7 +594,7 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() { add_child(top_hb); Ref<ButtonGroup> bg; - bg.instance(); + bg.instantiate(); tool_blend = memnew(Button); tool_blend->set_flat(true); diff --git a/editor/plugins/animation_blend_space_2d_editor.cpp b/editor/plugins/animation_blend_space_2d_editor.cpp index e719df53d5..359df95bce 100644 --- a/editor/plugins/animation_blend_space_2d_editor.cpp +++ b/editor/plugins/animation_blend_space_2d_editor.cpp @@ -308,7 +308,7 @@ void AnimationNodeBlendSpace2DEditor::_add_menu_type(int p_index) { } else { String type = menu->get_item_metadata(p_index); - Object *obj = ClassDB::instance(type); + Object *obj = ClassDB::instantiate(type); ERR_FAIL_COND(!obj); AnimationNode *an = Object::cast_to<AnimationNode>(obj); ERR_FAIL_COND(!an); @@ -335,7 +335,7 @@ void AnimationNodeBlendSpace2DEditor::_add_menu_type(int p_index) { void AnimationNodeBlendSpace2DEditor::_add_animation_type(int p_index) { Ref<AnimationNodeAnimation> anim; - anim.instance(); + anim.instantiate(); anim->set_animation(animations_to_add[p_index]); @@ -818,7 +818,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() { add_child(top_hb); Ref<ButtonGroup> bg; - bg.instance(); + bg.instantiate(); tool_blend = memnew(Button); tool_blend->set_flat(true); diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp index 867c701733..dcde89f177 100644 --- a/editor/plugins/animation_blend_tree_editor_plugin.cpp +++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp @@ -288,14 +288,14 @@ void AnimationNodeBlendTreeEditor::_add_node(int p_idx) { ERR_FAIL_COND(!anode.is_valid()); base_name = anode->get_class(); } else if (add_options[p_idx].type != String()) { - AnimationNode *an = Object::cast_to<AnimationNode>(ClassDB::instance(add_options[p_idx].type)); + AnimationNode *an = Object::cast_to<AnimationNode>(ClassDB::instantiate(add_options[p_idx].type)); ERR_FAIL_COND(!an); anode = Ref<AnimationNode>(an); base_name = add_options[p_idx].name; } else { ERR_FAIL_COND(add_options[p_idx].script.is_null()); String base_type = add_options[p_idx].script->get_instance_base_type(); - AnimationNode *an = Object::cast_to<AnimationNode>(ClassDB::instance(base_type)); + AnimationNode *an = Object::cast_to<AnimationNode>(ClassDB::instantiate(base_type)); ERR_FAIL_COND(!an); anode = Ref<AnimationNode>(an); anode->set_script(add_options[p_idx].script); diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index 4a3f3212fa..e31c98db92 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -121,11 +121,11 @@ void AnimationPlayerEditor::_notification(int p_what) { Ref<Image> reset_img = reset_icon->get_image(); Ref<Image> autoplay_reset_img; Size2 icon_size = Size2(autoplay_img->get_width(), autoplay_img->get_height()); - autoplay_reset_img.instance(); + autoplay_reset_img.instantiate(); autoplay_reset_img->create(icon_size.x * 2, icon_size.y, false, autoplay_img->get_format()); autoplay_reset_img->blit_rect(autoplay_img, Rect2(Point2(), icon_size), Point2()); autoplay_reset_img->blit_rect(reset_img, Rect2(Point2(), icon_size), Point2(icon_size.x, 0)); - autoplay_reset_icon.instance(); + autoplay_reset_icon.instantiate(); autoplay_reset_icon->create_from_image(autoplay_reset_img); } stop->set_icon(get_theme_icon("Stop", "EditorIcons")); diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp index fe5a0cab4d..94e526922d 100644 --- a/editor/plugins/animation_state_machine_editor.cpp +++ b/editor/plugins/animation_state_machine_editor.cpp @@ -257,7 +257,7 @@ void AnimationNodeStateMachineEditor::_state_machine_gui_input(const Ref<InputEv } else { Ref<AnimationNodeStateMachineTransition> tr; - tr.instance(); + tr.instantiate(); tr->set_switch_mode(AnimationNodeStateMachineTransition::SwitchMode(transition_mode->get_selected())); updating = true; @@ -423,7 +423,7 @@ void AnimationNodeStateMachineEditor::_add_menu_type(int p_index) { } else { String type = menu->get_item_metadata(p_index); - Object *obj = ClassDB::instance(type); + Object *obj = ClassDB::instantiate(type); ERR_FAIL_COND(!obj); AnimationNode *an = Object::cast_to<AnimationNode>(obj); ERR_FAIL_COND(!an); @@ -462,7 +462,7 @@ void AnimationNodeStateMachineEditor::_add_menu_type(int p_index) { void AnimationNodeStateMachineEditor::_add_animation_type(int p_index) { Ref<AnimationNodeAnimation> anim; - anim.instance(); + anim.instantiate(); anim->set_animation(animations_to_add[p_index]); @@ -1213,7 +1213,7 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() { add_child(top_hb); Ref<ButtonGroup> bg; - bg.instance(); + bg.instantiate(); tool_select = memnew(Button); tool_select->set_flat(true); diff --git a/editor/plugins/animation_tree_editor_plugin.cpp b/editor/plugins/animation_tree_editor_plugin.cpp index c33b06ff32..e90665f84d 100644 --- a/editor/plugins/animation_tree_editor_plugin.cpp +++ b/editor/plugins/animation_tree_editor_plugin.cpp @@ -76,7 +76,7 @@ void AnimationTreeEditor::_update_path() { } Ref<ButtonGroup> group; - group.instance(); + group.instantiate(); Button *b = memnew(Button); b->set_text("Root"); diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index f0254e5639..cd61ebd418 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -86,7 +86,7 @@ void EditorAssetLibraryItem::_bind_methods() { EditorAssetLibraryItem::EditorAssetLibraryItem() { Ref<StyleBoxEmpty> border; - border.instance(); + border.instantiate(); border->set_default_margin(SIDE_LEFT, 5 * EDSCALE); border->set_default_margin(SIDE_RIGHT, 5 * EDSCALE); border->set_default_margin(SIDE_BOTTOM, 5 * EDSCALE); @@ -155,7 +155,7 @@ void EditorAssetLibraryItemDescription::set_image(int p_type, int p_index, const thumbnail->blend_rect(overlay, overlay->get_used_rect(), overlay_pos); Ref<ImageTexture> tex; - tex.instance(); + tex.instantiate(); tex->create_from_image(thumbnail); preview_images[i].button->set_icon(tex); @@ -761,7 +761,7 @@ void EditorAssetLibrary::_image_update(bool use_cache, bool final, const PackedB } Ref<ImageTexture> tex; - tex.instance(); + tex.instantiate(); tex->create_from_image(image); obj->call("set_image", image_queue[p_queue_id].image_type, image_queue[p_queue_id].image_index, tex); @@ -1435,7 +1435,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { library_scroll_bg->add_child(library_scroll); Ref<StyleBoxEmpty> border2; - border2.instance(); + border2.instantiate(); border2->set_default_margin(SIDE_LEFT, 15 * EDSCALE); border2->set_default_margin(SIDE_RIGHT, 35 * EDSCALE); border2->set_default_margin(SIDE_BOTTOM, 15 * EDSCALE); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 5d248176c1..29012d1180 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -5698,7 +5698,7 @@ void CanvasItemEditorViewport::_create_preview(const Vector<String> &files) cons label_desc->show(); } else { if (scene.is_valid()) { - Node *instance = scene->instance(); + Node *instance = scene->instantiate(); if (instance) { preview_node->add_child(instance); } @@ -5811,26 +5811,26 @@ bool CanvasItemEditorViewport::_create_instance(Node *parent, String &path, cons return false; } - Node *instanced_scene = sdata->instance(PackedScene::GEN_EDIT_STATE_INSTANCE); - if (!instanced_scene) { // error on instancing + Node *instantiated_scene = sdata->instantiate(PackedScene::GEN_EDIT_STATE_INSTANCE); + if (!instantiated_scene) { // error on instancing return false; } if (editor->get_edited_scene()->get_filename() != "") { // cyclical instancing - if (_cyclical_dependency_exists(editor->get_edited_scene()->get_filename(), instanced_scene)) { - memdelete(instanced_scene); + if (_cyclical_dependency_exists(editor->get_edited_scene()->get_filename(), instantiated_scene)) { + memdelete(instantiated_scene); return false; } } - instanced_scene->set_filename(ProjectSettings::get_singleton()->localize_path(path)); + instantiated_scene->set_filename(ProjectSettings::get_singleton()->localize_path(path)); - editor_data->get_undo_redo().add_do_method(parent, "add_child", instanced_scene); - editor_data->get_undo_redo().add_do_method(instanced_scene, "set_owner", editor->get_edited_scene()); - editor_data->get_undo_redo().add_do_reference(instanced_scene); - editor_data->get_undo_redo().add_undo_method(parent, "remove_child", instanced_scene); + editor_data->get_undo_redo().add_do_method(parent, "add_child", instantiated_scene); + editor_data->get_undo_redo().add_do_method(instantiated_scene, "set_owner", editor->get_edited_scene()); + editor_data->get_undo_redo().add_do_reference(instantiated_scene); + editor_data->get_undo_redo().add_undo_method(parent, "remove_child", instantiated_scene); - String new_name = parent->validate_child_name(instanced_scene); + String new_name = parent->validate_child_name(instantiated_scene); EditorDebuggerNode *ed = EditorDebuggerNode::get_singleton(); editor_data->get_undo_redo().add_do_method(ed, "live_debug_instance_node", editor->get_edited_scene()->get_path_to(parent), path, new_name); editor_data->get_undo_redo().add_undo_method(ed, "live_debug_remove_node", NodePath(String(editor->get_edited_scene()->get_path_to(parent)) + "/" + new_name)); @@ -5841,11 +5841,11 @@ bool CanvasItemEditorViewport::_create_instance(Node *parent, String &path, cons target_pos = canvas_item_editor->snap_point(target_pos); target_pos = parent_ci->get_global_transform_with_canvas().affine_inverse().xform(target_pos); // Preserve instance position of the original scene. - CanvasItem *instance_ci = Object::cast_to<CanvasItem>(instanced_scene); + CanvasItem *instance_ci = Object::cast_to<CanvasItem>(instantiated_scene); if (instance_ci) { target_pos += instance_ci->_edit_get_position(); } - editor_data->get_undo_redo().add_do_method(instanced_scene, "set_position", target_pos); + editor_data->get_undo_redo().add_do_method(instantiated_scene, "set_position", target_pos); } return true; @@ -5928,7 +5928,7 @@ bool CanvasItemEditorViewport::can_drop_data(const Point2 &p_point, const Varian if (d.has("type")) { if (String(d["type"]) == "files") { Vector<String> files = d["files"]; - bool can_instance = false; + bool can_instantiate = false; for (int i = 0; i < files.size(); i++) { // check if dragged files contain resource or scene can be created at least once RES res = ResourceLoader::load(files[i]); if (res.is_null()) { @@ -5937,11 +5937,11 @@ bool CanvasItemEditorViewport::can_drop_data(const Point2 &p_point, const Varian String type = res->get_class(); if (type == "PackedScene") { Ref<PackedScene> sdata = Ref<PackedScene>(Object::cast_to<PackedScene>(*res)); - Node *instanced_scene = sdata->instance(PackedScene::GEN_EDIT_STATE_INSTANCE); - if (!instanced_scene) { + Node *instantiated_scene = sdata->instantiate(PackedScene::GEN_EDIT_STATE_INSTANCE); + if (!instantiated_scene) { continue; } - memdelete(instanced_scene); + memdelete(instantiated_scene); } else if (type == "Texture2D" || type == "ImageTexture" || type == "ViewportTexture" || @@ -5956,10 +5956,10 @@ bool CanvasItemEditorViewport::can_drop_data(const Point2 &p_point, const Varian } else { continue; } - can_instance = true; + can_instantiate = true; break; } - if (can_instance) { + if (can_instantiate) { if (!preview_node->get_parent()) { // create preview only once _create_preview(files); } @@ -5967,7 +5967,7 @@ bool CanvasItemEditorViewport::can_drop_data(const Point2 &p_point, const Varian preview_node->set_position((p_point - trans.get_origin()) / trans.get_scale().x); label->set_text(vformat(TTR("Adding %s..."), default_type)); } - return can_instance; + return can_instantiate; } } label->hide(); @@ -6092,7 +6092,7 @@ CanvasItemEditorViewport::CanvasItemEditorViewport(EditorNode *p_node, CanvasIte vbc->add_child(btn_group); btn_group->set_h_size_flags(0); - button_group.instance(); + button_group.instantiate(); for (int i = 0; i < types.size(); i++) { CheckBox *check = memnew(CheckBox); btn_group->add_child(check); diff --git a/editor/plugins/collision_polygon_3d_editor_plugin.cpp b/editor/plugins/collision_polygon_3d_editor_plugin.cpp index a0df7e289e..7873c1b136 100644 --- a/editor/plugins/collision_polygon_3d_editor_plugin.cpp +++ b/editor/plugins/collision_polygon_3d_editor_plugin.cpp @@ -537,7 +537,7 @@ CollisionPolygon3DEditor::CollisionPolygon3DEditor(EditorNode *p_editor) { pointsm = memnew(MeshInstance3D); imgeom->add_child(pointsm); - m.instance(); + m.instantiate(); pointsm->set_mesh(m); pointsm->set_transform(Transform3D(Basis(), Vector3(0, 0, 0.00001))); diff --git a/editor/plugins/cpu_particles_2d_editor_plugin.cpp b/editor/plugins/cpu_particles_2d_editor_plugin.cpp index 3403aeceba..6a56cd31d1 100644 --- a/editor/plugins/cpu_particles_2d_editor_plugin.cpp +++ b/editor/plugins/cpu_particles_2d_editor_plugin.cpp @@ -74,7 +74,7 @@ void CPUParticles2DEditorPlugin::_menu_callback(int p_idx) { void CPUParticles2DEditorPlugin::_generate_emission_mask() { Ref<Image> img; - img.instance(); + img.instantiate(); Error err = ImageLoader::load_image(source_emission_file, img); ERR_FAIL_COND_MSG(err != OK, "Error loading image '" + source_emission_file + "'."); diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index 7a38fd2bd5..a800232978 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -776,7 +776,7 @@ void EditorInspectorPluginCurve::parse_begin(Object *p_object) { CurveEditorPlugin::CurveEditorPlugin(EditorNode *p_node) { Ref<EditorInspectorPluginCurve> curve_plugin; - curve_plugin.instance(); + curve_plugin.instantiate(); EditorInspector::add_inspector_plugin(curve_plugin); get_editor_interface()->get_resource_previewer()->add_preview_generator(memnew(CurvePreviewGenerator)); @@ -798,7 +798,7 @@ Ref<Texture2D> CurvePreviewGenerator::generate(const Ref<Resource> &p_from, cons int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size"); thumbnail_size *= EDSCALE; Ref<Image> img_ref; - img_ref.instance(); + img_ref.instantiate(); Image &im = **img_ref; im.create(thumbnail_size, thumbnail_size / 2, false, Image::FORMAT_RGBA8); diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp index 235ccb18cb..a233d66d82 100644 --- a/editor/plugins/editor_preview_plugins.cpp +++ b/editor/plugins/editor_preview_plugins.cpp @@ -174,7 +174,7 @@ Ref<Texture2D> EditorImagePreviewPlugin::generate(const RES &p_from, const Size2 post_process_preview(img); Ref<ImageTexture> ptex; - ptex.instance(); + ptex.instantiate(); ptex->create_from_image(img); return ptex; @@ -219,7 +219,7 @@ Ref<Texture2D> EditorBitmapPreviewPlugin::generate(const RES &p_from, const Size } Ref<Image> img; - img.instance(); + img.instantiate(); img->create(bm->get_size().width, bm->get_size().height, false, Image::FORMAT_L8, data); if (img->is_compressed()) { @@ -278,7 +278,7 @@ Ref<Texture2D> EditorPackedScenePreviewPlugin::generate_from_path(const String & } Ref<Image> img; - img.instance(); + img.instantiate(); Error err = img->load(path); if (err == OK) { Ref<ImageTexture> ptex = Ref<ImageTexture>(memnew(ImageTexture)); @@ -501,7 +501,7 @@ Ref<Texture2D> EditorScriptPreviewPlugin::generate(const RES &p_from, const Size int line = 0; int col = 0; Ref<Image> img; - img.instance(); + img.instantiate(); int thumbnail_size = MAX(p_size.x, p_size.y); img->create(thumbnail_size, thumbnail_size, false, Image::FORMAT_RGBA8); @@ -688,7 +688,7 @@ Ref<Texture2D> EditorAudioStreamPreviewPlugin::generate(const RES &p_from, const Ref<ImageTexture> ptex = Ref<ImageTexture>(memnew(ImageTexture)); Ref<Image> image; - image.instance(); + image.instantiate(); image->create(w, h, false, Image::FORMAT_RGB8, img); ptex->create_from_image(image); return ptex; @@ -881,7 +881,7 @@ Ref<Texture2D> EditorFontPreviewPlugin::generate_from_path(const String &p_path, if (res->is_class("Font")) { sampled_font = res->duplicate(); } else if (res->is_class("FontData")) { - sampled_font.instance(); + sampled_font.instantiate(); sampled_font->add_data(res->duplicate()); } diff --git a/editor/plugins/font_editor_plugin.cpp b/editor/plugins/font_editor_plugin.cpp index 8de7dc2447..9b0af37abb 100644 --- a/editor/plugins/font_editor_plugin.cpp +++ b/editor/plugins/font_editor_plugin.cpp @@ -119,7 +119,7 @@ void FontDataPreview::set_data(const Ref<FontData> &p_data) { } FontDataPreview::FontDataPreview() { - line.instance(); + line.instantiate(); } /*************************************************************************/ @@ -326,6 +326,6 @@ bool EditorInspectorPluginFont::parse_property(Object *p_object, Variant::Type p FontEditorPlugin::FontEditorPlugin(EditorNode *p_node) { Ref<EditorInspectorPluginFont> fd_plugin; - fd_plugin.instance(); + fd_plugin.instantiate(); EditorInspector::add_inspector_plugin(fd_plugin); } diff --git a/editor/plugins/gpu_particles_2d_editor_plugin.cpp b/editor/plugins/gpu_particles_2d_editor_plugin.cpp index b447304a3f..37f900280b 100644 --- a/editor/plugins/gpu_particles_2d_editor_plugin.cpp +++ b/editor/plugins/gpu_particles_2d_editor_plugin.cpp @@ -146,7 +146,7 @@ void GPUParticles2DEditorPlugin::_generate_emission_mask() { } Ref<Image> img; - img.instance(); + img.instantiate(); Error err = ImageLoader::load_image(source_emission_file, img); ERR_FAIL_COND_MSG(err != OK, "Error loading image '" + source_emission_file + "'."); @@ -270,11 +270,11 @@ void GPUParticles2DEditorPlugin::_generate_emission_mask() { } } - img.instance(); + img.instantiate(); img->create(w, h, false, Image::FORMAT_RGF, texdata); Ref<ImageTexture> imgt; - imgt.instance(); + imgt.instantiate(); imgt->create_from_image(img); pm->set_emission_point_texture(imgt); @@ -291,10 +291,10 @@ void GPUParticles2DEditorPlugin::_generate_emission_mask() { } } - img.instance(); + img.instantiate(); img->create(w, h, false, Image::FORMAT_RGBA8, colordata); - imgt.instance(); + imgt.instantiate(); imgt->create_from_image(img); pm->set_emission_color_texture(imgt); } @@ -314,10 +314,10 @@ void GPUParticles2DEditorPlugin::_generate_emission_mask() { } } - img.instance(); + img.instantiate(); img->create(w, h, false, Image::FORMAT_RGF, normdata); - imgt.instance(); + imgt.instantiate(); imgt->create_from_image(img); pm->set_emission_normal_texture(imgt); diff --git a/editor/plugins/gpu_particles_3d_editor_plugin.cpp b/editor/plugins/gpu_particles_3d_editor_plugin.cpp index 17c7397729..571bcf9c4a 100644 --- a/editor/plugins/gpu_particles_3d_editor_plugin.cpp +++ b/editor/plugins/gpu_particles_3d_editor_plugin.cpp @@ -359,7 +359,7 @@ void GPUParticles3DEditor::_generate_emission_points() { Ref<Image> image = memnew(Image(w, h, false, Image::FORMAT_RGBF, point_img)); Ref<ImageTexture> tex; - tex.instance(); + tex.instantiate(); Ref<ParticlesMaterial> material = node->get_process_material(); ERR_FAIL_COND(material.is_null()); @@ -387,7 +387,7 @@ void GPUParticles3DEditor::_generate_emission_points() { Ref<Image> image2 = memnew(Image(w, h, false, Image::FORMAT_RGBF, point_img2)); Ref<ImageTexture> tex2; - tex2.instance(); + tex2.instantiate(); material->set_emission_normal_texture(tex2); } else { diff --git a/editor/plugins/gpu_particles_collision_sdf_editor_plugin.cpp b/editor/plugins/gpu_particles_collision_sdf_editor_plugin.cpp index 8c4928b7cb..a2dee4a1dc 100644 --- a/editor/plugins/gpu_particles_collision_sdf_editor_plugin.cpp +++ b/editor/plugins/gpu_particles_collision_sdf_editor_plugin.cpp @@ -137,7 +137,7 @@ void GPUParticlesCollisionSDFEditorPlugin::_sdf_save_path_and_bake(const String Ref<ConfigFile> config; - config.instance(); + config.instantiate(); if (FileAccess::exists(p_path + ".import")) { config->load(p_path + ".import"); } diff --git a/editor/plugins/gradient_editor_plugin.cpp b/editor/plugins/gradient_editor_plugin.cpp index 46fa00f730..355bdb69d8 100644 --- a/editor/plugins/gradient_editor_plugin.cpp +++ b/editor/plugins/gradient_editor_plugin.cpp @@ -92,6 +92,6 @@ void EditorInspectorPluginGradient::parse_begin(Object *p_object) { GradientEditorPlugin::GradientEditorPlugin(EditorNode *p_node) { Ref<EditorInspectorPluginGradient> plugin; - plugin.instance(); + plugin.instantiate(); add_inspector_plugin(plugin); } diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp index 81f0ecacf2..17a634ee14 100644 --- a/editor/plugins/material_editor_plugin.cpp +++ b/editor/plugins/material_editor_plugin.cpp @@ -111,7 +111,7 @@ MaterialEditor::MaterialEditor() { vc->set_anchors_and_offsets_preset(PRESET_WIDE); viewport = memnew(SubViewport); Ref<World3D> world_3d; - world_3d.instance(); + world_3d.instantiate(); viewport->set_world_3d(world_3d); //use own world vc->add_child(viewport); viewport->set_disable_input(true); @@ -146,9 +146,9 @@ MaterialEditor::MaterialEditor() { box_xform.origin.y = 0.2; box_instance->set_transform(box_xform); - sphere_mesh.instance(); + sphere_mesh.instantiate(); sphere_instance->set_mesh(sphere_mesh); - box_mesh.instance(); + box_mesh.instantiate(); box_instance->set_mesh(box_mesh); set_custom_minimum_size(Size2(1, 150) * EDSCALE); @@ -223,7 +223,7 @@ void EditorInspectorPluginMaterial::parse_begin(Object *p_object) { } EditorInspectorPluginMaterial::EditorInspectorPluginMaterial() { - env.instance(); + env.instantiate(); Ref<Sky> sky = memnew(Sky()); env->set_sky(sky); env->set_background(Environment::BG_COLOR); @@ -233,7 +233,7 @@ EditorInspectorPluginMaterial::EditorInspectorPluginMaterial() { MaterialEditorPlugin::MaterialEditorPlugin(EditorNode *p_node) { Ref<EditorInspectorPluginMaterial> plugin; - plugin.instance(); + plugin.instantiate(); add_inspector_plugin(plugin); } @@ -251,10 +251,10 @@ Ref<Resource> StandardMaterial3DConversionPlugin::convert(const Ref<Resource> &p ERR_FAIL_COND_V(!mat.is_valid(), Ref<Resource>()); Ref<ShaderMaterial> smat; - smat.instance(); + smat.instantiate(); Ref<Shader> shader; - shader.instance(); + shader.instantiate(); String code = RS::get_singleton()->shader_get_code(mat->get_shader_rid()); @@ -295,10 +295,10 @@ Ref<Resource> ParticlesMaterialConversionPlugin::convert(const Ref<Resource> &p_ ERR_FAIL_COND_V(!mat.is_valid(), Ref<Resource>()); Ref<ShaderMaterial> smat; - smat.instance(); + smat.instantiate(); Ref<Shader> shader; - shader.instance(); + shader.instantiate(); String code = RS::get_singleton()->shader_get_code(mat->get_shader_rid()); @@ -332,10 +332,10 @@ Ref<Resource> CanvasItemMaterialConversionPlugin::convert(const Ref<Resource> &p ERR_FAIL_COND_V(!mat.is_valid(), Ref<Resource>()); Ref<ShaderMaterial> smat; - smat.instance(); + smat.instantiate(); Ref<Shader> shader; - shader.instance(); + shader.instantiate(); String code = RS::get_singleton()->shader_get_code(mat->get_shader_rid()); @@ -369,10 +369,10 @@ Ref<Resource> ProceduralSkyMaterialConversionPlugin::convert(const Ref<Resource> ERR_FAIL_COND_V(!mat.is_valid(), Ref<Resource>()); Ref<ShaderMaterial> smat; - smat.instance(); + smat.instantiate(); Ref<Shader> shader; - shader.instance(); + shader.instantiate(); String code = RS::get_singleton()->shader_get_code(mat->get_shader_rid()); @@ -406,10 +406,10 @@ Ref<Resource> PanoramaSkyMaterialConversionPlugin::convert(const Ref<Resource> & ERR_FAIL_COND_V(!mat.is_valid(), Ref<Resource>()); Ref<ShaderMaterial> smat; - smat.instance(); + smat.instantiate(); Ref<Shader> shader; - shader.instance(); + shader.instantiate(); String code = RS::get_singleton()->shader_get_code(mat->get_shader_rid()); @@ -443,10 +443,10 @@ Ref<Resource> PhysicalSkyMaterialConversionPlugin::convert(const Ref<Resource> & ERR_FAIL_COND_V(!mat.is_valid(), Ref<Resource>()); Ref<ShaderMaterial> smat; - smat.instance(); + smat.instantiate(); Ref<Shader> shader; - shader.instance(); + shader.instantiate(); String code = RS::get_singleton()->shader_get_code(mat->get_shader_rid()); diff --git a/editor/plugins/mesh_editor_plugin.cpp b/editor/plugins/mesh_editor_plugin.cpp index 8d488dce20..fcc6b84efb 100644 --- a/editor/plugins/mesh_editor_plugin.cpp +++ b/editor/plugins/mesh_editor_plugin.cpp @@ -110,7 +110,7 @@ void MeshEditor::_bind_methods() { MeshEditor::MeshEditor() { viewport = memnew(SubViewport); Ref<World3D> world_3d; - world_3d.instance(); + world_3d.instantiate(); viewport->set_world_3d(world_3d); //use own world add_child(viewport); viewport->set_disable_input(true); @@ -182,6 +182,6 @@ void EditorInspectorPluginMesh::parse_begin(Object *p_object) { MeshEditorPlugin::MeshEditorPlugin(EditorNode *p_node) { Ref<EditorInspectorPluginMesh> plugin; - plugin.instance(); + plugin.instantiate(); add_inspector_plugin(plugin); } diff --git a/editor/plugins/mesh_library_editor_plugin.cpp b/editor/plugins/mesh_library_editor_plugin.cpp index e64992759d..5d1d29cbc8 100644 --- a/editor/plugins/mesh_library_editor_plugin.cpp +++ b/editor/plugins/mesh_library_editor_plugin.cpp @@ -193,7 +193,7 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library, void MeshLibraryEditor::_import_scene_cbk(const String &p_str) { Ref<PackedScene> ps = ResourceLoader::load(p_str, "PackedScene"); ERR_FAIL_COND(ps.is_null()); - Node *scene = ps->instance(); + Node *scene = ps->instantiate(); ERR_FAIL_COND_MSG(!scene, "Cannot create an instance from PackedScene '" + p_str + "'."); diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 3027246862..dcb79832b1 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -3714,7 +3714,7 @@ void Node3DEditorViewport::_create_preview(const Vector<String> &files) const { preview_node->add_child(mesh_instance); } else { if (scene.is_valid()) { - Node *instance = scene->instance(); + Node *instance = scene->instantiate(); if (instance) { preview_node->add_child(instance); } @@ -3759,49 +3759,49 @@ bool Node3DEditorViewport::_create_instance(Node *parent, String &path, const Po Ref<PackedScene> scene = Ref<PackedScene>(Object::cast_to<PackedScene>(*res)); Ref<Mesh> mesh = Ref<Mesh>(Object::cast_to<Mesh>(*res)); - Node *instanced_scene = nullptr; + Node *instantiated_scene = nullptr; if (mesh != nullptr || scene != nullptr) { if (mesh != nullptr) { MeshInstance3D *mesh_instance = memnew(MeshInstance3D); mesh_instance->set_mesh(mesh); mesh_instance->set_name(path.get_file().get_basename()); - instanced_scene = mesh_instance; + instantiated_scene = mesh_instance; } else { if (!scene.is_valid()) { // invalid scene return false; } else { - instanced_scene = scene->instance(PackedScene::GEN_EDIT_STATE_INSTANCE); + instantiated_scene = scene->instantiate(PackedScene::GEN_EDIT_STATE_INSTANCE); } } } - if (instanced_scene == nullptr) { + if (instantiated_scene == nullptr) { return false; } if (editor->get_edited_scene()->get_filename() != "") { // cyclical instancing - if (_cyclical_dependency_exists(editor->get_edited_scene()->get_filename(), instanced_scene)) { - memdelete(instanced_scene); + if (_cyclical_dependency_exists(editor->get_edited_scene()->get_filename(), instantiated_scene)) { + memdelete(instantiated_scene); return false; } } if (scene != nullptr) { - instanced_scene->set_filename(ProjectSettings::get_singleton()->localize_path(path)); + instantiated_scene->set_filename(ProjectSettings::get_singleton()->localize_path(path)); } - editor_data->get_undo_redo().add_do_method(parent, "add_child", instanced_scene); - editor_data->get_undo_redo().add_do_method(instanced_scene, "set_owner", editor->get_edited_scene()); - editor_data->get_undo_redo().add_do_reference(instanced_scene); - editor_data->get_undo_redo().add_undo_method(parent, "remove_child", instanced_scene); + editor_data->get_undo_redo().add_do_method(parent, "add_child", instantiated_scene); + editor_data->get_undo_redo().add_do_method(instantiated_scene, "set_owner", editor->get_edited_scene()); + editor_data->get_undo_redo().add_do_reference(instantiated_scene); + editor_data->get_undo_redo().add_undo_method(parent, "remove_child", instantiated_scene); - String new_name = parent->validate_child_name(instanced_scene); + String new_name = parent->validate_child_name(instantiated_scene); EditorDebuggerNode *ed = EditorDebuggerNode::get_singleton(); editor_data->get_undo_redo().add_do_method(ed, "live_debug_instance_node", editor->get_edited_scene()->get_path_to(parent), path, new_name); editor_data->get_undo_redo().add_undo_method(ed, "live_debug_remove_node", NodePath(String(editor->get_edited_scene()->get_path_to(parent)) + "/" + new_name)); - Node3D *node3d = Object::cast_to<Node3D>(instanced_scene); + Node3D *node3d = Object::cast_to<Node3D>(instantiated_scene); if (node3d) { Transform3D global_transform; Node3D *parent_node3d = Object::cast_to<Node3D>(parent); @@ -3812,7 +3812,7 @@ bool Node3DEditorViewport::_create_instance(Node *parent, String &path, const Po global_transform.origin = spatial_editor->snap_point(_get_instance_position(p_point)); global_transform.basis *= node3d->get_transform().basis; - editor_data->get_undo_redo().add_do_method(instanced_scene, "set_global_transform", global_transform); + editor_data->get_undo_redo().add_do_method(instantiated_scene, "set_global_transform", global_transform); } return true; @@ -3855,7 +3855,7 @@ void Node3DEditorViewport::_perform_drop_data() { } bool Node3DEditorViewport::can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const { - bool can_instance = false; + bool can_instantiate = false; if (!preview_node->is_inside_tree()) { Dictionary d = p_data; @@ -3877,11 +3877,11 @@ bool Node3DEditorViewport::can_drop_data_fw(const Point2 &p_point, const Variant String type = res->get_class(); if (type == "PackedScene") { Ref<PackedScene> sdata = ResourceLoader::load(files[i]); - Node *instanced_scene = sdata->instance(PackedScene::GEN_EDIT_STATE_INSTANCE); - if (!instanced_scene) { + Node *instantiated_scene = sdata->instantiate(PackedScene::GEN_EDIT_STATE_INSTANCE); + if (!instantiated_scene) { continue; } - memdelete(instanced_scene); + memdelete(instantiated_scene); } else if (type == "Mesh" || type == "ArrayMesh" || type == "PrimitiveMesh") { Ref<Mesh> mesh = ResourceLoader::load(files[i]); if (!mesh.is_valid()) { @@ -3890,24 +3890,24 @@ bool Node3DEditorViewport::can_drop_data_fw(const Point2 &p_point, const Variant } else { continue; } - can_instance = true; + can_instantiate = true; break; } } - if (can_instance) { + if (can_instantiate) { _create_preview(files); } } } else { - can_instance = true; + can_instantiate = true; } - if (can_instance) { + if (can_instantiate) { Transform3D global_transform = Transform3D(Basis(), _get_instance_position(p_point)); preview_node->set_global_transform(global_transform); } - return can_instance; + return can_instantiate; } void Node3DEditorViewport::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) { @@ -5317,7 +5317,7 @@ void Node3DEditor::_init_indicators() { origin_enabled = true; grid_enabled = true; - indicator_mat.instance(); + indicator_mat.instantiate(); indicator_mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED); indicator_mat->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true); indicator_mat->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true); @@ -5397,7 +5397,7 @@ void Node3DEditor::_init_indicators() { "}"); for (int i = 0; i < 3; i++) { - grid_mat[i].instance(); + grid_mat[i].instantiate(); grid_mat[i]->set_shader(grid_shader); } @@ -7115,9 +7115,9 @@ Node3DEditor::Node3DEditor(EditorNode *p_editor) { sun_direction->set_default_cursor_shape(CURSOR_MOVE); String sun_dir_shader_code = "shader_type canvas_item; uniform vec3 sun_direction; uniform vec3 sun_color; void fragment() { vec3 n; n.xy = UV * 2.0 - 1.0; n.z = sqrt(max(0.0, 1.0 - dot(n.xy, n.xy))); COLOR.rgb = dot(n,sun_direction) * sun_color; COLOR.a = 1.0 - smoothstep(0.99,1.0,length(n.xy)); }"; - sun_direction_shader.instance(); + sun_direction_shader.instantiate(); sun_direction_shader->set_code(sun_dir_shader_code); - sun_direction_material.instance(); + sun_direction_material.instantiate(); sun_direction_material->set_shader(sun_direction_shader); sun_direction_material->set_shader_param("sun_direction", Vector3(0, 0, 1)); sun_direction_material->set_shader_param("sun_color", Vector3(1, 1, 1)); @@ -7248,11 +7248,11 @@ Node3DEditor::Node3DEditor(EditorNode *p_editor) { preview_sun->set_shadow(true); preview_sun->set_shadow_mode(DirectionalLight3D::SHADOW_PARALLEL_4_SPLITS); preview_environment = memnew(WorldEnvironment); - environment.instance(); + environment.instantiate(); preview_environment->set_environment(environment); Ref<Sky> sky; - sky.instance(); - sky_material.instance(); + sky.instantiate(); + sky_material.instantiate(); sky->set_material(sky_material); environment->set_sky(sky); environment->set_background(Environment::BG_SKY); @@ -7383,17 +7383,17 @@ Node3DEditorPlugin::~Node3DEditorPlugin() { } void EditorNode3DGizmoPlugin::create_material(const String &p_name, const Color &p_color, bool p_billboard, bool p_on_top, bool p_use_vertex_color) { - Color instanced_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/instanced", Color(0.7, 0.7, 0.7, 0.6)); + Color instantiated_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/instantiated", Color(0.7, 0.7, 0.7, 0.6)); Vector<Ref<StandardMaterial3D>> mats; for (int i = 0; i < 4; i++) { bool selected = i % 2 == 1; - bool instanced = i < 2; + bool instantiated = i < 2; Ref<StandardMaterial3D> material = Ref<StandardMaterial3D>(memnew(StandardMaterial3D)); - Color color = instanced ? instanced_color : p_color; + Color color = instantiated ? instantiated_color : p_color; if (!selected) { color.a *= 0.3; @@ -7425,17 +7425,17 @@ void EditorNode3DGizmoPlugin::create_material(const String &p_name, const Color } void EditorNode3DGizmoPlugin::create_icon_material(const String &p_name, const Ref<Texture2D> &p_texture, bool p_on_top, const Color &p_albedo) { - Color instanced_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/instanced", Color(0.7, 0.7, 0.7, 0.6)); + Color instantiated_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/instantiated", Color(0.7, 0.7, 0.7, 0.6)); Vector<Ref<StandardMaterial3D>> icons; for (int i = 0; i < 4; i++) { bool selected = i % 2 == 1; - bool instanced = i < 2; + bool instantiated = i < 2; Ref<StandardMaterial3D> icon = Ref<StandardMaterial3D>(memnew(StandardMaterial3D)); - Color color = instanced ? instanced_color : p_albedo; + Color color = instantiated ? instantiated_color : p_albedo; if (!selected) { color.a *= 0.85; @@ -7594,7 +7594,7 @@ Ref<EditorNode3DGizmo> EditorNode3DGizmoPlugin::create_gizmo(Node3D *p_spatial) Ref<EditorNode3DGizmo> ref; if (has_gizmo(p_spatial)) { - ref.instance(); + ref.instantiate(); } return ref; } diff --git a/editor/plugins/node_3d_editor_plugin.h b/editor/plugins/node_3d_editor_plugin.h index 6f03516409..fa432a5868 100644 --- a/editor/plugins/node_3d_editor_plugin.h +++ b/editor/plugins/node_3d_editor_plugin.h @@ -52,7 +52,7 @@ class EditorNode3DGizmo : public Node3DGizmo { GDCLASS(EditorNode3DGizmo, Node3DGizmo); bool selected; - bool instanced; + bool instantiated; public: void set_selected(bool p_selected) { selected = p_selected; } diff --git a/editor/plugins/ot_features_plugin.cpp b/editor/plugins/ot_features_plugin.cpp index ebfdf2c7cd..baab9bc438 100644 --- a/editor/plugins/ot_features_plugin.cpp +++ b/editor/plugins/ot_features_plugin.cpp @@ -208,6 +208,6 @@ bool EditorInspectorPluginOpenTypeFeatures::parse_property(Object *p_object, Var OpenTypeFeaturesEditorPlugin::OpenTypeFeaturesEditorPlugin(EditorNode *p_node) { Ref<EditorInspectorPluginOpenTypeFeatures> ftr_plugin; - ftr_plugin.instance(); + ftr_plugin.instantiate(); EditorInspector::add_inspector_plugin(ftr_plugin); } diff --git a/editor/plugins/path_3d_editor_plugin.cpp b/editor/plugins/path_3d_editor_plugin.cpp index b0eb13c3c6..82b51f8a06 100644 --- a/editor/plugins/path_3d_editor_plugin.cpp +++ b/editor/plugins/path_3d_editor_plugin.cpp @@ -554,7 +554,7 @@ Path3DEditorPlugin::Path3DEditorPlugin(EditorNode *p_node) { mirror_handle_length = true; Ref<Path3DGizmoPlugin> gizmo_plugin; - gizmo_plugin.instance(); + gizmo_plugin.instantiate(); Node3DEditor::get_singleton()->add_gizmo_plugin(gizmo_plugin); sep = memnew(VSeparator); diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp index 8a14db0cfd..1a13a028c8 100644 --- a/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/editor/plugins/polygon_2d_editor_plugin.cpp @@ -162,7 +162,7 @@ void Polygon2DEditor::_update_bone_list() { } Ref<ButtonGroup> bg; - bg.instance(); + bg.instantiate(); for (int i = 0; i < node->get_bone_count(); i++) { CheckBox *cb = memnew(CheckBox); NodePath np = node->get_bone_path(i); @@ -1231,7 +1231,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) : uv_edit->add_child(uv_main_vb); HBoxContainer *uv_mode_hb = memnew(HBoxContainer); - uv_edit_group.instance(); + uv_edit_group.instantiate(); uv_edit_mode[0] = memnew(Button); uv_mode_hb->add_child(uv_edit_mode[0]); diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 0410ab3a45..c11e172ff7 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -71,7 +71,7 @@ Array EditorSyntaxHighlighter::_get_supported_languages() const { Ref<EditorSyntaxHighlighter> EditorSyntaxHighlighter::_create() const { Ref<EditorSyntaxHighlighter> syntax_highlighter; - syntax_highlighter.instance(); + syntax_highlighter.instantiate(); if (get_script_instance()) { syntax_highlighter->set_script(get_script_instance()->get_script()); } @@ -201,7 +201,7 @@ void EditorStandardSyntaxHighlighter::_update_cache() { Ref<EditorSyntaxHighlighter> EditorStandardSyntaxHighlighter::_create() const { Ref<EditorStandardSyntaxHighlighter> syntax_highlighter; - syntax_highlighter.instance(); + syntax_highlighter.instantiate(); return syntax_highlighter; } @@ -209,7 +209,7 @@ Ref<EditorSyntaxHighlighter> EditorStandardSyntaxHighlighter::_create() const { Ref<EditorSyntaxHighlighter> EditorPlainTextSyntaxHighlighter::_create() const { Ref<EditorPlainTextSyntaxHighlighter> syntax_highlighter; - syntax_highlighter.instance(); + syntax_highlighter.instantiate(); return syntax_highlighter; } diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h index 1d379059d4..a03a4b393b 100644 --- a/editor/plugins/script_editor_plugin.h +++ b/editor/plugins/script_editor_plugin.h @@ -80,7 +80,7 @@ public: virtual Ref<EditorSyntaxHighlighter> _create() const override; - EditorStandardSyntaxHighlighter() { highlighter.instance(); } + EditorStandardSyntaxHighlighter() { highlighter.instantiate(); } }; class EditorPlainTextSyntaxHighlighter : public EditorSyntaxHighlighter { diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 04d8c1d555..b36e198b7b 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1861,11 +1861,11 @@ ScriptTextEditor::ScriptTextEditor() { highlighter_menu->set_name("highlighter_menu"); Ref<EditorPlainTextSyntaxHighlighter> plain_highlighter; - plain_highlighter.instance(); + plain_highlighter.instantiate(); add_syntax_highlighter(plain_highlighter); Ref<EditorStandardSyntaxHighlighter> highlighter; - highlighter.instance(); + highlighter.instantiate(); add_syntax_highlighter(highlighter); set_syntax_highlighter(highlighter); diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index 22d598d180..3cc71c7626 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -287,7 +287,7 @@ void ShaderTextEditor::_bind_methods() { } ShaderTextEditor::ShaderTextEditor() { - syntax_highlighter.instance(); + syntax_highlighter.instantiate(); get_text_editor()->set_syntax_highlighter(syntax_highlighter); } diff --git a/editor/plugins/shader_file_editor_plugin.cpp b/editor/plugins/shader_file_editor_plugin.cpp index 47d7f8204b..85ccc5b798 100644 --- a/editor/plugins/shader_file_editor_plugin.cpp +++ b/editor/plugins/shader_file_editor_plugin.cpp @@ -272,7 +272,7 @@ ShaderFileEditor::ShaderFileEditor(EditorNode *p_node) { main_vb->add_child(stage_hb); Ref<ButtonGroup> bg; - bg.instance(); + bg.instantiate(); for (int i = 0; i < RD::SHADER_STAGE_MAX; i++) { Button *button = memnew(Button(stage_str[i])); button->set_toggle_mode(true); diff --git a/editor/plugins/skeleton_3d_editor_plugin.cpp b/editor/plugins/skeleton_3d_editor_plugin.cpp index a97584ebce..0b04c2e50e 100644 --- a/editor/plugins/skeleton_3d_editor_plugin.cpp +++ b/editor/plugins/skeleton_3d_editor_plugin.cpp @@ -700,7 +700,7 @@ Skeleton3DEditorPlugin::Skeleton3DEditorPlugin(EditorNode *p_node) { editor = p_node; Ref<EditorInspectorPluginSkeleton> skeleton_plugin; - skeleton_plugin.instance(); + skeleton_plugin.instantiate(); skeleton_plugin->editor = editor; EditorInspector::add_inspector_plugin(skeleton_plugin); diff --git a/editor/plugins/sprite_2d_editor_plugin.cpp b/editor/plugins/sprite_2d_editor_plugin.cpp index 4a7f6c0f7e..ef328bcfe2 100644 --- a/editor/plugins/sprite_2d_editor_plugin.cpp +++ b/editor/plugins/sprite_2d_editor_plugin.cpp @@ -186,7 +186,7 @@ void Sprite2DEditor::_update_mesh_data() { } Ref<BitMap> bm; - bm.instance(); + bm.instantiate(); bm->create_from_image_alpha(image); int shrink = shrink_pixels->get_value(); @@ -322,7 +322,7 @@ void Sprite2DEditor::_convert_to_mesh_2d_node() { } Ref<ArrayMesh> mesh; - mesh.instance(); + mesh.instantiate(); Array a; a.resize(Mesh::ARRAY_MAX); @@ -435,7 +435,7 @@ void Sprite2DEditor::_create_light_occluder_2d_node() { Vector<Vector2> outline = computed_outline_lines[i]; Ref<OccluderPolygon2D> polygon; - polygon.instance(); + polygon.instantiate(); PackedVector2Array a; a.resize(outline.size()); diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp index af72f59c1c..70c7b3072b 100644 --- a/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/editor/plugins/sprite_frames_editor_plugin.cpp @@ -227,7 +227,7 @@ void SpriteFramesEditor::_sheet_add_frames() { int y = (yp * height) + region_rect.position.y; Ref<AtlasTexture> at; - at.instance(); + at.instantiate(); at->set_atlas(split_sheet_preview->get_texture()); at->set_region(Rect2(x, y, width, height)); diff --git a/editor/plugins/style_box_editor_plugin.cpp b/editor/plugins/style_box_editor_plugin.cpp index 64df982d5d..6954cacac6 100644 --- a/editor/plugins/style_box_editor_plugin.cpp +++ b/editor/plugins/style_box_editor_plugin.cpp @@ -93,6 +93,6 @@ StyleBoxPreview::StyleBoxPreview() { StyleBoxEditorPlugin::StyleBoxEditorPlugin(EditorNode *p_node) { Ref<EditorInspectorPluginStyleBox> inspector_plugin; - inspector_plugin.instance(); + inspector_plugin.instantiate(); add_inspector_plugin(inspector_plugin); } diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp index 621f843e6f..e906f62fd3 100644 --- a/editor/plugins/text_editor.cpp +++ b/editor/plugins/text_editor.cpp @@ -581,11 +581,11 @@ TextEditor::TextEditor() { highlighter_menu->connect("id_pressed", callable_mp(this, &TextEditor::_change_syntax_highlighter)); Ref<EditorPlainTextSyntaxHighlighter> plain_highlighter; - plain_highlighter.instance(); + plain_highlighter.instantiate(); add_syntax_highlighter(plain_highlighter); Ref<EditorStandardSyntaxHighlighter> highlighter; - highlighter.instance(); + highlighter.instantiate(); add_syntax_highlighter(highlighter); set_syntax_highlighter(plain_highlighter); diff --git a/editor/plugins/texture_3d_editor_plugin.cpp b/editor/plugins/texture_3d_editor_plugin.cpp index 36297c8a4a..696aa88e23 100644 --- a/editor/plugins/texture_3d_editor_plugin.cpp +++ b/editor/plugins/texture_3d_editor_plugin.cpp @@ -85,9 +85,9 @@ void Texture3DEditor::_make_shaders() { " COLOR = textureLod(tex,vec3(UV,layer),0.0);\n" "}"; - shader.instance(); + shader.instantiate(); shader->set_code(shader_3d); - material.instance(); + material.instantiate(); material->set_shader(shader); } @@ -207,6 +207,6 @@ void EditorInspectorPlugin3DTexture::parse_begin(Object *p_object) { Texture3DEditorPlugin::Texture3DEditorPlugin(EditorNode *p_node) { Ref<EditorInspectorPlugin3DTexture> plugin; - plugin.instance(); + plugin.instantiate(); add_inspector_plugin(plugin); } diff --git a/editor/plugins/texture_editor_plugin.cpp b/editor/plugins/texture_editor_plugin.cpp index ecf7370834..10b942d9ee 100644 --- a/editor/plugins/texture_editor_plugin.cpp +++ b/editor/plugins/texture_editor_plugin.cpp @@ -160,6 +160,6 @@ void EditorInspectorPluginTexture::parse_begin(Object *p_object) { TextureEditorPlugin::TextureEditorPlugin(EditorNode *p_node) { Ref<EditorInspectorPluginTexture> plugin; - plugin.instance(); + plugin.instantiate(); add_inspector_plugin(plugin); } diff --git a/editor/plugins/texture_layered_editor_plugin.cpp b/editor/plugins/texture_layered_editor_plugin.cpp index 89ed98d53e..3f46cd64a2 100644 --- a/editor/plugins/texture_layered_editor_plugin.cpp +++ b/editor/plugins/texture_layered_editor_plugin.cpp @@ -112,7 +112,7 @@ void TextureLayeredEditor::_make_shaders() { " COLOR = textureLod(tex,vec3(UV,layer),0.0);\n" "}"; - shaders[0].instance(); + shaders[0].instantiate(); shaders[0]->set_code(shader_2d_array); String shader_cube = "" @@ -125,7 +125,7 @@ void TextureLayeredEditor::_make_shaders() { " COLOR = textureLod(tex,n,0.0);\n" "}"; - shaders[1].instance(); + shaders[1].instantiate(); shaders[1]->set_code(shader_cube); String shader_cube_array = "" @@ -139,11 +139,11 @@ void TextureLayeredEditor::_make_shaders() { " COLOR = textureLod(tex,vec4(n,layer),0.0);\n" "}"; - shaders[2].instance(); + shaders[2].instantiate(); shaders[2]->set_code(shader_cube_array); for (int i = 0; i < 3; i++) { - materials[i].instance(); + materials[i].instantiate(); materials[i]->set_shader(shaders[i]); } } @@ -271,6 +271,6 @@ void EditorInspectorPluginLayeredTexture::parse_begin(Object *p_object) { TextureLayeredEditorPlugin::TextureLayeredEditorPlugin(EditorNode *p_node) { Ref<EditorInspectorPluginLayeredTexture> plugin; - plugin.instance(); + plugin.instantiate(); add_inspector_plugin(plugin); } diff --git a/editor/plugins/theme_editor_preview.cpp b/editor/plugins/theme_editor_preview.cpp index cb7b5949d1..0b02150444 100644 --- a/editor/plugins/theme_editor_preview.cpp +++ b/editor/plugins/theme_editor_preview.cpp @@ -403,7 +403,7 @@ void SceneThemeEditorPreview::_reload_scene() { preview_content->remove_child(node); } - Node *instance = loaded_scene->instance(); + Node *instance = loaded_scene->instantiate(); if (!instance || !Object::cast_to<Control>(instance)) { EditorNode::get_singleton()->show_warning(TTR("Invalid PackedScene resource, must have a Control node at its root.")); emit_signal("scene_invalidated"); @@ -435,7 +435,7 @@ bool SceneThemeEditorPreview::set_preview_scene(const String &p_path) { return false; } - Node *instance = loaded_scene->instance(); + Node *instance = loaded_scene->instantiate(); if (!instance || !Object::cast_to<Control>(instance)) { EditorNode::get_singleton()->show_warning(TTR("Invalid PackedScene resource, must have a Control node at its root.")); return false; diff --git a/editor/plugins/tiles/tile_map_editor.cpp b/editor/plugins/tiles/tile_map_editor.cpp index ef13d8ea12..7ad6462c0e 100644 --- a/editor/plugins/tiles/tile_map_editor.cpp +++ b/editor/plugins/tiles/tile_map_editor.cpp @@ -1756,7 +1756,7 @@ TileMapEditorTilesPlugin::TileMapEditorTilesPlugin() { HBoxContainer *tilemap_tiles_tools_buttons = memnew(HBoxContainer); - tool_buttons_group.instance(); + tool_buttons_group.instantiate(); select_tool_button = memnew(Button); select_tool_button->set_flat(true); @@ -3043,11 +3043,11 @@ void TileMapEditorTerrainsPlugin::_update_terrains_tree() { } } else { Ref<Image> image; - image.instance(); + image.instantiate(); image->create(1, 1, false, Image::FORMAT_RGBA8); image->set_pixel(0, 0, tile_set->get_terrain_color(terrain_set_index, terrain_index)); Ref<ImageTexture> image_texture; - image_texture.instance(); + image_texture.instantiate(); image_texture->create_from_image(image); image_texture->set_size_override(Size2(32, 32) * EDSCALE); icon = image_texture; @@ -3188,7 +3188,7 @@ TileMapEditorTerrainsPlugin::TileMapEditorTerrainsPlugin() { HBoxContainer *tilemap_tiles_tools_buttons = memnew(HBoxContainer); - tool_buttons_group.instance(); + tool_buttons_group.instantiate(); paint_tool_button = memnew(Button); paint_tool_button->set_flat(true); diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp index eb52aff318..f6007afe4e 100644 --- a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp @@ -1719,7 +1719,7 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() { add_child(confirm_auto_create_tiles); // -- Toolbox -- - tools_button_group.instance(); + tools_button_group.instantiate(); toolbox = memnew(HBoxContainer); right_panel->add_child(toolbox); diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index e393f960bd..00750c3032 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -818,7 +818,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id) { if (is_expression) { CodeEdit *expression_box = memnew(CodeEdit); Ref<CodeHighlighter> expression_syntax_highlighter; - expression_syntax_highlighter.instance(); + expression_syntax_highlighter.instantiate(); expression_node->set_ctrl_pressed(expression_box, 0); node->add_child(expression_box); register_expression_edit(p_id, expression_box); @@ -1053,7 +1053,7 @@ void VisualShaderEditor::update_custom_nodes() { Ref<Script> script = Ref<Script>(res); Ref<VisualShaderNodeCustom> ref; - ref.instance(); + ref.instantiate(); ref->set_script(script); String name; @@ -2209,7 +2209,7 @@ void VisualShaderEditor::_add_node(int p_idx, int p_op_idx, String p_resource_pa bool is_custom = add_options[p_idx].is_custom; if (!is_custom && add_options[p_idx].type != String()) { - VisualShaderNode *vsn = Object::cast_to<VisualShaderNode>(ClassDB::instance(add_options[p_idx].type)); + VisualShaderNode *vsn = Object::cast_to<VisualShaderNode>(ClassDB::instantiate(add_options[p_idx].type)); ERR_FAIL_COND(!vsn); VisualShaderNodeFloatConstant *constant = Object::cast_to<VisualShaderNodeFloatConstant>(vsn); @@ -2234,7 +2234,7 @@ void VisualShaderEditor::_add_node(int p_idx, int p_op_idx, String p_resource_pa } else { ERR_FAIL_COND(add_options[p_idx].script.is_null()); String base_type = add_options[p_idx].script->get_instance_base_type(); - VisualShaderNode *vsn = Object::cast_to<VisualShaderNode>(ClassDB::instance(base_type)); + VisualShaderNode *vsn = Object::cast_to<VisualShaderNode>(ClassDB::instantiate(base_type)); ERR_FAIL_COND(!vsn); vsnode = Ref<VisualShaderNode>(vsn); vsnode->set_script(add_options[p_idx].script); @@ -3835,7 +3835,7 @@ VisualShaderEditor::VisualShaderEditor() { preview_vbox->add_theme_constant_override("separation", 0); preview_text = memnew(CodeEdit); - syntax_highlighter.instance(); + syntax_highlighter.instantiate(); preview_vbox->add_child(preview_text); preview_text->set_v_size_flags(Control::SIZE_EXPAND_FILL); preview_text->set_syntax_highlighter(syntax_highlighter); @@ -4427,10 +4427,10 @@ VisualShaderEditor::VisualShaderEditor() { undo_redo = EditorNode::get_singleton()->get_undo_redo(); Ref<VisualShaderNodePluginDefault> default_plugin; - default_plugin.instance(); + default_plugin.instantiate(); add_plugin(default_plugin); - graph_plugin.instance(); + graph_plugin.instantiate(); property_editor = memnew(CustomPropertyEditor); add_child(property_editor); @@ -4885,14 +4885,14 @@ void VisualShaderNodePortPreview::_shader_changed() { String shader_code = shader->generate_preview_shader(type, node, port, default_textures); Ref<Shader> preview_shader; - preview_shader.instance(); + preview_shader.instantiate(); preview_shader->set_code(shader_code); for (int i = 0; i < default_textures.size(); i++) { preview_shader->set_default_texture_param(default_textures[i].name, default_textures[i].param); } Ref<ShaderMaterial> material; - material.instance(); + material.instantiate(); material->set_shader(preview_shader); //find if a material is also being edited and copy parameters to this one @@ -4977,7 +4977,7 @@ Ref<Resource> VisualShaderConversionPlugin::convert(const Ref<Resource> &p_resou ERR_FAIL_COND_V(!vshader.is_valid(), Ref<Resource>()); Ref<Shader> shader; - shader.instance(); + shader.instantiate(); String code = vshader->get_code(); shader->set_code(code); diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index fdd114bb1e..50a763f05a 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -862,7 +862,7 @@ public: rasterizer_container->add_child(l); Container *rshb = memnew(HBoxContainer); rasterizer_container->add_child(rshb); - rasterizer_button_group.instance(); + rasterizer_button_group.instantiate(); Container *rvb = memnew(VBoxContainer); rvb->set_h_size_flags(Control::SIZE_EXPAND_FILL); @@ -1145,7 +1145,7 @@ void ProjectList::load_project_icon(int p_index) { Ref<Texture2D> icon; if (item.icon != "") { Ref<Image> img; - img.instance(); + img.instantiate(); Error err = img->load(item.icon.replace_first("res://", item.path + "/")); if (err == OK) { img->resize(default_icon->get_width(), default_icon->get_height(), Image::INTERPOLATE_LANCZOS); diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index ba3c9aafb4..7414c2d8e6 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -192,7 +192,7 @@ void CustomPropertyEditor::_menu_option(int p_which) { String orig_type = res_orig->get_class(); - Object *inst = ClassDB::instance(orig_type); + Object *inst = ClassDB::instantiate(orig_type); Ref<Resource> res = Ref<Resource>(Object::cast_to<Resource>(inst)); @@ -262,7 +262,7 @@ void CustomPropertyEditor::_menu_option(int p_which) { return; } - Variant obj = ClassDB::instance(intype); + Variant obj = ClassDB::instantiate(intype); if (!obj) { if (ScriptServer::is_global_class(intype)) { @@ -908,7 +908,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: } } - if (!is_custom_resource && !ClassDB::can_instance(t)) { + if (!is_custom_resource && !ClassDB::can_instantiate(t)) { continue; } @@ -1078,7 +1078,7 @@ void CustomPropertyEditor::_type_create_selected(int p_idx) { String intype = inheritors_array[p_idx]; - Variant obj = ClassDB::instance(intype); + Variant obj = ClassDB::instantiate(intype); if (!obj) { if (ScriptServer::is_global_class(intype)) { @@ -1111,7 +1111,7 @@ void CustomPropertyEditor::_node_path_selected(NodePath p_path) { } Ref<ViewportTexture> vt; - vt.instance(); + vt.instantiate(); vt->set_viewport_path_in_scene(get_tree()->get_edited_scene_root()->get_path_to(to_node)); vt->setup_local_to_scene(); v = vt; @@ -1268,7 +1268,7 @@ void CustomPropertyEditor::_action_pressed(int p_which) { String intype = inheritors_array[0]; if (hint == PROPERTY_HINT_RESOURCE_TYPE) { - Variant obj = ClassDB::instance(intype); + Variant obj = ClassDB::instantiate(intype); if (!obj) { if (ScriptServer::is_global_class(intype)) { @@ -1332,7 +1332,7 @@ void CustomPropertyEditor::_action_pressed(int p_which) { propvalues.push_back(p); } - Ref<Resource> res = Ref<Resource>(ClassDB::instance(res_orig->get_class())); + Ref<Resource> res = Ref<Resource>(ClassDB::instantiate(res_orig->get_class())); ERR_FAIL_COND(res.is_null()); @@ -1453,7 +1453,7 @@ void CustomPropertyEditor::_modified(String p_string) { case Variant::INT: { String text = TS->parse_number(value_editor[0]->get_text()); Ref<Expression> expr; - expr.instance(); + expr.instantiate(); Error err = expr->parse(text); if (err != OK) { v = value_editor[0]->get_text().to_int(); @@ -1629,7 +1629,7 @@ void CustomPropertyEditor::_modified(String p_string) { real_t CustomPropertyEditor::_parse_real_expression(String text) { Ref<Expression> expr; - expr.instance(); + expr.instantiate(); Error err = expr->parse(text); real_t out; if (err != OK) { diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 8d6b7f3389..2114ca41d3 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -58,7 +58,7 @@ void SceneTreeDock::_nodes_drag_begin() { } void SceneTreeDock::_quick_open() { - instance_scenes(quick_open->get_selected_files(), scene_tree->get_selected()); + instantiate_scenes(quick_open->get_selected_files(), scene_tree->get_selected()); } void SceneTreeDock::_input(Ref<InputEvent> p_event) { @@ -89,7 +89,7 @@ void SceneTreeDock::_unhandled_key_input(Ref<InputEvent> p_event) { } else if (ED_IS_SHORTCUT("scene_tree/add_child_node", p_event)) { _tool_selected(TOOL_NEW); } else if (ED_IS_SHORTCUT("scene_tree/instance_scene", p_event)) { - _tool_selected(TOOL_INSTANCE); + _tool_selected(TOOL_INSTANTIATE); } else if (ED_IS_SHORTCUT("scene_tree/expand_collapse_all", p_event)) { _tool_selected(TOOL_EXPAND_COLLAPSE); } else if (ED_IS_SHORTCUT("scene_tree/cut_node", p_event)) { @@ -128,13 +128,13 @@ void SceneTreeDock::_unhandled_key_input(Ref<InputEvent> p_event) { accept_event(); } -void SceneTreeDock::instance(const String &p_file) { +void SceneTreeDock::instantiate(const String &p_file) { Vector<String> scenes; scenes.push_back(p_file); - instance_scenes(scenes, scene_tree->get_selected()); + instantiate_scenes(scenes, scene_tree->get_selected()); } -void SceneTreeDock::instance_scenes(const Vector<String> &p_files, Node *p_parent) { +void SceneTreeDock::instantiate_scenes(const Vector<String> &p_files, Node *p_parent) { Node *parent = p_parent; if (!parent) { @@ -147,18 +147,18 @@ void SceneTreeDock::instance_scenes(const Vector<String> &p_files, Node *p_paren if (!parent) { if (p_files.size() == 1) { - accept->set_text(TTR("No parent to instance a child at.")); + accept->set_text(TTR("No parent to instantiate a child at.")); } else { - accept->set_text(TTR("No parent to instance the scenes at.")); + accept->set_text(TTR("No parent to instantiate the scenes at.")); } accept->popup_centered(); return; }; - _perform_instance_scenes(p_files, parent, -1); + _perform_instantiate_scenes(p_files, parent, -1); } -void SceneTreeDock::_perform_instance_scenes(const Vector<String> &p_files, Node *parent, int p_pos) { +void SceneTreeDock::_perform_instantiate_scenes(const Vector<String> &p_files, Node *parent, int p_pos) { ERR_FAIL_COND(!parent); Vector<Node *> instances; @@ -175,8 +175,8 @@ void SceneTreeDock::_perform_instance_scenes(const Vector<String> &p_files, Node break; } - Node *instanced_scene = sdata->instance(PackedScene::GEN_EDIT_STATE_INSTANCE); - if (!instanced_scene) { + Node *instantiated_scene = sdata->instantiate(PackedScene::GEN_EDIT_STATE_INSTANCE); + if (!instantiated_scene) { current_option = -1; accept->set_text(vformat(TTR("Error instancing scene from %s"), p_files[i])); accept->popup_centered(); @@ -185,7 +185,7 @@ void SceneTreeDock::_perform_instance_scenes(const Vector<String> &p_files, Node } if (edited_scene->get_filename() != "") { - if (_cyclical_dependency_exists(edited_scene->get_filename(), instanced_scene)) { + if (_cyclical_dependency_exists(edited_scene->get_filename(), instantiated_scene)) { accept->set_text(vformat(TTR("Cannot instance the scene '%s' because the current scene exists within one of its nodes."), p_files[i])); accept->popup_centered(); error = true; @@ -193,9 +193,9 @@ void SceneTreeDock::_perform_instance_scenes(const Vector<String> &p_files, Node } } - instanced_scene->set_filename(ProjectSettings::get_singleton()->localize_path(p_files[i])); + instantiated_scene->set_filename(ProjectSettings::get_singleton()->localize_path(p_files[i])); - instances.push_back(instanced_scene); + instances.push_back(instantiated_scene); } if (error) { @@ -208,19 +208,19 @@ void SceneTreeDock::_perform_instance_scenes(const Vector<String> &p_files, Node editor_data->get_undo_redo().create_action(TTR("Instance Scene(s)")); for (int i = 0; i < instances.size(); i++) { - Node *instanced_scene = instances[i]; + Node *instantiated_scene = instances[i]; - editor_data->get_undo_redo().add_do_method(parent, "add_child", instanced_scene); + editor_data->get_undo_redo().add_do_method(parent, "add_child", instantiated_scene); if (p_pos >= 0) { - editor_data->get_undo_redo().add_do_method(parent, "move_child", instanced_scene, p_pos + i); + editor_data->get_undo_redo().add_do_method(parent, "move_child", instantiated_scene, p_pos + i); } - editor_data->get_undo_redo().add_do_method(instanced_scene, "set_owner", edited_scene); + editor_data->get_undo_redo().add_do_method(instantiated_scene, "set_owner", edited_scene); editor_data->get_undo_redo().add_do_method(editor_selection, "clear"); - editor_data->get_undo_redo().add_do_method(editor_selection, "add_node", instanced_scene); - editor_data->get_undo_redo().add_do_reference(instanced_scene); - editor_data->get_undo_redo().add_undo_method(parent, "remove_child", instanced_scene); + editor_data->get_undo_redo().add_do_method(editor_selection, "add_node", instantiated_scene); + editor_data->get_undo_redo().add_do_reference(instantiated_scene); + editor_data->get_undo_redo().add_undo_method(parent, "remove_child", instantiated_scene); - String new_name = parent->validate_child_name(instanced_scene); + String new_name = parent->validate_child_name(instantiated_scene); EditorDebuggerNode *ed = EditorDebuggerNode::get_singleton(); editor_data->get_undo_redo().add_do_method(ed, "live_debug_instance_node", edited_scene->get_path_to(parent), p_files[i], new_name); editor_data->get_undo_redo().add_undo_method(ed, "live_debug_remove_node", NodePath(String(edited_scene->get_path_to(parent)).plus_file(new_name))); @@ -241,8 +241,8 @@ void SceneTreeDock::_replace_with_branch_scene(const String &p_file, Node *base) return; } - Node *instanced_scene = sdata->instance(PackedScene::GEN_EDIT_STATE_INSTANCE); - if (!instanced_scene) { + Node *instantiated_scene = sdata->instantiate(PackedScene::GEN_EDIT_STATE_INSTANCE); + if (!instantiated_scene) { accept->set_text(vformat(TTR("Error instancing scene from %s"), p_file)); accept->popup_centered(); return; @@ -254,10 +254,10 @@ void SceneTreeDock::_replace_with_branch_scene(const String &p_file, Node *base) Node *parent = base->get_parent(); int pos = base->get_index(); undo_redo->add_do_method(parent, "remove_child", base); - undo_redo->add_undo_method(parent, "remove_child", instanced_scene); - undo_redo->add_do_method(parent, "add_child", instanced_scene); + undo_redo->add_undo_method(parent, "remove_child", instantiated_scene); + undo_redo->add_do_method(parent, "add_child", instantiated_scene); undo_redo->add_undo_method(parent, "add_child", base); - undo_redo->add_do_method(parent, "move_child", instanced_scene, pos); + undo_redo->add_do_method(parent, "move_child", instantiated_scene, pos); undo_redo->add_undo_method(parent, "move_child", base, pos); List<Node *> owned; @@ -266,17 +266,17 @@ void SceneTreeDock::_replace_with_branch_scene(const String &p_file, Node *base) for (List<Node *>::Element *F = owned.front(); F; F = F->next()) { owners.push_back(F->get()); } - undo_redo->add_do_method(instanced_scene, "set_owner", edited_scene); + undo_redo->add_do_method(instantiated_scene, "set_owner", edited_scene); undo_redo->add_undo_method(this, "_set_owners", edited_scene, owners); undo_redo->add_do_method(editor_selection, "clear"); undo_redo->add_undo_method(editor_selection, "clear"); - undo_redo->add_do_method(editor_selection, "add_node", instanced_scene); + undo_redo->add_do_method(editor_selection, "add_node", instantiated_scene); undo_redo->add_undo_method(editor_selection, "add_node", base); - undo_redo->add_do_property(scene_tree, "set_selected", instanced_scene); + undo_redo->add_do_property(scene_tree, "set_selected", instantiated_scene); undo_redo->add_undo_property(scene_tree, "set_selected", base); - undo_redo->add_do_reference(instanced_scene); + undo_redo->add_do_reference(instantiated_scene); undo_redo->add_undo_reference(base); undo_redo->commit_action(); } @@ -313,7 +313,7 @@ bool SceneTreeDock::_track_inherit(const String &p_target_scene_path, Node *p_de String path = ss->get_path(); Ref<PackedScene> data = ResourceLoader::load(path); if (data.is_valid()) { - p = data->instance(PackedScene::GEN_EDIT_STATE_INSTANCE); + p = data->instantiate(PackedScene::GEN_EDIT_STATE_INSTANCE); if (!p) { continue; } @@ -388,7 +388,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { emit_signal("add_node_used"); } } break; - case TOOL_INSTANCE: { + case TOOL_INSTANTIATE: { if (!profile_allow_editing) { break; } @@ -400,7 +400,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { } quick_open->popup_dialog("PackedScene", true); - quick_open->set_title(TTR("Instance Child Scene")); + quick_open->set_title(TTR("Instantiate Child Scene")); if (!p_confirm_override) { emit_signal("add_node_used"); } @@ -881,7 +881,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { if (node == editor_data->get_edited_scene_root()) { msg = vformat(TTR("Delete the root node \"%s\"?"), node->get_name()); } else if (node->get_filename() == "" && node->get_child_count() > 0) { - // Display this message only for non-instanced scenes + // Display this message only for non-instantiated scenes msg = vformat(TTR("Delete node \"%s\" and its children?"), node->get_name()); } else { msg = vformat(TTR("Delete node \"%s\"?"), node->get_name()); @@ -922,13 +922,13 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { Node *tocopy = selection.front()->get(); if (tocopy == scene) { - accept->set_text(TTR("Can't save the root node branch as an instanced scene.\nTo create an editable copy of the current scene, duplicate it using the FileSystem dock context menu\nor create an inherited scene using Scene > New Inherited Scene... instead.")); + accept->set_text(TTR("Can't save the root node branch as an instantiated scene.\nTo create an editable copy of the current scene, duplicate it using the FileSystem dock context menu\nor create an inherited scene using Scene > New Inherited Scene... instead.")); accept->popup_centered(); break; } if (tocopy != editor_data->get_edited_scene_root() && tocopy->get_filename() != "") { - accept->set_text(TTR("Can't save the branch of an already instanced scene.\nTo create a variation of a scene, you can make an inherited scene based on the instanced scene using Scene > New Inherited Scene... instead.")); + accept->set_text(TTR("Can't save the branch of an already instantiated scene.\nTo create a variation of a scene, you can make an inherited scene based on the instantiated scene using Scene > New Inherited Scene... instead.")); accept->popup_centered(); break; } @@ -1103,14 +1103,14 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { if (TOOL_CREATE_FAVORITE == p_tool) { String name = selected_favorite_root.get_slicec(' ', 0); if (ScriptServer::is_global_class(name)) { - new_node = Object::cast_to<Node>(ClassDB::instance(ScriptServer::get_global_class_native_base(name))); + new_node = Object::cast_to<Node>(ClassDB::instantiate(ScriptServer::get_global_class_native_base(name))); Ref<Script> script = ResourceLoader::load(ScriptServer::get_global_class_path(name), "Script"); if (new_node && script.is_valid()) { new_node->set_script(script); new_node->set_name(name); } } else { - new_node = Object::cast_to<Node>(ClassDB::instance(selected_favorite_root)); + new_node = Object::cast_to<Node>(ClassDB::instantiate(selected_favorite_root)); } if (!new_node) { @@ -1640,7 +1640,7 @@ bool SceneTreeDock::_validate_no_instance() { for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { if (E->get() != edited_scene && E->get()->get_filename() != "") { - accept->set_text(TTR("This operation can't be done on instanced scenes.")); + accept->set_text(TTR("This operation can't be done on instantiated scenes.")); accept->popup_centered(); return false; } @@ -2218,7 +2218,7 @@ void SceneTreeDock::replace_node(Node *p_node, Node *p_by_node, bool p_keep_prop Node *newnode = p_by_node; if (p_keep_properties) { - Node *default_oldnode = Object::cast_to<Node>(ClassDB::instance(n->get_class())); + Node *default_oldnode = Object::cast_to<Node>(ClassDB::instantiate(n->get_class())); List<PropertyInfo> pinfo; n->get_property_list(&pinfo); @@ -2459,7 +2459,7 @@ void SceneTreeDock::_files_dropped(Vector<String> p_files, NodePath p_to, int p_ int to_pos = -1; _normalize_drop(node, to_pos, p_type); - _perform_instance_scenes(p_files, node, to_pos); + _perform_instantiate_scenes(p_files, node, to_pos); } void SceneTreeDock::_script_dropped(String p_file, NodePath p_to) { @@ -2542,7 +2542,7 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) { menu->clear(); if (profile_allow_editing) { menu->add_icon_shortcut(get_theme_icon("Add", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/add_child_node"), TOOL_NEW); - menu->add_icon_shortcut(get_theme_icon("Instance", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/instance_scene"), TOOL_INSTANCE); + menu->add_icon_shortcut(get_theme_icon("Instance", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/instance_scene"), TOOL_INSTANTIATE); } menu->set_size(Size2(1, 1)); @@ -2575,7 +2575,7 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) { } menu->add_icon_shortcut(get_theme_icon("Add", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/add_child_node"), TOOL_NEW); - menu->add_icon_shortcut(get_theme_icon("Instance", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/instance_scene"), TOOL_INSTANCE); + menu->add_icon_shortcut(get_theme_icon("Instance", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/instance_scene"), TOOL_INSTANTIATE); } menu->add_icon_shortcut(get_theme_icon("Collapse", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/expand_collapse_all"), TOOL_EXPAND_COLLAPSE); menu->add_separator(); @@ -2813,7 +2813,7 @@ void SceneTreeDock::open_add_child_dialog() { } void SceneTreeDock::open_instance_child_dialog() { - _tool_selected(TOOL_INSTANCE, true); + _tool_selected(TOOL_INSTANTIATE, true); } void SceneTreeDock::add_remote_tree_editor(Control *p_remote) { @@ -2959,7 +2959,7 @@ void SceneTreeDock::_clear_clipboard() { void SceneTreeDock::_create_remap_for_node(Node *p_node, Map<RES, RES> &r_remap) { List<PropertyInfo> props; p_node->get_property_list(&props); - bool is_instanced = EditorPropertyRevert::may_node_be_in_instance(p_node); + bool is_instantiated = EditorPropertyRevert::may_node_be_in_instance(p_node); for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) { if (!(E->get().usage & PROPERTY_USAGE_STORAGE)) { @@ -2970,9 +2970,9 @@ void SceneTreeDock::_create_remap_for_node(Node *p_node, Map<RES, RES> &r_remap) if (v.is_ref()) { RES res = v; if (res.is_valid()) { - if (is_instanced) { + if (is_instantiated) { Variant orig; - if (EditorPropertyRevert::get_instanced_node_original_property(p_node, E->get().name, orig)) { + if (EditorPropertyRevert::get_instantiated_node_original_property(p_node, E->get().name, orig)) { if (!EditorPropertyRevert::is_node_property_different(p_node, v, orig)) { continue; } @@ -3020,7 +3020,7 @@ void SceneTreeDock::_bind_methods() { ClassDB::bind_method(D_METHOD("_input"), &SceneTreeDock::_input); ClassDB::bind_method(D_METHOD("_update_script_button"), &SceneTreeDock::_update_script_button); - ClassDB::bind_method(D_METHOD("instance"), &SceneTreeDock::instance); + ClassDB::bind_method(D_METHOD("instantiate"), &SceneTreeDock::instantiate); ClassDB::bind_method(D_METHOD("get_tree_editor"), &SceneTreeDock::get_tree_editor); ClassDB::bind_method(D_METHOD("replace_node"), &SceneTreeDock::replace_node); @@ -3054,7 +3054,7 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel ED_SHORTCUT("scene_tree/rename", TTR("Rename"), KEY_F2); ED_SHORTCUT("scene_tree/batch_rename", TTR("Batch Rename"), KEY_MASK_SHIFT | KEY_F2); ED_SHORTCUT("scene_tree/add_child_node", TTR("Add Child Node"), KEY_MASK_CMD | KEY_A); - ED_SHORTCUT("scene_tree/instance_scene", TTR("Instance Child Scene"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_A); + ED_SHORTCUT("scene_tree/instance_scene", TTR("Instantiate Child Scene"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_A); ED_SHORTCUT("scene_tree/expand_collapse_all", TTR("Expand/Collapse All")); ED_SHORTCUT("scene_tree/cut_node", TTR("Cut"), KEY_MASK_CMD | KEY_X); ED_SHORTCUT("scene_tree/copy_node", TTR("Copy"), KEY_MASK_CMD | KEY_C); @@ -3083,8 +3083,8 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel button_instance = memnew(Button); button_instance->set_flat(true); - button_instance->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected), make_binds(TOOL_INSTANCE, false)); - button_instance->set_tooltip(TTR("Instance a scene file as a Node. Creates an inherited scene if no root node exists.")); + button_instance->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected), make_binds(TOOL_INSTANTIATE, false)); + button_instance->set_tooltip(TTR("Instantiate a scene file as a Node. Creates an inherited scene if no root node exists.")); button_instance->set_shortcut(ED_GET_SHORTCUT("scene_tree/instance_scene")); filter_hbc->add_child(button_instance); diff --git a/editor/scene_tree_dock.h b/editor/scene_tree_dock.h index 53f31375f8..a313337540 100644 --- a/editor/scene_tree_dock.h +++ b/editor/scene_tree_dock.h @@ -55,7 +55,7 @@ class SceneTreeDock : public VBoxContainer { enum Tool { TOOL_NEW, - TOOL_INSTANCE, + TOOL_INSTANTIATE, TOOL_EXPAND_COLLAPSE, TOOL_CUT, TOOL_COPY, @@ -224,7 +224,7 @@ class SceneTreeDock : public VBoxContainer { void _filter_changed(const String &p_filter); - void _perform_instance_scenes(const Vector<String> &p_files, Node *parent, int p_pos); + void _perform_instantiate_scenes(const Vector<String> &p_files, Node *parent, int p_pos); void _replace_with_branch_scene(const String &p_file, Node *base); void _file_selected(String p_file); @@ -259,8 +259,8 @@ public: void import_subscene(); void set_edited_scene(Node *p_scene); - void instance(const String &p_file); - void instance_scenes(const Vector<String> &p_files, Node *p_parent = nullptr); + void instantiate(const String &p_file); + void instantiate_scenes(const Vector<String> &p_files, Node *p_parent = nullptr); void set_selected(Node *p_node, bool p_emit_selected = false); void fill_path_renames(Node *p_node, Node *p_new_parent, List<Pair<NodePath, NodePath>> *p_renames); void perform_node_renames(Node *p_base, List<Pair<NodePath, NodePath>> *p_renames, Map<Ref<Animation>, Set<int>> *r_rem_anims = nullptr); diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index a5620f8cc5..3aa04e4dc3 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -944,7 +944,7 @@ Variant SceneTreeEditor::get_drag_data_fw(const Point2 &p_point, Control *p_from Node *n = get_node(np); if (n) { - // Only allow selection if not part of an instanced scene. + // Only allow selection if not part of an instantiated scene. if (!n->get_owner() || n->get_owner() == get_scene_node() || n->get_owner()->get_filename() == String()) { selected.push_back(n); icons.push_back(next->get_icon(0)); diff --git a/main/main.cpp b/main/main.cpp index 667aebebae..f2820fee07 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1669,7 +1669,7 @@ Error Main::setup2(Thread::ID p_main_tid_override) { boot_logo_path = boot_logo_path.strip_edges(); if (boot_logo_path != String()) { - boot_logo.instance(); + boot_logo.instantiate(); Error load_err = ImageLoader::load_image(boot_logo_path, boot_logo); if (load_err) { ERR_PRINT("Non-existing or invalid boot splash at '" + boot_logo_path + "'. Loading default splash."); @@ -2037,9 +2037,9 @@ bool Main::start() { return false; } - if (script_res->can_instance()) { + if (script_res->can_instantiate()) { StringName instance_type = script_res->get_instance_base_type(); - Object *obj = ClassDB::instance(instance_type); + Object *obj = ClassDB::instantiate(instance_type); MainLoop *script_loop = Object::cast_to<MainLoop>(obj); if (!script_loop) { if (obj) { @@ -2060,7 +2060,7 @@ bool Main::start() { String script_path = ScriptServer::get_global_class_path(main_loop_type); Ref<Script> script_res = ResourceLoader::load(script_path); StringName script_base = ScriptServer::get_global_class_native_base(main_loop_type); - Object *obj = ClassDB::instance(script_base); + Object *obj = ClassDB::instantiate(script_base); MainLoop *script_loop = Object::cast_to<MainLoop>(obj); if (!script_loop) { if (obj) { @@ -2083,7 +2083,7 @@ bool Main::start() { DisplayServer::get_singleton()->alert("Error: MainLoop type doesn't exist: " + main_loop_type); return false; } else { - Object *ml = ClassDB::instance(main_loop_type); + Object *ml = ClassDB::instantiate(main_loop_type); ERR_FAIL_COND_V_MSG(!ml, false, "Can't instance MainLoop type."); main_loop = Object::cast_to<MainLoop>(ml); @@ -2140,14 +2140,14 @@ bool Main::start() { Node *n = nullptr; if (res->is_class("PackedScene")) { Ref<PackedScene> ps = res; - n = ps->instance(); + n = ps->instantiate(); } else if (res->is_class("Script")) { Ref<Script> script_res = res; StringName ibt = script_res->get_instance_base_type(); bool valid_type = ClassDB::is_parent_class(ibt, "Node"); ERR_CONTINUE_MSG(!valid_type, "Script does not inherit a Node: " + info.path); - Object *obj = ClassDB::instance(ibt); + Object *obj = ClassDB::instantiate(ibt); ERR_CONTINUE_MSG(obj == nullptr, "Cannot instance script for autoload, expected 'Node' inheritance, got: " + @@ -2350,7 +2350,7 @@ bool Main::start() { Node *scene = nullptr; Ref<PackedScene> scenedata = ResourceLoader::load(local_game_path); if (scenedata.is_valid()) { - scene = scenedata->instance(); + scene = scenedata->instantiate(); } ERR_FAIL_COND_V_MSG(!scene, false, "Failed loading scene: " + local_game_path); @@ -2375,7 +2375,7 @@ bool Main::start() { String iconpath = GLOBAL_DEF("application/config/icon", "Variant()"); if ((iconpath != "") && (!hasicon)) { Ref<Image> icon; - icon.instance(); + icon.instantiate(); if (ImageLoader::load_image(iconpath, icon) == OK) { DisplayServer::get_singleton()->set_icon(icon); hasicon = true; diff --git a/modules/basis_universal/register_types.cpp b/modules/basis_universal/register_types.cpp index 772ac87dbf..23639a4f2f 100644 --- a/modules/basis_universal/register_types.cpp +++ b/modules/basis_universal/register_types.cpp @@ -260,7 +260,7 @@ static Ref<Image> basis_universal_unpacker(const Vector<uint8_t> &p_buffer) { }; }; - image.instance(); + image.instantiate(); image->create(info.m_width, info.m_height, info.m_total_levels > 1, imgfmt, gpudata); return image; diff --git a/modules/basis_universal/texture_basisu.cpp b/modules/basis_universal/texture_basisu.cpp index 6a5f6313c4..9e917420ce 100644 --- a/modules/basis_universal/texture_basisu.cpp +++ b/modules/basis_universal/texture_basisu.cpp @@ -130,7 +130,7 @@ void TextureBasisU::set_basisu_data(const Vector<uint8_t>& p_data) { }; Ref<Image> img; - img.instance(); + img.instantiate(); img->create(info.m_width, info.m_height, info.m_total_levels > 1, imgfmt, gpudata); RenderingServer::get_singleton()->texture_allocate(texture, tex_size.x, tex_size.y, 0, img->get_format(), RS::TEXTURE_TYPE_2D, flags); diff --git a/modules/bmp/image_loader_bmp.cpp b/modules/bmp/image_loader_bmp.cpp index 27b49a6609..171895ed24 100644 --- a/modules/bmp/image_loader_bmp.cpp +++ b/modules/bmp/image_loader_bmp.cpp @@ -298,7 +298,7 @@ static Ref<Image> _bmp_mem_loader_func(const uint8_t *p_bmp, int p_size) { Error open_memfile_error = memfile.open_custom(p_bmp, p_size); ERR_FAIL_COND_V_MSG(open_memfile_error, Ref<Image>(), "Could not create memfile for BMP image buffer."); Ref<Image> img; - img.instance(); + img.instantiate(); Error load_error = ImageLoaderBMP().load_image(img, &memfile, false, 1.0f); ERR_FAIL_COND_V_MSG(load_error, Ref<Image>(), "Failed to load BMP image."); return img; diff --git a/modules/camera/camera_osx.mm b/modules/camera/camera_osx.mm index 9b59b68075..6bc56add20 100644 --- a/modules/camera/camera_osx.mm +++ b/modules/camera/camera_osx.mm @@ -162,7 +162,7 @@ uint8_t *w = img_data[0].ptrw(); memcpy(w, dataY, new_width * new_height); - img[0].instance(); + img[0].instantiate(); img[0]->create(new_width, new_height, 0, Image::FORMAT_R8, img_data[0]); } @@ -181,7 +181,7 @@ memcpy(w, dataCbCr, 2 * new_width * new_height); ///TODO GLES2 doesn't support FORMAT_RG8, need to do some form of conversion - img[1].instance(); + img[1].instantiate(); img[1]->create(new_width, new_height, 0, Image::FORMAT_RG8, img_data[1]); } @@ -341,7 +341,7 @@ void CameraOSX::update_feeds() { if (!found) { Ref<CameraFeedOSX> newfeed; - newfeed.instance(); + newfeed.instantiate(); newfeed->set_device(device); // assume display camera so inverse diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp index d6690bb96c..6b0c2604e3 100644 --- a/modules/csg/csg_shape.cpp +++ b/modules/csg/csg_shape.cpp @@ -44,7 +44,7 @@ void CSGShape3D::set_use_collision(bool p_enable) { } if (use_collision) { - root_collision_shape.instance(); + root_collision_shape.instantiate(); root_collision_instance = PhysicsServer3D::get_singleton()->body_create(); PhysicsServer3D::get_singleton()->body_set_mode(root_collision_instance, PhysicsServer3D::BODY_MODE_STATIC); PhysicsServer3D::get_singleton()->body_set_state(root_collision_instance, PhysicsServer3D::BODY_STATE_TRANSFORM, get_global_transform()); @@ -411,7 +411,7 @@ void CSGShape3D::_update_shape() { } } - root_mesh.instance(); + root_mesh.instantiate(); //create surfaces for (int i = 0; i < surfaces.size(); i++) { @@ -498,7 +498,7 @@ void CSGShape3D::_notification(int p_what) { } if (use_collision && is_root_shape()) { - root_collision_shape.instance(); + root_collision_shape.instantiate(); root_collision_instance = PhysicsServer3D::get_singleton()->body_create(); PhysicsServer3D::get_singleton()->body_set_mode(root_collision_instance, PhysicsServer3D::BODY_MODE_STATIC); PhysicsServer3D::get_singleton()->body_set_state(root_collision_instance, PhysicsServer3D::BODY_STATE_TRANSFORM, get_global_transform()); diff --git a/modules/dds/register_types.cpp b/modules/dds/register_types.cpp index 1444d33171..60282c3f36 100644 --- a/modules/dds/register_types.cpp +++ b/modules/dds/register_types.cpp @@ -35,7 +35,7 @@ static Ref<ResourceFormatDDS> resource_loader_dds; void register_dds_types() { - resource_loader_dds.instance(); + resource_loader_dds.instantiate(); ResourceLoader::add_resource_format_loader(resource_loader_dds); } diff --git a/modules/fbx/data/fbx_material.cpp b/modules/fbx/data/fbx_material.cpp index d54ac86e9f..aef61a679b 100644 --- a/modules/fbx/data/fbx_material.cpp +++ b/modules/fbx/data/fbx_material.cpp @@ -160,7 +160,7 @@ Ref<StandardMaterial3D> FBXMaterial::import_material(ImportState &state) { const String p_fbx_current_directory = state.path; Ref<StandardMaterial3D> spatial_material; - spatial_material.instance(); + spatial_material.instantiate(); // read the material file // is material two sided @@ -223,7 +223,7 @@ Ref<StandardMaterial3D> FBXMaterial::import_material(ImportState &state) { } else if (fbx_texture_data != nullptr && fbx_texture_data->Media() != nullptr && fbx_texture_data->Media()->IsEmbedded()) { // This is an embedded texture. Extract it. Ref<Image> image; - //image.instance(); // oooo double instance bug? why make Image::_png_blah call + //image.instantiate(); // oooo double instance bug? why make Image::_png_blah call const String extension = texture_name.get_extension().to_upper(); if (extension == "PNG") { @@ -256,7 +256,7 @@ Ref<StandardMaterial3D> FBXMaterial::import_material(ImportState &state) { } Ref<ImageTexture> image_texture; - image_texture.instance(); + image_texture.instantiate(); image_texture->create_from_image(image); texture = image_texture; @@ -324,7 +324,7 @@ Ref<StandardMaterial3D> FBXMaterial::import_material(ImportState &state) { if (spatial_material.is_null()) { // Done here so if no data no material is created. - spatial_material.instance(); + spatial_material.instantiate(); } const FBXDocParser::TypedProperty<real_t> *real_value = dynamic_cast<const FBXDocParser::TypedProperty<real_t> *>(prop); diff --git a/modules/fbx/data/fbx_mesh_data.cpp b/modules/fbx/data/fbx_mesh_data.cpp index 8f32c523f9..0d33b8e7c6 100644 --- a/modules/fbx/data/fbx_mesh_data.cpp +++ b/modules/fbx/data/fbx_mesh_data.cpp @@ -211,7 +211,7 @@ EditorSceneImporterMeshNode3D *FBXMeshData::create_fbx_mesh(const ImportState &s const int surface_id = polygon_surfaces[*polygon_id]; if (surfaces.has(surface_id) == false) { SurfaceData sd; - sd.surface_tool.instance(); + sd.surface_tool.instantiate(); sd.surface_tool->begin(Mesh::PRIMITIVE_TRIANGLES); if (surface_id < 0) { @@ -316,7 +316,7 @@ EditorSceneImporterMeshNode3D *FBXMeshData::create_fbx_mesh(const ImportState &s Vector3 *normals_ptr = morph_data->normals.ptrw(); Ref<SurfaceTool> morph_st; - morph_st.instance(); + morph_st.instantiate(); morph_st->begin(Mesh::PRIMITIVE_TRIANGLES); for (unsigned int vi = 0; vi < surface->vertices_map.size(); vi += 1) { @@ -345,7 +345,7 @@ EditorSceneImporterMeshNode3D *FBXMeshData::create_fbx_mesh(const ImportState &s // Phase 6. Compose the mesh and return it. Ref<EditorSceneImporterMesh> mesh; - mesh.instance(); + mesh.instantiate(); // Add blend shape info. for (const String *morph_name = morphs.next(nullptr); morph_name != nullptr; morph_name = morphs.next(morph_name)) { diff --git a/modules/fbx/editor_scene_importer_fbx.cpp b/modules/fbx/editor_scene_importer_fbx.cpp index 40deaae74d..e3f36ef3e3 100644 --- a/modules/fbx/editor_scene_importer_fbx.cpp +++ b/modules/fbx/editor_scene_importer_fbx.cpp @@ -373,7 +373,7 @@ Node3D *EditorSceneImporterFBX::_generate_scene( scene_root->add_child(state.root); state.root->set_owner(scene_root); - state.fbx_root_node.instance(); + state.fbx_root_node.instantiate(); state.fbx_root_node->godot_node = state.root; // Size relative to cm. @@ -389,11 +389,11 @@ Node3D *EditorSceneImporterFBX::_generate_scene( // Enabled by default. state.enable_animation_import = true; Ref<FBXNode> root_node; - root_node.instance(); + root_node.instantiate(); // make sure fake noFBXDocParser::PropertyPtr ptrde always has a transform too ;) Ref<PivotTransform> pivot_transform; - pivot_transform.instance(); + pivot_transform.instantiate(); root_node->pivot_transform = pivot_transform; root_node->node_name = "root node"; root_node->current_node_id = 0; @@ -479,7 +479,7 @@ Node3D *EditorSceneImporterFBX::_generate_scene( if (state.renderer_mesh_data.has(mesh_id)) { mesh_vertex_data = state.renderer_mesh_data[mesh_id]; } else { - mesh_vertex_data.instance(); + mesh_vertex_data.instantiate(); state.renderer_mesh_data.insert(mesh_id, mesh_vertex_data); } @@ -535,7 +535,7 @@ Node3D *EditorSceneImporterFBX::_generate_scene( ERR_CONTINUE_MSG(!mat, "Could not convert fbx material by id: " + itos(material_id)); Ref<FBXMaterial> material; - material.instance(); + material.instantiate(); material->set_imported_material(mat); Ref<StandardMaterial3D> godot_material = material->import_material(state); @@ -575,7 +575,7 @@ Node3D *EditorSceneImporterFBX::_generate_scene( if (state.skeleton_map.has(armature_id)) { fbx_skeleton_inst = state.skeleton_map[armature_id]; } else { - fbx_skeleton_inst.instance(); + fbx_skeleton_inst.instantiate(); state.skeleton_map.insert(armature_id, fbx_skeleton_inst); } @@ -650,7 +650,7 @@ Node3D *EditorSceneImporterFBX::_generate_scene( if (state.renderer_mesh_data.has(mesh_id)) { mesh_data_precached = state.renderer_mesh_data[mesh_id]; } else { - mesh_data_precached.instance(); + mesh_data_precached.instantiate(); state.renderer_mesh_data.insert(mesh_id, mesh_data_precached); } @@ -735,7 +735,7 @@ Node3D *EditorSceneImporterFBX::_generate_scene( Ref<Skin> skin; if (!state.MeshSkins.has(mesh_id)) { print_verbose("Created new skin"); - skin.instance(); + skin.instantiate(); state.MeshSkins.insert(mesh_id, skin); } else { print_verbose("Grabbed skin"); @@ -848,7 +848,7 @@ Node3D *EditorSceneImporterFBX::_generate_scene( } Ref<Animation> animation; - animation.instance(); + animation.instantiate(); animation->set_name(animation_name); animation->set_length(duration); @@ -1312,7 +1312,7 @@ void EditorSceneImporterFBX::BuildDocumentBones(Ref<FBXBone> p_parent_bone, // declare our bone element reference (invalid, unless we create a bone in this step) // this lets us pass valid armature information into children objects and this is why we moved this up here - // previously this was created .instanced() on the same line. + // previously this was created .instantiated() on the same line. Ref<FBXBone> bone_element; if (model != nullptr) { @@ -1324,7 +1324,7 @@ void EditorSceneImporterFBX::BuildDocumentBones(Ref<FBXBone> p_parent_bone, ERR_FAIL_COND_MSG(state.fbx_bone_map.has(limb_node->ID()), "[serious] duplicate LimbNode detected"); bool parent_is_bone = state.fbx_bone_map.find(p_id); - bone_element.instance(); + bone_element.instantiate(); // used to build the bone hierarchy in the skeleton bone_element->parent_bone_id = parent_is_bone ? p_id : 0; @@ -1404,12 +1404,12 @@ void EditorSceneImporterFBX::BuildDocumentNodes( uint64_t current_node_id = model->ID(); Ref<FBXNode> new_node; - new_node.instance(); + new_node.instantiate(); new_node->current_node_id = current_node_id; new_node->node_name = ImportUtils::FBXNodeToName(model->Name()); Ref<PivotTransform> fbx_transform; - fbx_transform.instance(); + fbx_transform.instantiate(); fbx_transform->set_parent(parent_transform); fbx_transform->set_model(model); fbx_transform->debug_pivot_xform("name: " + new_node->node_name); diff --git a/modules/fbx/register_types.cpp b/modules/fbx/register_types.cpp index c0591dbc77..b615c91cd2 100644 --- a/modules/fbx/register_types.cpp +++ b/modules/fbx/register_types.cpp @@ -36,7 +36,7 @@ #ifdef TOOLS_ENABLED static void _editor_init() { Ref<EditorSceneImporterFBX> import_fbx; - import_fbx.instance(); + import_fbx.instantiate(); ResourceImporterScene::get_singleton()->add_importer(import_fbx); } #endif diff --git a/modules/fbx/tools/import_utils.h b/modules/fbx/tools/import_utils.h index 7625f67256..319a7a4697 100644 --- a/modules/fbx/tools/import_utils.h +++ b/modules/fbx/tools/import_utils.h @@ -317,7 +317,7 @@ public: // } // } else { // Ref<Image> img; - // img.instance(); + // img.instantiate(); // PoolByteArray arr; // uint32_t size = tex->mWidth * tex->mHeight; // arr.resize(size); @@ -362,7 +362,7 @@ public: // if (found) { // image_state.raw_image = AssimpUtils::load_image(state, state.assimp_scene, path); // if (image_state.raw_image.is_valid()) { - // image_state.texture.instance(); + // image_state.texture.instantiate(); // image_state.texture->create_from_image(image_state.raw_image); // image_state.texture->set_storage(ImageTexture::STORAGE_COMPRESS_LOSSY); // return true; diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp index fa11132dd9..1ff591a87f 100644 --- a/modules/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative.cpp @@ -52,7 +52,7 @@ extern const godot_gdnative_core_api_struct api_struct; Map<String, Vector<Ref<GDNative>>> GDNativeLibrary::loaded_libraries; GDNativeLibrary::GDNativeLibrary() { - config_file.instance(); + config_file.instantiate(); symbol_prefix = default_symbol_prefix; load_once = default_load_once; @@ -112,7 +112,7 @@ bool GDNativeLibrary::_get(const StringName &p_name, Variant &r_property) const } void GDNativeLibrary::reset_state() { - config_file.instance(); + config_file.instantiate(); current_library_path = ""; current_dependencies.clear(); symbol_prefix = default_symbol_prefix; @@ -532,7 +532,7 @@ Error GDNative::get_symbol(StringName p_procedure_name, void *&r_handle, bool p_ RES GDNativeLibraryResourceLoader::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, CacheMode p_cache_mode) { Ref<GDNativeLibrary> lib; - lib.instance(); + lib.instantiate(); Ref<ConfigFile> config = lib->get_config_file(); diff --git a/modules/gdnative/nativescript/api_generator.cpp b/modules/gdnative/nativescript/api_generator.cpp index 57717010f7..4f696f2a39 100644 --- a/modules/gdnative/nativescript/api_generator.cpp +++ b/modules/gdnative/nativescript/api_generator.cpp @@ -251,7 +251,7 @@ List<ClassAPI> generate_c_api_classes() { class_api.singleton_name = name; } } - class_api.is_instantiable = !class_api.is_singleton && ClassDB::can_instance(class_name); + class_api.is_instantiable = !class_api.is_singleton && ClassDB::can_instantiate(class_name); { List<StringName> inheriters; diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp index 0930302eb2..3695f6b9a3 100644 --- a/modules/gdnative/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -170,7 +170,7 @@ String NativeScript::get_script_class_icon_path() const { return script_class_icon_path; } -bool NativeScript::can_instance() const { +bool NativeScript::can_instantiate() const { NativeScriptDesc *script_data = get_script_desc(); #ifdef TOOLS_ENABLED @@ -503,7 +503,7 @@ Variant NativeScript::_new(const Variant **p_args, int p_argcount, Callable::Cal Object *owner = nullptr; if (!(script_data->base_native_type == "")) { - owner = ClassDB::instance(script_data->base_native_type); + owner = ClassDB::instantiate(script_data->base_native_type); } else { owner = memnew(RefCounted); } @@ -1422,7 +1422,7 @@ void NativeScriptLanguage::init_library(const Ref<GDNativeLibrary> &lib) { if (!E) { Ref<GDNative> gdn; - gdn.instance(); + gdn.instantiate(); gdn->set_library(lib); // TODO check the return value? diff --git a/modules/gdnative/nativescript/nativescript.h b/modules/gdnative/nativescript/nativescript.h index c53dc063b8..777a878660 100644 --- a/modules/gdnative/nativescript/nativescript.h +++ b/modules/gdnative/nativescript/nativescript.h @@ -137,7 +137,7 @@ public: void set_script_class_icon_path(String p_icon_path); String get_script_class_icon_path() const; - virtual bool can_instance() const override; + virtual bool can_instantiate() const override; virtual Ref<Script> get_base_script() const override; //for script inheritance diff --git a/modules/gdnative/nativescript/register_types.cpp b/modules/gdnative/nativescript/register_types.cpp index 0353ab2092..0191cfd809 100644 --- a/modules/gdnative/nativescript/register_types.cpp +++ b/modules/gdnative/nativescript/register_types.cpp @@ -50,10 +50,10 @@ void register_nativescript_types() { native_script_language->set_language_index(ScriptServer::get_language_count()); ScriptServer::register_language(native_script_language); - resource_saver_gdns.instance(); + resource_saver_gdns.instantiate(); ResourceSaver::add_resource_format_saver(resource_saver_gdns); - resource_loader_gdns.instance(); + resource_loader_gdns.instantiate(); ResourceLoader::add_resource_format_loader(resource_loader_gdns); } diff --git a/modules/gdnative/pluginscript/pluginscript_script.cpp b/modules/gdnative/pluginscript/pluginscript_script.cpp index 1dabb1db63..7fc8178e34 100644 --- a/modules/gdnative/pluginscript/pluginscript_script.cpp +++ b/modules/gdnative/pluginscript/pluginscript_script.cpp @@ -38,13 +38,13 @@ #ifdef DEBUG_ENABLED #define __ASSERT_SCRIPT_REASON "Cannot retrieve PluginScript class for this script, is your code correct?" -#define ASSERT_SCRIPT_VALID() \ - { \ - ERR_FAIL_COND_MSG(!can_instance(), __ASSERT_SCRIPT_REASON); \ +#define ASSERT_SCRIPT_VALID() \ + { \ + ERR_FAIL_COND_MSG(!can_instantiate(), __ASSERT_SCRIPT_REASON); \ } -#define ASSERT_SCRIPT_VALID_V(ret) \ - { \ - ERR_FAIL_COND_V_MSG(!can_instance(), ret, __ASSERT_SCRIPT_REASON); \ +#define ASSERT_SCRIPT_VALID_V(ret) \ + { \ + ERR_FAIL_COND_V_MSG(!can_instantiate(), ret, __ASSERT_SCRIPT_REASON); \ } #else #define ASSERT_SCRIPT_VALID() @@ -96,7 +96,7 @@ Variant PluginScript::_new(const Variant **p_args, int p_argcount, Callable::Cal if (get_instance_base_type() == "") { owner = memnew(RefCounted); } else { - owner = ClassDB::instance(get_instance_base_type()); + owner = ClassDB::instantiate(get_instance_base_type()); } if (!owner) { @@ -133,7 +133,7 @@ void PluginScript::_placeholder_erased(PlaceHolderScriptInstance *p_placeholder) #endif -bool PluginScript::can_instance() const { +bool PluginScript::can_instantiate() const { bool can = _valid || (!_tool && !ScriptServer::is_scripting_enabled()); return can; } @@ -198,7 +198,7 @@ ScriptInstance *PluginScript::instance_create(Object *p_this) { StringName base_type = get_instance_base_type(); if (base_type) { if (!ClassDB::is_parent_class(p_this->get_class_name(), base_type)) { - String msg = "Script inherits from native type '" + String(base_type) + "', so it can't be instanced in object of type: '" + p_this->get_class() + "'"; + String msg = "Script inherits from native type '" + String(base_type) + "', so it can't be instantiated in object of type: '" + p_this->get_class() + "'"; // TODO: implement PluginscriptLanguage::debug_break_parse // if (EngineDebugger::is_active()) { // _language->debug_break_parse(get_path(), 0, msg); diff --git a/modules/gdnative/pluginscript/pluginscript_script.h b/modules/gdnative/pluginscript/pluginscript_script.h index 97989a19d8..838195147f 100644 --- a/modules/gdnative/pluginscript/pluginscript_script.h +++ b/modules/gdnative/pluginscript/pluginscript_script.h @@ -92,7 +92,7 @@ public: return _icon_path; } - virtual bool can_instance() const override; + virtual bool can_instantiate() const override; virtual Ref<Script> get_base_script() const override; //for script inheritance diff --git a/modules/gdnative/register_types.cpp b/modules/gdnative/register_types.cpp index cf19c0c44c..8e20a2b90d 100644 --- a/modules/gdnative/register_types.cpp +++ b/modules/gdnative/register_types.cpp @@ -230,7 +230,7 @@ static void editor_init_callback() { ProjectSettingsEditor::get_singleton()->get_tabs()->add_child(library_editor); Ref<GDNativeExportPlugin> export_plugin; - export_plugin.instance(); + export_plugin.instantiate(); EditorExport::get_singleton()->add_export_plugin(export_plugin); @@ -262,10 +262,10 @@ void register_gdnative_types() { ClassDB::register_class<GDNativeLibrary>(); ClassDB::register_class<GDNative>(); - resource_loader_gdnlib.instance(); + resource_loader_gdnlib.instantiate(); ResourceLoader::add_resource_format_loader(resource_loader_gdnlib); - resource_saver_gdnlib.instance(); + resource_saver_gdnlib.instantiate(); ResourceSaver::add_resource_format_saver(resource_saver_gdnlib); GDNativeCallRegistry::singleton = memnew(GDNativeCallRegistry); @@ -298,7 +298,7 @@ void register_gdnative_types() { Ref<GDNativeLibrary> lib = ResourceLoader::load(path); Ref<GDNative> singleton; - singleton.instance(); + singleton.instantiate(); singleton->set_library(lib); if (!singleton->initialize()) { diff --git a/modules/gdnative/videodecoder/register_types.cpp b/modules/gdnative/videodecoder/register_types.cpp index 394831daeb..e822d42312 100644 --- a/modules/gdnative/videodecoder/register_types.cpp +++ b/modules/gdnative/videodecoder/register_types.cpp @@ -36,7 +36,7 @@ static Ref<ResourceFormatLoaderVideoStreamGDNative> resource_loader_vsgdnative; void register_videodecoder_types() { - resource_loader_vsgdnative.instance(); + resource_loader_vsgdnative.instantiate(); ResourceLoader::add_resource_format_loader(resource_loader_vsgdnative, true); ClassDB::register_class<VideoStreamGDNative>(); diff --git a/modules/gdnative/videodecoder/video_stream_gdnative.cpp b/modules/gdnative/videodecoder/video_stream_gdnative.cpp index 8b0434c7dd..26b044c0ef 100644 --- a/modules/gdnative/videodecoder/video_stream_gdnative.cpp +++ b/modules/gdnative/videodecoder/video_stream_gdnative.cpp @@ -122,7 +122,7 @@ bool VideoStreamPlaybackGDNative::open_file(const String &p_file) { samples_decoded = 0; Ref<Image> img; - img.instance(); + img.instantiate(); img->create((int)texture_size.width, false, (int)texture_size.height, Image::FORMAT_RGBA8); texture->create_from_image(img); diff --git a/modules/gdnative/xr/xr_interface_gdnative.cpp b/modules/gdnative/xr/xr_interface_gdnative.cpp index ff959affa3..80077590df 100644 --- a/modules/gdnative/xr/xr_interface_gdnative.cpp +++ b/modules/gdnative/xr/xr_interface_gdnative.cpp @@ -258,7 +258,7 @@ void GDAPI godot_xr_register_interface(const godot_xr_interface_gdnative *p_inte ERR_FAIL_COND_MSG(p_interface->version.major < 4, "GDNative XR interfaces build for Godot 3.x are not supported."); Ref<XRInterfaceGDNative> new_interface; - new_interface.instance(); + new_interface.instantiate(); new_interface->set_interface((const godot_xr_interface_gdnative *)p_interface); XRServer::get_singleton()->add_interface(new_interface); } @@ -331,7 +331,7 @@ godot_int GDAPI godot_xr_add_controller(char *p_device_name, godot_int p_hand, g ERR_FAIL_NULL_V(input, 0); Ref<XRPositionalTracker> new_tracker; - new_tracker.instance(); + new_tracker.instantiate(); new_tracker->set_tracker_name(p_device_name); new_tracker->set_tracker_type(XRServer::TRACKER_CONTROLLER); if (p_hand == 1) { diff --git a/modules/gdnavigation/navigation_mesh_generator.cpp b/modules/gdnavigation/navigation_mesh_generator.cpp index b94f4b4c6c..0d8330c1da 100644 --- a/modules/gdnavigation/navigation_mesh_generator.cpp +++ b/modules/gdnavigation/navigation_mesh_generator.cpp @@ -177,7 +177,7 @@ void NavigationMeshGenerator::_parse_geometry(Transform3D p_accumulated_transfor BoxShape3D *box = Object::cast_to<BoxShape3D>(*s); if (box) { Ref<BoxMesh> box_mesh; - box_mesh.instance(); + box_mesh.instantiate(); box_mesh->set_size(box->get_size()); mesh = box_mesh; } @@ -185,7 +185,7 @@ void NavigationMeshGenerator::_parse_geometry(Transform3D p_accumulated_transfor CapsuleShape3D *capsule = Object::cast_to<CapsuleShape3D>(*s); if (capsule) { Ref<CapsuleMesh> capsule_mesh; - capsule_mesh.instance(); + capsule_mesh.instantiate(); capsule_mesh->set_radius(capsule->get_radius()); capsule_mesh->set_mid_height(capsule->get_height() / 2.0); mesh = capsule_mesh; @@ -194,7 +194,7 @@ void NavigationMeshGenerator::_parse_geometry(Transform3D p_accumulated_transfor CylinderShape3D *cylinder = Object::cast_to<CylinderShape3D>(*s); if (cylinder) { Ref<CylinderMesh> cylinder_mesh; - cylinder_mesh.instance(); + cylinder_mesh.instantiate(); cylinder_mesh->set_height(cylinder->get_height()); cylinder_mesh->set_bottom_radius(cylinder->get_radius()); cylinder_mesh->set_top_radius(cylinder->get_radius()); @@ -204,7 +204,7 @@ void NavigationMeshGenerator::_parse_geometry(Transform3D p_accumulated_transfor SphereShape3D *sphere = Object::cast_to<SphereShape3D>(*s); if (sphere) { Ref<SphereMesh> sphere_mesh; - sphere_mesh.instance(); + sphere_mesh.instantiate(); sphere_mesh->set_radius(sphere->get_radius()); sphere_mesh->set_height(sphere->get_radius() * 2.0); mesh = sphere_mesh; diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml index 58620f2b3e..839aa6b3c6 100644 --- a/modules/gdscript/doc_classes/@GDScript.xml +++ b/modules/gdscript/doc_classes/@GDScript.xml @@ -177,7 +177,7 @@ [b]Note:[/b] Resource paths can be obtained by right clicking on a resource in the Assets Panel and choosing "Copy Path" or by dragging the file from the FileSystem dock into the script. [codeblock] # Instance a scene. - var diamond = preload("res://diamond.tscn").instance() + var diamond = preload("res://diamond.tscn").instantiate() [/codeblock] </description> </method> diff --git a/modules/gdscript/editor/gdscript_highlighter.cpp b/modules/gdscript/editor/gdscript_highlighter.cpp index b867b03903..79ec9eb65f 100644 --- a/modules/gdscript/editor/gdscript_highlighter.cpp +++ b/modules/gdscript/editor/gdscript_highlighter.cpp @@ -622,6 +622,6 @@ void GDScriptSyntaxHighlighter::add_color_region(const String &p_start_key, cons Ref<EditorSyntaxHighlighter> GDScriptSyntaxHighlighter::_create() const { Ref<GDScriptSyntaxHighlighter> syntax_highlighter; - syntax_highlighter.instance(); + syntax_highlighter.instantiate(); return syntax_highlighter; } diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index 1567576009..397776ba1a 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -72,7 +72,7 @@ void GDScriptNativeClass::_bind_methods() { } Variant GDScriptNativeClass::_new() { - Object *o = instance(); + Object *o = instantiate(); ERR_FAIL_COND_V_MSG(!o, Variant(), "Class type: '" + String(name) + "' is not instantiable."); RefCounted *rc = Object::cast_to<RefCounted>(o); @@ -83,8 +83,8 @@ Variant GDScriptNativeClass::_new() { } } -Object *GDScriptNativeClass::instance() { - return ClassDB::instance(name); +Object *GDScriptNativeClass::instantiate() { + return ClassDB::instantiate(name); } void GDScript::_super_implicit_constructor(GDScript *p_script, GDScriptInstance *p_instance, Callable::CallError &r_error) { @@ -170,7 +170,7 @@ Variant GDScript::_new(const Variant **p_args, int p_argcount, Callable::CallErr ERR_FAIL_COND_V(_baseptr->native.is_null(), Variant()); if (_baseptr->native.ptr()) { - owner = _baseptr->native->instance(); + owner = _baseptr->native->instantiate(); } else { owner = memnew(RefCounted); //by default, no base means use reference } @@ -196,7 +196,7 @@ Variant GDScript::_new(const Variant **p_args, int p_argcount, Callable::CallErr } } -bool GDScript::can_instance() const { +bool GDScript::can_instantiate() const { #ifdef TOOLS_ENABLED return valid && (tool || ScriptServer::is_scripting_enabled()); #else @@ -346,9 +346,9 @@ ScriptInstance *GDScript::instance_create(Object *p_this) { if (top->native.is_valid()) { if (!ClassDB::is_parent_class(p_this->get_class_name(), top->native->get_name())) { if (EngineDebugger::is_active()) { - GDScriptLanguage::get_singleton()->debug_break_parse(get_path(), 1, "Script inherits from native type '" + String(top->native->get_name()) + "', so it can't be instanced in object of type: '" + p_this->get_class() + "'"); + GDScriptLanguage::get_singleton()->debug_break_parse(get_path(), 1, "Script inherits from native type '" + String(top->native->get_name()) + "', so it can't be instantiated in object of type: '" + p_this->get_class() + "'"); } - ERR_FAIL_V_MSG(nullptr, "Script inherits from native type '" + String(top->native->get_name()) + "', so it can't be instanced in object of type '" + p_this->get_class() + "'" + "."); + ERR_FAIL_V_MSG(nullptr, "Script inherits from native type '" + String(top->native->get_name()) + "', so it can't be instantiated in object of type '" + p_this->get_class() + "'" + "."); } } @@ -2256,7 +2256,7 @@ RES ResourceFormatLoaderGDScript::load(const String &p_path, const String &p_ori if (script.is_null()) { // Don't fail loading because of parsing error. - script.instance(); + script.instantiate(); } if (r_error) { diff --git a/modules/gdscript/gdscript.h b/modules/gdscript/gdscript.h index 42019ae501..078b7a2fd0 100644 --- a/modules/gdscript/gdscript.h +++ b/modules/gdscript/gdscript.h @@ -51,7 +51,7 @@ protected: public: _FORCE_INLINE_ const StringName &get_name() const { return name; } Variant _new(); - Object *instance(); + Object *instantiate(); GDScriptNativeClass(const StringName &p_name); }; @@ -80,10 +80,10 @@ class GDScript : public Script { GDScript *_base = nullptr; //fast pointer access GDScript *_owner = nullptr; //for subclasses - Set<StringName> members; //members are just indices to the instanced script. + Set<StringName> members; //members are just indices to the instantiated script. Map<StringName, Variant> constants; Map<StringName, GDScriptFunction *> member_functions; - Map<StringName, MemberInfo> member_indices; //members are just indices to the instanced script. + Map<StringName, MemberInfo> member_indices; //members are just indices to the instantiated script. Map<StringName, Ref<GDScript>> subclasses; Map<StringName, Vector<StringName>> _signals; Vector<MultiplayerAPI::RPCConfig> rpc_functions; @@ -196,7 +196,7 @@ public: StringName debug_get_member_by_index(int p_idx) const; Variant _new(const Variant **p_args, int p_argcount, Callable::CallError &r_error); - virtual bool can_instance() const override; + virtual bool can_instantiate() const override; virtual Ref<Script> get_base_script() const override; diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index 485a4b7b61..e7fb33a6a7 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -229,7 +229,7 @@ Error GDScriptAnalyzer::resolve_inheritance(GDScriptParser::ClassNode *p_class, push_error(vformat(R"(Could not resolve super class inheritance from "%s".)", name), p_class); return err; } - } else if (class_exists(name) && ClassDB::can_instance(GDScriptParser::get_real_class_name(name))) { + } else if (class_exists(name) && ClassDB::can_instantiate(GDScriptParser::get_real_class_name(name))) { base.kind = GDScriptParser::DataType::NATIVE; base.native_type = name; } else { diff --git a/modules/gdscript/gdscript_cache.cpp b/modules/gdscript/gdscript_cache.cpp index a3b1fb93f9..1a844bf241 100644 --- a/modules/gdscript/gdscript_cache.cpp +++ b/modules/gdscript/gdscript_cache.cpp @@ -134,7 +134,7 @@ Ref<GDScriptParserRef> GDScriptCache::get_parser(const String &p_path, GDScriptP return ref; } GDScriptParser *parser = memnew(GDScriptParser); - ref.instance(); + ref.instantiate(); ref->parser = parser; ref->path = p_path; singleton->parser_map[p_path] = ref.ptr(); @@ -180,7 +180,7 @@ Ref<GDScript> GDScriptCache::get_shallow_script(const String &p_path, const Stri } Ref<GDScript> script; - script.instance(); + script.instantiate(); script->set_path(p_path, true); script->set_script_path(p_path); script->load_source_code(p_path); diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp index 6d6b9e15af..7fa8e9c067 100644 --- a/modules/gdscript/gdscript_compiler.cpp +++ b/modules/gdscript/gdscript_compiler.cpp @@ -2587,7 +2587,7 @@ void GDScriptCompiler::_make_scripts(GDScript *p_script, const GDScriptParser::C if (orphan_subclass.is_valid()) { subclass = orphan_subclass; } else { - subclass.instance(); + subclass.instantiate(); } } diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 0e0b32b2a6..b149828a2f 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -104,7 +104,7 @@ Ref<Script> GDScriptLanguage::get_template(const String &p_class_name, const Str _template = _get_processed_template(_template, p_base_class_name); Ref<GDScript> script; - script.instance(); + script.instantiate(); script->set_source_code(_template); return script; @@ -2900,7 +2900,7 @@ static Error _lookup_symbol_from_base(const GDScriptParser::DataType &p_base, co Variant v; REF v_ref; if (base_type.builtin_type == Variant::OBJECT) { - v_ref.instance(); + v_ref.instantiate(); v = v_ref; } else { Callable::CallError err; diff --git a/modules/gdscript/language_server/gdscript_language_protocol.cpp b/modules/gdscript/language_server/gdscript_language_protocol.cpp index 42ff8bb5b3..0d1f98778e 100644 --- a/modules/gdscript/language_server/gdscript_language_protocol.cpp +++ b/modules/gdscript/language_server/gdscript_language_protocol.cpp @@ -293,10 +293,10 @@ bool GDScriptLanguageProtocol::is_goto_native_symbols_enabled() const { } GDScriptLanguageProtocol::GDScriptLanguageProtocol() { - server.instance(); + server.instantiate(); singleton = this; - workspace.instance(); - text_document.instance(); + workspace.instantiate(); + text_document.instantiate(); set_scope("textDocument", text_document.ptr()); set_scope("completionItem", text_document.ptr()); set_scope("workspace", workspace.ptr()); diff --git a/modules/gdscript/language_server/gdscript_workspace.cpp b/modules/gdscript/language_server/gdscript_workspace.cpp index d83f77ed82..1915c92cbf 100644 --- a/modules/gdscript/language_server/gdscript_workspace.cpp +++ b/modules/gdscript/language_server/gdscript_workspace.cpp @@ -426,7 +426,7 @@ Node *GDScriptWorkspace::_get_owner_scene_node(String p_path) { RES owner_res = ResourceLoader::load(owner_path); if (Object::cast_to<PackedScene>(owner_res.ptr())) { Ref<PackedScene> owner_packed_scene = Ref<PackedScene>(Object::cast_to<PackedScene>(*owner_res)); - owner_scene_node = owner_packed_scene->instance(); + owner_scene_node = owner_packed_scene->instantiate(); break; } } diff --git a/modules/gdscript/register_types.cpp b/modules/gdscript/register_types.cpp index 867142019f..ad4ed8bf71 100644 --- a/modules/gdscript/register_types.cpp +++ b/modules/gdscript/register_types.cpp @@ -92,12 +92,12 @@ public: static void _editor_init() { Ref<EditorExportGDScript> gd_export; - gd_export.instance(); + gd_export.instantiate(); EditorExport::get_singleton()->add_export_plugin(gd_export); #ifdef TOOLS_ENABLED Ref<GDScriptSyntaxHighlighter> gdscript_syntax_highlighter; - gdscript_syntax_highlighter.instance(); + gdscript_syntax_highlighter.instantiate(); ScriptEditor::get_singleton()->register_syntax_highlighter(gdscript_syntax_highlighter); #endif @@ -117,10 +117,10 @@ void register_gdscript_types() { script_language_gd = memnew(GDScriptLanguage); ScriptServer::register_language(script_language_gd); - resource_loader_gd.instance(); + resource_loader_gd.instantiate(); ResourceLoader::add_resource_format_loader(resource_loader_gd); - resource_saver_gd.instance(); + resource_saver_gd.instantiate(); ResourceSaver::add_resource_format_saver(resource_saver_gd); gdscript_cache = memnew(GDScriptCache); @@ -128,7 +128,7 @@ void register_gdscript_types() { #ifdef TOOLS_ENABLED EditorNode::add_init_callback(_editor_init); - gdscript_translation_parser_plugin.instance(); + gdscript_translation_parser_plugin.instantiate(); EditorTranslationParser::get_singleton()->add_parser(gdscript_translation_parser_plugin, EditorTranslationParser::STANDARD); #endif // TOOLS_ENABLED diff --git a/modules/gdscript/tests/gdscript_test_runner.cpp b/modules/gdscript/tests/gdscript_test_runner.cpp index 67bc927517..b7faebb4ef 100644 --- a/modules/gdscript/tests/gdscript_test_runner.cpp +++ b/modules/gdscript/tests/gdscript_test_runner.cpp @@ -75,14 +75,14 @@ void init_autoloads() { Node *n = nullptr; if (res->is_class("PackedScene")) { Ref<PackedScene> ps = res; - n = ps->instance(); + n = ps->instantiate(); } else if (res->is_class("Script")) { Ref<Script> script_res = res; StringName ibt = script_res->get_instance_base_type(); bool valid_type = ClassDB::is_parent_class(ibt, "Node"); ERR_CONTINUE_MSG(!valid_type, "Script does not inherit a Node: " + info.path); - Object *obj = ClassDB::instance(ibt); + Object *obj = ClassDB::instantiate(ibt); ERR_CONTINUE_MSG(obj == nullptr, "Cannot instance script for autoload, expected 'Node' inheritance, got: " + @@ -420,7 +420,7 @@ GDScriptTest::TestResult GDScriptTest::execute_test_code(bool p_is_generating) { // Create script. Ref<GDScript> script; - script.instance(); + script.instantiate(); script->set_path(source_file); script->set_script_path(source_file); err = script->load_source_code(source_file); @@ -510,7 +510,7 @@ GDScriptTest::TestResult GDScriptTest::execute_test_code(bool p_is_generating) { script->reload(); // Create object instance for test. - Object *obj = ClassDB::instance(script->get_native()->get_name()); + Object *obj = ClassDB::instantiate(script->get_native()->get_name()); Ref<RefCounted> obj_ref; if (obj->is_ref_counted()) { obj_ref = Ref<RefCounted>(Object::cast_to<RefCounted>(obj)); diff --git a/modules/gdscript/tests/test_gdscript.cpp b/modules/gdscript/tests/test_gdscript.cpp index c37d52febd..7aa5895981 100644 --- a/modules/gdscript/tests/test_gdscript.cpp +++ b/modules/gdscript/tests/test_gdscript.cpp @@ -165,7 +165,7 @@ static void test_compiler(const String &p_code, const String &p_script_path, con GDScriptCompiler compiler; Ref<GDScript> script; - script.instance(); + script.instantiate(); script->set_path(p_script_path); err = compiler.compile(&parser, script.ptr(), false); diff --git a/modules/gltf/editor_scene_exporter_gltf_plugin.cpp b/modules/gltf/editor_scene_exporter_gltf_plugin.cpp index 4cdaccde6f..ae080bcc9a 100644 --- a/modules/gltf/editor_scene_exporter_gltf_plugin.cpp +++ b/modules/gltf/editor_scene_exporter_gltf_plugin.cpp @@ -49,7 +49,7 @@ bool SceneExporterGLTFPlugin::has_main_screen() const { SceneExporterGLTFPlugin::SceneExporterGLTFPlugin(EditorNode *p_node) { editor = p_node; - convert_gltf2.instance(); + convert_gltf2.instantiate(); file_export_lib = memnew(EditorFileDialog); editor->get_gui_base()->add_child(file_export_lib); file_export_lib->connect("file_selected", callable_mp(this, &SceneExporterGLTFPlugin::_gltf2_dialog_action)); diff --git a/modules/gltf/editor_scene_importer_gltf.cpp b/modules/gltf/editor_scene_importer_gltf.cpp index 5f220a9e57..cef5278f03 100644 --- a/modules/gltf/editor_scene_importer_gltf.cpp +++ b/modules/gltf/editor_scene_importer_gltf.cpp @@ -59,7 +59,7 @@ Node *EditorSceneImporterGLTF::import_scene(const String &p_path, List<String> *r_missing_deps, Error *r_err) { Ref<PackedSceneGLTF> importer; - importer.instance(); + importer.instantiate(); return importer->import_scene(p_path, p_flags, p_bake_fps, r_missing_deps, r_err, Ref<GLTFState>()); } @@ -90,13 +90,13 @@ Node *PackedSceneGLTF::import_scene(const String &p_path, uint32_t p_flags, Error *r_err, Ref<GLTFState> r_state) { if (r_state == Ref<GLTFState>()) { - r_state.instance(); + r_state.instantiate(); } r_state->use_named_skin_binds = p_flags & EditorSceneImporter::IMPORT_USE_NAMED_SKIN_BINDS; Ref<GLTFDocument> gltf_document; - gltf_document.instance(); + gltf_document.instantiate(); Error err = gltf_document->parse(r_state, p_path); if (r_err) { *r_err = err; @@ -138,9 +138,9 @@ void PackedSceneGLTF::save_scene(Node *p_node, const String &p_path, *r_err = err; } Ref<GLTFDocument> gltf_document; - gltf_document.instance(); + gltf_document.instantiate(); Ref<GLTFState> state; - state.instance(); + state.instantiate(); err = gltf_document->serialize(state, p_node, p_path); if (r_err) { *r_err = err; @@ -171,7 +171,7 @@ Error PackedSceneGLTF::export_gltf(Node *p_root, String p_path, int32_t flags = p_flags; real_t baked_fps = p_bake_fps; Ref<PackedSceneGLTF> exporter; - exporter.instance(); + exporter.instantiate(); exporter->save_scene(p_root, path, "", flags, baked_fps, &deps, &err); int32_t error_code = err; if (error_code != 0) { diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index 40f2116676..2fe28c0ac4 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -565,7 +565,7 @@ Error GLTFDocument::_parse_nodes(Ref<GLTFState> state) { const Array &nodes = state->json["nodes"]; for (int i = 0; i < nodes.size(); i++) { Ref<GLTFNode> node; - node.instance(); + node.instantiate(); const Dictionary &n = nodes[i]; if (n.has("name")) { @@ -826,7 +826,7 @@ Error GLTFDocument::_parse_buffer_views(Ref<GLTFState> state) { const Dictionary &d = buffers[i]; Ref<GLTFBufferView> buffer_view; - buffer_view.instance(); + buffer_view.instantiate(); ERR_FAIL_COND_V(!d.has("buffer"), ERR_PARSE_ERROR); buffer_view->buffer = d["buffer"]; @@ -972,7 +972,7 @@ Error GLTFDocument::_parse_accessors(Ref<GLTFState> state) { const Dictionary &d = accessors[i]; Ref<GLTFAccessor> accessor; - accessor.instance(); + accessor.instantiate(); ERR_FAIL_COND_V(!d.has("componentType"), ERR_PARSE_ERROR); accessor->component_type = d["componentType"]; @@ -1114,7 +1114,7 @@ Error GLTFDocument::_encode_buffer_view(Ref<GLTFState> state, const double *src, } Ref<GLTFBufferView> bv; - bv.instance(); + bv.instantiate(); const uint32_t offset = bv->byte_offset = byte_offset; Vector<uint8_t> &gltf_buffer = state->buffers.write[0]; @@ -1508,7 +1508,7 @@ GLTFAccessorIndex GLTFDocument::_encode_accessor_as_ints(Ref<GLTFState> state, c ERR_FAIL_COND_V(attribs.size() == 0, -1); Ref<GLTFAccessor> accessor; - accessor.instance(); + accessor.instantiate(); GLTFBufferIndex buffer_view_i; int64_t size = state->buffers[0].size(); const GLTFDocument::GLTFType type = GLTFDocument::TYPE_SCALAR; @@ -1592,7 +1592,7 @@ GLTFAccessorIndex GLTFDocument::_encode_accessor_as_vec2(Ref<GLTFState> state, c ERR_FAIL_COND_V(attribs.size() % element_count != 0, -1); Ref<GLTFAccessor> accessor; - accessor.instance(); + accessor.instantiate(); GLTFBufferIndex buffer_view_i; int64_t size = state->buffers[0].size(); const GLTFDocument::GLTFType type = GLTFDocument::TYPE_VEC2; @@ -1641,7 +1641,7 @@ GLTFAccessorIndex GLTFDocument::_encode_accessor_as_color(Ref<GLTFState> state, ERR_FAIL_COND_V(attribs.size() % element_count != 0, -1); Ref<GLTFAccessor> accessor; - accessor.instance(); + accessor.instantiate(); GLTFBufferIndex buffer_view_i; int64_t size = state->buffers[0].size(); const GLTFDocument::GLTFType type = GLTFDocument::TYPE_VEC4; @@ -1706,7 +1706,7 @@ GLTFAccessorIndex GLTFDocument::_encode_accessor_as_weights(Ref<GLTFState> state ERR_FAIL_COND_V(attribs.size() % element_count != 0, -1); Ref<GLTFAccessor> accessor; - accessor.instance(); + accessor.instantiate(); GLTFBufferIndex buffer_view_i; int64_t size = state->buffers[0].size(); const GLTFDocument::GLTFType type = GLTFDocument::TYPE_VEC4; @@ -1753,7 +1753,7 @@ GLTFAccessorIndex GLTFDocument::_encode_accessor_as_joints(Ref<GLTFState> state, ERR_FAIL_COND_V(attribs.size() % element_count != 0, -1); Ref<GLTFAccessor> accessor; - accessor.instance(); + accessor.instantiate(); GLTFBufferIndex buffer_view_i; int64_t size = state->buffers[0].size(); const GLTFDocument::GLTFType type = GLTFDocument::TYPE_VEC4; @@ -1802,7 +1802,7 @@ GLTFAccessorIndex GLTFDocument::_encode_accessor_as_quaternions(Ref<GLTFState> s ERR_FAIL_COND_V(attribs.size() % element_count != 0, -1); Ref<GLTFAccessor> accessor; - accessor.instance(); + accessor.instantiate(); GLTFBufferIndex buffer_view_i; int64_t size = state->buffers[0].size(); const GLTFDocument::GLTFType type = GLTFDocument::TYPE_VEC4; @@ -1867,7 +1867,7 @@ GLTFAccessorIndex GLTFDocument::_encode_accessor_as_floats(Ref<GLTFState> state, ERR_FAIL_COND_V(!attribs.size(), -1); Ref<GLTFAccessor> accessor; - accessor.instance(); + accessor.instantiate(); GLTFBufferIndex buffer_view_i; int64_t size = state->buffers[0].size(); const GLTFDocument::GLTFType type = GLTFDocument::TYPE_SCALAR; @@ -1913,7 +1913,7 @@ GLTFAccessorIndex GLTFDocument::_encode_accessor_as_vec3(Ref<GLTFState> state, c ERR_FAIL_COND_V(attribs.size() % element_count != 0, -1); Ref<GLTFAccessor> accessor; - accessor.instance(); + accessor.instantiate(); GLTFBufferIndex buffer_view_i; int64_t size = state->buffers[0].size(); const GLTFDocument::GLTFType type = GLTFDocument::TYPE_VEC3; @@ -1981,7 +1981,7 @@ GLTFAccessorIndex GLTFDocument::_encode_accessor_as_xform(Ref<GLTFState> state, ERR_FAIL_COND_V(attribs.size() % element_count != 0, -1); Ref<GLTFAccessor> accessor; - accessor.instance(); + accessor.instantiate(); GLTFBufferIndex buffer_view_i; int64_t size = state->buffers[0].size(); const GLTFDocument::GLTFType type = GLTFDocument::TYPE_MAT4; @@ -2331,7 +2331,7 @@ Error GLTFDocument::_serialize_meshes(Ref<GLTFState> state) { //generate indices because they need to be swapped for CW/CCW const Vector<Vector3> &vertices = array[Mesh::ARRAY_VERTEX]; Ref<SurfaceTool> st; - st.instance(); + st.instantiate(); st->create_from_triangle_arrays(array); st->index(); Vector<int32_t> generated_indices = st->commit_to_arrays()[Mesh::ARRAY_INDEX]; @@ -2455,7 +2455,7 @@ Error GLTFDocument::_parse_meshes(Ref<GLTFState> state) { Dictionary d = meshes[i]; Ref<GLTFMesh> mesh; - mesh.instance(); + mesh.instantiate(); bool has_vertex_color = false; ERR_FAIL_COND_V(!d.has("primitives"), ERR_PARSE_ERROR); @@ -2463,7 +2463,7 @@ Error GLTFDocument::_parse_meshes(Ref<GLTFState> state) { Array primitives = d["primitives"]; const Dictionary &extras = d.has("extras") ? (Dictionary)d["extras"] : Dictionary(); Ref<EditorSceneImporterMesh> import_mesh; - import_mesh.instance(); + import_mesh.instantiate(); String mesh_name = "mesh"; if (d.has("name") && !String(d["name"]).is_empty()) { mesh_name = d["name"]; @@ -2648,7 +2648,7 @@ Error GLTFDocument::_parse_meshes(Ref<GLTFState> state) { if (generate_tangents) { //must generate mikktspace tangents.. ergh.. Ref<SurfaceTool> st; - st.instance(); + st.instantiate(); st->create_from_triangle_arrays(array); if (a.has("JOINTS_0") && a.has("JOINTS_1")) { st->set_skin_weight_count(SurfaceTool::SKIN_8_WEIGHTS); @@ -2767,7 +2767,7 @@ Error GLTFDocument::_parse_meshes(Ref<GLTFState> state) { if (generate_tangents) { Ref<SurfaceTool> st; - st.instance(); + st.instantiate(); st->create_from_triangle_arrays(array_copy); if (a.has("JOINTS_0") && a.has("JOINTS_1")) { st->set_skin_weight_count(SurfaceTool::SKIN_8_WEIGHTS); @@ -2795,7 +2795,7 @@ Error GLTFDocument::_parse_meshes(Ref<GLTFState> state) { } else if (has_vertex_color) { Ref<StandardMaterial3D> mat3d; - mat3d.instance(); + mat3d.instantiate(); mat3d->set_flag(BaseMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true); mat = mat3d; } @@ -2843,7 +2843,7 @@ Error GLTFDocument::_serialize_images(Ref<GLTFState> state, const String &p_path GLTFBufferViewIndex bvi; Ref<GLTFBufferView> bv; - bv.instance(); + bv.instantiate(); const GLTFBufferIndex bi = 0; bv->buffer = bi; @@ -2875,7 +2875,7 @@ Error GLTFDocument::_serialize_images(Ref<GLTFState> state, const String &p_path name = _gen_unique_name(state, name); name = name.pad_zeros(3); Ref<_Directory> dir; - dir.instance(); + dir.instantiate(); String texture_dir = "textures"; String new_texture_dir = p_path.get_base_dir() + "/" + texture_dir; dir->open(p_path.get_base_dir()); @@ -3034,7 +3034,7 @@ Error GLTFDocument::_parse_images(Ref<GLTFState> state, const String &p_base_pat } Ref<ImageTexture> t; - t.instance(); + t.instantiate(); t->create_from_image(img); state->images.push_back(t); @@ -3075,7 +3075,7 @@ Error GLTFDocument::_parse_textures(Ref<GLTFState> state) { ERR_FAIL_COND_V(!d.has("source"), ERR_PARSE_ERROR); Ref<GLTFTexture> t; - t.instance(); + t.instantiate(); t->set_src_image(d["source"]); state->textures.push_back(t); } @@ -3086,7 +3086,7 @@ Error GLTFDocument::_parse_textures(Ref<GLTFState> state) { GLTFTextureIndex GLTFDocument::_set_texture(Ref<GLTFState> state, Ref<Texture2D> p_texture) { ERR_FAIL_COND_V(p_texture.is_null(), -1); Ref<GLTFTexture> gltf_texture; - gltf_texture.instance(); + gltf_texture.instantiate(); ERR_FAIL_COND_V(p_texture->get_image().is_null(), -1); GLTFImageIndex gltf_src_image_i = state->images.size(); state->images.push_back(p_texture); @@ -3159,9 +3159,9 @@ Error GLTFDocument::_serialize_materials(Ref<GLTFState> state) { Ref<Texture2D> ao_texture = material->get_texture(BaseMaterial3D::TEXTURE_AMBIENT_OCCLUSION); BaseMaterial3D::TextureChannel ao_channel = material->get_ao_texture_channel(); Ref<ImageTexture> orm_texture; - orm_texture.instance(); + orm_texture.instantiate(); Ref<Image> orm_image; - orm_image.instance(); + orm_image.instantiate(); int32_t height = 0; int32_t width = 0; Ref<Image> ao_image; @@ -3281,7 +3281,7 @@ Error GLTFDocument::_serialize_materials(Ref<GLTFState> state) { if (material->get_feature(BaseMaterial3D::FEATURE_NORMAL_MAPPING)) { Dictionary nt; Ref<ImageTexture> tex; - tex.instance(); + tex.instantiate(); { Ref<Texture2D> normal_texture = material->get_texture(BaseMaterial3D::TEXTURE_NORMAL); // Code for uncompressing RG normal maps @@ -3369,7 +3369,7 @@ Error GLTFDocument::_parse_materials(Ref<GLTFState> state) { const Dictionary &d = materials[i]; Ref<StandardMaterial3D> material; - material.instance(); + material.instantiate(); if (d.has("name") && !String(d["name"]).is_empty()) { material->set_name(d["name"]); } else { @@ -3385,7 +3385,7 @@ Error GLTFDocument::_parse_materials(Ref<GLTFState> state) { Dictionary sgm = pbr_spec_gloss_extensions["KHR_materials_pbrSpecularGlossiness"]; Ref<GLTFSpecGloss> spec_gloss; - spec_gloss.instance(); + spec_gloss.instantiate(); if (sgm.has("diffuseTexture")) { const Dictionary &diffuse_texture_dict = sgm["diffuseTexture"]; if (diffuse_texture_dict.has("index")) { @@ -3568,7 +3568,7 @@ void GLTFDocument::spec_gloss_to_rough_metal(Ref<GLTFSpecGloss> r_spec_gloss, Re return; } Ref<Image> rm_img; - rm_img.instance(); + rm_img.instantiate(); bool has_roughness = false; bool has_metal = false; p_material->set_roughness(1.0f); @@ -3610,11 +3610,11 @@ void GLTFDocument::spec_gloss_to_rough_metal(Ref<GLTFSpecGloss> r_spec_gloss, Re rm_img->generate_mipmaps(); r_spec_gloss->diffuse_img->generate_mipmaps(); Ref<ImageTexture> diffuse_image_texture; - diffuse_image_texture.instance(); + diffuse_image_texture.instantiate(); diffuse_image_texture->create_from_image(r_spec_gloss->diffuse_img); p_material->set_texture(BaseMaterial3D::TEXTURE_ALBEDO, diffuse_image_texture); Ref<ImageTexture> rm_image_texture; - rm_image_texture.instance(); + rm_image_texture.instantiate(); rm_image_texture->create_from_image(rm_img); if (has_roughness) { p_material->set_texture(BaseMaterial3D::TEXTURE_ROUGHNESS, rm_image_texture); @@ -3890,7 +3890,7 @@ Error GLTFDocument::_parse_skins(Ref<GLTFState> state) { const Dictionary &d = skins[i]; Ref<GLTFSkin> skin; - skin.instance(); + skin.instantiate(); ERR_FAIL_COND_V(!d.has("joints"), ERR_PARSE_ERROR); @@ -4018,7 +4018,7 @@ Error GLTFDocument::_determine_skeletons(Ref<GLTFState> state) { for (GLTFSkeletonIndex skel_i = 0; skel_i < skeleton_owners.size(); ++skel_i) { const GLTFNodeIndex skeleton_owner = skeleton_owners[skel_i]; Ref<GLTFSkeleton> skeleton; - skeleton.instance(); + skeleton.instantiate(); Vector<GLTFNodeIndex> skeleton_nodes; skeleton_sets.get_members(skeleton_nodes, skeleton_owner); @@ -4266,7 +4266,7 @@ Error GLTFDocument::_create_skins(Ref<GLTFState> state) { Ref<GLTFSkin> gltf_skin = state->skins.write[skin_i]; Ref<Skin> skin; - skin.instance(); + skin.instantiate(); // Some skins don't have IBM's! What absolute monsters! const bool has_ibms = !gltf_skin->inverse_binds.is_empty(); @@ -4448,7 +4448,7 @@ Error GLTFDocument::_parse_lights(Ref<GLTFState> state) { const Dictionary &d = lights[light_i]; Ref<GLTFLight> light; - light.instance(); + light.instantiate(); ERR_FAIL_COND_V(!d.has("type"), ERR_PARSE_ERROR); const String &type = d["type"]; light->type = type; @@ -4493,7 +4493,7 @@ Error GLTFDocument::_parse_cameras(Ref<GLTFState> state) { const Dictionary &d = cameras[i]; Ref<GLTFCamera> camera; - camera.instance(); + camera.instantiate(); ERR_FAIL_COND_V(!d.has("type"), ERR_PARSE_ERROR); const String &type = d["type"]; if (type == "orthographic") { @@ -4696,7 +4696,7 @@ Error GLTFDocument::_parse_animations(Ref<GLTFState> state) { const Dictionary &d = animations[i]; Ref<GLTFAnimation> animation; - animation.instance(); + animation.instantiate(); if (!d.has("channels") || !d.has("samplers")) { continue; @@ -4864,7 +4864,7 @@ GLTFMeshIndex GLTFDocument::_convert_mesh_instance(Ref<GLTFState> state, MeshIns return -1; } Ref<EditorSceneImporterMesh> import_mesh; - import_mesh.instance(); + import_mesh.instantiate(); Ref<Mesh> godot_mesh = p_mesh_instance->get_mesh(); if (godot_mesh.is_null()) { return -1; @@ -4901,7 +4901,7 @@ GLTFMeshIndex GLTFDocument::_convert_mesh_instance(Ref<GLTFState> state, MeshIns blend_weights.write[blend_i] = 0.0f; } Ref<GLTFMesh> gltf_mesh; - gltf_mesh.instance(); + gltf_mesh.instantiate(); gltf_mesh->set_mesh(import_mesh); gltf_mesh->set_blend_weights(blend_weights); GLTFMeshIndex mesh_i = state->meshes.size(); @@ -5006,7 +5006,7 @@ GLTFCameraIndex GLTFDocument::_convert_camera(Ref<GLTFState> state, Camera3D *p_ print_verbose("glTF: Converting camera: " + p_camera->get_name()); Ref<GLTFCamera> c; - c.instance(); + c.instantiate(); if (p_camera->get_projection() == Camera3D::Projection::PROJECTION_PERSPECTIVE) { c->set_perspective(true); @@ -5027,7 +5027,7 @@ GLTFLightIndex GLTFDocument::_convert_light(Ref<GLTFState> state, Light3D *p_lig print_verbose("glTF: Converting light: " + p_light->get_name()); Ref<GLTFLight> l; - l.instance(); + l.instantiate(); l->color = p_light->get_color(); if (cast_to<DirectionalLight3D>(p_light)) { l->type = "directional"; @@ -5062,7 +5062,7 @@ GLTFLightIndex GLTFDocument::_convert_light(Ref<GLTFState> state, Light3D *p_lig GLTFSkeletonIndex GLTFDocument::_convert_skeleton(Ref<GLTFState> state, Skeleton3D *p_skeleton) { print_verbose("glTF: Converting skeleton: " + p_skeleton->get_name()); Ref<GLTFSkeleton> gltf_skeleton; - gltf_skeleton.instance(); + gltf_skeleton.instantiate(); gltf_skeleton->set_name(_gen_unique_name(state, p_skeleton->get_name())); gltf_skeleton->godot_skeleton = p_skeleton; GLTFSkeletonIndex skeleton_i = state->skeletons.size(); @@ -5092,7 +5092,7 @@ void GLTFDocument::_convert_scene_node(Ref<GLTFState> state, Node *p_current, No return; } Ref<GLTFNode> gltf_node; - gltf_node.instance(); + gltf_node.instantiate(); gltf_node->set_name(_gen_unique_name(state, p_current->get_name())); if (cast_to<Node3D>(p_current)) { Node3D *spatial = cast_to<Node3D>(p_current); @@ -5158,9 +5158,9 @@ void GLTFDocument::_convert_csg_shape_to_gltf(Node *p_current, GLTFNodeIndex p_g mat = csg->get_material_override(); } Ref<GLTFMesh> gltf_mesh; - gltf_mesh.instance(); + gltf_mesh.instantiate(); Ref<EditorSceneImporterMesh> import_mesh; - import_mesh.instance(); + import_mesh.instantiate(); Ref<ArrayMesh> array_mesh = csg->get_meshes()[1]; for (int32_t surface_i = 0; surface_i < array_mesh->get_surface_count(); surface_i++) { import_mesh->add_surface(Mesh::PrimitiveType::PRIMITIVE_TRIANGLES, array_mesh->surface_get_arrays(surface_i), Array(), Dictionary(), mat, array_mesh->surface_get_name(surface_i)); @@ -5246,7 +5246,7 @@ void GLTFDocument::_convert_grid_map_to_gltf(Node *p_scene_parent, const GLTFNod cell_xform.set_origin(grid_map->map_to_world( Vector3(cell_location.x, cell_location.y, cell_location.z))); Ref<GLTFMesh> gltf_mesh; - gltf_mesh.instance(); + gltf_mesh.instantiate(); gltf_mesh = import_mesh_node; new_gltf_node->mesh = state->meshes.size(); state->meshes.push_back(gltf_mesh); @@ -5283,14 +5283,14 @@ void GLTFDocument::_convert_mult_mesh_instance_to_gltf(Node *p_scene_parent, con Ref<ArrayMesh> mm = multi_mesh->get_mesh(); if (mm.is_valid()) { Ref<EditorSceneImporterMesh> mesh; - mesh.instance(); + mesh.instantiate(); for (int32_t surface_i = 0; surface_i < mm->get_surface_count(); surface_i++) { Array surface = mm->surface_get_arrays(surface_i); mesh->add_surface(mm->surface_get_primitive_type(surface_i), surface, Array(), Dictionary(), mm->surface_get_material(surface_i), mm->get_name()); } Ref<GLTFMesh> gltf_mesh; - gltf_mesh.instance(); + gltf_mesh.instantiate(); gltf_mesh->set_name(multi_mesh->get_name()); gltf_mesh->set_mesh(mesh); new_gltf_node->mesh = state->meshes.size(); @@ -5611,7 +5611,7 @@ void GLTFDocument::_import_animation(Ref<GLTFState> state, AnimationPlayer *ap, } Ref<Animation> animation; - animation.instance(); + animation.instantiate(); animation->set_name(name); if (anim->get_loop()) { @@ -5822,7 +5822,7 @@ void GLTFDocument::_convert_mesh_instances(Ref<GLTFState> state) { skin = skeleton->register_skin(nullptr)->get_skin(); } Ref<GLTFSkin> gltf_skin; - gltf_skin.instance(); + gltf_skin.instantiate(); Array json_joints; GLTFSkeletonIndex skeleton_gltf_i = -1; @@ -5864,7 +5864,7 @@ void GLTFDocument::_convert_mesh_instances(Ref<GLTFState> state) { BoneId bone_index = skeleton->find_bone(godot_bone_name); ERR_CONTINUE(bone_index == -1); Ref<GLTFNode> joint_node; - joint_node.instance(); + joint_node.instantiate(); String gltf_bone_name = _gen_unique_bone_name(state, skeleton_gltf_i, godot_bone_name); joint_node->set_name(gltf_bone_name); @@ -6186,7 +6186,7 @@ GLTFAnimation::Track GLTFDocument::_convert_animation_track(Ref<GLTFState> state void GLTFDocument::_convert_animation(Ref<GLTFState> state, AnimationPlayer *ap, String p_animation_track_name) { Ref<Animation> animation = ap->get_animation(p_animation_track_name); Ref<GLTFAnimation> gltf_animation; - gltf_animation.instance(); + gltf_animation.instantiate(); gltf_animation->set_name(_gen_unique_name(state, p_animation_track_name)); for (int32_t track_i = 0; track_i < animation->get_track_count(); track_i++) { diff --git a/modules/gltf/register_types.cpp b/modules/gltf/register_types.cpp index dc995c9249..d11c7cb9cd 100644 --- a/modules/gltf/register_types.cpp +++ b/modules/gltf/register_types.cpp @@ -51,7 +51,7 @@ #ifdef TOOLS_ENABLED static void _editor_init() { Ref<EditorSceneImporterGLTF> import_gltf; - import_gltf.instance(); + import_gltf.instantiate(); ResourceImporterScene::get_singleton()->add_importer(import_gltf); } #endif diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp index 45af59622f..c62e7acd62 100644 --- a/modules/gridmap/grid_map.cpp +++ b/modules/gridmap/grid_map.cpp @@ -1012,7 +1012,7 @@ void GridMap::make_baked_meshes(bool p_gen_lightmap_uv, float p_lightmap_uv_texe Ref<Material> surf_mat = mesh->surface_get_material(i); if (!mat_map.has(surf_mat)) { Ref<SurfaceTool> st; - st.instance(); + st.instantiate(); st->begin(Mesh::PRIMITIVE_TRIANGLES); st->set_material(surf_mat); mat_map[surf_mat] = st; @@ -1024,7 +1024,7 @@ void GridMap::make_baked_meshes(bool p_gen_lightmap_uv, float p_lightmap_uv_texe for (Map<OctantKey, Map<Ref<Material>, Ref<SurfaceTool>>>::Element *E = surface_map.front(); E; E = E->next()) { Ref<ArrayMesh> mesh; - mesh.instance(); + mesh.instantiate(); for (Map<Ref<Material>, Ref<SurfaceTool>>::Element *F = E->get().front(); F; F = F->next()) { F->get()->commit(mesh); } diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index 80551de1ba..a2f570e6a5 100644 --- a/modules/gridmap/grid_map_editor_plugin.cpp +++ b/modules/gridmap/grid_map_editor_plugin.cpp @@ -1085,7 +1085,7 @@ void GridMapEditor::_notification(int p_what) { if (input_action == INPUT_PAINT) { // Simulate mouse released event to stop drawing when editor focus exists. Ref<InputEventMouseButton> release; - release.instance(); + release.instantiate(); release->set_button_index(MOUSE_BUTTON_LEFT); forward_spatial_input_event(nullptr, release); } @@ -1356,7 +1356,7 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { Array d; d.resize(RS::ARRAY_MAX); - inner_mat.instance(); + inner_mat.instantiate(); inner_mat->set_albedo(Color(0.7, 0.7, 1.0, 0.2)); inner_mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED); inner_mat->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA); @@ -1365,14 +1365,14 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { RenderingServer::get_singleton()->mesh_add_surface_from_arrays(selection_mesh, RS::PRIMITIVE_TRIANGLES, d); RenderingServer::get_singleton()->mesh_surface_set_material(selection_mesh, 0, inner_mat->get_rid()); - outer_mat.instance(); + outer_mat.instantiate(); outer_mat->set_albedo(Color(0.7, 0.7, 1.0, 0.8)); outer_mat->set_on_top_of_alpha(); outer_mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED); outer_mat->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA); - selection_floor_mat.instance(); + selection_floor_mat.instantiate(); selection_floor_mat->set_albedo(Color(0.80, 0.80, 1.0, 1)); selection_floor_mat->set_on_top_of_alpha(); selection_floor_mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED); @@ -1399,7 +1399,7 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { _set_selection(false); - indicator_mat.instance(); + indicator_mat.instantiate(); indicator_mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED); indicator_mat->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA); indicator_mat->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true); diff --git a/modules/jpg/image_loader_jpegd.cpp b/modules/jpg/image_loader_jpegd.cpp index d237544d66..b5e4753e8d 100644 --- a/modules/jpg/image_loader_jpegd.cpp +++ b/modules/jpg/image_loader_jpegd.cpp @@ -127,7 +127,7 @@ void ImageLoaderJPG::get_recognized_extensions(List<String> *p_extensions) const static Ref<Image> _jpegd_mem_loader_func(const uint8_t *p_png, int p_size) { Ref<Image> img; - img.instance(); + img.instantiate(); Error err = jpeg_load_image_from_buffer(img.ptr(), p_png, p_size); ERR_FAIL_COND_V(err, Ref<Image>()); return img; diff --git a/modules/lightmapper_rd/lightmapper_rd.cpp b/modules/lightmapper_rd/lightmapper_rd.cpp index 3b0fbb1c47..b75cf6502e 100644 --- a/modules/lightmapper_rd/lightmapper_rd.cpp +++ b/modules/lightmapper_rd/lightmapper_rd.cpp @@ -248,13 +248,13 @@ Lightmapper::BakeError LightmapperRD::_blit_meshes_into_atlas(int p_max_texture_ for (int i = 0; i < atlas_slices; i++) { Ref<Image> albedo; - albedo.instance(); + albedo.instantiate(); albedo->create(atlas_size.width, atlas_size.height, false, Image::FORMAT_RGBA8); albedo->set_as_black(); albedo_images.write[i] = albedo; Ref<Image> emission; - emission.instance(); + emission.instantiate(); emission->create(atlas_size.width, atlas_size.height, false, Image::FORMAT_RGBAH); emission->set_as_black(); emission_images.write[i] = emission; @@ -479,7 +479,7 @@ void LightmapperRD::_create_acceleration_structures(RenderingDevice *rd, Size2i } Ref<Image> img; - img.instance(); + img.instantiate(); img->create(grid_size, grid_size, false, Image::FORMAT_L8, grid_usage); img->save_png("res://grid_layer_" + itos(1000 + i).substr(1, 3) + ".png"); } @@ -725,7 +725,7 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d panorama_tex = p_environment_panorama; panorama_tex->convert(Image::FORMAT_RGBAF); } else { - panorama_tex.instance(); + panorama_tex.instantiate(); panorama_tex->create(8, 8, false, Image::FORMAT_RGBAF); for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { @@ -782,7 +782,7 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d //shaders Ref<RDShaderFile> raster_shader; - raster_shader.instance(); + raster_shader.instantiate(); Error err = raster_shader->parse_versions_from_text(lm_raster_shader_glsl); if (err != OK) { raster_shader->print_errors("raster_shader"); @@ -915,7 +915,7 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d for (int i = 0; i < atlas_slices; i++) { Vector<uint8_t> s = rd->texture_get_data(position_tex, i); Ref<Image> img; - img.instance(); + img.instantiate(); img->create(atlas_size.width, atlas_size.height, false, Image::FORMAT_RGBAF, s); img->save_exr("res://1_position_" + itos(i) + ".exr", false); @@ -933,7 +933,7 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d /* Plot direct light */ Ref<RDShaderFile> compute_shader; - compute_shader.instance(); + compute_shader.instantiate(); err = compute_shader->parse_versions_from_text(lm_compute_shader_glsl, p_bake_sh ? "\n#define USE_SH_LIGHTMAPS\n" : ""); if (err != OK) { FREE_TEXTURES @@ -1129,7 +1129,7 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d for (int i = 0; i < atlas_slices; i++) { Vector<uint8_t> s = rd->texture_get_data(light_source_tex, i); Ref<Image> img; - img.instance(); + img.instantiate(); img->create(atlas_size.width, atlas_size.height, false, Image::FORMAT_RGBAH, s); img->save_exr("res://2_light_primary_" + itos(i) + ".exr", false); } @@ -1379,12 +1379,12 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d #if 0 for (int i = 0; i < probe_positions.size(); i++) { Ref<Image> img; - img.instance(); + img.instantiate(); img->create(6, 4, false, Image::FORMAT_RGB8); for (int j = 0; j < 6; j++) { Vector<uint8_t> s = rd->texture_get_data(lightprobe_tex, i * 6 + j); Ref<Image> img2; - img2.instance(); + img2.instantiate(); img2->create(2, 2, false, Image::FORMAT_RGBAF, s); img2->convert(Image::FORMAT_RGB8); img->blit_rect(img2, Rect2(0, 0, 2, 2), Point2((j % 3) * 2, (j / 3) * 2)); @@ -1405,7 +1405,7 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d for (int i = 0; i < atlas_slices * (p_bake_sh ? 4 : 1); i++) { Vector<uint8_t> s = rd->texture_get_data(light_accum_tex, i); Ref<Image> img; - img.instance(); + img.instantiate(); img->create(atlas_size.width, atlas_size.height, false, Image::FORMAT_RGBAH, s); Ref<Image> denoised = denoiser->denoise_image(img); @@ -1432,7 +1432,7 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d for (int i = 0; i < atlas_slices * (p_bake_sh ? 4 : 1); i++) { Vector<uint8_t> s = rd->texture_get_data(light_accum_tex, i); Ref<Image> img; - img.instance(); + img.instantiate(); img->create(atlas_size.width, atlas_size.height, false, Image::FORMAT_RGBAH, s); img->save_exr("res://4_light_secondary_" + itos(i) + ".exr", false); } @@ -1484,7 +1484,7 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d for (int i = 0; i < atlas_slices * (p_bake_sh ? 4 : 1); i++) { Vector<uint8_t> s = rd->texture_get_data(light_accum_tex, i); Ref<Image> img; - img.instance(); + img.instantiate(); img->create(atlas_size.width, atlas_size.height, false, Image::FORMAT_RGBAH, s); img->convert(Image::FORMAT_RGBA8); img->save_png("res://5_dilated_" + itos(i) + ".png"); @@ -1494,7 +1494,7 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d /* BLEND SEAMS */ //shaders Ref<RDShaderFile> blendseams_shader; - blendseams_shader.instance(); + blendseams_shader.instantiate(); err = blendseams_shader->parse_versions_from_text(lm_blendseams_shader_glsl); if (err != OK) { FREE_TEXTURES @@ -1641,7 +1641,7 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d for (int i = 0; i < atlas_slices * (p_bake_sh ? 4 : 1); i++) { Vector<uint8_t> s = rd->texture_get_data(light_accum_tex, i); Ref<Image> img; - img.instance(); + img.instantiate(); img->create(atlas_size.width, atlas_size.height, false, Image::FORMAT_RGBAH, s); img->save_exr("res://5_blendseams" + itos(i) + ".exr", false); } @@ -1653,7 +1653,7 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d for (int i = 0; i < atlas_slices * (p_bake_sh ? 4 : 1); i++) { Vector<uint8_t> s = rd->texture_get_data(light_accum_tex, i); Ref<Image> img; - img.instance(); + img.instantiate(); img->create(atlas_size.width, atlas_size.height, false, Image::FORMAT_RGBAH, s); img->convert(Image::FORMAT_RGBH); //remove alpha bake_textures.push_back(img); @@ -1668,7 +1668,7 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d #ifdef DEBUG_TEXTURES { Ref<Image> img2; - img2.instance(); + img2.instantiate(); img2->create(probe_values.size(), 1, false, Image::FORMAT_RGBAF, probe_data); img2->save_exr("res://6_lightprobes.exr", false); } diff --git a/modules/mbedtls/crypto_mbedtls.cpp b/modules/mbedtls/crypto_mbedtls.cpp index 3cd2da3d85..774da5a324 100644 --- a/modules/mbedtls/crypto_mbedtls.cpp +++ b/modules/mbedtls/crypto_mbedtls.cpp @@ -324,7 +324,7 @@ void CryptoMbedTLS::load_default_certificates(String p_path) { Ref<CryptoKey> CryptoMbedTLS::generate_rsa(int p_bytes) { Ref<CryptoKeyMbedTLS> out; - out.instance(); + out.instantiate(); int ret = mbedtls_pk_setup(&(out->pkey), mbedtls_pk_info_from_type(MBEDTLS_PK_RSA)); ERR_FAIL_COND_V(ret != 0, nullptr); ret = mbedtls_rsa_gen_key(mbedtls_pk_rsa(out->pkey), mbedtls_ctr_drbg_random, &ctr_drbg, p_bytes, 65537); @@ -366,7 +366,7 @@ Ref<X509Certificate> CryptoMbedTLS::generate_self_signed_certificate(Ref<CryptoK buf[4095] = '\0'; // Make sure strlen can't fail. Ref<X509CertificateMbedTLS> out; - out.instance(); + out.instantiate(); out->load_from_memory(buf, strlen((char *)buf) + 1); // Use strlen to find correct output size. return out; } diff --git a/modules/mbedtls/dtls_server_mbedtls.cpp b/modules/mbedtls/dtls_server_mbedtls.cpp index 5d895d8579..b1b6b3844b 100644 --- a/modules/mbedtls/dtls_server_mbedtls.cpp +++ b/modules/mbedtls/dtls_server_mbedtls.cpp @@ -45,7 +45,7 @@ void DTLSServerMbedTLS::stop() { Ref<PacketPeerDTLS> DTLSServerMbedTLS::take_connection(Ref<PacketPeerUDP> p_udp_peer) { Ref<PacketPeerMbedDTLS> out; - out.instance(); + out.instantiate(); ERR_FAIL_COND_V(!out.is_valid(), out); ERR_FAIL_COND_V(!p_udp_peer.is_valid(), out); @@ -68,7 +68,7 @@ void DTLSServerMbedTLS::finalize() { } DTLSServerMbedTLS::DTLSServerMbedTLS() { - _cookies.instance(); + _cookies.instantiate(); } DTLSServerMbedTLS::~DTLSServerMbedTLS() { diff --git a/modules/mbedtls/packet_peer_mbed_dtls.cpp b/modules/mbedtls/packet_peer_mbed_dtls.cpp index 11c9f64e21..114bf49e9e 100644 --- a/modules/mbedtls/packet_peer_mbed_dtls.cpp +++ b/modules/mbedtls/packet_peer_mbed_dtls.cpp @@ -245,7 +245,7 @@ int PacketPeerMbedDTLS::get_max_packet_size() const { } PacketPeerMbedDTLS::PacketPeerMbedDTLS() { - ssl_ctx.instance(); + ssl_ctx.instantiate(); } PacketPeerMbedDTLS::~PacketPeerMbedDTLS() { diff --git a/modules/mbedtls/stream_peer_mbedtls.cpp b/modules/mbedtls/stream_peer_mbedtls.cpp index bc72b04fa4..5727f5f82f 100644 --- a/modules/mbedtls/stream_peer_mbedtls.cpp +++ b/modules/mbedtls/stream_peer_mbedtls.cpp @@ -273,7 +273,7 @@ int StreamPeerMbedTLS::get_available_bytes() const { } StreamPeerMbedTLS::StreamPeerMbedTLS() { - ssl_ctx.instance(); + ssl_ctx.instantiate(); } StreamPeerMbedTLS::~StreamPeerMbedTLS() { diff --git a/modules/minimp3/audio_stream_mp3.cpp b/modules/minimp3/audio_stream_mp3.cpp index 600bbe9bb5..2cc974322d 100644 --- a/modules/minimp3/audio_stream_mp3.cpp +++ b/modules/minimp3/audio_stream_mp3.cpp @@ -126,7 +126,7 @@ Ref<AudioStreamPlayback> AudioStreamMP3::instance_playback() { "to it. AudioStreamMP3 should not be created from the " "inspector or with `.new()`. Instead, load an audio file."); - mp3s.instance(); + mp3s.instantiate(); mp3s->mp3_stream = Ref<AudioStreamMP3>(this); mp3s->mp3d = (mp3dec_ex_t *)memalloc(sizeof(mp3dec_ex_t)); diff --git a/modules/minimp3/register_types.cpp b/modules/minimp3/register_types.cpp index 4ab4c743d6..27ea512b69 100644 --- a/modules/minimp3/register_types.cpp +++ b/modules/minimp3/register_types.cpp @@ -41,7 +41,7 @@ void register_minimp3_types() { #ifdef TOOLS_ENABLED if (Engine::get_singleton()->is_editor_hint()) { Ref<ResourceImporterMP3> mp3_import; - mp3_import.instance(); + mp3_import.instantiate(); ResourceFormatImporter::get_singleton()->add_importer(mp3_import); } #endif diff --git a/modules/minimp3/resource_importer_mp3.cpp b/modules/minimp3/resource_importer_mp3.cpp index dc16125726..dc360c12ba 100644 --- a/modules/minimp3/resource_importer_mp3.cpp +++ b/modules/minimp3/resource_importer_mp3.cpp @@ -90,7 +90,7 @@ Error ResourceImporterMP3::import(const String &p_source_file, const String &p_s memdelete(f); Ref<AudioStreamMP3> mp3_stream; - mp3_stream.instance(); + mp3_stream.instantiate(); mp3_stream->set_data(data); ERR_FAIL_COND_V(!mp3_stream->get_data().size(), ERR_FILE_CORRUPT); diff --git a/modules/mobile_vr/register_types.cpp b/modules/mobile_vr/register_types.cpp index e7d33ba8a7..7d138aa4c9 100644 --- a/modules/mobile_vr/register_types.cpp +++ b/modules/mobile_vr/register_types.cpp @@ -37,7 +37,7 @@ void register_mobile_vr_types() { if (XRServer::get_singleton()) { Ref<MobileVRInterface> mobile_vr; - mobile_vr.instance(); + mobile_vr.instantiate(); XRServer::get_singleton()->add_interface(mobile_vr); } } diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index b54340a7bc..c48230f524 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -375,7 +375,7 @@ Ref<Script> CSharpLanguage::get_template(const String &p_class_name, const Strin .replace("%CLASS%", class_name_no_spaces); Ref<CSharpScript> script; - script.instance(); + script.instantiate(); script->set_source_code(script_template); script->set_name(class_name_no_spaces); @@ -3049,7 +3049,7 @@ void CSharpScript::update_script_class_info(Ref<CSharpScript> p_script) { p_script->load_script_signals(p_script->script_class, p_script->native); } -bool CSharpScript::can_instance() const { +bool CSharpScript::can_instantiate() const { #ifdef TOOLS_ENABLED bool extra_cond = tool || ScriptServer::is_scripting_enabled(); #else @@ -3182,7 +3182,7 @@ Variant CSharpScript::_new(const Variant **p_args, int p_argcount, Callable::Cal GD_MONO_SCOPE_THREAD_ATTACH; - Object *owner = ClassDB::instance(NATIVE_GDMONOCLASS_NAME(native)); + Object *owner = ClassDB::instantiate(NATIVE_GDMONOCLASS_NAME(native)); REF ref; RefCounted *r = Object::cast_to<RefCounted>(owner); @@ -3216,10 +3216,10 @@ ScriptInstance *CSharpScript::instance_create(Object *p_this) { if (EngineDebugger::is_active()) { CSharpLanguage::get_singleton()->debug_break_parse(get_path(), 0, "Script inherits from native type '" + String(native_name) + - "', so it can't be instanced in object of type: '" + p_this->get_class() + "'"); + "', so it can't be instantiated in object of type: '" + p_this->get_class() + "'"); } ERR_FAIL_V_MSG(nullptr, "Script inherits from native type '" + String(native_name) + - "', so it can't be instanced in object of type: '" + p_this->get_class() + "'."); + "', so it can't be instantiated in object of type: '" + p_this->get_class() + "'."); } } diff --git a/modules/mono/csharp_script.h b/modules/mono/csharp_script.h index 2f1ee6b123..da6b60aee2 100644 --- a/modules/mono/csharp_script.h +++ b/modules/mono/csharp_script.h @@ -191,7 +191,7 @@ protected: void _get_property_list(List<PropertyInfo> *p_properties) const; public: - bool can_instance() const override; + bool can_instantiate() const override; StringName get_instance_base_type() const override; ScriptInstance *instance_create(Object *p_this) override; PlaceHolderScriptInstance *placeholder_instance_create(Object *p_this) override; diff --git a/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeManager.cs b/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeManager.cs index 451ce39f5c..21fe2706b2 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeManager.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeManager.cs @@ -114,12 +114,12 @@ namespace GodotTools.Ides if (Utils.OS.IsMacOS && editorId == ExternalEditorId.VisualStudioForMac) { vsForMacInstance = (vsForMacInstance?.IsDisposed ?? true ? null : vsForMacInstance) ?? - new MonoDevelop.Instance(solutionPath, MonoDevelop.EditorId.VisualStudioForMac); + new MonoDevelop.Instantiate(solutionPath, MonoDevelop.EditorId.VisualStudioForMac); return vsForMacInstance; } monoDevelInstance = (monoDevelInstance?.IsDisposed ?? true ? null : monoDevelInstance) ?? - new MonoDevelop.Instance(solutionPath, MonoDevelop.EditorId.MonoDevelop); + new MonoDevelop.Instantiate(solutionPath, MonoDevelop.EditorId.MonoDevelop); return monoDevelInstance; } diff --git a/modules/mono/glue/base_object_glue.cpp b/modules/mono/glue/base_object_glue.cpp index 2b6d2761ca..2b87c2d9a4 100644 --- a/modules/mono/glue/base_object_glue.cpp +++ b/modules/mono/glue/base_object_glue.cpp @@ -153,10 +153,10 @@ MonoObject *godot_icall_Object_weakref(Object *p_ptr) { return nullptr; } - wref.instance(); + wref.instantiate(); wref->set_ref(r); } else { - wref.instance(); + wref.instantiate(); wref->set_obj(p_ptr); } diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp index a3acfbd995..02d875f669 100644 --- a/modules/mono/mono_gd/gd_mono.cpp +++ b/modules/mono/mono_gd/gd_mono.cpp @@ -691,7 +691,7 @@ static bool try_get_cached_api_hash_for(const String &p_api_assemblies_dir, bool } Ref<ConfigFile> cfg; - cfg.instance(); + cfg.instantiate(); Error cfg_err = cfg->load(cached_api_hash_path); ERR_FAIL_COND_V(cfg_err != OK, false); @@ -717,7 +717,7 @@ static void create_cached_api_hash_for(const String &p_api_assemblies_dir) { String cached_api_hash_path = p_api_assemblies_dir.plus_file("api_hash_cache.cfg"); Ref<ConfigFile> cfg; - cfg.instance(); + cfg.instantiate(); cfg->set_value("core", "modified_time", FileAccess::get_modified_time(core_api_assembly_path)); cfg->set_value("editor", "modified_time", FileAccess::get_modified_time(editor_api_assembly_path)); diff --git a/modules/mono/mono_gd/gd_mono_utils.cpp b/modules/mono/mono_gd/gd_mono_utils.cpp index df45cb8e92..0b9a577e01 100644 --- a/modules/mono/mono_gd/gd_mono_utils.cpp +++ b/modules/mono/mono_gd/gd_mono_utils.cpp @@ -238,7 +238,7 @@ GDMonoClass *get_class_native_base(GDMonoClass *p_class) { MonoObject *create_managed_for_godot_object(GDMonoClass *p_class, const StringName &p_native, Object *p_object) { bool parent_is_object_class = ClassDB::is_parent_class(p_object->get_class_name(), p_native); ERR_FAIL_COND_V_MSG(!parent_is_object_class, nullptr, - "Type inherits from native type '" + p_native + "', so it can't be instanced in object of type: '" + p_object->get_class() + "'."); + "Type inherits from native type '" + p_native + "', so it can't be instantiated in object of type: '" + p_object->get_class() + "'."); MonoObject *mono_object = mono_object_new(mono_domain_get(), p_class->get_mono_ptr()); ERR_FAIL_NULL_V(mono_object, nullptr); diff --git a/modules/mono/register_types.cpp b/modules/mono/register_types.cpp index 80eb47bfd4..b4a6bfdcd4 100644 --- a/modules/mono/register_types.cpp +++ b/modules/mono/register_types.cpp @@ -52,10 +52,10 @@ void register_mono_types() { script_language_cs->set_language_index(ScriptServer::get_language_count()); ScriptServer::register_language(script_language_cs); - resource_loader_cs.instance(); + resource_loader_cs.instantiate(); ResourceLoader::add_resource_format_loader(resource_loader_cs); - resource_saver_cs.instance(); + resource_saver_cs.instantiate(); ResourceSaver::add_resource_format_saver(resource_saver_cs); } diff --git a/modules/pvr/image_compress_pvrtc.cpp b/modules/pvr/image_compress_pvrtc.cpp index 4d0430fa92..f33912cec0 100644 --- a/modules/pvr/image_compress_pvrtc.cpp +++ b/modules/pvr/image_compress_pvrtc.cpp @@ -52,7 +52,7 @@ static void _compress_pvrtc1_4bpp(Image *p_img) { bool use_alpha = img->detect_alpha(); Ref<Image> new_img; - new_img.instance(); + new_img.instantiate(); new_img->create(img->get_width(), img->get_height(), img->has_mipmaps(), use_alpha ? Image::FORMAT_PVRTC1_4A : Image::FORMAT_PVRTC1_4); Vector<uint8_t> data = new_img->get_data(); diff --git a/modules/pvr/register_types.cpp b/modules/pvr/register_types.cpp index aeac564c93..ef72087d25 100644 --- a/modules/pvr/register_types.cpp +++ b/modules/pvr/register_types.cpp @@ -36,7 +36,7 @@ static Ref<ResourceFormatPVR> resource_loader_pvr; void register_pvr_types() { - resource_loader_pvr.instance(); + resource_loader_pvr.instantiate(); ResourceLoader::add_resource_format_loader(resource_loader_pvr); _register_pvrtc_compress_func(); diff --git a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp index 78b4749939..768b419348 100644 --- a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp @@ -129,7 +129,7 @@ Ref<AudioStreamPlayback> AudioStreamOGGVorbis::instance_playback() { "to it. AudioStreamOGGVorbis should not be created from the " "inspector or with `.new()`. Instead, load an audio file."); - ovs.instance(); + ovs.instantiate(); ovs->vorbis_stream = Ref<AudioStreamOGGVorbis>(this); ovs->ogg_alloc.alloc_buffer = (char *)memalloc(decode_mem_size); ovs->ogg_alloc.alloc_buffer_length_in_bytes = decode_mem_size; diff --git a/modules/stb_vorbis/register_types.cpp b/modules/stb_vorbis/register_types.cpp index 6f7eb53bc8..d9c6c06d65 100644 --- a/modules/stb_vorbis/register_types.cpp +++ b/modules/stb_vorbis/register_types.cpp @@ -41,7 +41,7 @@ void register_stb_vorbis_types() { #ifdef TOOLS_ENABLED if (Engine::get_singleton()->is_editor_hint()) { Ref<ResourceImporterOGGVorbis> ogg_import; - ogg_import.instance(); + ogg_import.instantiate(); ResourceFormatImporter::get_singleton()->add_importer(ogg_import); } #endif diff --git a/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp b/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp index a0de5e5f0f..85de698efd 100644 --- a/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp +++ b/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp @@ -90,7 +90,7 @@ Error ResourceImporterOGGVorbis::import(const String &p_source_file, const Strin memdelete(f); Ref<AudioStreamOGGVorbis> ogg_stream; - ogg_stream.instance(); + ogg_stream.instantiate(); ogg_stream->set_data(data); ERR_FAIL_COND_V(!ogg_stream->get_data().size(), ERR_FILE_CORRUPT); diff --git a/modules/text_server_adv/dynamic_font_adv.cpp b/modules/text_server_adv/dynamic_font_adv.cpp index c29aac05bb..62eedebb59 100644 --- a/modules/text_server_adv/dynamic_font_adv.cpp +++ b/modules/text_server_adv/dynamic_font_adv.cpp @@ -420,7 +420,7 @@ DynamicFontDataAdvanced::Character DynamicFontDataAdvanced::bitmap_to_character( Ref<Image> img = memnew(Image(tex.texture_size, tex.texture_size, 0, require_format, tex.imgdata)); if (tex.texture.is_null()) { - tex.texture.instance(); + tex.texture.instantiate(); tex.texture->create_from_image(img); } else { tex.texture->update(img); //update diff --git a/modules/text_server_fb/dynamic_font_fb.cpp b/modules/text_server_fb/dynamic_font_fb.cpp index a261ba8f37..7e77987074 100644 --- a/modules/text_server_fb/dynamic_font_fb.cpp +++ b/modules/text_server_fb/dynamic_font_fb.cpp @@ -306,7 +306,7 @@ DynamicFontDataFallback::Character DynamicFontDataFallback::bitmap_to_character( Ref<Image> img = memnew(Image(tex.texture_size, tex.texture_size, 0, require_format, tex.imgdata)); if (tex.texture.is_null()) { - tex.texture.instance(); + tex.texture.instantiate(); tex.texture->create_from_image(img); } else { tex.texture->update(img); //update diff --git a/modules/tga/image_loader_tga.cpp b/modules/tga/image_loader_tga.cpp index 6eaa2d24a8..f0d7c335bd 100644 --- a/modules/tga/image_loader_tga.cpp +++ b/modules/tga/image_loader_tga.cpp @@ -343,7 +343,7 @@ static Ref<Image> _tga_mem_loader_func(const uint8_t *p_tga, int p_size) { Error open_memfile_error = memfile.open_custom(p_tga, p_size); ERR_FAIL_COND_V_MSG(open_memfile_error, Ref<Image>(), "Could not create memfile for TGA image buffer."); Ref<Image> img; - img.instance(); + img.instantiate(); Error load_error = ImageLoaderTGA().load_image(img, &memfile, false, 1.0f); ERR_FAIL_COND_V_MSG(load_error, Ref<Image>(), "Failed to load TGA image."); return img; diff --git a/modules/theora/register_types.cpp b/modules/theora/register_types.cpp index 0218b8c7a4..fd6c9dcd3c 100644 --- a/modules/theora/register_types.cpp +++ b/modules/theora/register_types.cpp @@ -35,7 +35,7 @@ static Ref<ResourceFormatLoaderTheora> resource_loader_theora; void register_theora_types() { - resource_loader_theora.instance(); + resource_loader_theora.instantiate(); ResourceLoader::add_resource_format_loader(resource_loader_theora, true); ClassDB::register_class<VideoStreamTheora>(); diff --git a/modules/theora/video_stream_theora.cpp b/modules/theora/video_stream_theora.cpp index 4400445f30..40be067a91 100644 --- a/modules/theora/video_stream_theora.cpp +++ b/modules/theora/video_stream_theora.cpp @@ -335,7 +335,7 @@ void VideoStreamPlaybackTheora::set_file(const String &p_file) { size.y = h; Ref<Image> img; - img.instance(); + img.instantiate(); img->create(w, h, false, Image::FORMAT_RGBA8); } else { diff --git a/modules/upnp/upnp.cpp b/modules/upnp/upnp.cpp index 8e4e833d45..efe618012a 100644 --- a/modules/upnp/upnp.cpp +++ b/modules/upnp/upnp.cpp @@ -92,7 +92,7 @@ int UPNP::discover(int timeout, int ttl, const String &device_filter) { void UPNP::add_device_to_list(UPNPDev *dev, UPNPDev *devlist) { Ref<UPNPDevice> new_device; - new_device.instance(); + new_device.instantiate(); new_device->set_description_url(dev->descURL); new_device->set_service_type(dev->st); diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index 1047a4d3a3..d49060bea8 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -725,7 +725,7 @@ int VisualScript::get_available_id() const { ///////////////////////////////// -bool VisualScript::can_instance() const { +bool VisualScript::can_instantiate() const { return true; // ScriptServer::is_scripting_enabled(); } @@ -1958,7 +1958,7 @@ void VisualScriptInstance::create(const Ref<VisualScript> &p_script, Object *p_o for (const Set<int>::Element *F = node_ids.front(); F; F = F->next()) { Ref<VisualScriptNode> node = script->nodes[F->get()].node; - VisualScriptNodeInstance *instance = node->instance(this); // Create instance. + VisualScriptNodeInstance *instance = node->instantiate(this); // Create instance. ERR_FAIL_COND(!instance); instance->base = node.ptr(); @@ -2262,7 +2262,7 @@ void VisualScriptLanguage::get_string_delimiters(List<String> *p_delimiters) con Ref<Script> VisualScriptLanguage::get_template(const String &p_class_name, const String &p_base_class_name) const { Ref<VisualScript> script; - script.instance(); + script.instantiate(); script->set_instance_base_type(p_base_class_name); return script; } diff --git a/modules/visual_script/visual_script.h b/modules/visual_script/visual_script.h index 5e848dc6c7..932ebeb27f 100644 --- a/modules/visual_script/visual_script.h +++ b/modules/visual_script/visual_script.h @@ -87,7 +87,7 @@ public: void set_breakpoint(bool p_breakpoint); bool is_breakpoint() const; - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) = 0; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) = 0; struct TypeGuess { Variant::Type type = Variant::NIL; @@ -325,7 +325,7 @@ public: void set_instance_base_type(const StringName &p_type); - virtual bool can_instance() const override; + virtual bool can_instantiate() const override; virtual Ref<Script> get_base_script() const override; virtual StringName get_instance_base_type() const override; @@ -619,7 +619,7 @@ public: template <class T> static Ref<VisualScriptNode> create_node_generic(const String &p_name) { Ref<T> node; - node.instance(); + node.instantiate(); return node; } diff --git a/modules/visual_script/visual_script_builtin_funcs.cpp b/modules/visual_script/visual_script_builtin_funcs.cpp index a3133f126d..f17ad62531 100644 --- a/modules/visual_script/visual_script_builtin_funcs.cpp +++ b/modules/visual_script/visual_script_builtin_funcs.cpp @@ -1187,7 +1187,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptBuiltinFunc::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptBuiltinFunc::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceBuiltinFunc *instance = memnew(VisualScriptNodeInstanceBuiltinFunc); instance->node = this; instance->instance = p_instance; diff --git a/modules/visual_script/visual_script_builtin_funcs.h b/modules/visual_script/visual_script_builtin_funcs.h index 1fafaf1d98..7196d4b46a 100644 --- a/modules/visual_script/visual_script_builtin_funcs.h +++ b/modules/visual_script/visual_script_builtin_funcs.h @@ -139,7 +139,7 @@ public: void set_func(BuiltinFunc p_which); BuiltinFunc get_func(); - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptBuiltinFunc(VisualScriptBuiltinFunc::BuiltinFunc func); VisualScriptBuiltinFunc(); diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 96f103f95a..51de8afc53 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -1303,7 +1303,7 @@ void VisualScriptEditor::_create_function() { Vector2 ofs = _get_available_pos(); Ref<VisualScriptFunction> func_node; - func_node.instance(); + func_node.instantiate(); func_node->set_name(name); for (int i = 0; i < func_input_vbox->get_child_count(); i++) { @@ -1420,7 +1420,7 @@ void VisualScriptEditor::_member_button(Object *p_item, int p_column, int p_butt Vector2 ofs = _get_available_pos(); Ref<VisualScriptFunction> func_node; - func_node.instance(); + func_node.instantiate(); func_node->set_name(name); int fn_id = script->get_available_id(); @@ -2084,12 +2084,12 @@ void VisualScriptEditor::drop_data_fw(const Point2 &p_point, const Variant &p_da Ref<VisualScriptNode> vnode; if (use_set) { Ref<VisualScriptVariableSet> vnodes; - vnodes.instance(); + vnodes.instantiate(); vnodes->set_variable(d["variable"]); vnode = vnodes; } else { Ref<VisualScriptVariableGet> vnodeg; - vnodeg.instance(); + vnodeg.instantiate(); vnodeg->set_variable(d["variable"]); vnode = vnodeg; } @@ -2120,7 +2120,7 @@ void VisualScriptEditor::drop_data_fw(const Point2 &p_point, const Variant &p_da ofs /= EDSCALE; Ref<VisualScriptFunctionCall> vnode; - vnode.instance(); + vnode.instantiate(); vnode->set_call_mode(VisualScriptFunctionCall::CALL_MODE_SELF); int new_id = script->get_available_id(); @@ -2152,7 +2152,7 @@ void VisualScriptEditor::drop_data_fw(const Point2 &p_point, const Variant &p_da ofs /= EDSCALE; Ref<VisualScriptEmitSignal> vnode; - vnode.instance(); + vnode.instantiate(); vnode->set_signal(d["signal"]); int new_id = script->get_available_id(); @@ -2181,7 +2181,7 @@ void VisualScriptEditor::drop_data_fw(const Point2 &p_point, const Variant &p_da ofs /= EDSCALE; Ref<VisualScriptPreload> prnode; - prnode.instance(); + prnode.instantiate(); prnode->set_preload(d["resource"]); int new_id = script->get_available_id(); @@ -2224,7 +2224,7 @@ void VisualScriptEditor::drop_data_fw(const Point2 &p_point, const Variant &p_da } Ref<VisualScriptPreload> prnode; - prnode.instance(); + prnode.instantiate(); prnode->set_preload(res); undo_redo->add_do_method(script.ptr(), "add_node", new_id, prnode, ofs); @@ -2290,13 +2290,13 @@ void VisualScriptEditor::drop_data_fw(const Point2 &p_point, const Variant &p_da if (use_node) { Ref<VisualScriptSceneNode> scene_node; - scene_node.instance(); + scene_node.instantiate(); scene_node->set_node_path(sn->get_path_to(node)); n = scene_node; } else { // ! Doesn't work properly. Ref<VisualScriptFunctionCall> call; - call.instance(); + call.instantiate(); call->set_call_mode(VisualScriptFunctionCall::CALL_MODE_NODE_PATH); call->set_base_path(sn->get_path_to(node)); call->set_base_type(node->get_class()); @@ -2358,7 +2358,7 @@ void VisualScriptEditor::drop_data_fw(const Point2 &p_point, const Variant &p_da if (!use_get) { Ref<VisualScriptPropertySet> pset; - pset.instance(); + pset.instantiate(); pset->set_call_mode(VisualScriptPropertySet::CALL_MODE_INSTANCE); pset->set_base_type(obj->get_class()); /*if (use_value) { @@ -2368,7 +2368,7 @@ void VisualScriptEditor::drop_data_fw(const Point2 &p_point, const Variant &p_da vnode = pset; } else { Ref<VisualScriptPropertyGet> pget; - pget.instance(); + pget.instantiate(); pget->set_call_mode(VisualScriptPropertyGet::CALL_MODE_INSTANCE); pget->set_base_type(obj->get_class()); @@ -2400,7 +2400,7 @@ void VisualScriptEditor::drop_data_fw(const Point2 &p_point, const Variant &p_da if (!use_get) { Ref<VisualScriptPropertySet> pset; - pset.instance(); + pset.instantiate(); if (sn == node) { pset->set_call_mode(VisualScriptPropertySet::CALL_MODE_SELF); } else { @@ -2411,7 +2411,7 @@ void VisualScriptEditor::drop_data_fw(const Point2 &p_point, const Variant &p_da vnode = pset; } else { Ref<VisualScriptPropertyGet> pget; - pget.instance(); + pget.instantiate(); if (sn == node) { pget->set_call_mode(VisualScriptPropertyGet::CALL_MODE_SELF); } else { @@ -2666,7 +2666,7 @@ void VisualScriptEditor::add_callback(const String &p_function, PackedStringArra } Ref<VisualScriptFunction> func; - func.instance(); + func.instantiate(); for (int i = 0; i < p_args.size(); i++) { String name = p_args[i]; Variant::Type type = Variant::NIL; @@ -3087,7 +3087,7 @@ void VisualScriptEditor::_port_action_menu(int p_option) { switch (p_option) { case CREATE_CALL_SET_GET: { Ref<VisualScriptFunctionCall> n; - n.instance(); + n.instantiate(); VisualScriptNode::TypeGuess tg = _guess_output_type(port_action_node, port_action_output, vn); @@ -3234,16 +3234,16 @@ void VisualScriptEditor::_selected_connect_node(const String &p_text, const Stri if (p_category == String("method")) { Ref<VisualScriptFunctionCall> n; - n.instance(); + n.instantiate(); vnode = n; } else if (p_category == String("set")) { Ref<VisualScriptPropertySet> n; - n.instance(); + n.instantiate(); vnode = n; script_prop_set = n; } else if (p_category == String("get")) { Ref<VisualScriptPropertyGet> n; - n.instance(); + n.instantiate(); n->set_property(p_text); vnode = n; } @@ -3251,28 +3251,28 @@ void VisualScriptEditor::_selected_connect_node(const String &p_text, const Stri if (p_category == String("action")) { if (p_text == "VisualScriptCondition") { Ref<VisualScriptCondition> n; - n.instance(); + n.instantiate(); vnode = n; } if (p_text == "VisualScriptSwitch") { Ref<VisualScriptSwitch> n; - n.instance(); + n.instantiate(); vnode = n; } else if (p_text == "VisualScriptSequence") { Ref<VisualScriptSequence> n; - n.instance(); + n.instantiate(); vnode = n; } else if (p_text == "VisualScriptIterator") { Ref<VisualScriptIterator> n; - n.instance(); + n.instantiate(); vnode = n; } else if (p_text == "VisualScriptWhile") { Ref<VisualScriptWhile> n; - n.instance(); + n.instantiate(); vnode = n; } else if (p_text == "VisualScriptReturn") { Ref<VisualScriptReturn> n; - n.instance(); + n.instantiate(); vnode = n; } } @@ -3468,7 +3468,7 @@ void VisualScriptEditor::_selected_new_virtual_method(const String &p_text, cons selected = name; Ref<VisualScriptFunction> func_node; - func_node.instance(); + func_node.instantiate(); func_node->set_name(name); int fn_id = script->get_available_id(); undo_redo->create_action(TTR("Add Function")); @@ -3484,7 +3484,7 @@ void VisualScriptEditor::_selected_new_virtual_method(const String &p_text, cons undo_redo->add_undo_method(script.ptr(), "remove_node", fn_id); if (minfo.return_val.type != Variant::NIL || minfo.return_val.usage & PROPERTY_USAGE_NIL_IS_VARIANT) { Ref<VisualScriptReturn> ret_node; - ret_node.instance(); + ret_node.instantiate(); ret_node->set_return_type(minfo.return_val.type); ret_node->set_enable_return_value(true); ret_node->set_name(name); @@ -3996,7 +3996,7 @@ void VisualScriptEditor::_menu_option(int p_what) { Vector2 ofs = _get_available_pos(false, script->get_node_position(start_node) - Vector2(80, 150)); Ref<VisualScriptFunction> func_node; - func_node.instance(); + func_node.instantiate(); func_node->set_name(new_fn); undo_redo->create_action(TTR("Create Function")); @@ -4041,7 +4041,7 @@ void VisualScriptEditor::_menu_option(int p_what) { int m = 1; for (Set<int>::Element *G = end_nodes.front(); G; G = G->next()) { Ref<VisualScriptReturn> ret_node; - ret_node.instance(); + ret_node.instantiate(); int ret_id = fn_id + (m++); selections.insert(ret_id); @@ -4529,7 +4529,7 @@ void VisualScriptEditor::register_editor() { Ref<VisualScriptNode> _VisualScriptEditor::create_node_custom(const String &p_name) { Ref<VisualScriptCustomNode> node; - node.instance(); + node.instantiate(); node->set_script(singleton->custom_nodes[p_name]); return node; } diff --git a/modules/visual_script/visual_script_expression.cpp b/modules/visual_script/visual_script_expression.cpp index cb4230bea9..d63fbeb726 100644 --- a/modules/visual_script/visual_script_expression.cpp +++ b/modules/visual_script/visual_script_expression.cpp @@ -1498,7 +1498,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptExpression::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptExpression::instantiate(VisualScriptInstance *p_instance) { _compile_expression(); VisualScriptNodeInstanceExpression *instance = memnew(VisualScriptNodeInstanceExpression); instance->instance = p_instance; diff --git a/modules/visual_script/visual_script_expression.h b/modules/visual_script/visual_script_expression.h index c35075ea53..ef16222b42 100644 --- a/modules/visual_script/visual_script_expression.h +++ b/modules/visual_script/visual_script_expression.h @@ -273,7 +273,7 @@ public: virtual String get_text() const override; virtual String get_category() const override { return "operators"; } - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptExpression(); ~VisualScriptExpression(); diff --git a/modules/visual_script/visual_script_flow_control.cpp b/modules/visual_script/visual_script_flow_control.cpp index e977f9c96b..af86f90b25 100644 --- a/modules/visual_script/visual_script_flow_control.cpp +++ b/modules/visual_script/visual_script_flow_control.cpp @@ -138,7 +138,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptReturn::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptReturn::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceReturn *instance = memnew(VisualScriptNodeInstanceReturn); instance->node = this; instance->instance = p_instance; @@ -154,7 +154,7 @@ VisualScriptReturn::VisualScriptReturn() { template <bool with_value> static Ref<VisualScriptNode> create_return_node(const String &p_name) { Ref<VisualScriptReturn> node; - node.instance(); + node.instantiate(); node->set_enable_return_value(with_value); return node; } @@ -231,7 +231,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptCondition::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptCondition::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceCondition *instance = memnew(VisualScriptNodeInstanceCondition); instance->node = this; instance->instance = p_instance; @@ -311,7 +311,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptWhile::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptWhile::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceWhile *instance = memnew(VisualScriptNodeInstanceWhile); instance->node = this; instance->instance = p_instance; @@ -435,7 +435,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptIterator::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptIterator::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceIterator *instance = memnew(VisualScriptNodeInstanceIterator); instance->node = this; instance->instance = p_instance; @@ -534,7 +534,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptSequence::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptSequence::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceSequence *instance = memnew(VisualScriptNodeInstanceSequence); instance->node = this; instance->instance = p_instance; @@ -618,7 +618,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptSwitch::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptSwitch::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceSwitch *instance = memnew(VisualScriptNodeInstanceSwitch); instance->instance = p_instance; instance->case_count = case_values.size(); @@ -831,7 +831,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptTypeCast::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptTypeCast::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceTypeCast *instance = memnew(VisualScriptNodeInstanceTypeCast); instance->instance = p_instance; instance->base_type = base_type; diff --git a/modules/visual_script/visual_script_flow_control.h b/modules/visual_script/visual_script_flow_control.h index d9c4dedafd..73822fcc37 100644 --- a/modules/visual_script/visual_script_flow_control.h +++ b/modules/visual_script/visual_script_flow_control.h @@ -64,7 +64,7 @@ public: void set_enable_return_value(bool p_enable); bool is_return_value_enabled() const; - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptReturn(); }; @@ -91,7 +91,7 @@ public: virtual String get_text() const override; virtual String get_category() const override { return "flow_control"; } - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptCondition(); }; @@ -118,7 +118,7 @@ public: virtual String get_text() const override; virtual String get_category() const override { return "flow_control"; } - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptWhile(); }; @@ -145,7 +145,7 @@ public: virtual String get_text() const override; virtual String get_category() const override { return "flow_control"; } - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptIterator(); }; @@ -177,7 +177,7 @@ public: void set_steps(int p_steps); int get_steps() const; - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptSequence(); }; @@ -220,7 +220,7 @@ public: virtual String get_text() const override; virtual String get_category() const override { return "flow_control"; } - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptSwitch(); }; @@ -258,7 +258,7 @@ public: virtual TypeGuess guess_output_type(TypeGuess *p_inputs, int p_output) const override; - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptTypeCast(); }; diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp index a0ba7b1962..43e1d38a16 100644 --- a/modules/visual_script/visual_script_func_nodes.cpp +++ b/modules/visual_script/visual_script_func_nodes.cpp @@ -856,7 +856,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptFunctionCall::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptFunctionCall::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceFunctionCall *instance = memnew(VisualScriptNodeInstanceFunctionCall); instance->node = this; instance->instance = p_instance; @@ -891,7 +891,7 @@ VisualScriptFunctionCall::VisualScriptFunctionCall() { template <VisualScriptFunctionCall::CallMode cmode> static Ref<VisualScriptNode> create_function_call_node(const String &p_name) { Ref<VisualScriptFunctionCall> node; - node.instance(); + node.instantiate(); node->set_call_mode(cmode); return node; } @@ -1587,7 +1587,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptPropertySet::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptPropertySet::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstancePropertySet *instance = memnew(VisualScriptNodeInstancePropertySet); instance->node = this; instance->instance = p_instance; @@ -1618,7 +1618,7 @@ VisualScriptPropertySet::VisualScriptPropertySet() { template <VisualScriptPropertySet::CallMode cmode> static Ref<VisualScriptNode> create_property_set_node(const String &p_name) { Ref<VisualScriptPropertySet> node; - node.instance(); + node.instantiate(); node->set_call_mode(cmode); return node; } @@ -2175,7 +2175,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptPropertyGet::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptPropertyGet::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstancePropertyGet *instance = memnew(VisualScriptNodeInstancePropertyGet); instance->node = this; instance->instance = p_instance; @@ -2197,7 +2197,7 @@ VisualScriptPropertyGet::VisualScriptPropertyGet() { template <VisualScriptPropertyGet::CallMode cmode> static Ref<VisualScriptNode> create_property_get_node(const String &p_name) { Ref<VisualScriptPropertyGet> node; - node.instance(); + node.instantiate(); node->set_call_mode(cmode); return node; } @@ -2321,7 +2321,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptEmitSignal::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptEmitSignal::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceEmitSignal *instance = memnew(VisualScriptNodeInstanceEmitSignal); instance->node = this; instance->instance = p_instance; @@ -2340,7 +2340,7 @@ static Ref<VisualScriptNode> create_basic_type_call_node(const String &p_name) { String method = path[3]; Ref<VisualScriptFunctionCall> node; - node.instance(); + node.instantiate(); Variant::Type type = Variant::VARIANT_MAX; diff --git a/modules/visual_script/visual_script_func_nodes.h b/modules/visual_script/visual_script_func_nodes.h index 2ff9b7a981..eb17be1fbe 100644 --- a/modules/visual_script/visual_script_func_nodes.h +++ b/modules/visual_script/visual_script_func_nodes.h @@ -125,7 +125,7 @@ public: void set_rpc_call_mode(RPCCallMode p_mode); RPCCallMode get_rpc_call_mode() const; - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; virtual TypeGuess guess_output_type(TypeGuess *p_inputs, int p_output) const override; @@ -231,7 +231,7 @@ public: void set_assign_op(AssignOp p_op); AssignOp get_assign_op() const; - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; virtual TypeGuess guess_output_type(TypeGuess *p_inputs, int p_output) const override; VisualScriptPropertySet(); @@ -314,7 +314,7 @@ public: void set_index(const StringName &p_type); StringName get_index() const; - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptPropertyGet(); }; @@ -351,7 +351,7 @@ public: void set_signal(const StringName &p_type); StringName get_signal() const; - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptEmitSignal(); }; diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp index 07dc3dfaf6..60a132c6a5 100644 --- a/modules/visual_script/visual_script_nodes.cpp +++ b/modules/visual_script/visual_script_nodes.cpp @@ -296,7 +296,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptFunction::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptFunction::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceFunction *instance = memnew(VisualScriptNodeInstanceFunction); instance->node = this; instance->instance = p_instance; @@ -791,7 +791,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptComposeArray::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptComposeArray::instantiate(VisualScriptInstance *p_instance) { VisualScriptComposeArrayNode *instance = memnew(VisualScriptComposeArrayNode); instance->input_count = inputports.size(); return instance; @@ -1062,7 +1062,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptOperator::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptOperator::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceOperator *instance = memnew(VisualScriptNodeInstanceOperator); instance->unary = get_input_value_port_count() == 1; instance->op = op; @@ -1077,7 +1077,7 @@ VisualScriptOperator::VisualScriptOperator() { template <Variant::Operator OP> static Ref<VisualScriptNode> create_op_node(const String &p_name) { Ref<VisualScriptOperator> node; - node.instance(); + node.instantiate(); node->set_operator(OP); return node; } @@ -1169,7 +1169,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptSelect::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptSelect::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceSelect *instance = memnew(VisualScriptNodeInstanceSelect); return instance; } @@ -1277,7 +1277,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptVariableGet::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptVariableGet::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceVariableGet *instance = memnew(VisualScriptNodeInstanceVariableGet); instance->node = this; instance->instance = p_instance; @@ -1389,7 +1389,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptVariableSet::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptVariableSet::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceVariableSet *instance = memnew(VisualScriptNodeInstanceVariableSet); instance->node = this; instance->instance = p_instance; @@ -1504,7 +1504,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptConstant::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptConstant::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceConstant *instance = memnew(VisualScriptNodeInstanceConstant); instance->constant = value; return instance; @@ -1597,7 +1597,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptPreload::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptPreload::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstancePreload *instance = memnew(VisualScriptNodeInstancePreload); instance->preload = preload; return instance; @@ -1662,7 +1662,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptIndexGet::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptIndexGet::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceIndexGet *instance = memnew(VisualScriptNodeInstanceIndexGet); return instance; } @@ -1732,7 +1732,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptIndexSet::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptIndexSet::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceIndexSet *instance = memnew(VisualScriptNodeInstanceIndexSet); return instance; } @@ -1798,7 +1798,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptGlobalConstant::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptGlobalConstant::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceGlobalConstant *instance = memnew(VisualScriptNodeInstanceGlobalConstant); instance->index = index; return instance; @@ -1916,7 +1916,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptClassConstant::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptClassConstant::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceClassConstant *instance = memnew(VisualScriptNodeInstanceClassConstant); instance->value = ClassDB::get_integer_constant(base_type, name, &instance->valid); return instance; @@ -2050,7 +2050,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptBasicTypeConstant::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptBasicTypeConstant::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceBasicTypeConstant *instance = memnew(VisualScriptNodeInstanceBasicTypeConstant); instance->value = Variant::get_constant_value(type, name, &instance->valid); return instance; @@ -2174,7 +2174,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptMathConstant::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptMathConstant::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceMathConstant *instance = memnew(VisualScriptNodeInstanceMathConstant); instance->value = const_value[constant]; return instance; @@ -2268,7 +2268,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptEngineSingleton::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptEngineSingleton::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceEngineSingleton *instance = memnew(VisualScriptNodeInstanceEngineSingleton); instance->singleton = Engine::get_singleton()->get_singleton_object(singleton); return instance; @@ -2394,7 +2394,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptSceneNode::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptSceneNode::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceSceneNode *instance = memnew(VisualScriptNodeInstanceSceneNode); instance->node = this; instance->instance = p_instance; @@ -2574,7 +2574,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptSceneTree::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptSceneTree::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceSceneTree *instance = memnew(VisualScriptNodeInstanceSceneTree); instance->node = this; instance->instance = p_instance; @@ -2655,7 +2655,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptResourcePath::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptResourcePath::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceResourcePath *instance = memnew(VisualScriptNodeInstanceResourcePath); instance->path = path; return instance; @@ -2727,7 +2727,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptSelf::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptSelf::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceSelf *instance = memnew(VisualScriptNodeInstanceSelf); instance->instance = p_instance; return instance; @@ -2908,7 +2908,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptCustomNode::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptCustomNode::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceCustomNode *instance = memnew(VisualScriptNodeInstanceCustomNode); instance->instance = p_instance; instance->node = this; @@ -3059,7 +3059,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptSubCall::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptSubCall::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceSubCall *instance = memnew(VisualScriptNodeInstanceSubCall); instance->instance = p_instance; Ref<Script> script = get_script(); @@ -3172,7 +3172,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptComment::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptComment::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceComment *instance = memnew(VisualScriptNodeInstanceComment); instance->instance = p_instance; return instance; @@ -3279,7 +3279,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptConstructor::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptConstructor::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceConstructor *instance = memnew(VisualScriptNodeInstanceConstructor); instance->instance = p_instance; instance->type = type; @@ -3308,7 +3308,7 @@ static Ref<VisualScriptNode> create_constructor_node(const String &p_name) { ERR_FAIL_COND_V(!constructor_map.has(p_name), Ref<VisualScriptNode>()); Ref<VisualScriptConstructor> vsc; - vsc.instance(); + vsc.instantiate(); vsc->set_constructor_type(constructor_map[p_name].first); vsc->set_constructor(constructor_map[p_name].second); @@ -3389,7 +3389,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptLocalVar::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptLocalVar::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceLocalVar *instance = memnew(VisualScriptNodeInstanceLocalVar); instance->instance = p_instance; instance->name = name; @@ -3497,7 +3497,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptLocalVarSet::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptLocalVarSet::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceLocalVarSet *instance = memnew(VisualScriptNodeInstanceLocalVarSet); instance->instance = p_instance; instance->name = name; @@ -3634,7 +3634,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptInputAction::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptInputAction::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceInputAction *instance = memnew(VisualScriptNodeInstanceInputAction); instance->instance = p_instance; instance->action = name; @@ -3812,7 +3812,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptDeconstruct::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptDeconstruct::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceDeconstruct *instance = memnew(VisualScriptNodeInstanceDeconstruct); instance->instance = p_instance; instance->outputs.resize(elements.size()); @@ -3849,7 +3849,7 @@ VisualScriptDeconstruct::VisualScriptDeconstruct() { template <Variant::Type T> static Ref<VisualScriptNode> create_node_deconst_typed(const String &p_name) { Ref<VisualScriptDeconstruct> node; - node.instance(); + node.instantiate(); node->set_deconstruct_type(T); return node; } diff --git a/modules/visual_script/visual_script_nodes.h b/modules/visual_script/visual_script_nodes.h index 7392443e4e..551832b002 100644 --- a/modules/visual_script/visual_script_nodes.h +++ b/modules/visual_script/visual_script_nodes.h @@ -97,7 +97,7 @@ public: void set_rpc_mode(MultiplayerAPI::RPCMode p_mode); MultiplayerAPI::RPCMode get_rpc_mode() const; - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; virtual void reset_state() override; @@ -192,7 +192,7 @@ public: virtual String get_text() const override; virtual String get_category() const override { return "functions"; } - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptComposeArray(); }; @@ -227,7 +227,7 @@ public: void set_typed(Variant::Type p_op); Variant::Type get_typed() const; - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptOperator(); }; @@ -259,7 +259,7 @@ public: void set_typed(Variant::Type p_op); Variant::Type get_typed() const; - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptSelect(); }; @@ -291,7 +291,7 @@ public: void set_variable(StringName p_variable); StringName get_variable() const; - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptVariableGet(); }; @@ -323,7 +323,7 @@ public: void set_variable(StringName p_variable); StringName get_variable() const; - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptVariableSet(); }; @@ -359,7 +359,7 @@ public: void set_constant_value(Variant p_value); Variant get_constant_value() const; - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptConstant(); }; @@ -390,7 +390,7 @@ public: void set_preload(const Ref<Resource> &p_preload); Ref<Resource> get_preload() const; - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptPreload(); }; @@ -413,7 +413,7 @@ public: virtual String get_caption() const override; virtual String get_category() const override { return "operators"; } - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptIndexGet(); }; @@ -436,7 +436,7 @@ public: virtual String get_caption() const override; virtual String get_category() const override { return "operators"; } - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptIndexSet(); }; @@ -466,7 +466,7 @@ public: void set_global_constant(int p_which); int get_global_constant(); - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptGlobalConstant(); }; @@ -502,7 +502,7 @@ public: void set_base_type(const StringName &p_which); StringName get_base_type(); - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptClassConstant(); }; @@ -539,7 +539,7 @@ public: void set_basic_type(Variant::Type p_which); Variant::Type get_basic_type() const; - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptBasicTypeConstant(); }; @@ -586,7 +586,7 @@ public: void set_math_constant(MathConstant p_which); MathConstant get_math_constant(); - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptMathConstant(); }; @@ -621,7 +621,7 @@ public: void set_singleton(const String &p_string); String get_singleton(); - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; virtual TypeGuess guess_output_type(TypeGuess *p_inputs, int p_output) const override; @@ -655,7 +655,7 @@ public: void set_node_path(const NodePath &p_path); NodePath get_node_path(); - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; virtual TypeGuess guess_output_type(TypeGuess *p_inputs, int p_output) const override; @@ -684,7 +684,7 @@ public: virtual String get_caption() const override; virtual String get_category() const override { return "data"; } - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; virtual TypeGuess guess_output_type(TypeGuess *p_inputs, int p_output) const override; @@ -717,7 +717,7 @@ public: void set_resource_path(const String &p_path); String get_resource_path(); - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptResourcePath(); }; @@ -743,7 +743,7 @@ public: virtual String get_caption() const override; virtual String get_category() const override { return "data"; } - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; virtual TypeGuess guess_output_type(TypeGuess *p_inputs, int p_output) const override; @@ -788,7 +788,7 @@ public: virtual String get_text() const override; virtual String get_category() const override; - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; void _script_changed(); @@ -819,7 +819,7 @@ public: virtual String get_text() const override; virtual String get_category() const override; - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptSubCall(); }; @@ -859,7 +859,7 @@ public: void set_size(const Size2 &p_size); Size2 get_size() const; - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptComment(); }; @@ -894,7 +894,7 @@ public: void set_constructor(const Dictionary &p_info); Dictionary get_constructor() const; - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptConstructor(); }; @@ -929,7 +929,7 @@ public: void set_var_type(Variant::Type p_type); Variant::Type get_var_type() const; - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptLocalVar(); }; @@ -965,7 +965,7 @@ public: void set_var_type(Variant::Type p_type); Variant::Type get_var_type() const; - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptLocalVarSet(); }; @@ -1010,7 +1010,7 @@ public: void set_action_mode(Mode p_mode); Mode get_action_mode() const; - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptInputAction(); }; @@ -1056,7 +1056,7 @@ public: void set_deconstruct_type(Variant::Type p_type); Variant::Type get_deconstruct_type() const; - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptDeconstruct(); }; diff --git a/modules/visual_script/visual_script_yield_nodes.cpp b/modules/visual_script/visual_script_yield_nodes.cpp index 52fe659983..2e1b0a3e99 100644 --- a/modules/visual_script/visual_script_yield_nodes.cpp +++ b/modules/visual_script/visual_script_yield_nodes.cpp @@ -113,7 +113,7 @@ public: } Ref<VisualScriptFunctionState> state; - state.instance(); + state.instantiate(); int ret = STEP_YIELD_BIT; switch (mode) { @@ -138,7 +138,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptYield::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptYield::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceYield *instance = memnew(VisualScriptNodeInstanceYield); //instance->instance=p_instance; instance->mode = yield_mode; @@ -202,7 +202,7 @@ VisualScriptYield::VisualScriptYield() { template <VisualScriptYield::YieldMode MODE> static Ref<VisualScriptNode> create_yield_node(const String &p_name) { Ref<VisualScriptYield> node; - node.instance(); + node.instantiate(); node->set_yield_mode(MODE); return node; } @@ -548,7 +548,7 @@ public: } Ref<VisualScriptFunctionState> state; - state.instance(); + state.instantiate(); state->connect_to_signal(object, signal, Array()); @@ -559,7 +559,7 @@ public: } }; -VisualScriptNodeInstance *VisualScriptYieldSignal::instance(VisualScriptInstance *p_instance) { +VisualScriptNodeInstance *VisualScriptYieldSignal::instantiate(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceYieldSignal *instance = memnew(VisualScriptNodeInstanceYieldSignal); instance->node = this; instance->instance = p_instance; @@ -578,7 +578,7 @@ VisualScriptYieldSignal::VisualScriptYieldSignal() { template <VisualScriptYieldSignal::CallMode cmode> static Ref<VisualScriptNode> create_yield_signal_node(const String &p_name) { Ref<VisualScriptYieldSignal> node; - node.instance(); + node.instantiate(); node->set_call_mode(cmode); return node; } diff --git a/modules/visual_script/visual_script_yield_nodes.h b/modules/visual_script/visual_script_yield_nodes.h index cc7ce0a1c6..fa596173a6 100644 --- a/modules/visual_script/visual_script_yield_nodes.h +++ b/modules/visual_script/visual_script_yield_nodes.h @@ -76,7 +76,7 @@ public: void set_wait_time(float p_time); float get_wait_time(); - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptYield(); }; @@ -135,7 +135,7 @@ public: void set_call_mode(CallMode p_mode); CallMode get_call_mode() const; - virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance) override; + virtual VisualScriptNodeInstance *instantiate(VisualScriptInstance *p_instance) override; VisualScriptYieldSignal(); }; diff --git a/modules/webm/register_types.cpp b/modules/webm/register_types.cpp index 82157a71c9..9cfaba83c1 100644 --- a/modules/webm/register_types.cpp +++ b/modules/webm/register_types.cpp @@ -35,7 +35,7 @@ static Ref<ResourceFormatLoaderWebm> resource_loader_webm; void register_webm_types() { - resource_loader_webm.instance(); + resource_loader_webm.instantiate(); ResourceLoader::add_resource_format_loader(resource_loader_webm, true); ClassDB::register_class<VideoStreamWebm>(); diff --git a/modules/webm/video_stream_webm.cpp b/modules/webm/video_stream_webm.cpp index 6ec0bde7bd..12e0f5bd25 100644 --- a/modules/webm/video_stream_webm.cpp +++ b/modules/webm/video_stream_webm.cpp @@ -116,7 +116,7 @@ bool VideoStreamPlaybackWebm::open_file(const String &p_file) { frame_data.resize((webm->getWidth() * webm->getHeight()) << 2); Ref<Image> img; - img.instance(); + img.instantiate(); img->create(webm->getWidth(), webm->getHeight(), false, Image::FORMAT_RGBA8); texture->create_from_image(img); diff --git a/modules/webp/image_loader_webp.cpp b/modules/webp/image_loader_webp.cpp index 772445190c..5bebad2b53 100644 --- a/modules/webp/image_loader_webp.cpp +++ b/modules/webp/image_loader_webp.cpp @@ -205,7 +205,7 @@ Error webp_load_image_from_buffer(Image *p_image, const uint8_t *p_buffer, int p static Ref<Image> _webp_mem_loader_func(const uint8_t *p_png, int p_size) { Ref<Image> img; - img.instance(); + img.instantiate(); Error err = webp_load_image_from_buffer(img.ptr(), p_png, p_size); ERR_FAIL_COND_V(err, Ref<Image>()); return img; diff --git a/modules/websocket/wsl_client.cpp b/modules/websocket/wsl_client.cpp index 111d2178d6..af1bdb532c 100644 --- a/modules/websocket/wsl_client.cpp +++ b/modules/websocket/wsl_client.cpp @@ -337,8 +337,8 @@ Error WSLClient::set_buffers(int p_in_buffer, int p_in_packets, int p_out_buffer } WSLClient::WSLClient() { - _peer.instance(); - _tcp.instance(); + _peer.instantiate(); + _tcp.instantiate(); disconnect_from_host(); } diff --git a/modules/websocket/wsl_server.cpp b/modules/websocket/wsl_server.cpp index dc5b23c31e..22bb1b6d1a 100644 --- a/modules/websocket/wsl_server.cpp +++ b/modules/websocket/wsl_server.cpp @@ -301,7 +301,7 @@ Error WSLServer::set_buffers(int p_in_buffer, int p_in_packets, int p_out_buffer } WSLServer::WSLServer() { - _server.instance(); + _server.instantiate(); } WSLServer::~WSLServer() { diff --git a/modules/webxr/register_types.cpp b/modules/webxr/register_types.cpp index 8baf7e05b8..6df0234811 100644 --- a/modules/webxr/register_types.cpp +++ b/modules/webxr/register_types.cpp @@ -38,7 +38,7 @@ void register_webxr_types() { #ifdef JAVASCRIPT_ENABLED Ref<WebXRInterfaceJS> webxr; - webxr.instance(); + webxr.instantiate(); XRServer::get_singleton()->add_interface(webxr); #endif } diff --git a/modules/webxr/webxr_interface_js.cpp b/modules/webxr/webxr_interface_js.cpp index 13981e73e1..2eab0cdb07 100644 --- a/modules/webxr/webxr_interface_js.cpp +++ b/modules/webxr/webxr_interface_js.cpp @@ -400,7 +400,7 @@ void WebXRInterfaceJS::_update_tracker(int p_controller_id) { Ref<XRPositionalTracker> tracker = xr_server->find_by_type_and_id(XRServer::TRACKER_CONTROLLER, p_controller_id + 1); if (godot_webxr_is_controller_connected(p_controller_id)) { if (tracker.is_null()) { - tracker.instance(); + tracker.instantiate(); tracker->set_tracker_type(XRServer::TRACKER_CONTROLLER); // Controller id's 0 and 1 are always the left and right hands. if (p_controller_id < 2) { diff --git a/platform/android/display_server_android.cpp b/platform/android/display_server_android.cpp index ff61eeaee1..db497133aa 100644 --- a/platform/android/display_server_android.cpp +++ b/platform/android/display_server_android.cpp @@ -528,7 +528,7 @@ void DisplayServerAndroid::process_key_event(int p_keycode, int p_scancode, int } Ref<InputEventKey> ev; - ev.instance(); + ev.instantiate(); int val = unicode; int keycode = android_get_keysym(p_keycode); int phy_keycode = android_get_keysym(p_scancode); @@ -575,7 +575,7 @@ void DisplayServerAndroid::process_touch(int p_event, int p_pointer, const Vecto //end all if exist for (int i = 0; i < touch.size(); i++) { Ref<InputEventScreenTouch> ev; - ev.instance(); + ev.instantiate(); ev->set_index(touch[i].id); ev->set_pressed(false); ev->set_position(touch[i].pos); @@ -592,7 +592,7 @@ void DisplayServerAndroid::process_touch(int p_event, int p_pointer, const Vecto //send touch for (int i = 0; i < touch.size(); i++) { Ref<InputEventScreenTouch> ev; - ev.instance(); + ev.instantiate(); ev->set_index(touch[i].id); ev->set_pressed(true); ev->set_position(touch[i].pos); @@ -618,7 +618,7 @@ void DisplayServerAndroid::process_touch(int p_event, int p_pointer, const Vecto continue; //no move unncesearily Ref<InputEventScreenDrag> ev; - ev.instance(); + ev.instantiate(); ev->set_index(touch[i].id); ev->set_position(p_points[idx].pos); ev->set_relative(p_points[idx].pos - touch[i].pos); @@ -633,7 +633,7 @@ void DisplayServerAndroid::process_touch(int p_event, int p_pointer, const Vecto //end all if exist for (int i = 0; i < touch.size(); i++) { Ref<InputEventScreenTouch> ev; - ev.instance(); + ev.instantiate(); ev->set_index(touch[i].id); ev->set_pressed(false); ev->set_position(touch[i].pos); @@ -649,7 +649,7 @@ void DisplayServerAndroid::process_touch(int p_event, int p_pointer, const Vecto touch.push_back(tp); Ref<InputEventScreenTouch> ev; - ev.instance(); + ev.instantiate(); ev->set_index(tp.id); ev->set_pressed(true); @@ -664,7 +664,7 @@ void DisplayServerAndroid::process_touch(int p_event, int p_pointer, const Vecto for (int i = 0; i < touch.size(); i++) { if (touch[i].id == p_pointer) { Ref<InputEventScreenTouch> ev; - ev.instance(); + ev.instantiate(); ev->set_index(touch[i].id); ev->set_pressed(false); ev->set_position(touch[i].pos); @@ -685,7 +685,7 @@ void DisplayServerAndroid::process_hover(int p_type, Point2 p_pos) { case AMOTION_EVENT_ACTION_HOVER_ENTER: // hover enter case AMOTION_EVENT_ACTION_HOVER_EXIT: { // hover exit Ref<InputEventMouseMotion> ev; - ev.instance(); + ev.instantiate(); _set_key_modifier_state(ev); ev->set_position(p_pos); ev->set_global_position(p_pos); @@ -702,7 +702,7 @@ void DisplayServerAndroid::process_mouse_event(int input_device, int event_actio case AMOTION_EVENT_ACTION_BUTTON_PRESS: case AMOTION_EVENT_ACTION_BUTTON_RELEASE: { Ref<InputEventMouseButton> ev; - ev.instance(); + ev.instantiate(); _set_key_modifier_state(ev); if ((input_device & AINPUT_SOURCE_MOUSE) == AINPUT_SOURCE_MOUSE) { ev->set_position(event_pos); @@ -723,7 +723,7 @@ void DisplayServerAndroid::process_mouse_event(int input_device, int event_actio case AMOTION_EVENT_ACTION_MOVE: { Ref<InputEventMouseMotion> ev; - ev.instance(); + ev.instantiate(); _set_key_modifier_state(ev); if ((input_device & AINPUT_SOURCE_MOUSE) == AINPUT_SOURCE_MOUSE) { ev->set_position(event_pos); @@ -740,7 +740,7 @@ void DisplayServerAndroid::process_mouse_event(int input_device, int event_actio } break; case AMOTION_EVENT_ACTION_SCROLL: { Ref<InputEventMouseButton> ev; - ev.instance(); + ev.instantiate(); if ((input_device & AINPUT_SOURCE_MOUSE) == AINPUT_SOURCE_MOUSE) { ev->set_position(event_pos); ev->set_global_position(event_pos); @@ -781,7 +781,7 @@ void DisplayServerAndroid::_wheel_button_click(int event_buttons_mask, const Ref void DisplayServerAndroid::process_double_tap(int event_android_button_mask, Point2 p_pos) { int event_button_mask = _android_button_mask_to_godot_button_mask(event_android_button_mask); Ref<InputEventMouseButton> ev; - ev.instance(); + ev.instantiate(); _set_key_modifier_state(ev); ev->set_position(p_pos); ev->set_global_position(p_pos); @@ -811,7 +811,7 @@ int DisplayServerAndroid::_button_index_from_mask(int button_mask) { void DisplayServerAndroid::process_scroll(Point2 p_pos) { Ref<InputEventPanGesture> ev; - ev.instance(); + ev.instantiate(); _set_key_modifier_state(ev); ev->set_position(p_pos); ev->set_delta(p_pos - scroll_prev_pos); diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 4262cc1a50..923435eec5 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -1461,7 +1461,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { String project_splash_path = ProjectSettings::get_singleton()->get("application/boot_splash/image"); if (!project_splash_path.is_empty()) { - splash_image.instance(); + splash_image.instantiate(); print_verbose("Loading splash image: " + project_splash_path); const Error err = ImageLoader::load_image(project_splash_path, splash_image); if (err) { @@ -1501,7 +1501,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { } print_verbose("Creating splash background color image."); - splash_bg_color_image.instance(); + splash_bg_color_image.instantiate(); splash_bg_color_image->create(splash_image->get_width(), splash_image->get_height(), false, splash_image->get_format()); splash_bg_color_image->fill(bg_color); @@ -1512,9 +1512,9 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { void load_icon_refs(const Ref<EditorExportPreset> &p_preset, Ref<Image> &icon, Ref<Image> &foreground, Ref<Image> &background) { String project_icon_path = ProjectSettings::get_singleton()->get("application/config/icon"); - icon.instance(); - foreground.instance(); - background.instance(); + icon.instantiate(); + foreground.instantiate(); + background.instantiate(); // Regular icon: user selection -> project icon -> default. String path = static_cast<String>(p_preset->get(launcher_icon_option)).strip_edges(); @@ -2941,11 +2941,11 @@ public: EditorExportPlatformAndroid() { Ref<Image> img = memnew(Image(_android_logo)); - logo.instance(); + logo.instantiate(); logo->create_from_image(img); img = Ref<Image>(memnew(Image(_android_run_icon))); - run_icon.instance(); + run_icon.instantiate(); run_icon->create_from_image(img); devices_changed.set(); diff --git a/platform/android/plugin/godot_plugin_jni.cpp b/platform/android/plugin/godot_plugin_jni.cpp index ba3e9fa20f..cf0c02e2bf 100644 --- a/platform/android/plugin/godot_plugin_jni.cpp +++ b/platform/android/plugin/godot_plugin_jni.cpp @@ -43,7 +43,7 @@ extern "C" { JNIEXPORT void JNICALL Java_org_godotengine_godot_plugin_GodotPlugin_nativeRegisterSingleton(JNIEnv *env, jclass clazz, jstring name, jobject obj) { String singname = jstring_to_string(name, env); - JNISingleton *s = (JNISingleton *)ClassDB::instance("JNISingleton"); + JNISingleton *s = (JNISingleton *)ClassDB::instantiate("JNISingleton"); s->set_instance(env->NewGlobalRef(obj)); jni_singletons[singname] = s; diff --git a/platform/iphone/display_server_iphone.mm b/platform/iphone/display_server_iphone.mm index 9e74de0842..74d7419715 100644 --- a/platform/iphone/display_server_iphone.mm +++ b/platform/iphone/display_server_iphone.mm @@ -224,7 +224,7 @@ void DisplayServerIPhone::_window_callback(const Callable &p_callable, const Var void DisplayServerIPhone::touch_press(int p_idx, int p_x, int p_y, bool p_pressed, bool p_double_click) { if (!GLOBAL_DEF("debug/disable_touch", false)) { Ref<InputEventScreenTouch> ev; - ev.instance(); + ev.instantiate(); ev->set_index(p_idx); ev->set_pressed(p_pressed); @@ -236,7 +236,7 @@ void DisplayServerIPhone::touch_press(int p_idx, int p_x, int p_y, bool p_presse void DisplayServerIPhone::touch_drag(int p_idx, int p_prev_x, int p_prev_y, int p_x, int p_y) { if (!GLOBAL_DEF("debug/disable_touch", false)) { Ref<InputEventScreenDrag> ev; - ev.instance(); + ev.instantiate(); ev->set_index(p_idx); ev->set_position(Vector2(p_x, p_y)); ev->set_relative(Vector2(p_x - p_prev_x, p_y - p_prev_y)); @@ -256,7 +256,7 @@ void DisplayServerIPhone::touches_cancelled(int p_idx) { void DisplayServerIPhone::key(uint32_t p_key, bool p_pressed) { Ref<InputEventKey> ev; - ev.instance(); + ev.instantiate(); ev->set_echo(false); ev->set_pressed(p_pressed); ev->set_keycode(p_key); diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp index e2df573b09..8e977e1783 100644 --- a/platform/iphone/export/export.cpp +++ b/platform/iphone/export/export.cpp @@ -820,7 +820,7 @@ Error EditorExportPlatformIOS::_export_loading_screen_file(const Ref<EditorExpor if (custom_launch_image_2x.length() > 0 && custom_launch_image_3x.length() > 0) { Ref<Image> image; String image_path = p_dest_dir.plus_file("splash@2x.png"); - image.instance(); + image.instantiate(); Error err = image->load(custom_launch_image_2x); if (err) { @@ -834,7 +834,7 @@ Error EditorExportPlatformIOS::_export_loading_screen_file(const Ref<EditorExpor image.unref(); image_path = p_dest_dir.plus_file("splash@3x.png"); - image.instance(); + image.instantiate(); err = image->load(custom_launch_image_3x); if (err) { @@ -851,7 +851,7 @@ Error EditorExportPlatformIOS::_export_loading_screen_file(const Ref<EditorExpor const String splash_path = ProjectSettings::get_singleton()->get("application/boot_splash/image"); if (!splash_path.is_empty()) { - splash.instance(); + splash.instantiate(); const Error err = splash->load(splash_path); if (err) { splash.unref(); @@ -1999,7 +1999,7 @@ bool EditorExportPlatformIOS::can_export(const Ref<EditorExportPreset> &p_preset EditorExportPlatformIOS::EditorExportPlatformIOS() { Ref<Image> img = memnew(Image(_iphone_logo)); - logo.instance(); + logo.instantiate(); logo->create_from_image(img); plugins_changed.set(); @@ -2014,7 +2014,7 @@ EditorExportPlatformIOS::~EditorExportPlatformIOS() { void register_iphone_exporter() { Ref<EditorExportPlatformIOS> platform; - platform.instance(); + platform.instantiate(); EditorExport::get_singleton()->add_export_platform(platform); } diff --git a/platform/javascript/display_server_javascript.cpp b/platform/javascript/display_server_javascript.cpp index 1cc05a2e19..8831d26190 100644 --- a/platform/javascript/display_server_javascript.cpp +++ b/platform/javascript/display_server_javascript.cpp @@ -128,7 +128,7 @@ void DisplayServerJavaScript::dom2godot_mod(T *emscripten_event_ptr, Ref<InputEv Ref<InputEventKey> DisplayServerJavaScript::setup_key_event(const EmscriptenKeyboardEvent *emscripten_event) { Ref<InputEventKey> ev; - ev.instance(); + ev.instantiate(); ev->set_echo(emscripten_event->repeat); dom2godot_mod(emscripten_event, ev); ev->set_keycode(dom_code2godot_scancode(emscripten_event->code, emscripten_event->key, false)); @@ -181,7 +181,7 @@ EM_BOOL DisplayServerJavaScript::mouse_button_callback(int p_event_type, const E DisplayServerJavaScript *display = get_singleton(); Ref<InputEventMouseButton> ev; - ev.instance(); + ev.instantiate(); ev->set_pressed(p_event_type == EMSCRIPTEN_EVENT_MOUSEDOWN); ev->set_position(compute_position_in_canvas(p_event->clientX, p_event->clientY)); ev->set_global_position(ev->get_position()); @@ -261,7 +261,7 @@ EM_BOOL DisplayServerJavaScript::mousemove_callback(int p_event_type, const Emsc return false; Ref<InputEventMouseMotion> ev; - ev.instance(); + ev.instantiate(); dom2godot_mod(p_event, ev); ev->set_button_mask(input_mask); @@ -452,7 +452,7 @@ EM_BOOL DisplayServerJavaScript::wheel_callback(int p_event_type, const Emscript Input *input = Input::get_singleton(); Ref<InputEventMouseButton> ev; - ev.instance(); + ev.instantiate(); ev->set_position(input->get_mouse_position()); ev->set_global_position(ev->get_position()); @@ -492,7 +492,7 @@ EM_BOOL DisplayServerJavaScript::wheel_callback(int p_event_type, const Emscript EM_BOOL DisplayServerJavaScript::touch_press_callback(int p_event_type, const EmscriptenTouchEvent *p_event, void *p_user_data) { DisplayServerJavaScript *display = get_singleton(); Ref<InputEventScreenTouch> ev; - ev.instance(); + ev.instantiate(); int lowest_id_index = -1; for (int i = 0; i < p_event->numTouches; ++i) { const EmscriptenTouchPoint &touch = p_event->touches[i]; @@ -514,7 +514,7 @@ EM_BOOL DisplayServerJavaScript::touch_press_callback(int p_event_type, const Em EM_BOOL DisplayServerJavaScript::touchmove_callback(int p_event_type, const EmscriptenTouchEvent *p_event, void *p_user_data) { DisplayServerJavaScript *display = get_singleton(); Ref<InputEventScreenDrag> ev; - ev.instance(); + ev.instantiate(); int lowest_id_index = -1; for (int i = 0; i < p_event->numTouches; ++i) { const EmscriptenTouchPoint &touch = p_event->touches[i]; @@ -553,12 +553,12 @@ void DisplayServerJavaScript::vk_input_text_callback(const char *p_text, int p_c Input *input = Input::get_singleton(); Ref<InputEventKey> k; for (int i = 0; i < p_cursor; i++) { - k.instance(); + k.instantiate(); k->set_pressed(true); k->set_echo(false); k->set_keycode(KEY_RIGHT); input->parse_input_event(k); - k.instance(); + k.instantiate(); k->set_pressed(false); k->set_echo(false); k->set_keycode(KEY_RIGHT); diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp index 823f9b8281..58cecfef63 100644 --- a/platform/javascript/export/export.cpp +++ b/platform/javascript/export/export.cpp @@ -90,7 +90,7 @@ public: mimes["png"] = "image/png"; mimes["svg"] = "image/svg"; mimes["wasm"] = "application/wasm"; - server.instance(); + server.instantiate(); stop(); } @@ -289,7 +289,7 @@ class EditorExportPlatformJavaScript : public EditorExportPlatform { Ref<Image> _get_project_icon() const { Ref<Image> icon; - icon.instance(); + icon.instantiate(); const String icon_path = String(GLOBAL_GET("application/config/icon")).strip_edges(); if (icon_path.is_empty() || ImageLoader::load_image(icon_path, icon) != OK) { return EditorNode::get_singleton()->get_editor_theme()->get_icon("DefaultProjectIcon", "EditorIcons")->get_image(); @@ -299,7 +299,7 @@ class EditorExportPlatformJavaScript : public EditorExportPlatform { Ref<Image> _get_project_splash() const { Ref<Image> splash; - splash.instance(); + splash.instantiate(); const String splash_path = String(GLOBAL_GET("application/boot_splash/image")).strip_edges(); if (splash_path.is_empty() || ImageLoader::load_image(splash_path, splash) != OK) { return Ref<Image>(memnew(Image(boot_splash_png))); @@ -481,7 +481,7 @@ Error EditorExportPlatformJavaScript::_add_manifest_icon(const String &p_path, c Ref<Image> icon; if (!p_icon.is_empty()) { - icon.instance(); + icon.instantiate(); const Error err = ImageLoader::load_image(p_icon, icon); if (err != OK) { EditorNode::get_singleton()->show_warning(TTR("Could not read file:") + "\n" + p_icon); @@ -964,22 +964,22 @@ void EditorExportPlatformJavaScript::_server_thread_poll(void *data) { } EditorExportPlatformJavaScript::EditorExportPlatformJavaScript() { - server.instance(); + server.instantiate(); server_thread.start(_server_thread_poll, this); Ref<Image> img = memnew(Image(_javascript_logo)); - logo.instance(); + logo.instantiate(); logo->create_from_image(img); img = Ref<Image>(memnew(Image(_javascript_run_icon))); - run_icon.instance(); + run_icon.instantiate(); run_icon->create_from_image(img); Ref<Theme> theme = EditorNode::get_singleton()->get_editor_theme(); if (theme.is_valid()) { stop_icon = theme->get_icon("Stop", "EditorIcons"); } else { - stop_icon.instance(); + stop_icon.instantiate(); } } @@ -1000,6 +1000,6 @@ void register_javascript_exporter() { EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/web/ssl_certificate", PROPERTY_HINT_GLOBAL_FILE, "*.crt,*.pem")); Ref<EditorExportPlatformJavaScript> platform; - platform.instance(); + platform.instantiate(); EditorExport::get_singleton()->add_export_platform(platform); } diff --git a/platform/linuxbsd/display_server_x11.cpp b/platform/linuxbsd/display_server_x11.cpp index 8b6922699c..b1bb064274 100644 --- a/platform/linuxbsd/display_server_x11.cpp +++ b/platform/linuxbsd/display_server_x11.cpp @@ -2255,7 +2255,7 @@ void DisplayServerX11::_handle_key_event(WindowID p_window, XKeyEvent *p_event, tmp.parse_utf8(utf8string, utf8bytes); for (int i = 0; i < tmp.length(); i++) { Ref<InputEventKey> k; - k.instance(); + k.instantiate(); if (physical_keycode == 0 && keycode == 0 && tmp[i] == 0) { continue; } @@ -2346,7 +2346,7 @@ void DisplayServerX11::_handle_key_event(WindowID p_window, XKeyEvent *p_event, //print_verbose("mod1: "+itos(xkeyevent->state&Mod1Mask)+" mod 5: "+itos(xkeyevent->state&Mod5Mask)); Ref<InputEventKey> k; - k.instance(); + k.instantiate(); k->set_window_id(p_window); _get_key_modifier_state(xkeyevent->state, k); @@ -2904,7 +2904,7 @@ void DisplayServerX11::process_events() { bool is_begin = event_data->evtype == XI_TouchBegin; Ref<InputEventScreenTouch> st; - st.instance(); + st.instantiate(); st->set_window_id(window_id); st->set_index(index); st->set_position(pos); @@ -2938,7 +2938,7 @@ void DisplayServerX11::process_events() { if (curr_pos_elem->value() != pos) { Ref<InputEventScreenDrag> sd; - sd.instance(); + sd.instantiate(); sd->set_window_id(window_id); sd->set_index(index); sd->set_position(pos); @@ -3091,7 +3091,7 @@ void DisplayServerX11::process_events() { // Release every pointer to avoid sticky points for (Map<int, Vector2>::Element *E = xi.state.front(); E; E = E->next()) { Ref<InputEventScreenTouch> st; - st.instance(); + st.instantiate(); st->set_index(E->key()); st->set_window_id(window_id); st->set_position(E->get()); @@ -3126,7 +3126,7 @@ void DisplayServerX11::process_events() { } Ref<InputEventMouseButton> mb; - mb.instance(); + mb.instantiate(); mb->set_window_id(window_id); _get_key_modifier_state(event.xbutton.state, mb); @@ -3291,7 +3291,7 @@ void DisplayServerX11::process_events() { } Ref<InputEventMouseMotion> mm; - mm.instance(); + mm.instantiate(); mm->set_window_id(window_id); if (xi.pressure_supported) { diff --git a/platform/linuxbsd/export/export.cpp b/platform/linuxbsd/export/export.cpp index 3ee088dd35..5c6be2d7d4 100644 --- a/platform/linuxbsd/export/export.cpp +++ b/platform/linuxbsd/export/export.cpp @@ -39,11 +39,11 @@ static Error fixup_embedded_pck(const String &p_path, int64_t p_embedded_start, void register_linuxbsd_exporter() { Ref<EditorExportPlatformPC> platform; - platform.instance(); + platform.instantiate(); Ref<Image> img = memnew(Image(_linuxbsd_logo)); Ref<ImageTexture> logo; - logo.instance(); + logo.instantiate(); logo->create_from_image(img); platform->set_logo(logo); platform->set_name("Linux/X11"); diff --git a/platform/osx/display_server_osx.mm b/platform/osx/display_server_osx.mm index 408feb4db9..84e8770043 100644 --- a/platform/osx/display_server_osx.mm +++ b/platform/osx/display_server_osx.mm @@ -119,7 +119,7 @@ static NSCursor *_cursorFromSelector(SEL selector, SEL fallback = nil) { if ([event type] == NSEventTypeKeyDown) { if (([event modifierFlags] & NSEventModifierFlagCommand) && [event keyCode] == 0x2f) { Ref<InputEventKey> k; - k.instance(); + k.instantiate(); _get_key_modifier_state([event modifierFlags], k); k->set_window_id(DisplayServerOSX::INVALID_WINDOW_ID); @@ -824,7 +824,7 @@ static void _mouseDownEvent(DisplayServer::WindowID window_id, NSEvent *event, i } Ref<InputEventMouseButton> mb; - mb.instance(); + mb.instantiate(); mb->set_window_id(window_id); const Vector2 pos = _get_mouse_pos(wd, [event locationInWindow]); _get_key_modifier_state([event modifierFlags], mb); @@ -928,7 +928,7 @@ static void _mouseDownEvent(DisplayServer::WindowID window_id, NSEvent *event, i } Ref<InputEventMouseMotion> mm; - mm.instance(); + mm.instantiate(); mm->set_window_id(window_id); mm->set_button_mask(DS_OSX->last_button_state); @@ -1016,7 +1016,7 @@ static void _mouseDownEvent(DisplayServer::WindowID window_id, NSEvent *event, i DisplayServerOSX::WindowData &wd = DS_OSX->windows[window_id]; Ref<InputEventMagnifyGesture> ev; - ev.instance(); + ev.instantiate(); ev->set_window_id(window_id); _get_key_modifier_state([event modifierFlags], ev); ev->set_position(_get_mouse_pos(wd, [event locationInWindow])); @@ -1492,7 +1492,7 @@ inline void sendScrollEvent(DisplayServer::WindowID window_id, int button, doubl unsigned int mask = 1 << (button - 1); Ref<InputEventMouseButton> sc; - sc.instance(); + sc.instantiate(); sc->set_window_id(window_id); _get_key_modifier_state(modifierFlags, sc); @@ -1506,7 +1506,7 @@ inline void sendScrollEvent(DisplayServer::WindowID window_id, int button, doubl Input::get_singleton()->accumulate_input_event(sc); - sc.instance(); + sc.instantiate(); sc->set_window_id(window_id); sc->set_button_index(button); sc->set_factor(factor); @@ -1524,7 +1524,7 @@ inline void sendPanEvent(DisplayServer::WindowID window_id, double dx, double dy DisplayServerOSX::WindowData &wd = DS_OSX->windows[window_id]; Ref<InputEventPanGesture> pg; - pg.instance(); + pg.instantiate(); pg->set_window_id(window_id); _get_key_modifier_state(modifierFlags, pg); @@ -3375,7 +3375,7 @@ void DisplayServerOSX::_process_key_events() { const KeyEvent &ke = key_event_buffer[i]; if (ke.raw) { // Non IME input - no composite characters, pass events as is - k.instance(); + k.instantiate(); k->set_window_id(ke.window_id); _get_key_modifier_state(ke.osx_state, k); @@ -3389,7 +3389,7 @@ void DisplayServerOSX::_process_key_events() { } else { // IME input if ((i == 0 && ke.keycode == 0) || (i > 0 && key_event_buffer[i - 1].keycode == 0)) { - k.instance(); + k.instantiate(); k->set_window_id(ke.window_id); _get_key_modifier_state(ke.osx_state, k); @@ -3402,7 +3402,7 @@ void DisplayServerOSX::_process_key_events() { _push_input(k); } if (ke.keycode != 0) { - k.instance(); + k.instantiate(); k->set_window_id(ke.window_id); _get_key_modifier_state(ke.osx_state, k); diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp index f52853ca9e..f68ff32012 100644 --- a/platform/osx/export/export.cpp +++ b/platform/osx/export/export.cpp @@ -700,7 +700,7 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p } } else { Ref<Image> icon; - icon.instance(); + icon.instantiate(); icon->load(iconpath); if (!icon->is_empty()) { _make_icon(icon, data); @@ -1151,7 +1151,7 @@ bool EditorExportPlatformOSX::can_export(const Ref<EditorExportPreset> &p_preset EditorExportPlatformOSX::EditorExportPlatformOSX() { Ref<Image> img = memnew(Image(_osx_logo)); - logo.instance(); + logo.instantiate(); logo->create_from_image(img); } @@ -1160,7 +1160,7 @@ EditorExportPlatformOSX::~EditorExportPlatformOSX() { void register_osx_exporter() { Ref<EditorExportPlatformOSX> platform; - platform.instance(); + platform.instantiate(); EditorExport::get_singleton()->add_export_platform(platform); } diff --git a/platform/uwp/app.cpp b/platform/uwp/app.cpp index 67f054aeaa..570c41a8b3 100644 --- a/platform/uwp/app.cpp +++ b/platform/uwp/app.cpp @@ -244,7 +244,7 @@ void App::pointer_event(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Cor int but = _get_button(point); if (_is_touch(point)) { Ref<InputEventScreenTouch> screen_touch; - screen_touch.instance(); + screen_touch.instantiate(); screen_touch->set_device(0); screen_touch->set_pressed(p_pressed); screen_touch->set_position(Vector2(pos.X, pos.Y)); @@ -256,7 +256,7 @@ void App::pointer_event(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Cor os->input_event(screen_touch); } else { Ref<InputEventMouseButton> mouse_button; - mouse_button.instance(); + mouse_button.instantiate(); mouse_button->set_device(0); mouse_button->set_pressed(p_pressed); mouse_button->set_button_index(but); @@ -324,7 +324,7 @@ void App::OnPointerMoved(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Co if (_is_touch(point)) { Ref<InputEventScreenDrag> screen_drag; - screen_drag.instance(); + screen_drag.instantiate(); screen_drag->set_device(0); screen_drag->set_position(Vector2(pos.X, pos.Y)); screen_drag->set_index(_get_finger(point->PointerId)); @@ -338,7 +338,7 @@ void App::OnPointerMoved(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Co } Ref<InputEventMouseMotion> mouse_motion; - mouse_motion.instance(); + mouse_motion.instantiate(); mouse_motion->set_device(0); mouse_motion->set_position(Vector2(pos.X, pos.Y)); mouse_motion->set_global_position(Vector2(pos.X, pos.Y)); @@ -361,7 +361,7 @@ void App::OnMouseMoved(MouseDevice ^ mouse_device, MouseEventArgs ^ args) { pos.Y = last_mouse_pos.Y + args->MouseDelta.Y; Ref<InputEventMouseMotion> mouse_motion; - mouse_motion.instance(); + mouse_motion.instantiate(); mouse_motion->set_device(0); mouse_motion->set_position(Vector2(pos.X, pos.Y)); mouse_motion->set_global_position(Vector2(pos.X, pos.Y)); diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp index a7edc6e6e5..1075ae38ce 100644 --- a/platform/uwp/export/export.cpp +++ b/platform/uwp/export/export.cpp @@ -1429,7 +1429,7 @@ public: EditorExportPlatformUWP() { Ref<Image> img = memnew(Image(_uwp_logo)); - logo.instance(); + logo.instantiate(); logo->create_from_image(img); } }; @@ -1446,6 +1446,6 @@ void register_uwp_exporter() { #endif // WINDOWS_ENABLED Ref<EditorExportPlatformUWP> exporter; - exporter.instance(); + exporter.instantiate(); EditorExport::get_singleton()->add_export_platform(exporter); } diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp index 65934b6681..b0f6bbd330 100644 --- a/platform/uwp/os_uwp.cpp +++ b/platform/uwp/os_uwp.cpp @@ -562,7 +562,7 @@ void OS_UWP::process_key_events() { KeyEvent &kev = key_event_buffer[i]; Ref<InputEventKey> key_event; - key_event.instance(); + key_event.instantiate(); key_event->set_alt_pressed(kev.alt); key_event->set_shift_pressed(kev.shift); key_event->set_ctrl_pressed(kev.control); diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index f16595f379..5a2bb354d7 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -1727,7 +1727,7 @@ void DisplayServerWindows::_touch_event(WindowID p_window, bool p_pressed, float } Ref<InputEventScreenTouch> event; - event.instance(); + event.instantiate(); event->set_index(idx); event->set_window_id(p_window); event->set_pressed(p_pressed); @@ -1746,7 +1746,7 @@ void DisplayServerWindows::_drag_event(WindowID p_window, float p_x, float p_y, return; Ref<InputEventScreenDrag> event; - event.instance(); + event.instantiate(); event->set_window_id(p_window); event->set_index(idx); event->set_position(Vector2(p_x, p_y)); @@ -1965,7 +1965,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA if (raw->header.dwType == RIM_TYPEMOUSE) { Ref<InputEventMouseMotion> mm; - mm.instance(); + mm.instantiate(); mm->set_window_id(window_id); mm->set_ctrl_pressed(control_mem); @@ -2062,7 +2062,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA break; Ref<InputEventMouseMotion> mm; - mm.instance(); + mm.instantiate(); mm->set_window_id(window_id); mm->set_ctrl_pressed(GetKeyState(VK_CONTROL) < 0); mm->set_shift_pressed(GetKeyState(VK_SHIFT) < 0); @@ -2196,7 +2196,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA } Ref<InputEventMouseMotion> mm; - mm.instance(); + mm.instantiate(); mm->set_window_id(window_id); if (pen_info.penMask & PEN_MASK_PRESSURE) { @@ -2302,7 +2302,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA } Ref<InputEventMouseMotion> mm; - mm.instance(); + mm.instantiate(); mm->set_window_id(window_id); mm->set_ctrl_pressed((wParam & MK_CONTROL) != 0); mm->set_shift_pressed((wParam & MK_SHIFT) != 0); @@ -2385,7 +2385,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA case WM_XBUTTONDOWN: case WM_XBUTTONUP: { Ref<InputEventMouseButton> mb; - mb.instance(); + mb.instantiate(); mb->set_window_id(window_id); switch (uMsg) { @@ -2843,7 +2843,7 @@ void DisplayServerWindows::_process_key_events() { prev_wc = 0; } Ref<InputEventKey> k; - k.instance(); + k.instantiate(); k->set_window_id(ke.window_id); k->set_shift_pressed(ke.shift); @@ -2870,7 +2870,7 @@ void DisplayServerWindows::_process_key_events() { case WM_KEYUP: case WM_KEYDOWN: { Ref<InputEventKey> k; - k.instance(); + k.instantiate(); k->set_window_id(ke.window_id); k->set_shift_pressed(ke.shift); diff --git a/platform/windows/export/export.cpp b/platform/windows/export/export.cpp index 803d9371f5..03093ab6dd 100644 --- a/platform/windows/export/export.cpp +++ b/platform/windows/export/export.cpp @@ -344,11 +344,11 @@ void register_windows_exporter() { #endif Ref<EditorExportPlatformWindows> platform; - platform.instance(); + platform.instantiate(); Ref<Image> img = memnew(Image(_windows_logo)); Ref<ImageTexture> logo; - logo.instance(); + logo.instantiate(); logo->create_from_image(img); platform->set_logo(logo); platform->set_name("Windows Desktop"); diff --git a/scene/2d/canvas_modulate.cpp b/scene/2d/canvas_modulate.cpp index 52eabefbcb..4de99959a3 100644 --- a/scene/2d/canvas_modulate.cpp +++ b/scene/2d/canvas_modulate.cpp @@ -81,7 +81,7 @@ TypedArray<String> CanvasModulate::get_configuration_warnings() const { get_tree()->get_nodes_in_group("_canvas_modulate_" + itos(get_canvas().get_id()), &nodes); if (nodes.size() > 1) { - warnings.push_back(TTR("Only one visible CanvasModulate is allowed per scene (or set of instanced scenes). The first created one will work, while the rest will be ignored.")); + warnings.push_back(TTR("Only one visible CanvasModulate is allowed per scene (or set of instantiated scenes). The first created one will work, while the rest will be ignored.")); } } diff --git a/scene/2d/navigation_region_2d.cpp b/scene/2d/navigation_region_2d.cpp index d2caf5bea8..ea639ae3a3 100644 --- a/scene/2d/navigation_region_2d.cpp +++ b/scene/2d/navigation_region_2d.cpp @@ -169,7 +169,7 @@ Ref<NavigationMesh> NavigationPolygon::get_mesh() { MutexLock lock(navmesh_generation); if (navmesh.is_null()) { - navmesh.instance(); + navmesh.instantiate(); Vector<Vector3> verts; { verts.resize(get_vertices().size()); diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index ce63b25ce0..6c1cdc2129 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -64,7 +64,7 @@ Ref<KinematicCollision2D> PhysicsBody2D::_move(const Vector2 &p_motion, bool p_i if (move_and_collide(p_motion, p_infinite_inertia, result, p_margin, p_exclude_raycast_shapes, p_test_only)) { if (motion_cache.is_null()) { - motion_cache.instance(); + motion_cache.instantiate(); motion_cache->owner = this; } @@ -1120,7 +1120,7 @@ Ref<KinematicCollision2D> CharacterBody2D::_get_slide_collision(int p_bounce) { } if (slide_colliders[p_bounce].is_null()) { - slide_colliders.write[p_bounce].instance(); + slide_colliders.write[p_bounce].instantiate(); slide_colliders.write[p_bounce]->owner = this; } diff --git a/scene/2d/touch_screen_button.cpp b/scene/2d/touch_screen_button.cpp index 4e58984b37..0a6393551c 100644 --- a/scene/2d/touch_screen_button.cpp +++ b/scene/2d/touch_screen_button.cpp @@ -288,7 +288,7 @@ void TouchScreenButton::_press(int p_finger_pressed) { if (action != StringName()) { Input::get_singleton()->action_press(action); Ref<InputEventAction> iea; - iea.instance(); + iea.instantiate(); iea->set_action(action); iea->set_pressed(true); get_viewport()->input(iea, true); @@ -305,7 +305,7 @@ void TouchScreenButton::_release(bool p_exiting_tree) { Input::get_singleton()->action_release(action); if (!p_exiting_tree) { Ref<InputEventAction> iea; - iea.instance(); + iea.instantiate(); iea->set_action(action); iea->set_pressed(false); get_viewport()->input(iea, true); diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index 9640043031..e05f37c73c 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -997,7 +997,7 @@ void AudioStreamPlayer3D::_bind_methods() { } AudioStreamPlayer3D::AudioStreamPlayer3D() { - velocity_tracker.instance(); + velocity_tracker.instantiate(); AudioServer::get_singleton()->connect("bus_layout_changed", callable_mp(this, &AudioStreamPlayer3D::_bus_layout_changed)); set_disable_scale(true); } diff --git a/scene/3d/camera_3d.cpp b/scene/3d/camera_3d.cpp index 62bbebe6e7..32006d5e7f 100644 --- a/scene/3d/camera_3d.cpp +++ b/scene/3d/camera_3d.cpp @@ -661,7 +661,7 @@ Camera3D::Camera3D() { set_perspective(75.0, 0.05, 4000.0); RenderingServer::get_singleton()->camera_set_cull_mask(camera, layers); //active=false; - velocity_tracker.instance(); + velocity_tracker.instantiate(); set_notify_transform(true); set_disable_scale(true); } diff --git a/scene/3d/gpu_particles_collision_3d.cpp b/scene/3d/gpu_particles_collision_3d.cpp index 322bc60fce..c1e71b9565 100644 --- a/scene/3d/gpu_particles_collision_3d.cpp +++ b/scene/3d/gpu_particles_collision_3d.cpp @@ -495,7 +495,7 @@ Ref<Image> GPUParticlesCollisionSDF::bake() { _compute_sdf(¶ms); Ref<Image> ret; - ret.instance(); + ret.instantiate(); ret->create(sdf_size.x, sdf_size.y * sdf_size.z, false, Image::FORMAT_RF, data); ret->convert(Image::FORMAT_RH); //convert to half, save space ret->set_meta("depth", sdf_size.z); //hack, make sure to add to the docs of this function diff --git a/scene/3d/light_3d.cpp b/scene/3d/light_3d.cpp index d45749d36b..37881c3332 100644 --- a/scene/3d/light_3d.cpp +++ b/scene/3d/light_3d.cpp @@ -353,7 +353,7 @@ Light3D::Light3D(RenderingServer::LightType p_type) { } Light3D::Light3D() { - ERR_PRINT("Light3D should not be instanced directly; use the DirectionalLight3D, OmniLight3D or SpotLight3D subtypes instead."); + ERR_PRINT("Light3D should not be instantiated directly; use the DirectionalLight3D, OmniLight3D or SpotLight3D subtypes instead."); } Light3D::~Light3D() { diff --git a/scene/3d/lightmap_gi.cpp b/scene/3d/lightmap_gi.cpp index a3f681e53c..74b4269169 100644 --- a/scene/3d/lightmap_gi.cpp +++ b/scene/3d/lightmap_gi.cpp @@ -717,7 +717,7 @@ LightmapGI::BakeError LightmapGI::bake(Node *p_from_node, String p_image_data_pa w_albedo[i + 3] = 255; } - md.albedo_on_uv2.instance(); + md.albedo_on_uv2.instantiate(); md.albedo_on_uv2->create(lightmap_size.width, lightmap_size.height, false, Image::FORMAT_RGBA8, albedom); } @@ -940,7 +940,7 @@ LightmapGI::BakeError LightmapGI::bake(Node *p_from_node, String p_image_data_pa } break; case ENVIRONMENT_MODE_CUSTOM_COLOR: { - environment_image.instance(); + environment_image.instantiate(); environment_image->create(128, 64, false, Image::FORMAT_RGBAF); Color c = environment_custom_color; c.r *= environment_custom_energy; @@ -972,7 +972,7 @@ LightmapGI::BakeError LightmapGI::bake(Node *p_from_node, String p_image_data_pa } //we assume they are all the same, so let's create a large one for saving Ref<Image> large_image; - large_image.instance(); + large_image.instantiate(); large_image->create(images[0]->get_width(), images[0]->get_height() * images.size(), false, images[0]->get_format()); @@ -984,7 +984,7 @@ LightmapGI::BakeError LightmapGI::bake(Node *p_from_node, String p_image_data_pa Ref<ConfigFile> config; - config.instance(); + config.instantiate(); if (FileAccess::exists(base_path + ".import")) { config->load(base_path + ".import"); } @@ -1017,7 +1017,7 @@ LightmapGI::BakeError LightmapGI::bake(Node *p_from_node, String p_image_data_pa set_light_data(Ref<LightmapGIData>()); //clear data->clear(); } else { - data.instance(); + data.instantiate(); } data->set_light_texture(texture); diff --git a/scene/3d/mesh_instance_3d.cpp b/scene/3d/mesh_instance_3d.cpp index c495f68890..08dec232ab 100644 --- a/scene/3d/mesh_instance_3d.cpp +++ b/scene/3d/mesh_instance_3d.cpp @@ -405,14 +405,14 @@ void MeshInstance3D::create_debug_tangents() { if (lines.size()) { Ref<StandardMaterial3D> sm; - sm.instance(); + sm.instantiate(); sm->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED); sm->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true); sm->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true); Ref<ArrayMesh> am; - am.instance(); + am.instantiate(); Array a; a.resize(Mesh::ARRAY_MAX); a[Mesh::ARRAY_VERTEX] = lines; diff --git a/scene/3d/occluder_instance_3d.cpp b/scene/3d/occluder_instance_3d.cpp index 429e1d4b98..b0b9668fd2 100644 --- a/scene/3d/occluder_instance_3d.cpp +++ b/scene/3d/occluder_instance_3d.cpp @@ -114,7 +114,7 @@ Ref<ArrayMesh> Occluder3D::get_debug_mesh() const { arrays[Mesh::ARRAY_VERTEX] = vertices; arrays[Mesh::ARRAY_INDEX] = indices; - debug_mesh.instance(); + debug_mesh.instantiate(); debug_mesh->add_surface_from_arrays(Mesh::PRIMITIVE_TRIANGLES, arrays); return debug_mesh; } @@ -303,7 +303,7 @@ OccluderInstance3D::BakeError OccluderInstance3D::bake(Node *p_from_node, String if (get_occluder().is_valid()) { occ = get_occluder(); } else { - occ.instance(); + occ.instantiate(); occ->set_path(p_occluder_path); } diff --git a/scene/3d/physics_body_3d.cpp b/scene/3d/physics_body_3d.cpp index 28a0c72fe3..8e10a37afb 100644 --- a/scene/3d/physics_body_3d.cpp +++ b/scene/3d/physics_body_3d.cpp @@ -106,7 +106,7 @@ Ref<KinematicCollision3D> PhysicsBody3D::_move(const Vector3 &p_motion, bool p_i PhysicsServer3D::MotionResult result; if (move_and_collide(p_motion, p_infinite_inertia, result, p_margin, p_exclude_raycast_shapes, p_test_only)) { if (motion_cache.is_null()) { - motion_cache.instance(); + motion_cache.instantiate(); motion_cache->owner = this; } @@ -1168,7 +1168,7 @@ Ref<KinematicCollision3D> CharacterBody3D::_get_slide_collision(int p_bounce) { } if (slide_colliders[p_bounce].is_null()) { - slide_colliders.write[p_bounce].instance(); + slide_colliders.write[p_bounce].instantiate(); slide_colliders.write[p_bounce]->owner = this; } diff --git a/scene/3d/skeleton_3d.cpp b/scene/3d/skeleton_3d.cpp index f9d613a4bb..fa3b16935c 100644 --- a/scene/3d/skeleton_3d.cpp +++ b/scene/3d/skeleton_3d.cpp @@ -797,7 +797,7 @@ Ref<SkinReference> Skeleton3D::register_skin(const Ref<Skin> &p_skin) { //when skeletons did not support skins. It is also used by gizmo //to display the skeleton. - skin.instance(); + skin.instantiate(); skin->set_bind_count(bones.size()); _update_process_order(); //just in case @@ -826,7 +826,7 @@ Ref<SkinReference> Skeleton3D::register_skin(const Ref<Skin> &p_skin) { ERR_FAIL_COND_V(skin.is_null(), Ref<SkinReference>()); Ref<SkinReference> skin_ref; - skin_ref.instance(); + skin_ref.instantiate(); skin_ref->skeleton_node = this; skin_ref->bind_count = 0; diff --git a/scene/3d/soft_body_3d.cpp b/scene/3d/soft_body_3d.cpp index df5474d03e..9592fe5849 100644 --- a/scene/3d/soft_body_3d.cpp +++ b/scene/3d/soft_body_3d.cpp @@ -465,7 +465,7 @@ void SoftBody3D::become_mesh_owner() { surface_format |= Mesh::ARRAY_FLAG_USE_DYNAMIC_UPDATE; Ref<ArrayMesh> soft_mesh; - soft_mesh.instance(); + soft_mesh.instantiate(); soft_mesh->add_surface_from_arrays(Mesh::PRIMITIVE_TRIANGLES, surface_arrays, surface_blend_arrays, surface_lods, surface_format); soft_mesh->surface_set_material(0, mesh->surface_get_material(0)); diff --git a/scene/3d/voxel_gi.cpp b/scene/3d/voxel_gi.cpp index e00be9204c..5558930df8 100644 --- a/scene/3d/voxel_gi.cpp +++ b/scene/3d/voxel_gi.cpp @@ -55,7 +55,7 @@ void VoxelGIData::_set_data(const Dictionary &p_data) { } else if (p_data.has("octree_df_png")) { Vector<uint8_t> octree_df_png = p_data["octree_df_png"]; Ref<Image> img; - img.instance(); + img.instantiate(); Error err = img->load_png_from_buffer(octree_df_png); ERR_FAIL_COND(err != OK); ERR_FAIL_COND(img->get_format() != Image::FORMAT_L8); @@ -76,7 +76,7 @@ Dictionary VoxelGIData::_get_data() const { d["octree_data"] = get_data_cells(); if (otsize != Vector3i()) { Ref<Image> img; - img.instance(); + img.instantiate(); img->create(otsize.x * otsize.y, otsize.z, false, Image::FORMAT_L8, get_distance_field()); Vector<uint8_t> df_png = img->save_png_to_buffer(); ERR_FAIL_COND_V(df_png.size() == 0, Dictionary()); @@ -467,7 +467,7 @@ void VoxelGI::bake(Node *p_from_node, bool p_create_visual_debug) { Ref<VoxelGIData> probe_data = get_probe_data(); if (probe_data.is_null()) { - probe_data.instance(); + probe_data.instantiate(); } if (bake_step_function) { diff --git a/scene/3d/voxelizer.cpp b/scene/3d/voxelizer.cpp index ee0c3fe9b6..12f055c01d 100644 --- a/scene/3d/voxelizer.cpp +++ b/scene/3d/voxelizer.cpp @@ -931,14 +931,14 @@ void Voxelizer::_debug_mesh(int p_idx, int p_level, const AABB &p_aabb, Ref<Mult Ref<MultiMesh> Voxelizer::create_debug_multimesh() { Ref<MultiMesh> mm; - mm.instance(); + mm.instantiate(); mm->set_transform_format(MultiMesh::TRANSFORM_3D); mm->set_use_colors(true); mm->set_instance_count(leaf_voxel_count); Ref<ArrayMesh> mesh; - mesh.instance(); + mesh.instantiate(); { Array arr; @@ -985,7 +985,7 @@ Ref<MultiMesh> Voxelizer::create_debug_multimesh() { { Ref<StandardMaterial3D> fsm; - fsm.instance(); + fsm.instantiate(); fsm->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true); fsm->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true); fsm->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED); diff --git a/scene/3d/world_environment.cpp b/scene/3d/world_environment.cpp index 829ecc5ec2..352bef072f 100644 --- a/scene/3d/world_environment.cpp +++ b/scene/3d/world_environment.cpp @@ -145,7 +145,7 @@ TypedArray<String> WorldEnvironment::get_configuration_warnings() const { } if (camera_effects.is_valid() && get_viewport()->find_world_3d()->get_camera_effects() != camera_effects) { - warnings.push_back(TTR("Only one WorldEnvironment is allowed per scene (or set of instanced scenes).")); + warnings.push_back(TTR("Only one WorldEnvironment is allowed per scene (or set of instantiated scenes).")); } return warnings; diff --git a/scene/animation/animation_blend_tree.cpp b/scene/animation/animation_blend_tree.cpp index 79a1dc1ac0..ad6115fa16 100644 --- a/scene/animation/animation_blend_tree.cpp +++ b/scene/animation/animation_blend_tree.cpp @@ -1164,7 +1164,7 @@ void AnimationNodeBlendTree::_bind_methods() { AnimationNodeBlendTree::AnimationNodeBlendTree() { Ref<AnimationNodeOutput> output; - output.instance(); + output.instantiate(); Node n; n.node = output; n.position = Vector2(300, 150); diff --git a/scene/animation/animation_node_state_machine.cpp b/scene/animation/animation_node_state_machine.cpp index 65918a2989..f494f5c163 100644 --- a/scene/animation/animation_node_state_machine.cpp +++ b/scene/animation/animation_node_state_machine.cpp @@ -496,7 +496,7 @@ void AnimationNodeStateMachinePlayback::_bind_methods() { } AnimationNodeStateMachinePlayback::AnimationNodeStateMachinePlayback() { - set_local_to_scene(true); //only one per instanced scene + set_local_to_scene(true); //only one per instantiated scene } /////////////////////////////////////////////////////// @@ -520,7 +520,7 @@ void AnimationNodeStateMachine::get_parameter_list(List<PropertyInfo> *r_list) c Variant AnimationNodeStateMachine::get_parameter_default_value(const StringName &p_parameter) const { if (p_parameter == playback) { Ref<AnimationNodeStateMachinePlayback> p; - p.instance(); + p.instantiate(); return p; } else { return false; //advance condition diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index e3748a4ae1..799c81c2ab 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -1511,7 +1511,7 @@ Ref<AnimatedValuesBackup> AnimationPlayer::backup_animated_values(Node *p_root_o _ensure_node_caches(playback.current.from, p_root_override); - backup.instance(); + backup.instantiate(); for (int i = 0; i < playback.current.from->node_cache.size(); i++) { TrackNodeCache *nc = playback.current.from->node_cache[i]; if (!nc) { diff --git a/scene/debugger/scene_debugger.cpp b/scene/debugger/scene_debugger.cpp index 11ce9b2ddc..1bf841be04 100644 --- a/scene/debugger/scene_debugger.cpp +++ b/scene/debugger/scene_debugger.cpp @@ -661,7 +661,7 @@ void LiveEditor::_create_node_func(const NodePath &p_parent, const String &p_typ } Node *n2 = n->get_node(p_parent); - Node *no = Object::cast_to<Node>(ClassDB::instance(p_type)); + Node *no = Object::cast_to<Node>(ClassDB::instantiate(p_type)); if (!no) { continue; } @@ -705,7 +705,7 @@ void LiveEditor::_instance_node_func(const NodePath &p_parent, const String &p_p } Node *n2 = n->get_node(p_parent); - Node *no = ps->instance(); + Node *no = ps->instantiate(); if (!no) { continue; } diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp index c0df5271b4..595d712eb8 100644 --- a/scene/gui/button.cpp +++ b/scene/gui/button.cpp @@ -543,7 +543,7 @@ void Button::_bind_methods() { } Button::Button(const String &p_text) { - text_buf.instance(); + text_buf.instantiate(); text_buf->set_flags(TextServer::BREAK_MANDATORY); set_mouse_filter(MOUSE_FILTER_STOP); diff --git a/scene/gui/code_edit.cpp b/scene/gui/code_edit.cpp index 5b720945b8..6e6f5d9300 100644 --- a/scene/gui/code_edit.cpp +++ b/scene/gui/code_edit.cpp @@ -122,7 +122,7 @@ void CodeEdit::_notification(int p_what) { ERR_CONTINUE(l < 0 || l >= code_completion_options_count); Ref<TextLine> tl; - tl.instance(); + tl.instantiate(); tl->add_string(code_completion_options[l].display, cache.font, cache.font_size); int yofs = (row_height - tl->get_size().y) / 2; @@ -615,7 +615,7 @@ bool CodeEdit::is_line_numbers_zero_padded() const { void CodeEdit::_line_number_draw_callback(int p_line, int p_gutter, const Rect2 &p_region) { String fc = TS->format_number(String::num(p_line + 1).lpad(line_number_digits, line_number_padding)); Ref<TextLine> tl; - tl.instance(); + tl.instantiate(); tl->add_string(fc, cache.font, cache.font_size); int yofs = p_region.position.y + (get_row_height() - tl->get_size().y) / 2; Color number_color = get_line_gutter_item_color(p_line, line_number_gutter); diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index f394b9e3a5..049de4c8c5 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -88,7 +88,7 @@ Ref<Shader> ColorPicker::wheel_shader; Ref<Shader> ColorPicker::circle_shader; void ColorPicker::init_shaders() { - wheel_shader.instance(); + wheel_shader.instantiate(); wheel_shader->set_code( "shader_type canvas_item;" "void fragment() {" @@ -107,7 +107,7 @@ void ColorPicker::init_shaders() { " COLOR = vec4(clamp((abs(fract(((a - TAU) / TAU) + vec3(3.0, 2.0, 1.0) / 3.0) * 6.0 - 3.0) - 1.0), 0.0, 1.0), (b + b2 + b3 + b4) / 4.00);" "}"); - circle_shader.instance(); + circle_shader.instantiate(); circle_shader->set_code( "shader_type canvas_item;" "uniform float v = 1.0;" @@ -1213,9 +1213,9 @@ ColorPicker::ColorPicker() : wheel_edit->set_custom_minimum_size(Size2(get_theme_constant("sv_width"), get_theme_constant("sv_height"))); hb_edit->add_child(wheel_edit); - wheel_mat.instance(); + wheel_mat.instantiate(); wheel_mat->set_shader(wheel_shader); - circle_mat.instance(); + circle_mat.instantiate(); circle_mat->set_shader(circle_shader); MarginContainer *wheel_margin(memnew(MarginContainer)); diff --git a/scene/gui/graph_node.cpp b/scene/gui/graph_node.cpp index 77c502cf8d..93f1fe9e8e 100644 --- a/scene/gui/graph_node.cpp +++ b/scene/gui/graph_node.cpp @@ -1021,6 +1021,6 @@ void GraphNode::_bind_methods() { } GraphNode::GraphNode() { - title_buf.instance(); + title_buf.instantiate(); set_mouse_filter(MOUSE_FILTER_STOP); } diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 150980b2e9..b0d54bf8c9 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -57,7 +57,7 @@ int ItemList::add_item(const String &p_item, const Ref<Texture2D> &p_texture, bo item.icon_region = Rect2i(); item.icon_modulate = Color(1, 1, 1, 1); item.text = p_item; - item.text_buf.instance(); + item.text_buf.instantiate(); item.selectable = p_selectable; item.selected = false; item.disabled = false; @@ -80,7 +80,7 @@ int ItemList::add_icon_item(const Ref<Texture2D> &p_item, bool p_selectable) { item.icon_region = Rect2i(); item.icon_modulate = Color(1, 1, 1, 1); //item.text=p_item; - item.text_buf.instance(); + item.text_buf.instantiate(); item.selectable = p_selectable; item.selected = false; item.disabled = false; diff --git a/scene/gui/link_button.cpp b/scene/gui/link_button.cpp index d45ffde715..ee0618a991 100644 --- a/scene/gui/link_button.cpp +++ b/scene/gui/link_button.cpp @@ -301,7 +301,7 @@ void LinkButton::_bind_methods() { } LinkButton::LinkButton() { - text_buf.instance(); + text_buf.instantiate(); set_focus_mode(FOCUS_NONE); set_default_cursor_shape(CURSOR_POINTING_HAND); } diff --git a/scene/gui/popup_menu.h b/scene/gui/popup_menu.h index e4cbe984c9..74718395d3 100644 --- a/scene/gui/popup_menu.h +++ b/scene/gui/popup_menu.h @@ -80,8 +80,8 @@ class PopupMenu : public Popup { } Item() { - text_buf.instance(); - accel_text_buf.instance(); + text_buf.instantiate(); + accel_text_buf.instantiate(); checkable_type = CHECKABLE_TYPE_NONE; } }; diff --git a/scene/gui/rich_text_label.h b/scene/gui/rich_text_label.h index 9cf94b0cd7..ae2a4af268 100644 --- a/scene/gui/rich_text_label.h +++ b/scene/gui/rich_text_label.h @@ -100,7 +100,7 @@ private: int char_offset = 0; int char_count = 0; - Line() { text_buf.instance(); } + Line() { text_buf.instantiate(); } }; struct Item { @@ -313,7 +313,7 @@ private: ItemCustomFX() { type = ITEM_CUSTOMFX; - char_fx_transform.instance(); + char_fx_transform.instantiate(); } virtual ~ItemCustomFX() { diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp index 4ac73ae6b5..895f9db353 100644 --- a/scene/gui/spin_box.cpp +++ b/scene/gui/spin_box.cpp @@ -52,7 +52,7 @@ void SpinBox::_value_changed(double) { void SpinBox::_text_submitted(const String &p_string) { Ref<Expression> expr; - expr.instance(); + expr.instantiate(); String num = TS->parse_number(p_string); // Ignore the prefix and suffix in the expression diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index acf0641005..133966013b 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -586,7 +586,7 @@ void TabContainer::_refresh_texts() { Control *control = Object::cast_to<Control>(tabs[i]); String text = control->has_meta("_tab_name") ? String(tr(String(control->get_meta("_tab_name")))) : String(tr(control->get_name())); Ref<TextLine> name; - name.instance(); + name.instantiate(); name->set_direction(rtl ? TextServer::DIRECTION_RTL : TextServer::DIRECTION_LTR); name->add_string(text, font, font_size, Dictionary(), TranslationServer::get_singleton()->get_tool_locale()); text_buf.push_back(name); diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp index 11096e7976..6f1cff9ec8 100644 --- a/scene/gui/tabs.cpp +++ b/scene/gui/tabs.cpp @@ -743,7 +743,7 @@ void Tabs::add_tab(const String &p_str, const Ref<Texture2D> &p_icon) { Tab t; t.text = p_str; t.xl_text = tr(p_str); - t.text_buf.instance(); + t.text_buf.instantiate(); t.text_buf->set_direction(is_layout_rtl() ? TextServer::DIRECTION_RTL : TextServer::DIRECTION_LTR); t.text_buf->add_string(t.xl_text, get_theme_font("font"), get_theme_font_size("font_size"), Dictionary(), TranslationServer::get_singleton()->get_tool_locale()); t.icon = p_icon; diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 369bc0fd26..b504da2224 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -1114,7 +1114,7 @@ void TextEdit::_notification(int p_what) { } Ref<TextLine> tl; - tl.instance(); + tl.instantiate(); tl->add_string(text, cache.font, cache.font_size); int yofs = ofs_y + (row_height - tl->get_size().y) / 2; diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index 00a3b8c531..27577c48d8 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -96,7 +96,7 @@ private: bool hidden = false; Line() { - data_buf.instance(); + data_buf.instantiate(); } }; diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 26d881955b..b796b494eb 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -2092,7 +2092,7 @@ void Tree::_range_click_timeout() { click_handled = false; Ref<InputEventMouseButton> mb; - mb.instance(); + mb.instantiate(); propagate_mouse_activated = false; // done from outside, so signal handler can't clear the tree in the middle of emit (which is a common case) blocked++; diff --git a/scene/gui/tree.h b/scene/gui/tree.h index 0571a605a5..42dd27cb55 100644 --- a/scene/gui/tree.h +++ b/scene/gui/tree.h @@ -115,7 +115,7 @@ private: Ref<Font> custom_font; Cell() { - text_buf.instance(); + text_buf.instantiate(); } Size2 get_icon_size() const; @@ -416,7 +416,7 @@ private: String language; Control::TextDirection text_direction = Control::TEXT_DIRECTION_INHERITED; ColumnInfo() { - text_buf.instance(); + text_buf.instantiate(); } }; diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp index 927b114fbc..f3c7d128ba 100644 --- a/scene/main/http_request.cpp +++ b/scene/main/http_request.cpp @@ -627,7 +627,7 @@ void HTTPRequest::_bind_methods() { } HTTPRequest::HTTPRequest() { - client.instance(); + client.instantiate(); timer = memnew(Timer); timer->set_one_shot(true); timer->connect("timeout", callable_mp(this, &HTTPRequest::_timeout)); diff --git a/scene/main/instance_placeholder.cpp b/scene/main/instance_placeholder.cpp index 1661984e30..89dac5f5a8 100644 --- a/scene/main/instance_placeholder.cpp +++ b/scene/main/instance_placeholder.cpp @@ -88,7 +88,7 @@ Node *InstancePlaceholder::create_instance(bool p_replace, const Ref<PackedScene if (!ps.is_valid()) { return nullptr; } - Node *scene = ps->instance(); + Node *scene = ps->instantiate(); if (!scene) { return nullptr; } diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 679fca0217..baf185c847 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -1813,7 +1813,7 @@ bool Node::get_scene_instance_load_placeholder() const { Node *Node::_duplicate(int p_flags, Map<const Node *, Node *> *r_duplimap) const { Node *node = nullptr; - bool instanced = false; + bool instantiated = false; if (Object::cast_to<InstancePlaceholder>(this)) { const InstancePlaceholder *ip = Object::cast_to<const InstancePlaceholder>(this); @@ -1830,13 +1830,13 @@ Node *Node::_duplicate(int p_flags, Map<const Node *, Node *> *r_duplimap) const ges = PackedScene::GEN_EDIT_STATE_INSTANCE; } #endif - node = res->instance(ges); + node = res->instantiate(ges); ERR_FAIL_COND_V(!node, nullptr); - instanced = true; + instantiated = true; } else { - Object *obj = ClassDB::instance(get_class()); + Object *obj = ClassDB::instantiate(get_class()); ERR_FAIL_COND_V(!obj, nullptr); node = Object::cast_to<Node>(obj); if (!node) { @@ -1856,9 +1856,9 @@ Node *Node::_duplicate(int p_flags, Map<const Node *, Node *> *r_duplimap) const List<const Node *> node_tree; node_tree.push_front(this); - if (instanced) { - // Since nodes in the instanced hierarchy won't be duplicated explicitly, we need to make an inventory - // of all the nodes in the tree of the instanced scene in order to transfer the values of the properties + if (instantiated) { + // Since nodes in the instantiated hierarchy won't be duplicated explicitly, we need to make an inventory + // of all the nodes in the tree of the instantiated scene in order to transfer the values of the properties Vector<const Node *> instance_roots; instance_roots.push_back(this); @@ -1866,8 +1866,8 @@ Node *Node::_duplicate(int p_flags, Map<const Node *, Node *> *r_duplimap) const for (List<const Node *>::Element *N = node_tree.front(); N; N = N->next()) { for (int i = 0; i < N->get()->get_child_count(); ++i) { Node *descendant = N->get()->get_child(i); - // Skip nodes not really belonging to the instanced hierarchy; they'll be processed normally later - // but remember non-instanced nodes that are hidden below instanced ones + // Skip nodes not really belonging to the instantiated hierarchy; they'll be processed normally later + // but remember non-instantiated nodes that are hidden below instantiated ones if (!instance_roots.has(descendant->get_owner())) { if (descendant->get_parent() && descendant->get_parent() != this && descendant->data.owner != descendant->get_parent()) { hidden_roots.push_back(descendant); @@ -1950,7 +1950,7 @@ Node *Node::_duplicate(int p_flags, Map<const Node *, Node *> *r_duplimap) const if (get_child(i)->data.parent_owned) { continue; } - if (instanced && get_child(i)->data.owner == this) { + if (instantiated && get_child(i)->data.owner == this) { continue; //part of instance } diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index 918eca7def..6c46db7801 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -1093,7 +1093,7 @@ Error SceneTree::change_scene(const String &p_path) { Error SceneTree::change_scene_to(const Ref<PackedScene> &p_scene) { Node *new_scene = nullptr; if (p_scene.is_valid()) { - new_scene = p_scene->instance(); + new_scene = p_scene->instantiate(); ERR_FAIL_COND_V(!new_scene, ERR_CANT_CREATE); } @@ -1114,7 +1114,7 @@ void SceneTree::add_current_scene(Node *p_current) { Ref<SceneTreeTimer> SceneTree::create_timer(float p_delay_sec, bool p_process_always) { Ref<SceneTreeTimer> stt; - stt.instance(); + stt.instantiate(); stt->set_process_always(p_process_always); stt->set_time_left(p_delay_sec); timers.push_back(stt); @@ -1123,7 +1123,7 @@ Ref<SceneTreeTimer> SceneTree::create_timer(float p_delay_sec, bool p_process_al Ref<Tween> SceneTree::create_tween() { Ref<Tween> tween; - tween.instance(); + tween.instantiate(); tween->set_valid(true); tweens.push_back(tween); return tween; diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 84a6dbe889..4ba50eeaa8 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -594,7 +594,7 @@ void Viewport::_process_picking() { if (!has_mouse_event) { Ref<InputEventMouseMotion> mm; - mm.instance(); + mm.instantiate(); mm->set_device(InputEvent::DEVICE_ID_INTERNAL); mm->set_global_position(physics_last_mousepos); @@ -2585,7 +2585,7 @@ void Viewport::_drop_mouse_focus() { for (int i = 0; i < 3; i++) { if (mask & (1 << i)) { Ref<InputEventMouseButton> mb; - mb.instance(); + mb.instantiate(); mb->set_position(c->get_local_mouse_position()); mb->set_global_position(c->get_local_mouse_position()); mb->set_button_index(i + 1); @@ -2661,7 +2661,7 @@ void Viewport::_post_gui_grab_click_focus() { for (int i = 0; i < 3; i++) { if (mask & (1 << i)) { Ref<InputEventMouseButton> mb; - mb.instance(); + mb.instantiate(); //send unclick @@ -2679,7 +2679,7 @@ void Viewport::_post_gui_grab_click_focus() { for (int i = 0; i < 3; i++) { if (mask & (1 << i)) { Ref<InputEventMouseButton> mb; - mb.instance(); + mb.instantiate(); //send click @@ -3698,7 +3698,7 @@ Viewport::Viewport() { viewport = RenderingServer::get_singleton()->viewport_create(); texture_rid = RenderingServer::get_singleton()->viewport_get_texture(viewport); - default_texture.instance(); + default_texture.instantiate(); default_texture->vp = const_cast<Viewport *>(this); viewport_textures.insert(default_texture.ptr()); default_texture->proxy = RS::get_singleton()->texture_proxy_create(texture_rid); diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index 931c81ad65..3a2b34c6c8 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -260,33 +260,33 @@ void register_scene_types() { Node::init_node_hrcr(); - resource_loader_font.instance(); + resource_loader_font.instantiate(); ResourceLoader::add_resource_format_loader(resource_loader_font); #ifndef DISABLE_DEPRECATED - resource_loader_compat_font.instance(); + resource_loader_compat_font.instantiate(); ResourceLoader::add_resource_format_loader(resource_loader_compat_font); #endif /* DISABLE_DEPRECATED */ - resource_loader_stream_texture.instance(); + resource_loader_stream_texture.instantiate(); ResourceLoader::add_resource_format_loader(resource_loader_stream_texture); - resource_loader_texture_layered.instance(); + resource_loader_texture_layered.instantiate(); ResourceLoader::add_resource_format_loader(resource_loader_texture_layered); - resource_loader_texture_3d.instance(); + resource_loader_texture_3d.instantiate(); ResourceLoader::add_resource_format_loader(resource_loader_texture_3d); - resource_saver_text.instance(); + resource_saver_text.instantiate(); ResourceSaver::add_resource_format_saver(resource_saver_text, true); - resource_loader_text.instance(); + resource_loader_text.instantiate(); ResourceLoader::add_resource_format_loader(resource_loader_text, true); - resource_saver_shader.instance(); + resource_saver_shader.instantiate(); ResourceSaver::add_resource_format_saver(resource_saver_shader, true); - resource_loader_shader.instance(); + resource_loader_shader.instantiate(); ResourceLoader::add_resource_format_loader(resource_loader_shader, true); OS::get_singleton()->yield(); //may take time to init diff --git a/scene/resources/audio_stream_sample.cpp b/scene/resources/audio_stream_sample.cpp index 81062feb46..8ffd2df112 100644 --- a/scene/resources/audio_stream_sample.cpp +++ b/scene/resources/audio_stream_sample.cpp @@ -596,7 +596,7 @@ Error AudioStreamSample::save_to_wav(const String &p_path) { Ref<AudioStreamPlayback> AudioStreamSample::instance_playback() { Ref<AudioStreamPlaybackSample> sample; - sample.instance(); + sample.instantiate(); sample->base = Ref<AudioStreamSample>(this); return sample; } diff --git a/scene/resources/bit_map.cpp b/scene/resources/bit_map.cpp index 0ffeb8a5bf..de557494c3 100644 --- a/scene/resources/bit_map.cpp +++ b/scene/resources/bit_map.cpp @@ -487,7 +487,7 @@ Vector<Vector<Vector2>> BitMap::clip_opaque_to_polygons(const Rect2 &p_rect, flo Point2i from; Ref<BitMap> fill; - fill.instance(); + fill.instantiate(); fill->create(get_size()); Vector<Vector<Vector2>> polygons; @@ -525,7 +525,7 @@ void BitMap::grow_mask(int p_pixels, const Rect2 &p_rect) { Rect2i r = Rect2i(0, 0, width, height).intersection(p_rect); Ref<BitMap> copy; - copy.instance(); + copy.instantiate(); copy->create(get_size()); copy->bitmask = bitmask; @@ -604,7 +604,7 @@ Array BitMap::_opaque_to_polygons_bind(const Rect2 &p_rect, float p_epsilon) con void BitMap::resize(const Size2 &p_new_size) { Ref<BitMap> new_bitmap; - new_bitmap.instance(); + new_bitmap.instantiate(); new_bitmap->create(p_new_size); int lw = MIN(width, p_new_size.width); int lh = MIN(height, p_new_size.height); @@ -621,7 +621,7 @@ void BitMap::resize(const Size2 &p_new_size) { Ref<Image> BitMap::convert_to_image() const { Ref<Image> image; - image.instance(); + image.instantiate(); image->create(width, height, false, Image::FORMAT_L8); for (int i = 0; i < width; i++) { diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index a4228d48b4..5464a46df4 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -559,7 +559,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const // ScrollContainer Ref<StyleBoxEmpty> empty; - empty.instance(); + empty.instantiate(); theme->set_stylebox("bg", "ScrollContainer", empty); // WindowDialog @@ -979,7 +979,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const void make_default_theme(bool p_hidpi, Ref<Font> p_font) { Ref<Theme> t; - t.instance(); + t.instantiate(); Ref<StyleBox> default_style; Ref<Texture2D> default_icon; @@ -993,10 +993,10 @@ void make_default_theme(bool p_hidpi, Ref<Font> p_font) { // The default DynamicFont is chosen to have a small file size since it's // embedded in both editor and export template binaries. Ref<Font> dynamic_font; - dynamic_font.instance(); + dynamic_font.instantiate(); Ref<FontData> dynamic_font_data; - dynamic_font_data.instance(); + dynamic_font_data.instantiate(); dynamic_font_data->load_memory(_font_OpenSans_SemiBold, _font_OpenSans_SemiBold_size, "ttf", default_font_size); dynamic_font->add_data(dynamic_font_data); diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp index 6f87c524d8..032171847d 100644 --- a/scene/resources/font.cpp +++ b/scene/resources/font.cpp @@ -813,7 +813,7 @@ Size2 Font::get_string_size(const String &p_text, int p_size) const { if (cache.has(hash)) { buffer = cache.get(hash); } else { - buffer.instance(); + buffer.instantiate(); int size = p_size <= 0 ? data[0]->get_base_size() : p_size; buffer->add_string(p_text, Ref<Font>(this), size, Dictionary(), TranslationServer::get_singleton()->get_tool_locale()); cache.insert(hash, buffer); @@ -838,7 +838,7 @@ Size2 Font::get_multiline_string_size(const String &p_text, float p_width, int p if (cache_wrap.has(wrp_hash)) { lines_buffer = cache_wrap.get(wrp_hash); } else { - lines_buffer.instance(); + lines_buffer.instantiate(); int size = p_size <= 0 ? data[0]->get_base_size() : p_size; lines_buffer->add_string(p_text, Ref<Font>(this), size, Dictionary(), TranslationServer::get_singleton()->get_tool_locale()); lines_buffer->set_width(p_width); @@ -870,7 +870,7 @@ void Font::draw_string(RID p_canvas_item, const Point2 &p_pos, const String &p_t if (cache.has(hash)) { buffer = cache.get(hash); } else { - buffer.instance(); + buffer.instantiate(); int size = p_size <= 0 ? data[0]->get_base_size() : p_size; buffer->add_string(p_text, Ref<Font>(this), size, Dictionary(), TranslationServer::get_singleton()->get_tool_locale()); cache.insert(hash, buffer); @@ -905,7 +905,7 @@ void Font::draw_multiline_string(RID p_canvas_item, const Point2 &p_pos, const S if (cache_wrap.has(wrp_hash)) { lines_buffer = cache_wrap.get(wrp_hash); } else { - lines_buffer.instance(); + lines_buffer.instantiate(); int size = p_size <= 0 ? data[0]->get_base_size() : p_size; lines_buffer->add_string(p_text, Ref<Font>(this), size, Dictionary(), TranslationServer::get_singleton()->get_tool_locale()); lines_buffer->set_width(p_width); @@ -1041,7 +1041,7 @@ RES ResourceFormatLoaderFont::load(const String &p_path, const String &p_origina } Ref<FontData> dfont; - dfont.instance(); + dfont.instantiate(); dfont->load_resource(p_path); if (r_error) { @@ -1096,11 +1096,11 @@ RES ResourceFormatLoaderCompatFont::load(const String &p_path, const String &p_o } Ref<FontData> dfont; - dfont.instance(); + dfont.instantiate(); dfont->load_resource(p_path); Ref<Font> font; - font.instance(); + font.instantiate(); font->add_data(dfont); if (r_error) { diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 2c5634e6ef..7027319554 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -2092,7 +2092,7 @@ RID BaseMaterial3D::get_material_rid_for_2d(bool p_shaded, bool p_transparent, b } Ref<StandardMaterial3D> material; - material.instance(); + material.instantiate(); material->set_shading_mode(p_shaded ? SHADING_MODE_PER_PIXEL : SHADING_MODE_UNSHADED); material->set_transparency(p_transparent ? (p_opaque_prepass ? TRANSPARENCY_ALPHA_DEPTH_PRE_PASS : (p_cut_alpha ? TRANSPARENCY_ALPHA_SCISSOR : TRANSPARENCY_ALPHA)) : TRANSPARENCY_DISABLED); diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index 5e8e77c730..cf59c6fa22 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -571,7 +571,7 @@ Vector<Ref<Shape3D>> Mesh::convex_decompose() const { } Ref<ConvexPolygonShape3D> shape; - shape.instance(); + shape.instantiate(); shape->set_points(convex_points); ret.push_back(shape); } @@ -1537,7 +1537,7 @@ Error ArrayMesh::lightmap_unwrap_cached(const Transform3D &p_base_transform, flo for (int i = 0; i < lightmap_surfaces.size(); i++) { Ref<SurfaceTool> st; - st.instance(); + st.instantiate(); st->begin(Mesh::PRIMITIVE_TRIANGLES); st->set_material(lightmap_surfaces[i].material); surfaces_tools.push_back(st); //stay there diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index e93c005779..913f1ca376 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -41,11 +41,11 @@ #define PACKED_SCENE_VERSION 2 -bool SceneState::can_instance() const { +bool SceneState::can_instantiate() const { return nodes.size() > 0; } -Node *SceneState::instance(GenEditState p_edit_state) const { +Node *SceneState::instantiate(GenEditState p_edit_state) const { // nodes where instancing failed (because something is missing) List<Node *> stray_instances; @@ -109,7 +109,7 @@ Node *SceneState::instance(GenEditState p_edit_state) const { //scene inheritance on root node Ref<PackedScene> sdata = props[base_scene_idx]; ERR_FAIL_COND_V(!sdata.is_valid(), nullptr); - node = sdata->instance(p_edit_state == GEN_EDIT_STATE_DISABLED ? PackedScene::GEN_EDIT_STATE_DISABLED : PackedScene::GEN_EDIT_STATE_INSTANCE); //only main gets main edit state + node = sdata->instantiate(p_edit_state == GEN_EDIT_STATE_DISABLED ? PackedScene::GEN_EDIT_STATE_DISABLED : PackedScene::GEN_EDIT_STATE_INSTANCE); //only main gets main edit state ERR_FAIL_COND_V(!node, nullptr); if (p_edit_state != GEN_EDIT_STATE_DISABLED) { node->set_scene_inherited_state(sdata->get_state()); @@ -122,7 +122,7 @@ Node *SceneState::instance(GenEditState p_edit_state) const { if (disable_placeholders) { Ref<PackedScene> sdata = ResourceLoader::load(path, "PackedScene"); ERR_FAIL_COND_V(!sdata.is_valid(), nullptr); - node = sdata->instance(p_edit_state == GEN_EDIT_STATE_DISABLED ? PackedScene::GEN_EDIT_STATE_DISABLED : PackedScene::GEN_EDIT_STATE_INSTANCE); + node = sdata->instantiate(p_edit_state == GEN_EDIT_STATE_DISABLED ? PackedScene::GEN_EDIT_STATE_DISABLED : PackedScene::GEN_EDIT_STATE_INSTANCE); ERR_FAIL_COND_V(!node, nullptr); } else { InstancePlaceholder *ip = memnew(InstancePlaceholder); @@ -133,7 +133,7 @@ Node *SceneState::instance(GenEditState p_edit_state) const { } else { Ref<PackedScene> sdata = props[n.instance & FLAG_MASK]; ERR_FAIL_COND_V(!sdata.is_valid(), nullptr); - node = sdata->instance(p_edit_state == GEN_EDIT_STATE_DISABLED ? PackedScene::GEN_EDIT_STATE_DISABLED : PackedScene::GEN_EDIT_STATE_INSTANCE); + node = sdata->instantiate(p_edit_state == GEN_EDIT_STATE_DISABLED ? PackedScene::GEN_EDIT_STATE_DISABLED : PackedScene::GEN_EDIT_STATE_INSTANCE); ERR_FAIL_COND_V(!node, nullptr); } @@ -152,7 +152,7 @@ Node *SceneState::instance(GenEditState p_edit_state) const { if (ClassDB::is_class_enabled(snames[n.type])) { //node belongs to this scene and must be created - obj = ClassDB::instance(snames[n.type]); + obj = ClassDB::instantiate(snames[n.type]); } if (!Object::cast_to<Node>(obj)) { @@ -180,7 +180,7 @@ Node *SceneState::instance(GenEditState p_edit_state) const { } if (node) { - // may not have found the node (part of instanced scene and removed) + // may not have found the node (part of instantiated scene and removed) // if found all is good, otherwise ignore //properties @@ -266,7 +266,7 @@ Node *SceneState::instance(GenEditState p_edit_state) const { parent->move_child(node, n.index); } } else { - //it may be possible that an instanced scene has changed + //it may be possible that an instantiated scene has changed //and the node has nowhere to go anymore stray_instances.push_back(node); //can't be added, go to stray list } @@ -368,7 +368,7 @@ static int _vm_get_variant(const Variant &p_variant, HashMap<Variant, int, Varia Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map<StringName, int> &name_map, HashMap<Variant, int, VariantHasher, VariantComparator> &variant_map, Map<Node *, int> &node_map, Map<Node *, int> &nodepath_map) { // this function handles all the work related to properly packing scenes, be it - // instanced or inherited. + // instantiated or inherited. // given the complexity of this process, an attempt will be made to properly // document it. if you fail to understand something, please ask! @@ -377,7 +377,7 @@ Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map return OK; } - // save the child instanced scenes that are chosen as editable, so they can be restored + // save the child instantiated scenes that are chosen as editable, so they can be restored // upon load back if (p_node != p_owner && p_node->get_filename() != String() && p_owner->is_editable_instance(p_node)) { editable_instances.push_back(p_owner->get_path_to(p_node)); @@ -386,7 +386,7 @@ Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map NodeData nd; nd.name = _nm_get_string(p_node->get_name(), name_map); - nd.instance = -1; //not instanced by default + nd.instance = -1; //not instantiated by default //really convoluted condition, but it basically checks that index is only saved when part of an inherited scene OR the node parent is from the edited scene if (p_owner->get_scene_inherited_state().is_null() && (p_node == p_owner || (p_node->get_owner() == p_owner && (p_node->get_parent() == p_owner || p_node->get_parent()->get_owner() == p_owner)))) { @@ -396,18 +396,18 @@ Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map //This (hopefully) happens if the node is a scene root, so its index is irrelevant. nd.index = -1; } else { - //part of an inherited scene, or parent is from an instanced scene + //part of an inherited scene, or parent is from an instantiated scene nd.index = p_node->get_index(); } - // if this node is part of an instanced scene or sub-instanced scene + // if this node is part of an instantiated scene or sub-instantiated scene // we need to get the corresponding instance states. // with the instance states, we can query for identical properties/groups // and only save what has changed List<PackState> pack_state_stack; - bool instanced_by_owner = true; + bool instantiated_by_owner = true; { Node *n = p_node; @@ -423,11 +423,11 @@ Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map ps.node = node; ps.state = state; pack_state_stack.push_back(ps); - instanced_by_owner = false; + instantiated_by_owner = false; } } - if (p_node->get_filename() != String() && p_node->get_owner() == p_owner && instanced_by_owner) { + if (p_node->get_filename() != String() && p_node->get_owner() == p_owner && instantiated_by_owner) { if (p_node->get_scene_instance_load_placeholder()) { //it's a placeholder, use the placeholder path nd.instance = _vm_get_variant(p_node->get_filename(), variant_map); @@ -500,8 +500,8 @@ Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map // } if (pack_state_stack.size()) { - // we are on part of an instanced subscene - // or part of instanced scene. + // we are on part of an instantiated subscene + // or part of instantiated scene. // only save what has been changed // only save changed properties in instance @@ -571,7 +571,7 @@ Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map } /* if (instance_state_node>=0 && instance_state->is_node_in_group(instance_state_node,gi.name)) - continue; //group was instanced, don't add here + continue; //group was instantiated, don't add here */ bool skip = false; @@ -594,7 +594,7 @@ Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map // save the right owner // for the saved scene root this is -1 // for nodes of the saved scene this is 0 - // for nodes of instanced scenes this is >0 + // for nodes of instantiated scenes this is >0 if (p_node == p_owner) { //saved scene root @@ -612,20 +612,20 @@ Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map //this node is not part of an instancing process, so save the type nd.type = _nm_get_string(p_node->get_class(), name_map); } else { - // this node is part of an instanced process, so do not save the type. - // instead, save that it was instanced + // this node is part of an instantiated process, so do not save the type. + // instead, save that it was instantiated nd.type = TYPE_INSTANCED; } // determine whether to save this node or not - // if this node is part of an instanced sub-scene, we can skip storing it if basically + // if this node is part of an instantiated sub-scene, we can skip storing it if basically // no properties changed and no groups were added to it. // below condition is true for all nodes of the scene being saved, and ones in subscenes // that hold changes bool save_node = nd.properties.size() || nd.groups.size(); // some local properties or groups exist save_node = save_node || p_node == p_owner; // owner is always saved - save_node = save_node || (p_node->get_owner() == p_owner && instanced_by_owner); //part of scene and not instanced + save_node = save_node || (p_node->get_owner() == p_owner && instantiated_by_owner); //part of scene and not instantiated int idx = nodes.size(); int parent_node = NO_PARENT_SAVED; @@ -955,7 +955,7 @@ int SceneState::find_node_by_path(const NodePath &p_node) const { if (_get_base_scene_state().is_valid() && !base_scene_node_remap.has(nid)) { //for nodes that _do_ exist in current scene, still try to look for - //the node in the instanced scene, as a property may be missing + //the node in the instantiated scene, as a property may be missing //from the local one int idx = _get_base_scene_state()->find_node_by_path(p_node); if (idx != -1) { @@ -1623,16 +1623,16 @@ void PackedScene::clear() { state->clear(); } -bool PackedScene::can_instance() const { - return state->can_instance(); +bool PackedScene::can_instantiate() const { + return state->can_instantiate(); } -Node *PackedScene::instance(GenEditState p_edit_state) const { +Node *PackedScene::instantiate(GenEditState p_edit_state) const { #ifndef TOOLS_ENABLED ERR_FAIL_COND_V_MSG(p_edit_state != GEN_EDIT_STATE_DISABLED, nullptr, "Edit state is only for editors, does not work without tools compiled."); #endif - Node *s = state->instance((SceneState::GenEditState)p_edit_state); + Node *s = state->instantiate((SceneState::GenEditState)p_edit_state); if (!s) { return nullptr; } @@ -1680,8 +1680,8 @@ void PackedScene::reset_state() { } void PackedScene::_bind_methods() { ClassDB::bind_method(D_METHOD("pack", "path"), &PackedScene::pack); - ClassDB::bind_method(D_METHOD("instance", "edit_state"), &PackedScene::instance, DEFVAL(GEN_EDIT_STATE_DISABLED)); - ClassDB::bind_method(D_METHOD("can_instance"), &PackedScene::can_instance); + ClassDB::bind_method(D_METHOD("instantiate", "edit_state"), &PackedScene::instantiate, DEFVAL(GEN_EDIT_STATE_DISABLED)); + ClassDB::bind_method(D_METHOD("can_instantiate"), &PackedScene::can_instantiate); ClassDB::bind_method(D_METHOD("_set_bundled_scene"), &PackedScene::_set_bundled_scene); ClassDB::bind_method(D_METHOD("_get_bundled_scene"), &PackedScene::_get_bundled_scene); ClassDB::bind_method(D_METHOD("get_state"), &PackedScene::get_state); diff --git a/scene/resources/packed_scene.h b/scene/resources/packed_scene.h index e85b933439..55708f7914 100644 --- a/scene/resources/packed_scene.h +++ b/scene/resources/packed_scene.h @@ -136,8 +136,8 @@ public: void clear(); - bool can_instance() const; - Node *instance(GenEditState p_edit_state) const; + bool can_instantiate() const; + Node *instantiate(GenEditState p_edit_state) const; //unbuild API @@ -213,8 +213,8 @@ public: void clear(); - bool can_instance() const; - Node *instance(GenEditState p_edit_state = GEN_EDIT_STATE_DISABLED) const; + bool can_instantiate() const; + Node *instantiate(GenEditState p_edit_state = GEN_EDIT_STATE_DISABLED) const; void recreate_state(); void replace_state(Ref<SceneState> p_by); diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp index 27f0c50a79..ee61e64ed3 100644 --- a/scene/resources/resource_format_text.cpp +++ b/scene/resources/resource_format_text.cpp @@ -65,7 +65,7 @@ Error ResourceLoaderText::_parse_sub_resource_dummy(DummyReadData *p_data, Varia if (!p_data->resource_map.has(index)) { Ref<DummyResource> dr; - dr.instance(); + dr.instantiate(); dr->set_subindex(index); p_data->resource_map[index] = dr; p_data->resource_set.insert(dr); @@ -183,7 +183,7 @@ Error ResourceLoaderText::_parse_ext_resource(VariantParser::Stream *p_stream, R Ref<PackedScene> ResourceLoaderText::_parse_node_tag(VariantParser::ResourceParser &parser) { Ref<PackedScene> packed_scene; - packed_scene.instance(); + packed_scene.instantiate(); while (true) { if (next_tag.name == "node") { @@ -208,7 +208,7 @@ Ref<PackedScene> ResourceLoaderText::_parse_node_tag(VariantParser::ResourcePars if (next_tag.fields.has("type")) { type = packed_scene->get_state()->add_name(next_tag.fields["type"]); } else { - type = SceneState::TYPE_INSTANCED; //no type? assume this was instanced + type = SceneState::TYPE_INSTANCED; //no type? assume this was instantiated } if (next_tag.fields.has("instance")) { @@ -522,7 +522,7 @@ Error ResourceLoaderText::load() { } else { //create - Object *obj = ClassDB::instance(type); + Object *obj = ClassDB::instantiate(type); if (!obj) { error_text += "Can't create sub resource of type: " + type; _printerr(); @@ -604,7 +604,7 @@ Error ResourceLoaderText::load() { } if (!resource.is_valid()) { - Object *obj = ClassDB::instance(res_type); + Object *obj = ClassDB::instantiate(res_type); if (!obj) { error_text += "Can't create sub resource of type: " + res_type; _printerr(); @@ -1022,7 +1022,7 @@ Error ResourceLoaderText::save_as_binary(FileAccess *p_f, const String &p_path) int lindex = dummy_read.external_resources.size(); Ref<DummyResource> dr; - dr.instance(); + dr.instantiate(); dr->set_path("res://dummy" + itos(lindex)); //anything is good to detect it for saving as external dummy_read.external_resources[dr] = lindex; dummy_read.rev_external_resources[index] = dr; diff --git a/scene/resources/shader.cpp b/scene/resources/shader.cpp index cbd44315b7..f19d08dbb1 100644 --- a/scene/resources/shader.cpp +++ b/scene/resources/shader.cpp @@ -167,7 +167,7 @@ RES ResourceFormatLoaderShader::load(const String &p_path, const String &p_origi } Ref<Shader> shader; - shader.instance(); + shader.instantiate(); Vector<uint8_t> buffer = FileAccess::get_file_as_array(p_path); diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp index fee9f92ad7..9f8c35b668 100644 --- a/scene/resources/surface_tool.cpp +++ b/scene/resources/surface_tool.cpp @@ -607,7 +607,7 @@ Ref<ArrayMesh> SurfaceTool::commit(const Ref<ArrayMesh> &p_existing, uint32_t p_ if (p_existing.is_valid()) { mesh = p_existing; } else { - mesh.instance(); + mesh.instantiate(); } int varr_len = vertex_array.size(); diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index aa85c7116b..b8dd8b1c14 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -88,7 +88,7 @@ void ImageTexture::reload_from_file() { } Ref<Image> img; - img.instance(); + img.instantiate(); if (ImageLoader::load_image(path, img) == OK) { create_from_image(img); @@ -138,7 +138,7 @@ void ImageTexture::_reload_hook(const RID &p_hook) { } Ref<Image> img; - img.instance(); + img.instantiate(); Error err = ImageLoader::load_image(path, img); ERR_FAIL_COND_MSG(err != OK, "Cannot load image from path '" + path + "'."); @@ -258,7 +258,7 @@ bool ImageTexture::is_pixel_opaque(int p_x, int p_y) const { decom->decompress(); img = decom; } - alpha_cache.instance(); + alpha_cache.instantiate(); alpha_cache->create_from_image_alpha(img); } } @@ -390,7 +390,7 @@ Ref<Image> StreamTexture2D::load_image_from_file(FileAccess *f, int p_size_limit //print_line("mipmap read total: " + itos(mipmap_images.size())); Ref<Image> image; - image.instance(); + image.instantiate(); if (mipmap_images.size() == 1) { //only one image (which will most likely be the case anyway for this format) @@ -442,7 +442,7 @@ Ref<Image> StreamTexture2D::load_image_from_file(FileAccess *f, int p_size_limit } Ref<Image> image; - image.instance(); + image.instantiate(); image->create(tw, th, mipmaps - i ? true : false, format, data); @@ -553,7 +553,7 @@ Error StreamTexture2D::_load_data(const String &p_path, int &r_width, int &r_hei Error StreamTexture2D::load(const String &p_path) { int lw, lh; Ref<Image> image; - image.instance(); + image.instantiate(); bool request_3d; bool request_normal; @@ -679,7 +679,7 @@ bool StreamTexture2D::is_pixel_opaque(int p_x, int p_y) const { img = decom; } - alpha_cache.instance(); + alpha_cache.instantiate(); alpha_cache->create_from_image_alpha(img); } } @@ -738,7 +738,7 @@ StreamTexture2D::~StreamTexture2D() { RES ResourceFormatLoaderStreamTexture2D::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, CacheMode p_cache_mode) { Ref<StreamTexture2D> st; - st.instance(); + st.instantiate(); Error err = st->load(p_path); if (r_error) { *r_error = err; @@ -1036,7 +1036,7 @@ StreamTexture3D::~StreamTexture3D() { RES ResourceFormatLoaderStreamTexture3D::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, CacheMode p_cache_mode) { Ref<StreamTexture3D> st; - st.instance(); + st.instantiate(); Error err = st->load(p_path); if (r_error) { *r_error = err; @@ -2257,15 +2257,15 @@ RES ResourceFormatLoaderStreamTextureLayered::load(const String &p_path, const S Ref<StreamTextureLayered> st; if (p_path.get_extension().to_lower() == "stexarray") { Ref<StreamTexture2DArray> s; - s.instance(); + s.instantiate(); st = s; } else if (p_path.get_extension().to_lower() == "scube") { Ref<StreamCubemap> s; - s.instance(); + s.instantiate(); st = s; } else if (p_path.get_extension().to_lower() == "scubearray") { Ref<StreamCubemapArray> s; - s.instance(); + s.instantiate(); st = s; } else { if (r_error) { diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp index 0eeea29da4..ef4a53cb0d 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -4587,7 +4587,7 @@ void TileSetPluginScenesCollections::update_dirty_quadrants(TileMap *p_tile_map, if (scenes_collection_source) { Ref<PackedScene> packed_scene = scenes_collection_source->get_scene_tile_scene(c.alternative_tile); if (packed_scene.is_valid()) { - Node *scene = packed_scene->instance(); + Node *scene = packed_scene->instantiate(); p_tile_map->add_child(scene); Control *scene_as_control = Object::cast_to<Control>(scene); Node2D *scene_as_node2d = Object::cast_to<Node2D>(scene); diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index 5759948fe6..774c1a5c33 100644 --- a/scene/resources/visual_shader.cpp +++ b/scene/resources/visual_shader.cpp @@ -617,7 +617,7 @@ void VisualShader::replace_node(Type p_type, int p_id, const StringName &p_new_c if (g->nodes[p_id].node->get_class_name() == p_new_class) { return; } - VisualShaderNode *vsn = Object::cast_to<VisualShaderNode>(ClassDB::instance(p_new_class)); + VisualShaderNode *vsn = Object::cast_to<VisualShaderNode>(ClassDB::instantiate(p_new_class)); vsn->connect("changed", callable_mp(this, &VisualShader::_queue_update)); g->nodes[p_id].node = Ref<VisualShaderNode>(vsn); @@ -2020,13 +2020,13 @@ VisualShader::VisualShader() { for (int i = 0; i < TYPE_MAX; i++) { if (i > (int)TYPE_LIGHT && i < (int)TYPE_SKY) { Ref<VisualShaderNodeParticleOutput> output; - output.instance(); + output.instantiate(); output->shader_type = Type(i); output->shader_mode = shader_mode; graph[i].nodes[NODE_ID_OUTPUT].node = output; } else { Ref<VisualShaderNodeOutput> output; - output.instance(); + output.instantiate(); output->shader_type = Type(i); output->shader_mode = shader_mode; graph[i].nodes[NODE_ID_OUTPUT].node = output; diff --git a/servers/audio/audio_effect.h b/servers/audio/audio_effect.h index 5d14f03199..bea7292b8e 100644 --- a/servers/audio/audio_effect.h +++ b/servers/audio/audio_effect.h @@ -46,7 +46,7 @@ class AudioEffect : public Resource { GDCLASS(AudioEffect, Resource); public: - virtual Ref<AudioEffectInstance> instance() = 0; + virtual Ref<AudioEffectInstance> instantiate() = 0; AudioEffect(); }; diff --git a/servers/audio/audio_stream.cpp b/servers/audio/audio_stream.cpp index ae07f999ed..aec6932326 100644 --- a/servers/audio/audio_stream.cpp +++ b/servers/audio/audio_stream.cpp @@ -100,7 +100,7 @@ void AudioStream::_bind_methods() { Ref<AudioStreamPlayback> AudioStreamMicrophone::instance_playback() { Ref<AudioStreamPlaybackMicrophone> playback; - playback.instance(); + playback.instantiate(); playbacks.insert(playback.ptr()); @@ -256,7 +256,7 @@ float AudioStreamRandomPitch::get_random_pitch() const { Ref<AudioStreamPlayback> AudioStreamRandomPitch::instance_playback() { Ref<AudioStreamPlaybackRandomPitch> playback; - playback.instance(); + playback.instantiate(); if (audio_stream.is_valid()) { playback->playback = audio_stream->instance_playback(); } diff --git a/servers/audio/effects/audio_effect_amplify.cpp b/servers/audio/effects/audio_effect_amplify.cpp index c5c1174670..79788d334b 100644 --- a/servers/audio/effects/audio_effect_amplify.cpp +++ b/servers/audio/effects/audio_effect_amplify.cpp @@ -44,9 +44,9 @@ void AudioEffectAmplifyInstance::process(const AudioFrame *p_src_frames, AudioFr mix_volume_db = volume_db; } -Ref<AudioEffectInstance> AudioEffectAmplify::instance() { +Ref<AudioEffectInstance> AudioEffectAmplify::instantiate() { Ref<AudioEffectAmplifyInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectAmplify>(this); ins->mix_volume_db = volume_db; return ins; diff --git a/servers/audio/effects/audio_effect_amplify.h b/servers/audio/effects/audio_effect_amplify.h index 2ece57854c..9d3facc230 100644 --- a/servers/audio/effects/audio_effect_amplify.h +++ b/servers/audio/effects/audio_effect_amplify.h @@ -56,7 +56,7 @@ protected: static void _bind_methods(); public: - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; void set_volume_db(float p_volume); float get_volume_db() const; diff --git a/servers/audio/effects/audio_effect_capture.cpp b/servers/audio/effects/audio_effect_capture.cpp index 78837c7531..065065042e 100644 --- a/servers/audio/effects/audio_effect_capture.cpp +++ b/servers/audio/effects/audio_effect_capture.cpp @@ -73,7 +73,7 @@ void AudioEffectCapture::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "buffer_length", PROPERTY_HINT_RANGE, "0.01,10,0.01"), "set_buffer_length", "get_buffer_length"); } -Ref<AudioEffectInstance> AudioEffectCapture::instance() { +Ref<AudioEffectInstance> AudioEffectCapture::instantiate() { if (!buffer_initialized) { float target_buffer_size = AudioServer::get_singleton()->get_mix_rate() * buffer_length_seconds; ERR_FAIL_COND_V(target_buffer_size <= 0 || target_buffer_size >= (1 << 27), Ref<AudioEffectInstance>()); @@ -84,7 +84,7 @@ Ref<AudioEffectInstance> AudioEffectCapture::instance() { clear_buffer(); Ref<AudioEffectCaptureInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectCapture>(this); return ins; diff --git a/servers/audio/effects/audio_effect_capture.h b/servers/audio/effects/audio_effect_capture.h index 82686d5b4c..7f50fc4965 100644 --- a/servers/audio/effects/audio_effect_capture.h +++ b/servers/audio/effects/audio_effect_capture.h @@ -64,7 +64,7 @@ protected: static void _bind_methods(); public: - virtual Ref<AudioEffectInstance> instance() override; + virtual Ref<AudioEffectInstance> instantiate() override; void set_buffer_length(float p_buffer_length_seconds); float get_buffer_length(); diff --git a/servers/audio/effects/audio_effect_chorus.cpp b/servers/audio/effects/audio_effect_chorus.cpp index eb2268aa2e..54cd5ed0bf 100644 --- a/servers/audio/effects/audio_effect_chorus.cpp +++ b/servers/audio/effects/audio_effect_chorus.cpp @@ -141,9 +141,9 @@ void AudioEffectChorusInstance::_process_chunk(const AudioFrame *p_src_frames, A buffer_pos += p_frame_count; } -Ref<AudioEffectInstance> AudioEffectChorus::instance() { +Ref<AudioEffectInstance> AudioEffectChorus::instantiate() { Ref<AudioEffectChorusInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectChorus>(this); for (int i = 0; i < 4; i++) { ins->filter_h[i] = AudioFrame(0, 0); diff --git a/servers/audio/effects/audio_effect_chorus.h b/servers/audio/effects/audio_effect_chorus.h index f5b023734a..f81bebb0ae 100644 --- a/servers/audio/effects/audio_effect_chorus.h +++ b/servers/audio/effects/audio_effect_chorus.h @@ -128,7 +128,7 @@ public: void set_dry(float amount); float get_dry() const; - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; AudioEffectChorus(); }; diff --git a/servers/audio/effects/audio_effect_compressor.cpp b/servers/audio/effects/audio_effect_compressor.cpp index bb4a90f3d6..cfa2ae6f79 100644 --- a/servers/audio/effects/audio_effect_compressor.cpp +++ b/servers/audio/effects/audio_effect_compressor.cpp @@ -112,9 +112,9 @@ void AudioEffectCompressorInstance::process(const AudioFrame *p_src_frames, Audi } } -Ref<AudioEffectInstance> AudioEffectCompressor::instance() { +Ref<AudioEffectInstance> AudioEffectCompressor::instantiate() { Ref<AudioEffectCompressorInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectCompressor>(this); ins->rundb = 0; ins->runratio = 0; diff --git a/servers/audio/effects/audio_effect_compressor.h b/servers/audio/effects/audio_effect_compressor.h index 33c60680fc..dae4618a64 100644 --- a/servers/audio/effects/audio_effect_compressor.h +++ b/servers/audio/effects/audio_effect_compressor.h @@ -65,7 +65,7 @@ protected: static void _bind_methods(); public: - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; void set_threshold(float p_threshold); float get_threshold() const; diff --git a/servers/audio/effects/audio_effect_delay.cpp b/servers/audio/effects/audio_effect_delay.cpp index ba50eeb0a3..07475e1ed4 100644 --- a/servers/audio/effects/audio_effect_delay.cpp +++ b/servers/audio/effects/audio_effect_delay.cpp @@ -111,9 +111,9 @@ void AudioEffectDelayInstance::_process_chunk(const AudioFrame *p_src_frames, Au } } -Ref<AudioEffectInstance> AudioEffectDelay::instance() { +Ref<AudioEffectInstance> AudioEffectDelay::instantiate() { Ref<AudioEffectDelayInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectDelay>(this); float ring_buffer_max_size = MAX_DELAY_MS + 100; //add 100ms of extra room, just in case diff --git a/servers/audio/effects/audio_effect_delay.h b/servers/audio/effects/audio_effect_delay.h index ff267d5023..50a2233e5f 100644 --- a/servers/audio/effects/audio_effect_delay.h +++ b/servers/audio/effects/audio_effect_delay.h @@ -126,7 +126,7 @@ public: void set_feedback_lowpass(float p_lowpass); float get_feedback_lowpass() const; - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; AudioEffectDelay(); }; diff --git a/servers/audio/effects/audio_effect_distortion.cpp b/servers/audio/effects/audio_effect_distortion.cpp index 5c076ca3fe..188b7a3301 100644 --- a/servers/audio/effects/audio_effect_distortion.cpp +++ b/servers/audio/effects/audio_effect_distortion.cpp @@ -93,9 +93,9 @@ void AudioEffectDistortionInstance::process(const AudioFrame *p_src_frames, Audi } } -Ref<AudioEffectInstance> AudioEffectDistortion::instance() { +Ref<AudioEffectInstance> AudioEffectDistortion::instantiate() { Ref<AudioEffectDistortionInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectDistortion>(this); ins->h[0] = 0; ins->h[1] = 0; diff --git a/servers/audio/effects/audio_effect_distortion.h b/servers/audio/effects/audio_effect_distortion.h index 9da800b79f..3a762f8cf6 100644 --- a/servers/audio/effects/audio_effect_distortion.h +++ b/servers/audio/effects/audio_effect_distortion.h @@ -68,7 +68,7 @@ protected: static void _bind_methods(); public: - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; void set_mode(Mode p_mode); Mode get_mode() const; diff --git a/servers/audio/effects/audio_effect_eq.cpp b/servers/audio/effects/audio_effect_eq.cpp index 01ac605bd7..e87944b74b 100644 --- a/servers/audio/effects/audio_effect_eq.cpp +++ b/servers/audio/effects/audio_effect_eq.cpp @@ -59,9 +59,9 @@ void AudioEffectEQInstance::process(const AudioFrame *p_src_frames, AudioFrame * } } -Ref<AudioEffectInstance> AudioEffectEQ::instance() { +Ref<AudioEffectInstance> AudioEffectEQ::instantiate() { Ref<AudioEffectEQInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectEQ>(this); ins->gains.resize(eq.get_band_count()); for (int i = 0; i < 2; i++) { diff --git a/servers/audio/effects/audio_effect_eq.h b/servers/audio/effects/audio_effect_eq.h index 38c63a7d4f..b99727d7c0 100644 --- a/servers/audio/effects/audio_effect_eq.h +++ b/servers/audio/effects/audio_effect_eq.h @@ -66,7 +66,7 @@ protected: static void _bind_methods(); public: - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; void set_band_gain_db(int p_band, float p_volume); float get_band_gain_db(int p_band) const; int get_band_count() const; diff --git a/servers/audio/effects/audio_effect_filter.cpp b/servers/audio/effects/audio_effect_filter.cpp index c2d6074825..1db8b1f1b5 100644 --- a/servers/audio/effects/audio_effect_filter.cpp +++ b/servers/audio/effects/audio_effect_filter.cpp @@ -100,9 +100,9 @@ AudioEffectFilterInstance::AudioEffectFilterInstance() { } } -Ref<AudioEffectInstance> AudioEffectFilter::instance() { +Ref<AudioEffectInstance> AudioEffectFilter::instantiate() { Ref<AudioEffectFilterInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectFilter>(this); return ins; diff --git a/servers/audio/effects/audio_effect_filter.h b/servers/audio/effects/audio_effect_filter.h index 9a48ccf70b..9aab97da29 100644 --- a/servers/audio/effects/audio_effect_filter.h +++ b/servers/audio/effects/audio_effect_filter.h @@ -88,7 +88,7 @@ public: void set_db(FilterDB p_db); FilterDB get_db() const; - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; AudioEffectFilter(AudioFilterSW::Mode p_mode = AudioFilterSW::LOWPASS); }; diff --git a/servers/audio/effects/audio_effect_limiter.cpp b/servers/audio/effects/audio_effect_limiter.cpp index 1a4b01d947..280411641b 100644 --- a/servers/audio/effects/audio_effect_limiter.cpp +++ b/servers/audio/effects/audio_effect_limiter.cpp @@ -67,9 +67,9 @@ void AudioEffectLimiterInstance::process(const AudioFrame *p_src_frames, AudioFr } } -Ref<AudioEffectInstance> AudioEffectLimiter::instance() { +Ref<AudioEffectInstance> AudioEffectLimiter::instantiate() { Ref<AudioEffectLimiterInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectLimiter>(this); return ins; diff --git a/servers/audio/effects/audio_effect_limiter.h b/servers/audio/effects/audio_effect_limiter.h index 8f3092c0e2..d5def670a4 100644 --- a/servers/audio/effects/audio_effect_limiter.h +++ b/servers/audio/effects/audio_effect_limiter.h @@ -71,7 +71,7 @@ public: void set_soft_clip_ratio(float p_soft_clip); float get_soft_clip_ratio() const; - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; void set_volume_db(float p_volume); float get_volume_db() const; diff --git a/servers/audio/effects/audio_effect_panner.cpp b/servers/audio/effects/audio_effect_panner.cpp index 238e979e13..e2062609b9 100644 --- a/servers/audio/effects/audio_effect_panner.cpp +++ b/servers/audio/effects/audio_effect_panner.cpp @@ -40,9 +40,9 @@ void AudioEffectPannerInstance::process(const AudioFrame *p_src_frames, AudioFra } } -Ref<AudioEffectInstance> AudioEffectPanner::instance() { +Ref<AudioEffectInstance> AudioEffectPanner::instantiate() { Ref<AudioEffectPannerInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectPanner>(this); return ins; } diff --git a/servers/audio/effects/audio_effect_panner.h b/servers/audio/effects/audio_effect_panner.h index 0938824c64..d75bcaeb95 100644 --- a/servers/audio/effects/audio_effect_panner.h +++ b/servers/audio/effects/audio_effect_panner.h @@ -54,7 +54,7 @@ protected: static void _bind_methods(); public: - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; void set_pan(float p_cpanume); float get_pan() const; diff --git a/servers/audio/effects/audio_effect_phaser.cpp b/servers/audio/effects/audio_effect_phaser.cpp index 9b70f03a19..c76692eed7 100644 --- a/servers/audio/effects/audio_effect_phaser.cpp +++ b/servers/audio/effects/audio_effect_phaser.cpp @@ -78,9 +78,9 @@ void AudioEffectPhaserInstance::process(const AudioFrame *p_src_frames, AudioFra } } -Ref<AudioEffectInstance> AudioEffectPhaser::instance() { +Ref<AudioEffectInstance> AudioEffectPhaser::instantiate() { Ref<AudioEffectPhaserInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectPhaser>(this); ins->phase = 0; ins->h = AudioFrame(0, 0); diff --git a/servers/audio/effects/audio_effect_phaser.h b/servers/audio/effects/audio_effect_phaser.h index 563927c678..2a0ed64805 100644 --- a/servers/audio/effects/audio_effect_phaser.h +++ b/servers/audio/effects/audio_effect_phaser.h @@ -83,7 +83,7 @@ protected: static void _bind_methods(); public: - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; void set_range_min_hz(float p_hz); float get_range_min_hz() const; diff --git a/servers/audio/effects/audio_effect_pitch_shift.cpp b/servers/audio/effects/audio_effect_pitch_shift.cpp index 7b0151b9c1..bfbaeee3f3 100644 --- a/servers/audio/effects/audio_effect_pitch_shift.cpp +++ b/servers/audio/effects/audio_effect_pitch_shift.cpp @@ -298,9 +298,9 @@ void AudioEffectPitchShiftInstance::process(const AudioFrame *p_src_frames, Audi shift_r.PitchShift(base->pitch_scale, p_frame_count, fft_size, base->oversampling, sample_rate, in_r, out_r, 2); } -Ref<AudioEffectInstance> AudioEffectPitchShift::instance() { +Ref<AudioEffectInstance> AudioEffectPitchShift::instantiate() { Ref<AudioEffectPitchShiftInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectPitchShift>(this); static const int fft_sizes[FFT_SIZE_MAX] = { 256, 512, 1024, 2048, 4096 }; ins->fft_size = fft_sizes[fft_size]; diff --git a/servers/audio/effects/audio_effect_pitch_shift.h b/servers/audio/effects/audio_effect_pitch_shift.h index 669943fa43..3ed096cd94 100644 --- a/servers/audio/effects/audio_effect_pitch_shift.h +++ b/servers/audio/effects/audio_effect_pitch_shift.h @@ -109,7 +109,7 @@ protected: static void _bind_methods(); public: - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; void set_pitch_scale(float p_pitch_scale); float get_pitch_scale() const; diff --git a/servers/audio/effects/audio_effect_record.cpp b/servers/audio/effects/audio_effect_record.cpp index 2015ede81f..f71679d30f 100644 --- a/servers/audio/effects/audio_effect_record.cpp +++ b/servers/audio/effects/audio_effect_record.cpp @@ -134,9 +134,9 @@ AudioEffectRecordInstance::~AudioEffectRecordInstance() { finish(); } -Ref<AudioEffectInstance> AudioEffectRecord::instance() { +Ref<AudioEffectInstance> AudioEffectRecord::instantiate() { Ref<AudioEffectRecordInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectRecord>(this); ins->is_recording = false; @@ -269,7 +269,7 @@ Ref<AudioStreamSample> AudioEffectRecord::get_recording() const { } Ref<AudioStreamSample> sample; - sample.instance(); + sample.instantiate(); sample->set_data(dst_data); sample->set_format(dst_format); sample->set_mix_rate(AudioServer::get_singleton()->get_mix_rate()); diff --git a/servers/audio/effects/audio_effect_record.h b/servers/audio/effects/audio_effect_record.h index 8f56e227e0..1a89821f80 100644 --- a/servers/audio/effects/audio_effect_record.h +++ b/servers/audio/effects/audio_effect_record.h @@ -96,7 +96,7 @@ protected: static void debug(uint64_t time_diff, int p_frame_count); public: - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; void set_recording_active(bool p_record); bool is_recording_active() const; void set_format(AudioStreamSample::Format p_format); diff --git a/servers/audio/effects/audio_effect_reverb.cpp b/servers/audio/effects/audio_effect_reverb.cpp index b8d812680e..819f906773 100644 --- a/servers/audio/effects/audio_effect_reverb.cpp +++ b/servers/audio/effects/audio_effect_reverb.cpp @@ -79,9 +79,9 @@ AudioEffectReverbInstance::AudioEffectReverbInstance() { reverb[1].set_extra_spread_base(0.000521); //for stereo effect } -Ref<AudioEffectInstance> AudioEffectReverb::instance() { +Ref<AudioEffectInstance> AudioEffectReverb::instantiate() { Ref<AudioEffectReverbInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectReverb>(this); return ins; } diff --git a/servers/audio/effects/audio_effect_reverb.h b/servers/audio/effects/audio_effect_reverb.h index 141ba48e29..d01d1120bd 100644 --- a/servers/audio/effects/audio_effect_reverb.h +++ b/servers/audio/effects/audio_effect_reverb.h @@ -89,7 +89,7 @@ public: float get_wet() const; float get_hpf() const; - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; void set_volume_db(float p_volume); float get_volume_db() const; diff --git a/servers/audio/effects/audio_effect_spectrum_analyzer.cpp b/servers/audio/effects/audio_effect_spectrum_analyzer.cpp index 44b7f64d52..6f9e7ac67d 100644 --- a/servers/audio/effects/audio_effect_spectrum_analyzer.cpp +++ b/servers/audio/effects/audio_effect_spectrum_analyzer.cpp @@ -207,9 +207,9 @@ Vector2 AudioEffectSpectrumAnalyzerInstance::get_magnitude_for_frequency_range(f } } -Ref<AudioEffectInstance> AudioEffectSpectrumAnalyzer::instance() { +Ref<AudioEffectInstance> AudioEffectSpectrumAnalyzer::instantiate() { Ref<AudioEffectSpectrumAnalyzerInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectSpectrumAnalyzer>(this); static const int fft_sizes[FFT_SIZE_MAX] = { 256, 512, 1024, 2048, 4096 }; ins->fft_size = fft_sizes[fft_size]; diff --git a/servers/audio/effects/audio_effect_spectrum_analyzer.h b/servers/audio/effects/audio_effect_spectrum_analyzer.h index fc275446f0..3c5ae4a5e8 100644 --- a/servers/audio/effects/audio_effect_spectrum_analyzer.h +++ b/servers/audio/effects/audio_effect_spectrum_analyzer.h @@ -90,7 +90,7 @@ protected: static void _bind_methods(); public: - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; void set_buffer_length(float p_seconds); float get_buffer_length() const; void set_tap_back_pos(float p_seconds); diff --git a/servers/audio/effects/audio_effect_stereo_enhance.cpp b/servers/audio/effects/audio_effect_stereo_enhance.cpp index dfdf154aa4..3a016b06b8 100644 --- a/servers/audio/effects/audio_effect_stereo_enhance.cpp +++ b/servers/audio/effects/audio_effect_stereo_enhance.cpp @@ -74,9 +74,9 @@ AudioEffectStereoEnhanceInstance::~AudioEffectStereoEnhanceInstance() { memdelete_arr(delay_ringbuff); } -Ref<AudioEffectInstance> AudioEffectStereoEnhance::instance() { +Ref<AudioEffectInstance> AudioEffectStereoEnhance::instantiate() { Ref<AudioEffectStereoEnhanceInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectStereoEnhance>(this); diff --git a/servers/audio/effects/audio_effect_stereo_enhance.h b/servers/audio/effects/audio_effect_stereo_enhance.h index f99256470b..e0f9d79a94 100644 --- a/servers/audio/effects/audio_effect_stereo_enhance.h +++ b/servers/audio/effects/audio_effect_stereo_enhance.h @@ -68,7 +68,7 @@ protected: static void _bind_methods(); public: - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; void set_pan_pullout(float p_amount); float get_pan_pullout() const; diff --git a/servers/audio/effects/audio_stream_generator.cpp b/servers/audio/effects/audio_stream_generator.cpp index d1a05ccf2a..bced2997ce 100644 --- a/servers/audio/effects/audio_stream_generator.cpp +++ b/servers/audio/effects/audio_stream_generator.cpp @@ -48,7 +48,7 @@ float AudioStreamGenerator::get_buffer_length() const { Ref<AudioStreamPlayback> AudioStreamGenerator::instance_playback() { Ref<AudioStreamGeneratorPlayback> playback; - playback.instance(); + playback.instantiate(); playback->generator = this; int target_buffer_size = mix_rate * buffer_len; playback->buffer.resize(nearest_shift(target_buffer_size)); diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp index acfdfa783a..667087d1ec 100644 --- a/servers/audio_server.cpp +++ b/servers/audio_server.cpp @@ -794,7 +794,7 @@ void AudioServer::_update_bus_effects(int p_bus) { for (int i = 0; i < buses[p_bus]->channels.size(); i++) { buses.write[p_bus]->channels.write[i].effect_instances.resize(buses[p_bus]->effects.size()); for (int j = 0; j < buses[p_bus]->effects.size(); j++) { - Ref<AudioEffectInstance> fx = buses.write[p_bus]->effects.write[j].effect->instance(); + Ref<AudioEffectInstance> fx = buses.write[p_bus]->effects.write[j].effect->instantiate(); if (Object::cast_to<AudioEffectCompressorInstance>(*fx)) { Object::cast_to<AudioEffectCompressorInstance>(*fx)->set_current_channel(i); } @@ -813,7 +813,7 @@ void AudioServer::add_bus_effect(int p_bus, const Ref<AudioEffect> &p_effect, in Bus::Effect fx; fx.effect = p_effect; - //fx.instance=p_effect->instance(); + //fx.instance=p_effect->instantiate(); fx.enabled = true; #ifdef DEBUG_ENABLED fx.prof_time = 0; @@ -1188,7 +1188,7 @@ void AudioServer::set_bus_layout(const Ref<AudioBusLayout> &p_bus_layout) { Ref<AudioBusLayout> AudioServer::generate_bus_layout() const { Ref<AudioBusLayout> state; - state.instance(); + state.instantiate(); state->buses.resize(buses.size()); diff --git a/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp b/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp index 43a4058ab6..be1642998c 100644 --- a/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp @@ -1862,7 +1862,7 @@ void RendererSceneGIRD::SDFGI::render_region(RID p_render_buffers, int p_region, #if 0 Vector<uint8_t> data = RD::get_singleton()->texture_get_data(cascades[cascade].sdf, 0); Ref<Image> img; - img.instance(); + img.instantiate(); for (uint32_t i = 0; i < cascade_size; i++) { Vector<uint8_t> subarr = data.subarray(128 * 128 * i, 128 * 128 * (i + 1) - 1); img->create(cascade_size, cascade_size, false, Image::FORMAT_L8, subarr); @@ -1875,7 +1875,7 @@ void RendererSceneGIRD::SDFGI::render_region(RID p_render_buffers, int p_region, #if 0 Vector<uint8_t> data = RD::get_singleton()->texture_get_data(render_albedo, 0); Ref<Image> img; - img.instance(); + img.instantiate(); for (uint32_t i = 0; i < cascade_size; i++) { Vector<uint8_t> subarr = data.subarray(128 * 128 * i * 2, 128 * 128 * (i + 1) * 2 - 1); img->createcascade_size, cascade_size, false, Image::FORMAT_RGB565, subarr); diff --git a/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp b/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp index be98fb42c0..089651cbfb 100644 --- a/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp @@ -486,7 +486,7 @@ Ref<Image> RendererSceneRenderRD::environment_bake_panorama(RID p_env, bool p_ba color.b *= env->bg_energy; Ref<Image> ret; - ret.instance(); + ret.instantiate(); ret->create(p_size.width, p_size.height, false, Image::FORMAT_RGBAF); for (int i = 0; i < p_size.width; i++) { for (int j = 0; j < p_size.height; j++) { @@ -4174,7 +4174,7 @@ TypedArray<Image> RendererSceneRenderRD::bake_render_uv2(RID p_base, const Vecto { PackedByteArray data = RD::get_singleton()->texture_get_data(albedo_alpha_tex, 0); Ref<Image> img; - img.instance(); + img.instantiate(); img->create(p_image_size.width, p_image_size.height, false, Image::FORMAT_RGBA8, data); RD::get_singleton()->free(albedo_alpha_tex); ret.push_back(img); @@ -4183,7 +4183,7 @@ TypedArray<Image> RendererSceneRenderRD::bake_render_uv2(RID p_base, const Vecto { PackedByteArray data = RD::get_singleton()->texture_get_data(normal_tex, 0); Ref<Image> img; - img.instance(); + img.instantiate(); img->create(p_image_size.width, p_image_size.height, false, Image::FORMAT_RGBA8, data); RD::get_singleton()->free(normal_tex); ret.push_back(img); @@ -4192,7 +4192,7 @@ TypedArray<Image> RendererSceneRenderRD::bake_render_uv2(RID p_base, const Vecto { PackedByteArray data = RD::get_singleton()->texture_get_data(orm_tex, 0); Ref<Image> img; - img.instance(); + img.instantiate(); img->create(p_image_size.width, p_image_size.height, false, Image::FORMAT_RGBA8, data); RD::get_singleton()->free(orm_tex); ret.push_back(img); @@ -4201,7 +4201,7 @@ TypedArray<Image> RendererSceneRenderRD::bake_render_uv2(RID p_base, const Vecto { PackedByteArray data = RD::get_singleton()->texture_get_data(emission_tex, 0); Ref<Image> img; - img.instance(); + img.instantiate(); img->create(p_image_size.width, p_image_size.height, false, Image::FORMAT_RGBAH, data); RD::get_singleton()->free(emission_tex); ret.push_back(img); diff --git a/servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp b/servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp index 1aa01dd16e..2082ac9150 100644 --- a/servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp @@ -628,7 +628,7 @@ Ref<Image> RendererSceneSkyRD::Sky::bake_panorama(RendererStorageRD *p_storage, RD::get_singleton()->free(rad_tex); Ref<Image> img; - img.instance(); + img.instantiate(); img->create(p_size.width, p_size.height, false, Image::FORMAT_RGBAF, data); for (int i = 0; i < p_size.width; i++) { for (int j = 0; j < p_size.height; j++) { diff --git a/servers/rendering/renderer_rd/renderer_storage_rd.cpp b/servers/rendering/renderer_rd/renderer_storage_rd.cpp index 246b5f0e4c..b95647b8b7 100644 --- a/servers/rendering/renderer_rd/renderer_storage_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_storage_rd.cpp @@ -972,7 +972,7 @@ void RendererStorageRD::texture_2d_placeholder_initialize(RID p_texture) { //this could be better optimized to reuse an existing image , done this way //for now to get it working Ref<Image> image; - image.instance(); + image.instantiate(); image->create(4, 4, false, Image::FORMAT_RGBA8); for (int i = 0; i < 4; i++) { @@ -988,7 +988,7 @@ void RendererStorageRD::texture_2d_layered_placeholder_initialize(RID p_texture, //this could be better optimized to reuse an existing image , done this way //for now to get it working Ref<Image> image; - image.instance(); + image.instantiate(); image->create(4, 4, false, Image::FORMAT_RGBA8); for (int i = 0; i < 4; i++) { @@ -1014,7 +1014,7 @@ void RendererStorageRD::texture_3d_placeholder_initialize(RID p_texture) { //this could be better optimized to reuse an existing image , done this way //for now to get it working Ref<Image> image; - image.instance(); + image.instantiate(); image->create(4, 4, false, Image::FORMAT_RGBA8); for (int i = 0; i < 4; i++) { @@ -1044,7 +1044,7 @@ Ref<Image> RendererStorageRD::texture_2d_get(RID p_texture) const { Vector<uint8_t> data = RD::get_singleton()->texture_get_data(tex->rd_texture, 0); ERR_FAIL_COND_V(data.size() == 0, Ref<Image>()); Ref<Image> image; - image.instance(); + image.instantiate(); image->create(tex->width, tex->height, tex->mipmaps > 1, tex->validated_format, data); ERR_FAIL_COND_V(image->is_empty(), Ref<Image>()); if (tex->format != tex->validated_format) { @@ -1067,7 +1067,7 @@ Ref<Image> RendererStorageRD::texture_2d_layer_get(RID p_texture, int p_layer) c Vector<uint8_t> data = RD::get_singleton()->texture_get_data(tex->rd_texture, p_layer); ERR_FAIL_COND_V(data.size() == 0, Ref<Image>()); Ref<Image> image; - image.instance(); + image.instantiate(); image->create(tex->width, tex->height, tex->mipmaps > 1, tex->validated_format, data); ERR_FAIL_COND_V(image->is_empty(), Ref<Image>()); if (tex->format != tex->validated_format) { @@ -1095,7 +1095,7 @@ Vector<Ref<Image>> RendererStorageRD::texture_3d_get(RID p_texture) const { Vector<uint8_t> sub_region = all_data.subarray(bs.offset, bs.offset + bs.buffer_size - 1); Ref<Image> img; - img.instance(); + img.instantiate(); img->create(bs.size.width, bs.size.height, false, tex->validated_format, sub_region); ERR_FAIL_COND_V(img->is_empty(), Vector<Ref<Image>>()); if (tex->format != tex->validated_format) { diff --git a/servers/rendering/renderer_scene_occlusion_cull.cpp b/servers/rendering/renderer_scene_occlusion_cull.cpp index c491ccbe7a..54795f32a7 100644 --- a/servers/rendering/renderer_scene_occlusion_cull.cpp +++ b/servers/rendering/renderer_scene_occlusion_cull.cpp @@ -172,7 +172,7 @@ RID RendererSceneOcclusionCull::HZBuffer::get_debug_texture() { } if (debug_image.is_null()) { - debug_image.instance(); + debug_image.instantiate(); } unsigned char *ptrw = debug_data.ptrw(); diff --git a/servers/rendering/rendering_device.cpp b/servers/rendering/rendering_device.cpp index 056cec4c1f..ddf2ee9fe3 100644 --- a/servers/rendering/rendering_device.cpp +++ b/servers/rendering/rendering_device.cpp @@ -143,7 +143,7 @@ Ref<RDShaderBytecode> RenderingDevice::_shader_compile_from_source(const Ref<RDS ERR_FAIL_COND_V(p_source.is_null(), Ref<RDShaderBytecode>()); Ref<RDShaderBytecode> bytecode; - bytecode.instance(); + bytecode.instantiate(); for (int i = 0; i < RD::SHADER_STAGE_MAX; i++) { String error; diff --git a/servers/rendering/rendering_device_binds.cpp b/servers/rendering/rendering_device_binds.cpp index 2f11360364..2652edb1bc 100644 --- a/servers/rendering/rendering_device_binds.cpp +++ b/servers/rendering/rendering_device_binds.cpp @@ -156,7 +156,7 @@ Error RDShaderFile::parse_versions_from_text(const String &p_text, const String } Ref<RDShaderFile> shader_file; - shader_file.instance(); + shader_file.instantiate(); if (base_error == "") { if (stage_found[RD::SHADER_STAGE_COMPUTE] && stages_found > 1) { @@ -173,7 +173,7 @@ Error RDShaderFile::parse_versions_from_text(const String &p_text, const String for (Map<StringName, String>::Element *E = version_texts.front(); E; E = E->next()) { Ref<RDShaderBytecode> bytecode; - bytecode.instance(); + bytecode.instantiate(); for (int i = 0; i < RD::SHADER_STAGE_MAX; i++) { String code = stage_code[i]; diff --git a/servers/text_server.cpp b/servers/text_server.cpp index daed612b02..6f48148cab 100644 --- a/servers/text_server.cpp +++ b/servers/text_server.cpp @@ -466,16 +466,16 @@ void TextServer::initialize_hex_code_box_fonts() { Vector<uint8_t> hex_box_data; Ref<Image> image; - image.instance(); + image.instantiate(); Ref<ImageTexture> hex_code_image_tex[2]; hex_box_data.resize(tamsyn5x9_png_len); memcpy(hex_box_data.ptrw(), tamsyn5x9_png, tamsyn5x9_png_len); image->load_png_from_buffer(hex_box_data); - hex_code_image_tex[0].instance(); + hex_code_image_tex[0].instantiate(); hex_code_image_tex[0]->create_from_image(image); - hex_code_box_font_tex[0].instance(); + hex_code_box_font_tex[0].instantiate(); hex_code_box_font_tex[0]->set_diffuse_texture(hex_code_image_tex[0]); hex_code_box_font_tex[0]->set_texture_filter(CanvasItem::TEXTURE_FILTER_NEAREST); hex_box_data.clear(); @@ -483,9 +483,9 @@ void TextServer::initialize_hex_code_box_fonts() { hex_box_data.resize(tamsyn10x20_png_len); memcpy(hex_box_data.ptrw(), tamsyn10x20_png, tamsyn10x20_png_len); image->load_png_from_buffer(hex_box_data); - hex_code_image_tex[1].instance(); + hex_code_image_tex[1].instantiate(); hex_code_image_tex[1]->create_from_image(image); - hex_code_box_font_tex[1].instance(); + hex_code_box_font_tex[1].instantiate(); hex_code_box_font_tex[1]->set_diffuse_texture(hex_code_image_tex[1]); hex_code_box_font_tex[1]->set_texture_filter(CanvasItem::TEXTURE_FILTER_NEAREST); hex_box_data.clear(); diff --git a/thirdparty/enet/godot.cpp b/thirdparty/enet/godot.cpp index fd7968204b..f6a56f1f5d 100644 --- a/thirdparty/enet/godot.cpp +++ b/thirdparty/enet/godot.cpp @@ -164,7 +164,7 @@ public: verify = p_verify; for_hostname = p_for_hostname; cert = p_cert; - udp.instance(); + udp.instantiate(); dtls = Ref<PacketPeerDTLS>(PacketPeerDTLS::create()); if (p_base->bound) { uint16_t port; @@ -254,7 +254,7 @@ class ENetDTLSServer : public ENetGodotSocket { public: ENetDTLSServer(ENetUDP *p_base, Ref<CryptoKey> p_key, Ref<X509Certificate> p_cert) { - udp_server.instance(); + udp_server.instantiate(); if (p_base->bound) { uint16_t port; p_base->get_socket_address(&local_address, &port); |