summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/area.cpp32
-rw-r--r--scene/3d/audio_stream_player_3d.cpp4
-rw-r--r--scene/3d/collision_shape.cpp11
-rw-r--r--scene/3d/cpu_particles.cpp189
-rw-r--r--scene/3d/cpu_particles.h2
-rw-r--r--scene/3d/mesh_instance.cpp8
-rw-r--r--scene/3d/navigation.h2
-rw-r--r--scene/3d/navigation_region.cpp (renamed from scene/3d/navigation_mesh_instance.cpp)44
-rw-r--r--scene/3d/navigation_region.h (renamed from scene/3d/navigation_mesh_instance.h)16
-rw-r--r--scene/3d/path.cpp5
-rw-r--r--scene/3d/physics_body.cpp33
-rw-r--r--scene/3d/skeleton.cpp3
-rw-r--r--scene/3d/soft_body.cpp8
-rw-r--r--scene/3d/sprite_3d.cpp20
-rw-r--r--scene/3d/sprite_3d.h2
-rw-r--r--scene/3d/visibility_notifier.cpp5
-rw-r--r--scene/3d/visual_instance.cpp2
17 files changed, 168 insertions, 218 deletions
diff --git a/scene/3d/area.cpp b/scene/3d/area.cpp
index 265b42ab5e..321926d841 100644
--- a/scene/3d/area.cpp
+++ b/scene/3d/area.cpp
@@ -29,6 +29,7 @@
/*************************************************************************/
#include "area.h"
+
#include "scene/scene_string_names.h"
#include "servers/audio_server.h"
#include "servers/physics_server.h"
@@ -170,8 +171,8 @@ void Area::_body_inout(int p_status, const RID &p_body, ObjectID p_instance, int
E->get().rc = 0;
E->get().in_tree = node && node->is_inside_tree();
if (node) {
- node->connect_compat(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree, make_binds(objid));
- node->connect_compat(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree, make_binds(objid));
+ node->connect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &Area::_body_enter_tree), make_binds(objid));
+ node->connect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Area::_body_exit_tree), make_binds(objid));
if (E->get().in_tree) {
emit_signal(SceneStringNames::get_singleton()->body_entered, node);
}
@@ -197,8 +198,8 @@ void Area::_body_inout(int p_status, const RID &p_body, ObjectID p_instance, int
if (E->get().rc == 0) {
if (node) {
- node->disconnect_compat(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree);
- node->disconnect_compat(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree);
+ node->disconnect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &Area::_body_enter_tree));
+ node->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Area::_body_exit_tree));
if (E->get().in_tree)
emit_signal(SceneStringNames::get_singleton()->body_exited, obj);
}
@@ -244,8 +245,8 @@ void Area::_clear_monitoring() {
emit_signal(SceneStringNames::get_singleton()->body_exited, node);
- node->disconnect_compat(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree);
- node->disconnect_compat(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree);
+ node->disconnect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &Area::_body_enter_tree));
+ node->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Area::_body_exit_tree));
}
}
@@ -274,8 +275,8 @@ void Area::_clear_monitoring() {
emit_signal(SceneStringNames::get_singleton()->area_exited, obj);
- node->disconnect_compat(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_area_enter_tree);
- node->disconnect_compat(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_area_exit_tree);
+ node->disconnect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &Area::_area_enter_tree));
+ node->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Area::_area_exit_tree));
}
}
}
@@ -363,8 +364,8 @@ void Area::_area_inout(int p_status, const RID &p_area, ObjectID p_instance, int
E->get().rc = 0;
E->get().in_tree = node && node->is_inside_tree();
if (node) {
- node->connect_compat(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_area_enter_tree, make_binds(objid));
- node->connect_compat(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_area_exit_tree, make_binds(objid));
+ node->connect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &Area::_area_enter_tree), make_binds(objid));
+ node->connect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Area::_area_exit_tree), make_binds(objid));
if (E->get().in_tree) {
emit_signal(SceneStringNames::get_singleton()->area_entered, node);
}
@@ -390,8 +391,8 @@ void Area::_area_inout(int p_status, const RID &p_area, ObjectID p_instance, int
if (E->get().rc == 0) {
if (node) {
- node->disconnect_compat(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_area_enter_tree);
- node->disconnect_compat(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_area_exit_tree);
+ node->disconnect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &Area::_area_enter_tree));
+ node->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &Area::_area_exit_tree));
if (E->get().in_tree) {
emit_signal(SceneStringNames::get_singleton()->area_exited, obj);
}
@@ -618,13 +619,6 @@ void Area::_validate_property(PropertyInfo &property) const {
}
void Area::_bind_methods() {
-
- ClassDB::bind_method(D_METHOD("_body_enter_tree", "id"), &Area::_body_enter_tree);
- ClassDB::bind_method(D_METHOD("_body_exit_tree", "id"), &Area::_body_exit_tree);
-
- ClassDB::bind_method(D_METHOD("_area_enter_tree", "id"), &Area::_area_enter_tree);
- ClassDB::bind_method(D_METHOD("_area_exit_tree", "id"), &Area::_area_exit_tree);
-
ClassDB::bind_method(D_METHOD("set_space_override_mode", "enable"), &Area::set_space_override_mode);
ClassDB::bind_method(D_METHOD("get_space_override_mode"), &Area::get_space_override_mode);
diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp
index 461ac1748b..855d254bd6 100644
--- a/scene/3d/audio_stream_player_3d.cpp
+++ b/scene/3d/audio_stream_player_3d.cpp
@@ -1008,8 +1008,6 @@ void AudioStreamPlayer3D::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_stream_playback"), &AudioStreamPlayer3D::get_stream_playback);
- ClassDB::bind_method(D_METHOD("_bus_layout_changed"), &AudioStreamPlayer3D::_bus_layout_changed);
-
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE, "AudioStream"), "set_stream", "get_stream");
ADD_PROPERTY(PropertyInfo(Variant::INT, "attenuation_model", PROPERTY_HINT_ENUM, "Inverse,InverseSquare,Log,Disabled"), "set_attenuation_model", "get_attenuation_model");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "unit_db", PROPERTY_HINT_RANGE, "-80,80"), "set_unit_db", "get_unit_db");
@@ -1076,7 +1074,7 @@ AudioStreamPlayer3D::AudioStreamPlayer3D() {
stream_paused_fade_out = false;
velocity_tracker.instance();
- AudioServer::get_singleton()->connect_compat("bus_layout_changed", this, "_bus_layout_changed");
+ AudioServer::get_singleton()->connect("bus_layout_changed", callable_mp(this, &AudioStreamPlayer3D::_bus_layout_changed));
set_disable_scale(true);
}
AudioStreamPlayer3D::~AudioStreamPlayer3D() {
diff --git a/scene/3d/collision_shape.cpp b/scene/3d/collision_shape.cpp
index d0d775d557..35e4a61cd6 100644
--- a/scene/3d/collision_shape.cpp
+++ b/scene/3d/collision_shape.cpp
@@ -33,9 +33,9 @@
#include "scene/resources/capsule_shape.h"
#include "scene/resources/concave_polygon_shape.h"
#include "scene/resources/convex_polygon_shape.h"
-#include "scene/resources/plane_shape.h"
#include "scene/resources/ray_shape.h"
#include "scene/resources/sphere_shape.h"
+#include "scene/resources/world_margin_shape.h"
#include "servers/visual_server.h"
//TODO: Implement CylinderShape and HeightMapShape?
#include "core/math/quick_hull.h"
@@ -123,10 +123,6 @@ String CollisionShape::get_configuration_warning() const {
return TTR("A shape must be provided for CollisionShape to function. Please create a shape resource for it.");
}
- if (shape->is_class("PlaneShape")) {
- return TTR("Plane shapes don't work well and will be removed in future versions. Please don't use them.");
- }
-
return String();
}
@@ -141,7 +137,6 @@ void CollisionShape::_bind_methods() {
ClassDB::bind_method(D_METHOD("make_convex_from_brothers"), &CollisionShape::make_convex_from_brothers);
ClassDB::set_method_flags("CollisionShape", "make_convex_from_brothers", METHOD_FLAGS_DEFAULT | METHOD_FLAG_EDITOR);
- ClassDB::bind_method(D_METHOD("_shape_changed"), &CollisionShape::_shape_changed);
ClassDB::bind_method(D_METHOD("_update_debug_shape"), &CollisionShape::_update_debug_shape);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "shape", PROPERTY_HINT_RESOURCE_TYPE, "Shape"), "set_shape", "get_shape");
@@ -152,12 +147,12 @@ void CollisionShape::set_shape(const Ref<Shape> &p_shape) {
if (!shape.is_null()) {
shape->unregister_owner(this);
- shape->disconnect_compat("changed", this, "_shape_changed");
+ shape->disconnect("changed", callable_mp(this, &CollisionShape::_shape_changed));
}
shape = p_shape;
if (!shape.is_null()) {
shape->register_owner(this);
- shape->connect_compat("changed", this, "_shape_changed");
+ shape->connect("changed", callable_mp(this, &CollisionShape::_shape_changed));
}
update_gizmo();
if (parent) {
diff --git a/scene/3d/cpu_particles.cpp b/scene/3d/cpu_particles.cpp
index cddbe4bbbb..bde578d0af 100644
--- a/scene/3d/cpu_particles.cpp
+++ b/scene/3d/cpu_particles.cpp
@@ -1017,140 +1017,125 @@ void CPUParticles::_particles_process(float p_delta) {
}
void CPUParticles::_update_particle_data_buffer() {
-#ifndef NO_THREADS
- update_mutex->lock();
-#endif
+ MutexLock lock(update_mutex);
- {
+ int pc = particles.size();
- int pc = particles.size();
+ int *ow;
+ int *order = NULL;
- int *ow;
- int *order = NULL;
+ float *w = particle_data.ptrw();
+ const Particle *r = particles.ptr();
+ float *ptr = w;
- float *w = particle_data.ptrw();
- const Particle *r = particles.ptr();
- float *ptr = w;
+ if (draw_order != DRAW_ORDER_INDEX) {
+ ow = particle_order.ptrw();
+ order = ow;
- if (draw_order != DRAW_ORDER_INDEX) {
- ow = particle_order.ptrw();
- order = ow;
+ for (int i = 0; i < pc; i++) {
+ order[i] = i;
+ }
+ if (draw_order == DRAW_ORDER_LIFETIME) {
+ SortArray<int, SortLifetime> sorter;
+ sorter.compare.particles = r;
+ sorter.sort(order, pc);
+ } else if (draw_order == DRAW_ORDER_VIEW_DEPTH) {
+ Camera *c = get_viewport()->get_camera();
+ if (c) {
+ Vector3 dir = c->get_global_transform().basis.get_axis(2); //far away to close
+
+ if (local_coords) {
+
+ // will look different from Particles in editor as this is based on the camera in the scenetree
+ // and not the editor camera
+ dir = inv_emission_transform.xform(dir).normalized();
+ } else {
+ dir = dir.normalized();
+ }
- for (int i = 0; i < pc; i++) {
- order[i] = i;
- }
- if (draw_order == DRAW_ORDER_LIFETIME) {
- SortArray<int, SortLifetime> sorter;
+ SortArray<int, SortAxis> sorter;
sorter.compare.particles = r;
+ sorter.compare.axis = dir;
sorter.sort(order, pc);
- } else if (draw_order == DRAW_ORDER_VIEW_DEPTH) {
- Camera *c = get_viewport()->get_camera();
- if (c) {
- Vector3 dir = c->get_global_transform().basis.get_axis(2); //far away to close
-
- if (local_coords) {
-
- // will look different from Particles in editor as this is based on the camera in the scenetree
- // and not the editor camera
- dir = inv_emission_transform.xform(dir).normalized();
- } else {
- dir = dir.normalized();
- }
-
- SortArray<int, SortAxis> sorter;
- sorter.compare.particles = r;
- sorter.compare.axis = dir;
- sorter.sort(order, pc);
- }
}
}
+ }
- for (int i = 0; i < pc; i++) {
-
- int idx = order ? order[i] : i;
+ for (int i = 0; i < pc; i++) {
- Transform t = r[idx].transform;
+ int idx = order ? order[i] : i;
- if (!local_coords) {
- t = inv_emission_transform * t;
- }
+ Transform t = r[idx].transform;
- if (r[idx].active) {
- ptr[0] = t.basis.elements[0][0];
- ptr[1] = t.basis.elements[0][1];
- ptr[2] = t.basis.elements[0][2];
- ptr[3] = t.origin.x;
- ptr[4] = t.basis.elements[1][0];
- ptr[5] = t.basis.elements[1][1];
- ptr[6] = t.basis.elements[1][2];
- ptr[7] = t.origin.y;
- ptr[8] = t.basis.elements[2][0];
- ptr[9] = t.basis.elements[2][1];
- ptr[10] = t.basis.elements[2][2];
- ptr[11] = t.origin.z;
- } else {
- zeromem(ptr, sizeof(float) * 12);
- }
+ if (!local_coords) {
+ t = inv_emission_transform * t;
+ }
- Color c = r[idx].color;
+ if (r[idx].active) {
+ ptr[0] = t.basis.elements[0][0];
+ ptr[1] = t.basis.elements[0][1];
+ ptr[2] = t.basis.elements[0][2];
+ ptr[3] = t.origin.x;
+ ptr[4] = t.basis.elements[1][0];
+ ptr[5] = t.basis.elements[1][1];
+ ptr[6] = t.basis.elements[1][2];
+ ptr[7] = t.origin.y;
+ ptr[8] = t.basis.elements[2][0];
+ ptr[9] = t.basis.elements[2][1];
+ ptr[10] = t.basis.elements[2][2];
+ ptr[11] = t.origin.z;
+ } else {
+ zeromem(ptr, sizeof(float) * 12);
+ }
- ptr[12] = c.r;
- ptr[13] = c.g;
- ptr[14] = c.b;
- ptr[15] = c.a;
+ Color c = r[idx].color;
- ptr[16] = r[idx].custom[0];
- ptr[17] = r[idx].custom[1];
- ptr[18] = r[idx].custom[2];
- ptr[19] = r[idx].custom[3];
+ ptr[12] = c.r;
+ ptr[13] = c.g;
+ ptr[14] = c.b;
+ ptr[15] = c.a;
- ptr += 20;
- }
+ ptr[16] = r[idx].custom[0];
+ ptr[17] = r[idx].custom[1];
+ ptr[18] = r[idx].custom[2];
+ ptr[19] = r[idx].custom[3];
- can_update = true;
+ ptr += 20;
}
-#ifndef NO_THREADS
- update_mutex->unlock();
-#endif
+ can_update = true;
}
void CPUParticles::_set_redraw(bool p_redraw) {
if (redraw == p_redraw)
return;
redraw = p_redraw;
-#ifndef NO_THREADS
- update_mutex->lock();
-#endif
- if (redraw) {
- VS::get_singleton()->connect_compat("frame_pre_draw", this, "_update_render_thread");
- VS::get_singleton()->instance_geometry_set_flag(get_instance(), VS::INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE, true);
- VS::get_singleton()->multimesh_set_visible_instances(multimesh, -1);
- } else {
- if (VS::get_singleton()->is_connected_compat("frame_pre_draw", this, "_update_render_thread")) {
- VS::get_singleton()->disconnect_compat("frame_pre_draw", this, "_update_render_thread");
+
+ {
+ MutexLock lock(update_mutex);
+
+ if (redraw) {
+ VS::get_singleton()->connect("frame_pre_draw", callable_mp(this, &CPUParticles::_update_render_thread));
+ VS::get_singleton()->instance_geometry_set_flag(get_instance(), VS::INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE, true);
+ VS::get_singleton()->multimesh_set_visible_instances(multimesh, -1);
+ } else {
+ if (VS::get_singleton()->is_connected("frame_pre_draw", callable_mp(this, &CPUParticles::_update_render_thread))) {
+ VS::get_singleton()->disconnect("frame_pre_draw", callable_mp(this, &CPUParticles::_update_render_thread));
+ }
+ VS::get_singleton()->instance_geometry_set_flag(get_instance(), VS::INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE, false);
+ VS::get_singleton()->multimesh_set_visible_instances(multimesh, 0);
}
- VS::get_singleton()->instance_geometry_set_flag(get_instance(), VS::INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE, false);
- VS::get_singleton()->multimesh_set_visible_instances(multimesh, 0);
}
-#ifndef NO_THREADS
- update_mutex->unlock();
-#endif
}
void CPUParticles::_update_render_thread() {
-#ifndef NO_THREADS
- update_mutex->lock();
-#endif
+ MutexLock lock(update_mutex);
+
if (can_update) {
VS::get_singleton()->multimesh_set_buffer(multimesh, particle_data);
can_update = false; //wait for next time
}
-
-#ifndef NO_THREADS
- update_mutex->unlock();
-#endif
}
void CPUParticles::_notification(int p_what) {
@@ -1397,8 +1382,6 @@ void CPUParticles::_bind_methods() {
ClassDB::bind_method(D_METHOD("convert_from_particles", "particles"), &CPUParticles::convert_from_particles);
- ClassDB::bind_method(D_METHOD("_update_render_thread"), &CPUParticles::_update_render_thread);
-
ADD_GROUP("Emission Shape", "emission_");
ADD_PROPERTY(PropertyInfo(Variant::INT, "emission_shape", PROPERTY_HINT_ENUM, "Point,Sphere,Box,Points,Directed Points"), "set_emission_shape", "get_emission_shape");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "emission_sphere_radius", PROPERTY_HINT_RANGE, "0.01,128,0.01"), "set_emission_sphere_radius", "get_emission_sphere_radius");
@@ -1556,16 +1539,8 @@ CPUParticles::CPUParticles() {
can_update = false;
set_color(Color(1, 1, 1, 1));
-
-#ifndef NO_THREADS
- update_mutex = Mutex::create();
-#endif
}
CPUParticles::~CPUParticles() {
VS::get_singleton()->free(multimesh);
-
-#ifndef NO_THREADS
- memdelete(update_mutex);
-#endif
}
diff --git a/scene/3d/cpu_particles.h b/scene/3d/cpu_particles.h
index 1a5537e4f2..231e1f1ad9 100644
--- a/scene/3d/cpu_particles.h
+++ b/scene/3d/cpu_particles.h
@@ -178,7 +178,7 @@ private:
void _particles_process(float p_delta);
void _update_particle_data_buffer();
- Mutex *update_mutex;
+ Mutex update_mutex;
void _update_render_thread();
diff --git a/scene/3d/mesh_instance.cpp b/scene/3d/mesh_instance.cpp
index 06e1202a24..4ca139ebbc 100644
--- a/scene/3d/mesh_instance.cpp
+++ b/scene/3d/mesh_instance.cpp
@@ -34,7 +34,6 @@
#include "core/core_string_names.h"
#include "physics_body.h"
#include "scene/resources/material.h"
-#include "scene/scene_string_names.h"
#include "skeleton.h"
bool MeshInstance::_set(const StringName &p_name, const Variant &p_value) {
@@ -101,7 +100,7 @@ void MeshInstance::_get_property_list(List<PropertyInfo> *p_list) const {
if (mesh.is_valid()) {
for (int i = 0; i < mesh->get_surface_count(); i++) {
- p_list->push_back(PropertyInfo(Variant::OBJECT, "material/" + itos(i), PROPERTY_HINT_RESOURCE_TYPE, "ShaderMaterial,StandardMaterial3D"));
+ p_list->push_back(PropertyInfo(Variant::OBJECT, "material/" + itos(i), PROPERTY_HINT_RESOURCE_TYPE, "ShaderMaterial,StandardMaterial3D", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_DEFERRED_SET_RESOURCE));
}
}
}
@@ -112,7 +111,7 @@ void MeshInstance::set_mesh(const Ref<Mesh> &p_mesh) {
return;
if (mesh.is_valid()) {
- mesh->disconnect_compat(CoreStringNames::get_singleton()->changed, this, SceneStringNames::get_singleton()->_mesh_changed);
+ mesh->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &MeshInstance::_mesh_changed));
materials.clear();
}
@@ -129,7 +128,7 @@ void MeshInstance::set_mesh(const Ref<Mesh> &p_mesh) {
blend_shape_tracks["blend_shapes/" + String(mesh->get_blend_shape_name(i))] = mt;
}
- mesh->connect_compat(CoreStringNames::get_singleton()->changed, this, SceneStringNames::get_singleton()->_mesh_changed);
+ mesh->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &MeshInstance::_mesh_changed));
materials.resize(mesh->get_surface_count());
set_base(mesh->get_rid());
@@ -403,7 +402,6 @@ void MeshInstance::_bind_methods() {
ClassDB::set_method_flags("MeshInstance", "create_trimesh_collision", METHOD_FLAGS_DEFAULT);
ClassDB::bind_method(D_METHOD("create_convex_collision"), &MeshInstance::create_convex_collision);
ClassDB::set_method_flags("MeshInstance", "create_convex_collision", METHOD_FLAGS_DEFAULT);
- ClassDB::bind_method(D_METHOD("_mesh_changed"), &MeshInstance::_mesh_changed);
ClassDB::bind_method(D_METHOD("create_debug_tangents"), &MeshInstance::create_debug_tangents);
ClassDB::set_method_flags("MeshInstance", "create_debug_tangents", METHOD_FLAGS_DEFAULT | METHOD_FLAG_EDITOR);
diff --git a/scene/3d/navigation.h b/scene/3d/navigation.h
index 85887651ff..08f306611f 100644
--- a/scene/3d/navigation.h
+++ b/scene/3d/navigation.h
@@ -31,7 +31,7 @@
#ifndef NAVIGATION_H
#define NAVIGATION_H
-#include "scene/3d/navigation_mesh_instance.h"
+#include "scene/3d/navigation_region.h"
#include "scene/3d/spatial.h"
class Navigation : public Spatial {
diff --git a/scene/3d/navigation_mesh_instance.cpp b/scene/3d/navigation_region.cpp
index 8f8574ba2d..d96d095797 100644
--- a/scene/3d/navigation_mesh_instance.cpp
+++ b/scene/3d/navigation_region.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* navigation_mesh_instance.cpp */
+/* navigation_region.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,13 +28,13 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "navigation_mesh_instance.h"
+#include "navigation_region.h"
#include "core/os/thread.h"
#include "mesh_instance.h"
#include "navigation.h"
#include "servers/navigation_server.h"
-void NavigationMeshInstance::set_enabled(bool p_enabled) {
+void NavigationRegion::set_enabled(bool p_enabled) {
if (enabled == p_enabled)
return;
@@ -66,14 +66,14 @@ void NavigationMeshInstance::set_enabled(bool p_enabled) {
update_gizmo();
}
-bool NavigationMeshInstance::is_enabled() const {
+bool NavigationRegion::is_enabled() const {
return enabled;
}
/////////////////////////////
-void NavigationMeshInstance::_notification(int p_what) {
+void NavigationRegion::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE: {
@@ -129,7 +129,7 @@ void NavigationMeshInstance::_notification(int p_what) {
}
}
-void NavigationMeshInstance::set_navigation_mesh(const Ref<NavigationMesh> &p_navmesh) {
+void NavigationRegion::set_navigation_mesh(const Ref<NavigationMesh> &p_navmesh) {
if (p_navmesh == navmesh)
return;
@@ -156,13 +156,13 @@ void NavigationMeshInstance::set_navigation_mesh(const Ref<NavigationMesh> &p_na
update_configuration_warning();
}
-Ref<NavigationMesh> NavigationMeshInstance::get_navigation_mesh() const {
+Ref<NavigationMesh> NavigationRegion::get_navigation_mesh() const {
return navmesh;
}
struct BakeThreadsArgs {
- NavigationMeshInstance *nav_mesh_instance;
+ NavigationRegion *nav_mesh_instance;
};
void _bake_navigation_mesh(void *p_user_data) {
@@ -182,7 +182,7 @@ void _bake_navigation_mesh(void *p_user_data) {
}
}
-void NavigationMeshInstance::bake_navigation_mesh() {
+void NavigationRegion::bake_navigation_mesh() {
ERR_FAIL_COND(bake_thread != NULL);
BakeThreadsArgs *args = memnew(BakeThreadsArgs);
@@ -192,12 +192,12 @@ void NavigationMeshInstance::bake_navigation_mesh() {
ERR_FAIL_COND(bake_thread == NULL);
}
-void NavigationMeshInstance::_bake_finished(Ref<NavigationMesh> p_nav_mesh) {
+void NavigationRegion::_bake_finished(Ref<NavigationMesh> p_nav_mesh) {
set_navigation_mesh(p_nav_mesh);
bake_thread = NULL;
}
-String NavigationMeshInstance::get_configuration_warning() const {
+String NavigationRegion::get_configuration_warning() const {
if (!is_visible_in_tree() || !is_inside_tree())
return String();
@@ -214,19 +214,19 @@ String NavigationMeshInstance::get_configuration_warning() const {
c = Object::cast_to<Spatial>(c->get_parent());
}
- return TTR("NavigationMeshInstance must be a child or grandchild to a Navigation node. It only provides navigation data.");
+ return TTR("NavigationRegion must be a child or grandchild to a Navigation node. It only provides navigation data.");
}
-void NavigationMeshInstance::_bind_methods() {
+void NavigationRegion::_bind_methods() {
- ClassDB::bind_method(D_METHOD("set_navigation_mesh", "navmesh"), &NavigationMeshInstance::set_navigation_mesh);
- ClassDB::bind_method(D_METHOD("get_navigation_mesh"), &NavigationMeshInstance::get_navigation_mesh);
+ ClassDB::bind_method(D_METHOD("set_navigation_mesh", "navmesh"), &NavigationRegion::set_navigation_mesh);
+ ClassDB::bind_method(D_METHOD("get_navigation_mesh"), &NavigationRegion::get_navigation_mesh);
- ClassDB::bind_method(D_METHOD("set_enabled", "enabled"), &NavigationMeshInstance::set_enabled);
- ClassDB::bind_method(D_METHOD("is_enabled"), &NavigationMeshInstance::is_enabled);
+ ClassDB::bind_method(D_METHOD("set_enabled", "enabled"), &NavigationRegion::set_enabled);
+ ClassDB::bind_method(D_METHOD("is_enabled"), &NavigationRegion::is_enabled);
- ClassDB::bind_method(D_METHOD("bake_navigation_mesh"), &NavigationMeshInstance::bake_navigation_mesh);
- ClassDB::bind_method(D_METHOD("_bake_finished", "nav_mesh"), &NavigationMeshInstance::_bake_finished);
+ ClassDB::bind_method(D_METHOD("bake_navigation_mesh"), &NavigationRegion::bake_navigation_mesh);
+ ClassDB::bind_method(D_METHOD("_bake_finished", "nav_mesh"), &NavigationRegion::_bake_finished);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "navmesh", PROPERTY_HINT_RESOURCE_TYPE, "NavigationMesh"), "set_navigation_mesh", "get_navigation_mesh");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "enabled"), "set_enabled", "is_enabled");
@@ -235,12 +235,12 @@ void NavigationMeshInstance::_bind_methods() {
ADD_SIGNAL(MethodInfo("bake_finished"));
}
-void NavigationMeshInstance::_changed_callback(Object *p_changed, const char *p_prop) {
+void NavigationRegion::_changed_callback(Object *p_changed, const char *p_prop) {
update_gizmo();
update_configuration_warning();
}
-NavigationMeshInstance::NavigationMeshInstance() {
+NavigationRegion::NavigationRegion() {
enabled = true;
set_notify_transform(true);
@@ -251,7 +251,7 @@ NavigationMeshInstance::NavigationMeshInstance() {
bake_thread = NULL;
}
-NavigationMeshInstance::~NavigationMeshInstance() {
+NavigationRegion::~NavigationRegion() {
if (navmesh.is_valid())
navmesh->remove_change_receptor(this);
NavigationServer::get_singleton()->free(region);
diff --git a/scene/3d/navigation_mesh_instance.h b/scene/3d/navigation_region.h
index 1135bf47d2..f215e92c97 100644
--- a/scene/3d/navigation_mesh_instance.h
+++ b/scene/3d/navigation_region.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* navigation_mesh_instance.h */
+/* navigation_region.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,8 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifndef NAVIGATION_MESH_INSTANCE_H
-#define NAVIGATION_MESH_INSTANCE_H
+#ifndef NAVIGATION_REGION_H
+#define NAVIGATION_REGION_H
#include "scene/3d/spatial.h"
#include "scene/resources/mesh.h"
@@ -37,9 +37,9 @@
class Navigation;
-class NavigationMeshInstance : public Spatial {
+class NavigationRegion : public Spatial {
- GDCLASS(NavigationMeshInstance, Spatial);
+ GDCLASS(NavigationRegion, Spatial);
bool enabled;
RID region;
@@ -68,8 +68,8 @@ public:
String get_configuration_warning() const;
- NavigationMeshInstance();
- ~NavigationMeshInstance();
+ NavigationRegion();
+ ~NavigationRegion();
};
-#endif // NAVIGATION_MESH_INSTANCE_H
+#endif // NAVIGATION_REGION_H
diff --git a/scene/3d/path.cpp b/scene/3d/path.cpp
index 0cdcbd9a1f..f93485d79f 100644
--- a/scene/3d/path.cpp
+++ b/scene/3d/path.cpp
@@ -59,13 +59,13 @@ void Path::_curve_changed() {
void Path::set_curve(const Ref<Curve3D> &p_curve) {
if (curve.is_valid()) {
- curve->disconnect_compat("changed", this, "_curve_changed");
+ curve->disconnect("changed", callable_mp(this, &Path::_curve_changed));
}
curve = p_curve;
if (curve.is_valid()) {
- curve->connect_compat("changed", this, "_curve_changed");
+ curve->connect("changed", callable_mp(this, &Path::_curve_changed));
}
_curve_changed();
}
@@ -79,7 +79,6 @@ void Path::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_curve", "curve"), &Path::set_curve);
ClassDB::bind_method(D_METHOD("get_curve"), &Path::get_curve);
- ClassDB::bind_method(D_METHOD("_curve_changed"), &Path::_curve_changed);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve3D"), "set_curve", "get_curve");
diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp
index f483787e49..eba45a5604 100644
--- a/scene/3d/physics_body.cpp
+++ b/scene/3d/physics_body.cpp
@@ -180,14 +180,15 @@ PhysicsBody::PhysicsBody(PhysicsServer::BodyMode p_mode) :
void StaticBody::set_physics_material_override(const Ref<PhysicsMaterial> &p_physics_material_override) {
if (physics_material_override.is_valid()) {
- if (physics_material_override->is_connected_compat(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics"))
- physics_material_override->disconnect_compat(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics");
+ if (physics_material_override->is_connected(CoreStringNames::get_singleton()->changed, callable_mp(this, &StaticBody::_reload_physics_characteristics))) {
+ physics_material_override->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &StaticBody::_reload_physics_characteristics));
+ }
}
physics_material_override = p_physics_material_override;
if (physics_material_override.is_valid()) {
- physics_material_override->connect_compat(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics");
+ physics_material_override->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &StaticBody::_reload_physics_characteristics));
}
_reload_physics_characteristics();
}
@@ -227,8 +228,6 @@ void StaticBody::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_physics_material_override", "physics_material_override"), &StaticBody::set_physics_material_override);
ClassDB::bind_method(D_METHOD("get_physics_material_override"), &StaticBody::get_physics_material_override);
- ClassDB::bind_method(D_METHOD("_reload_physics_characteristics"), &StaticBody::_reload_physics_characteristics);
-
ClassDB::bind_method(D_METHOD("get_collision_exceptions"), &PhysicsBody::get_collision_exceptions);
ClassDB::bind_method(D_METHOD("add_collision_exception_with", "body"), &PhysicsBody::add_collision_exception_with);
ClassDB::bind_method(D_METHOD("remove_collision_exception_with", "body"), &PhysicsBody::remove_collision_exception_with);
@@ -322,8 +321,8 @@ void RigidBody::_body_inout(int p_status, ObjectID p_instance, int p_body_shape,
//E->get().rc=0;
E->get().in_tree = node && node->is_inside_tree();
if (node) {
- node->connect_compat(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree, make_binds(objid));
- node->connect_compat(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree, make_binds(objid));
+ node->connect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &RigidBody::_body_enter_tree), make_binds(objid));
+ node->connect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &RigidBody::_body_exit_tree), make_binds(objid));
if (E->get().in_tree) {
emit_signal(SceneStringNames::get_singleton()->body_entered, node);
}
@@ -349,8 +348,8 @@ void RigidBody::_body_inout(int p_status, ObjectID p_instance, int p_body_shape,
if (E->get().shapes.empty()) {
if (node) {
- node->disconnect_compat(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree);
- node->disconnect_compat(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree);
+ node->disconnect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &RigidBody::_body_enter_tree));
+ node->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &RigidBody::_body_exit_tree));
if (in_tree)
emit_signal(SceneStringNames::get_singleton()->body_exited, node);
}
@@ -550,14 +549,15 @@ real_t RigidBody::get_weight() const {
void RigidBody::set_physics_material_override(const Ref<PhysicsMaterial> &p_physics_material_override) {
if (physics_material_override.is_valid()) {
- if (physics_material_override->is_connected_compat(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics"))
- physics_material_override->disconnect_compat(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics");
+ if (physics_material_override->is_connected(CoreStringNames::get_singleton()->changed, callable_mp(this, &RigidBody::_reload_physics_characteristics))) {
+ physics_material_override->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &RigidBody::_reload_physics_characteristics));
+ }
}
physics_material_override = p_physics_material_override;
if (physics_material_override.is_valid()) {
- physics_material_override->connect_compat(CoreStringNames::get_singleton()->changed, this, "_reload_physics_characteristics");
+ physics_material_override->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &RigidBody::_reload_physics_characteristics));
}
_reload_physics_characteristics();
}
@@ -737,9 +737,8 @@ void RigidBody::set_contact_monitor(bool p_enabled) {
Node *node = Object::cast_to<Node>(obj);
if (node) {
-
- node->disconnect_compat(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree);
- node->disconnect_compat(SceneStringNames::get_singleton()->tree_exiting, this, SceneStringNames::get_singleton()->_body_exit_tree);
+ node->disconnect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &RigidBody::_body_enter_tree));
+ node->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &RigidBody::_body_exit_tree));
}
}
@@ -814,8 +813,6 @@ void RigidBody::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_physics_material_override", "physics_material_override"), &RigidBody::set_physics_material_override);
ClassDB::bind_method(D_METHOD("get_physics_material_override"), &RigidBody::get_physics_material_override);
- ClassDB::bind_method(D_METHOD("_reload_physics_characteristics"), &RigidBody::_reload_physics_characteristics);
-
ClassDB::bind_method(D_METHOD("set_linear_velocity", "linear_velocity"), &RigidBody::set_linear_velocity);
ClassDB::bind_method(D_METHOD("get_linear_velocity"), &RigidBody::get_linear_velocity);
@@ -860,8 +857,6 @@ void RigidBody::_bind_methods() {
ClassDB::bind_method(D_METHOD("is_able_to_sleep"), &RigidBody::is_able_to_sleep);
ClassDB::bind_method(D_METHOD("_direct_state_changed"), &RigidBody::_direct_state_changed);
- ClassDB::bind_method(D_METHOD("_body_enter_tree"), &RigidBody::_body_enter_tree);
- ClassDB::bind_method(D_METHOD("_body_exit_tree"), &RigidBody::_body_exit_tree);
ClassDB::bind_method(D_METHOD("set_axis_lock", "axis", "lock"), &RigidBody::set_axis_lock);
ClassDB::bind_method(D_METHOD("get_axis_lock", "axis"), &RigidBody::get_axis_lock);
diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp
index 3ef502cfd3..b2252bcb04 100644
--- a/scene/3d/skeleton.cpp
+++ b/scene/3d/skeleton.cpp
@@ -30,9 +30,8 @@
#include "skeleton.h"
-#include "core/message_queue.h"
-
#include "core/engine.h"
+#include "core/message_queue.h"
#include "core/project_settings.h"
#include "scene/3d/physics_body.h"
#include "scene/resources/surface_tool.h"
diff --git a/scene/3d/soft_body.cpp b/scene/3d/soft_body.cpp
index 14b1c24fa3..3859a278ef 100644
--- a/scene/3d/soft_body.cpp
+++ b/scene/3d/soft_body.cpp
@@ -319,8 +319,6 @@ void SoftBody::_notification(int p_what) {
void SoftBody::_bind_methods() {
- ClassDB::bind_method(D_METHOD("_draw_soft_mesh"), &SoftBody::_draw_soft_mesh);
-
ClassDB::bind_method(D_METHOD("set_collision_mask", "collision_mask"), &SoftBody::set_collision_mask);
ClassDB::bind_method(D_METHOD("get_collision_mask"), &SoftBody::get_collision_mask);
@@ -464,12 +462,12 @@ void SoftBody::prepare_physics_server() {
become_mesh_owner();
PhysicsServer::get_singleton()->soft_body_set_mesh(physics_rid, get_mesh());
- VS::get_singleton()->connect_compat("frame_pre_draw", this, "_draw_soft_mesh");
+ VS::get_singleton()->connect("frame_pre_draw", callable_mp(this, &SoftBody::_draw_soft_mesh));
} else {
PhysicsServer::get_singleton()->soft_body_set_mesh(physics_rid, NULL);
- if (VS::get_singleton()->is_connected_compat("frame_pre_draw", this, "_draw_soft_mesh")) {
- VS::get_singleton()->disconnect_compat("frame_pre_draw", this, "_draw_soft_mesh");
+ if (VS::get_singleton()->is_connected("frame_pre_draw", callable_mp(this, &SoftBody::_draw_soft_mesh))) {
+ VS::get_singleton()->disconnect("frame_pre_draw", callable_mp(this, &SoftBody::_draw_soft_mesh));
}
}
}
diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp
index 0aa404de7d..fd22076091 100644
--- a/scene/3d/sprite_3d.cpp
+++ b/scene/3d/sprite_3d.cpp
@@ -29,6 +29,7 @@
/*************************************************************************/
#include "sprite_3d.h"
+
#include "core/core_string_names.h"
#include "scene/scene_string_names.h"
@@ -177,8 +178,6 @@ void SpriteBase3D::_im_update() {
_draw();
pending_update = false;
-
- //texture->draw_rect_region(ci,dst_rect,src_rect,modulate);
}
void SpriteBase3D::_queue_update() {
@@ -334,9 +333,6 @@ void SpriteBase3D::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_item_rect"), &SpriteBase3D::get_item_rect);
ClassDB::bind_method(D_METHOD("generate_triangle_mesh"), &SpriteBase3D::generate_triangle_mesh);
- ClassDB::bind_method(D_METHOD("_queue_update"), &SpriteBase3D::_queue_update);
- ClassDB::bind_method(D_METHOD("_im_update"), &SpriteBase3D::_im_update);
-
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "centered"), "set_centered", "is_centered");
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "offset"), "set_offset", "get_offset");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "flip_h"), "set_flip_h", "is_flipped_h");
@@ -526,16 +522,20 @@ void Sprite3D::_draw() {
VS::get_singleton()->immediate_end(immediate);
}
+void Sprite3D::_texture_changed() {
+ _queue_update();
+}
+
void Sprite3D::set_texture(const Ref<Texture2D> &p_texture) {
if (p_texture == texture)
return;
if (texture.is_valid()) {
- texture->disconnect_compat(CoreStringNames::get_singleton()->changed, this, SceneStringNames::get_singleton()->_queue_update);
+ texture->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Sprite3D::_texture_changed));
}
texture = p_texture;
if (texture.is_valid()) {
- texture->connect_compat(CoreStringNames::get_singleton()->changed, this, SceneStringNames::get_singleton()->_queue_update);
+ texture->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Sprite3D::_texture_changed));
}
_queue_update();
}
@@ -952,10 +952,10 @@ void AnimatedSprite3D::_notification(int p_what) {
void AnimatedSprite3D::set_sprite_frames(const Ref<SpriteFrames> &p_frames) {
if (frames.is_valid())
- frames->disconnect_compat("changed", this, "_res_changed");
+ frames->disconnect("changed", callable_mp(this, &AnimatedSprite3D::_res_changed));
frames = p_frames;
if (frames.is_valid())
- frames->connect_compat("changed", this, "_res_changed");
+ frames->connect("changed", callable_mp(this, &AnimatedSprite3D::_res_changed));
if (!frames.is_valid()) {
frame = 0;
@@ -1125,8 +1125,6 @@ void AnimatedSprite3D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_frame", "frame"), &AnimatedSprite3D::set_frame);
ClassDB::bind_method(D_METHOD("get_frame"), &AnimatedSprite3D::get_frame);
- ClassDB::bind_method(D_METHOD("_res_changed"), &AnimatedSprite3D::_res_changed);
-
ADD_SIGNAL(MethodInfo("frame_changed"));
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "frames", PROPERTY_HINT_RESOURCE_TYPE, "SpriteFrames"), "set_sprite_frames", "get_sprite_frames");
diff --git a/scene/3d/sprite_3d.h b/scene/3d/sprite_3d.h
index 3b3f0265ce..082884c83b 100644
--- a/scene/3d/sprite_3d.h
+++ b/scene/3d/sprite_3d.h
@@ -157,6 +157,8 @@ class Sprite3D : public SpriteBase3D {
int vframes;
int hframes;
+ void _texture_changed();
+
protected:
virtual void _draw();
static void _bind_methods();
diff --git a/scene/3d/visibility_notifier.cpp b/scene/3d/visibility_notifier.cpp
index 3bf9584258..986607f18d 100644
--- a/scene/3d/visibility_notifier.cpp
+++ b/scene/3d/visibility_notifier.cpp
@@ -170,7 +170,7 @@ void VisibilityEnabler::_find_nodes(Node *p_node) {
if (add) {
- p_node->connect_compat(SceneStringNames::get_singleton()->tree_exiting, this, "_node_removed", varray(p_node), CONNECT_ONESHOT);
+ p_node->connect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &VisibilityEnabler::_node_removed), varray(p_node), CONNECT_ONESHOT);
nodes[p_node] = meta;
_change_node_state(p_node, false);
}
@@ -208,7 +208,7 @@ void VisibilityEnabler::_notification(int p_what) {
if (!visible)
_change_node_state(E->key(), true);
- E->key()->disconnect_compat(SceneStringNames::get_singleton()->tree_exiting, this, "_node_removed");
+ E->key()->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &VisibilityEnabler::_node_removed));
}
nodes.clear();
@@ -247,7 +247,6 @@ void VisibilityEnabler::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_enabler", "enabler", "enabled"), &VisibilityEnabler::set_enabler);
ClassDB::bind_method(D_METHOD("is_enabler_enabled", "enabler"), &VisibilityEnabler::is_enabler_enabled);
- ClassDB::bind_method(D_METHOD("_node_removed"), &VisibilityEnabler::_node_removed);
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "pause_animations"), "set_enabler", "is_enabler_enabled", ENABLER_PAUSE_ANIMATIONS);
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "freeze_bodies"), "set_enabler", "is_enabler_enabled", ENABLER_FREEZE_BODIES);
diff --git a/scene/3d/visual_instance.cpp b/scene/3d/visual_instance.cpp
index 73cffe9c89..105ce9ca74 100644
--- a/scene/3d/visual_instance.cpp
+++ b/scene/3d/visual_instance.cpp
@@ -294,7 +294,7 @@ void GeometryInstance::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_aabb"), &GeometryInstance::get_aabb);
ADD_GROUP("Geometry", "");
- ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "material_override", PROPERTY_HINT_RESOURCE_TYPE, "ShaderMaterial,StandardMaterial3D"), "set_material_override", "get_material_override");
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "material_override", PROPERTY_HINT_RESOURCE_TYPE, "ShaderMaterial,StandardMaterial3D", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_DEFERRED_SET_RESOURCE), "set_material_override", "get_material_override");
ADD_PROPERTY(PropertyInfo(Variant::INT, "cast_shadow", PROPERTY_HINT_ENUM, "Off,On,Double-Sided,Shadows Only"), "set_cast_shadows_setting", "get_cast_shadows_setting");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "extra_cull_margin", PROPERTY_HINT_RANGE, "0,16384,0.01"), "set_extra_cull_margin", "get_extra_cull_margin");
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "use_in_baked_light"), "set_flag", "get_flag", FLAG_USE_BAKED_LIGHT);