summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorLightning_A <aaronjrecord@gmail.com>2021-06-17 16:03:09 -0600
committerLightning_A <aaronjrecord@gmail.com>2021-06-19 20:49:18 -0600
commite28fd07b2bbe78db0f286604a6eb469d8a0664be (patch)
treed10b935e7a77774960fefd93ac306db447cc2bfd /modules
parent60dcc4f39c0e6289dba691225c002cd6e77be6ba (diff)
Rename `instance()`->`instantiate()` when it's a verb
Diffstat (limited to 'modules')
-rw-r--r--modules/basis_universal/register_types.cpp2
-rw-r--r--modules/basis_universal/texture_basisu.cpp2
-rw-r--r--modules/bmp/image_loader_bmp.cpp2
-rw-r--r--modules/camera/camera_osx.mm6
-rw-r--r--modules/csg/csg_shape.cpp6
-rw-r--r--modules/dds/register_types.cpp2
-rw-r--r--modules/fbx/data/fbx_material.cpp8
-rw-r--r--modules/fbx/data/fbx_mesh_data.cpp6
-rw-r--r--modules/fbx/editor_scene_importer_fbx.cpp26
-rw-r--r--modules/fbx/register_types.cpp2
-rw-r--r--modules/fbx/tools/import_utils.h4
-rw-r--r--modules/gdnative/gdnative.cpp6
-rw-r--r--modules/gdnative/nativescript/api_generator.cpp2
-rw-r--r--modules/gdnative/nativescript/nativescript.cpp6
-rw-r--r--modules/gdnative/nativescript/nativescript.h2
-rw-r--r--modules/gdnative/nativescript/register_types.cpp4
-rw-r--r--modules/gdnative/pluginscript/pluginscript_script.cpp18
-rw-r--r--modules/gdnative/pluginscript/pluginscript_script.h2
-rw-r--r--modules/gdnative/register_types.cpp8
-rw-r--r--modules/gdnative/videodecoder/register_types.cpp2
-rw-r--r--modules/gdnative/videodecoder/video_stream_gdnative.cpp2
-rw-r--r--modules/gdnative/xr/xr_interface_gdnative.cpp4
-rw-r--r--modules/gdnavigation/navigation_mesh_generator.cpp8
-rw-r--r--modules/gdscript/doc_classes/@GDScript.xml2
-rw-r--r--modules/gdscript/editor/gdscript_highlighter.cpp2
-rw-r--r--modules/gdscript/gdscript.cpp16
-rw-r--r--modules/gdscript/gdscript.h8
-rw-r--r--modules/gdscript/gdscript_analyzer.cpp2
-rw-r--r--modules/gdscript/gdscript_cache.cpp4
-rw-r--r--modules/gdscript/gdscript_compiler.cpp2
-rw-r--r--modules/gdscript/gdscript_editor.cpp4
-rw-r--r--modules/gdscript/language_server/gdscript_language_protocol.cpp6
-rw-r--r--modules/gdscript/language_server/gdscript_workspace.cpp2
-rw-r--r--modules/gdscript/register_types.cpp10
-rw-r--r--modules/gdscript/tests/gdscript_test_runner.cpp8
-rw-r--r--modules/gdscript/tests/test_gdscript.cpp2
-rw-r--r--modules/gltf/editor_scene_exporter_gltf_plugin.cpp2
-rw-r--r--modules/gltf/editor_scene_importer_gltf.cpp12
-rw-r--r--modules/gltf/gltf_document.cpp106
-rw-r--r--modules/gltf/register_types.cpp2
-rw-r--r--modules/gridmap/grid_map.cpp4
-rw-r--r--modules/gridmap/grid_map_editor_plugin.cpp10
-rw-r--r--modules/jpg/image_loader_jpegd.cpp2
-rw-r--r--modules/lightmapper_rd/lightmapper_rd.cpp34
-rw-r--r--modules/mbedtls/crypto_mbedtls.cpp4
-rw-r--r--modules/mbedtls/dtls_server_mbedtls.cpp4
-rw-r--r--modules/mbedtls/packet_peer_mbed_dtls.cpp2
-rw-r--r--modules/mbedtls/stream_peer_mbedtls.cpp2
-rw-r--r--modules/minimp3/audio_stream_mp3.cpp2
-rw-r--r--modules/minimp3/register_types.cpp2
-rw-r--r--modules/minimp3/resource_importer_mp3.cpp2
-rw-r--r--modules/mobile_vr/register_types.cpp2
-rw-r--r--modules/mono/csharp_script.cpp10
-rw-r--r--modules/mono/csharp_script.h2
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Ides/GodotIdeManager.cs4
-rw-r--r--modules/mono/glue/base_object_glue.cpp4
-rw-r--r--modules/mono/mono_gd/gd_mono.cpp4
-rw-r--r--modules/mono/mono_gd/gd_mono_utils.cpp2
-rw-r--r--modules/mono/register_types.cpp4
-rw-r--r--modules/pvr/image_compress_pvrtc.cpp2
-rw-r--r--modules/pvr/register_types.cpp2
-rw-r--r--modules/stb_vorbis/audio_stream_ogg_vorbis.cpp2
-rw-r--r--modules/stb_vorbis/register_types.cpp2
-rw-r--r--modules/stb_vorbis/resource_importer_ogg_vorbis.cpp2
-rw-r--r--modules/text_server_adv/dynamic_font_adv.cpp2
-rw-r--r--modules/text_server_fb/dynamic_font_fb.cpp2
-rw-r--r--modules/tga/image_loader_tga.cpp2
-rw-r--r--modules/theora/register_types.cpp2
-rw-r--r--modules/theora/video_stream_theora.cpp2
-rw-r--r--modules/upnp/upnp.cpp2
-rw-r--r--modules/visual_script/visual_script.cpp6
-rw-r--r--modules/visual_script/visual_script.h6
-rw-r--r--modules/visual_script/visual_script_builtin_funcs.cpp2
-rw-r--r--modules/visual_script/visual_script_builtin_funcs.h2
-rw-r--r--modules/visual_script/visual_script_editor.cpp60
-rw-r--r--modules/visual_script/visual_script_expression.cpp2
-rw-r--r--modules/visual_script/visual_script_expression.h2
-rw-r--r--modules/visual_script/visual_script_flow_control.cpp16
-rw-r--r--modules/visual_script/visual_script_flow_control.h14
-rw-r--r--modules/visual_script/visual_script_func_nodes.cpp16
-rw-r--r--modules/visual_script/visual_script_func_nodes.h8
-rw-r--r--modules/visual_script/visual_script_nodes.cpp60
-rw-r--r--modules/visual_script/visual_script_nodes.h54
-rw-r--r--modules/visual_script/visual_script_yield_nodes.cpp12
-rw-r--r--modules/visual_script/visual_script_yield_nodes.h4
-rw-r--r--modules/webm/register_types.cpp2
-rw-r--r--modules/webm/video_stream_webm.cpp2
-rw-r--r--modules/webp/image_loader_webp.cpp2
-rw-r--r--modules/websocket/wsl_client.cpp4
-rw-r--r--modules/websocket/wsl_server.cpp2
-rw-r--r--modules/webxr/register_types.cpp2
-rw-r--r--modules/webxr/webxr_interface_js.cpp2
92 files changed, 361 insertions, 361 deletions
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) {