diff options
25 files changed, 96 insertions, 78 deletions
diff --git a/core/io/dir_access.cpp b/core/io/dir_access.cpp index 680a653dfc..e99885befa 100644 --- a/core/io/dir_access.cpp +++ b/core/io/dir_access.cpp @@ -84,7 +84,7 @@ static Error _erase_recursive(DirAccess *da) { String n = da->get_next(); while (!n.is_empty()) { if (n != "." && n != "..") { - if (da->current_is_dir()) { + if (da->current_is_dir() && !da->is_link(n)) { dirs.push_back(n); } else { files.push_back(n); diff --git a/doc/classes/BoneAttachment3D.xml b/doc/classes/BoneAttachment3D.xml index bafa463f82..a51b2d9a94 100644 --- a/doc/classes/BoneAttachment3D.xml +++ b/doc/classes/BoneAttachment3D.xml @@ -21,11 +21,10 @@ Returns whether the BoneAttachment3D node is using an external [Skeleton3D] rather than attempting to use its parent node as the [Skeleton3D]. </description> </method> - <method name="on_bone_pose_update"> + <method name="on_skeleton_update"> <return type="void" /> - <param index="0" name="bone_index" type="int" /> <description> - A function that is called automatically when the [Skeleton3D] the BoneAttachment3D node is using has a bone that has changed its pose. This function is where the BoneAttachment3D node updates its position so it is correctly bound when it is [i]not[/i] set to override the bone pose. + A function that is called automatically when the [Skeleton3D] is updated. This function is where the [BoneAttachment3D] node updates its position so it is correctly bound when it is [i]not[/i] set to override the bone pose. </description> </method> <method name="set_external_skeleton"> diff --git a/doc/classes/Skeleton3D.xml b/doc/classes/Skeleton3D.xml index caa3097a6b..14d9c568d7 100644 --- a/doc/classes/Skeleton3D.xml +++ b/doc/classes/Skeleton3D.xml @@ -252,7 +252,7 @@ <param index="1" name="pose" type="Transform3D" /> <description> Sets the global pose transform, [param pose], for the bone at [param bone_idx]. - [b]Note:[/b] If other bone poses have been changed, this method executes an update process and will cause performance to deteriorate. If you know that multiple global poses will be applied, consider using [method set_bone_pose] with precalculation. + [b]Note:[/b] If other bone poses have been changed, this method executes a dirty poses recalculation and will cause performance to deteriorate. If you know that multiple global poses will be applied, consider using [method set_bone_pose] with precalculation. </description> </method> <method name="set_bone_global_pose_override" deprecated=""> @@ -355,15 +355,10 @@ <description> </description> </signal> - <signal name="bone_pose_changed"> - <param index="0" name="bone_idx" type="int" /> - <description> - Emitted when the bone at [param bone_idx] changes its transform/pose. This can be used to update other nodes that rely on bone positions. - </description> - </signal> <signal name="pose_updated"> <description> - Emitted when the pose is updated, after [constant NOTIFICATION_UPDATE_SKELETON] is received. + Emitted when the pose is updated. + [b]Note:[/b] During the update process, this signal is not fired, so modification by [SkeletonModifier3D] is not detected. </description> </signal> <signal name="show_rest_only_changed"> @@ -371,11 +366,16 @@ Emitted when the value of [member show_rest_only] changes. </description> </signal> + <signal name="skeleton_updated"> + <description> + Emitted when the final pose has been calculated will be applied to the skin in the update process. + This means that all [SkeletonModifier3D] processing is complete. In order to detect the completion of the processing of each [SkeletonModifier3D], use [signal SkeletonModifier3D.modification_processed]. + </description> + </signal> </signals> <constants> <constant name="NOTIFICATION_UPDATE_SKELETON" value="50"> - Notification received when this skeleton's pose needs to be updated. - This notification is received [i]before[/i] the related [signal pose_updated] signal. + Notification received when this skeleton's pose needs to be updated. In that case, this is called only once per frame in a deferred process. </constant> <constant name="MODIFIER_CALLBACK_MODE_PROCESS_PHYSICS" value="0" enum="ModifierCallbackModeProcess"> Set a flag to process modification during physics frames (see [constant Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS]). diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp index 46efb45934..2a85a81b91 100644 --- a/drivers/unix/dir_access_unix.cpp +++ b/drivers/unix/dir_access_unix.cpp @@ -419,7 +419,7 @@ Error DirAccessUnix::remove(String p_path) { return FAILED; } - if (S_ISDIR(flags.st_mode)) { + if (S_ISDIR(flags.st_mode) && !is_link(p_path)) { return ::rmdir(p_path.utf8().get_data()) == 0 ? OK : FAILED; } else { return ::unlink(p_path.utf8().get_data()) == 0 ? OK : FAILED; @@ -435,7 +435,7 @@ bool DirAccessUnix::is_link(String p_file) { struct stat flags = {}; if ((lstat(p_file.utf8().get_data(), &flags) != 0)) { - return FAILED; + return false; } return S_ISLNK(flags.st_mode); diff --git a/misc/extension_api_validation/4.2-stable.expected b/misc/extension_api_validation/4.2-stable.expected index 9cd732813e..e8195d0aa0 100644 --- a/misc/extension_api_validation/4.2-stable.expected +++ b/misc/extension_api_validation/4.2-stable.expected @@ -272,3 +272,11 @@ Validate extension JSON: API was removed: classes/SkeletonIK3D/methods/set_inter Validate extension JSON: API was removed: classes/SkeletonIK3D/properties/interpolation These base class is changed to SkeletonModifier3D which is processed by Skeleton3D with the assumption that it is Skeleton3D's child. + + +GH-90575 +-------- +Validate extension JSON: API was removed: classes/BoneAttachment3D/methods/on_bone_pose_update +Validate extension JSON: API was removed: classes/Skeleton3D/signals/bone_pose_changed + +They have been replaced by a safer API due to performance concerns. Compatibility method registered. diff --git a/scene/2d/parallax_2d.cpp b/scene/2d/parallax_2d.cpp index 7e47e0f061..555f3b031c 100644 --- a/scene/2d/parallax_2d.cpp +++ b/scene/2d/parallax_2d.cpp @@ -102,14 +102,14 @@ void Parallax2D::_update_scroll() { scroll_ofs *= scroll_scale; if (repeat_size.x) { - real_t mod = Math::fposmod(scroll_ofs.x - scroll_offset.x - autoscroll_offset.x, repeat_size.x); + real_t mod = Math::fposmod(scroll_ofs.x - scroll_offset.x - autoscroll_offset.x, repeat_size.x * get_scale().x); scroll_ofs.x = screen_offset.x - mod; } else { scroll_ofs.x = screen_offset.x + scroll_offset.x - scroll_ofs.x; } if (repeat_size.y) { - real_t mod = Math::fposmod(scroll_ofs.y - scroll_offset.y - autoscroll_offset.y, repeat_size.y); + real_t mod = Math::fposmod(scroll_ofs.y - scroll_offset.y - autoscroll_offset.y, repeat_size.y * get_scale().y); scroll_ofs.y = screen_offset.y - mod; } else { scroll_ofs.y = screen_offset.y + scroll_offset.y - scroll_ofs.y; @@ -127,8 +127,7 @@ void Parallax2D::_update_repeat() { return; } - Point2 repeat_scale = repeat_size * get_scale(); - RenderingServer::get_singleton()->canvas_set_item_repeat(get_canvas_item(), repeat_scale, repeat_times); + RenderingServer::get_singleton()->canvas_set_item_repeat(get_canvas_item(), repeat_size, repeat_times); RenderingServer::get_singleton()->canvas_item_set_interpolated(get_canvas_item(), false); } diff --git a/scene/2d/physics/character_body_2d.cpp b/scene/2d/physics/character_body_2d.cpp index e5d575a159..a503f3cb78 100644 --- a/scene/2d/physics/character_body_2d.cpp +++ b/scene/2d/physics/character_body_2d.cpp @@ -501,7 +501,7 @@ Ref<KinematicCollision2D> CharacterBody2D::_get_slide_collision(int p_bounce) { // Create a new instance when the cached reference is invalid or still in use in script. if (slide_colliders[p_bounce].is_null() || slide_colliders[p_bounce]->get_reference_count() > 1) { slide_colliders.write[p_bounce].instantiate(); - slide_colliders.write[p_bounce]->owner = this; + slide_colliders.write[p_bounce]->owner_id = get_instance_id(); } slide_colliders.write[p_bounce]->result = motion_results[p_bounce]; @@ -745,11 +745,3 @@ void CharacterBody2D::_bind_methods() { CharacterBody2D::CharacterBody2D() : PhysicsBody2D(PhysicsServer2D::BODY_MODE_KINEMATIC) { } - -CharacterBody2D::~CharacterBody2D() { - for (int i = 0; i < slide_colliders.size(); i++) { - if (slide_colliders[i].is_valid()) { - slide_colliders.write[i]->owner = nullptr; - } - } -} diff --git a/scene/2d/physics/character_body_2d.h b/scene/2d/physics/character_body_2d.h index 395438a1f1..536d0a1ebd 100644 --- a/scene/2d/physics/character_body_2d.h +++ b/scene/2d/physics/character_body_2d.h @@ -111,7 +111,6 @@ public: PlatformOnLeave get_platform_on_leave() const; CharacterBody2D(); - ~CharacterBody2D(); private: real_t margin = 0.08; diff --git a/scene/2d/physics/kinematic_collision_2d.cpp b/scene/2d/physics/kinematic_collision_2d.cpp index 7e7c33b259..18b0254769 100644 --- a/scene/2d/physics/kinematic_collision_2d.cpp +++ b/scene/2d/physics/kinematic_collision_2d.cpp @@ -59,6 +59,7 @@ real_t KinematicCollision2D::get_depth() const { } Object *KinematicCollision2D::get_local_shape() const { + PhysicsBody2D *owner = Object::cast_to<PhysicsBody2D>(ObjectDB::get_instance(owner_id)); if (!owner) { return nullptr; } diff --git a/scene/2d/physics/kinematic_collision_2d.h b/scene/2d/physics/kinematic_collision_2d.h index 0d187b87a5..8d3d6ca8c1 100644 --- a/scene/2d/physics/kinematic_collision_2d.h +++ b/scene/2d/physics/kinematic_collision_2d.h @@ -40,7 +40,7 @@ class PhysicsBody2D; class KinematicCollision2D : public RefCounted { GDCLASS(KinematicCollision2D, RefCounted); - PhysicsBody2D *owner = nullptr; + ObjectID owner_id; friend class PhysicsBody2D; friend class CharacterBody2D; PhysicsServer2D::MotionResult result; diff --git a/scene/2d/physics/physics_body_2d.cpp b/scene/2d/physics/physics_body_2d.cpp index 81120d0b01..fc14e6ed62 100644 --- a/scene/2d/physics/physics_body_2d.cpp +++ b/scene/2d/physics/physics_body_2d.cpp @@ -30,8 +30,6 @@ #include "physics_body_2d.h" -#include "scene/scene_string_names.h" - void PhysicsBody2D::_bind_methods() { ClassDB::bind_method(D_METHOD("move_and_collide", "motion", "test_only", "safe_margin", "recovery_as_collision"), &PhysicsBody2D::_move, DEFVAL(false), DEFVAL(0.08), DEFVAL(false)); ClassDB::bind_method(D_METHOD("test_move", "from", "motion", "collision", "safe_margin", "recovery_as_collision"), &PhysicsBody2D::test_move, DEFVAL(Variant()), DEFVAL(0.08), DEFVAL(false)); @@ -48,12 +46,6 @@ PhysicsBody2D::PhysicsBody2D(PhysicsServer2D::BodyMode p_mode) : set_pickable(false); } -PhysicsBody2D::~PhysicsBody2D() { - if (motion_cache.is_valid()) { - motion_cache->owner = nullptr; - } -} - Ref<KinematicCollision2D> PhysicsBody2D::_move(const Vector2 &p_motion, bool p_test_only, real_t p_margin, bool p_recovery_as_collision) { PhysicsServer2D::MotionParameters parameters(get_global_transform(), p_motion, p_margin); parameters.recovery_as_collision = p_recovery_as_collision; @@ -64,7 +56,7 @@ Ref<KinematicCollision2D> PhysicsBody2D::_move(const Vector2 &p_motion, bool p_t // Create a new instance when the cached reference is invalid or still in use in script. if (motion_cache.is_null() || motion_cache->get_reference_count() > 1) { motion_cache.instantiate(); - motion_cache->owner = this; + motion_cache->owner_id = get_instance_id(); } motion_cache->result = result; diff --git a/scene/2d/physics/physics_body_2d.h b/scene/2d/physics/physics_body_2d.h index 43bc479881..d44eebabee 100644 --- a/scene/2d/physics/physics_body_2d.h +++ b/scene/2d/physics/physics_body_2d.h @@ -56,8 +56,6 @@ public: TypedArray<PhysicsBody2D> get_collision_exceptions(); void add_collision_exception_with(Node *p_node); //must be physicsbody void remove_collision_exception_with(Node *p_node); - - virtual ~PhysicsBody2D(); }; #endif // PHYSICS_BODY_2D_H diff --git a/scene/3d/bone_attachment_3d.compat.inc b/scene/3d/bone_attachment_3d.compat.inc new file mode 100644 index 0000000000..1b21612d5f --- /dev/null +++ b/scene/3d/bone_attachment_3d.compat.inc @@ -0,0 +1,43 @@ +/**************************************************************************/ +/* bone_attachment_3d.compat.inc */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#ifndef DISABLE_DEPRECATED + +#include "bone_attachment_3d.h" + +void BoneAttachment3D::_on_bone_pose_update_bind_compat_90575(int p_bone_index) { + return on_skeleton_update(); +} + +void BoneAttachment3D::_bind_compatibility_methods() { + ClassDB::bind_compatibility_method(D_METHOD("on_bone_pose_update", "bone_index"), &BoneAttachment3D::_on_bone_pose_update_bind_compat_90575); +} + +#endif // DISABLE_DEPRECATED diff --git a/scene/3d/bone_attachment_3d.cpp b/scene/3d/bone_attachment_3d.cpp index 221200284d..6afbc68e42 100644 --- a/scene/3d/bone_attachment_3d.cpp +++ b/scene/3d/bone_attachment_3d.cpp @@ -29,6 +29,7 @@ /**************************************************************************/ #include "bone_attachment_3d.h" +#include "bone_attachment_3d.compat.inc" void BoneAttachment3D::_validate_property(PropertyInfo &p_property) const { if (p_property.name == "bone_name") { @@ -148,9 +149,9 @@ void BoneAttachment3D::_check_bind() { bone_idx = sk->find_bone(bone_name); } if (bone_idx != -1) { - sk->connect(SNAME("bone_pose_changed"), callable_mp(this, &BoneAttachment3D::on_bone_pose_update)); + sk->connect(SNAME("skeleton_updated"), callable_mp(this, &BoneAttachment3D::on_skeleton_update)); bound = true; - callable_mp(this, &BoneAttachment3D::on_bone_pose_update).call_deferred(bone_idx); + callable_mp(this, &BoneAttachment3D::on_skeleton_update); } } } @@ -176,7 +177,7 @@ void BoneAttachment3D::_check_unbind() { Skeleton3D *sk = _get_skeleton3d(); if (sk) { - sk->disconnect(SNAME("bone_pose_changed"), callable_mp(this, &BoneAttachment3D::on_bone_pose_update)); + sk->disconnect(SNAME("skeleton_updated"), callable_mp(this, &BoneAttachment3D::on_skeleton_update)); } bound = false; } @@ -308,12 +309,12 @@ void BoneAttachment3D::_notification(int p_what) { } } -void BoneAttachment3D::on_bone_pose_update(int p_bone_index) { +void BoneAttachment3D::on_skeleton_update() { if (updating) { return; } updating = true; - if (bone_idx == p_bone_index) { + if (bone_idx >= 0) { Skeleton3D *sk = _get_skeleton3d(); if (sk) { if (!override_pose) { @@ -371,7 +372,7 @@ void BoneAttachment3D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_bone_idx", "bone_idx"), &BoneAttachment3D::set_bone_idx); ClassDB::bind_method(D_METHOD("get_bone_idx"), &BoneAttachment3D::get_bone_idx); - ClassDB::bind_method(D_METHOD("on_bone_pose_update", "bone_index"), &BoneAttachment3D::on_bone_pose_update); + ClassDB::bind_method(D_METHOD("on_skeleton_update"), &BoneAttachment3D::on_skeleton_update); ClassDB::bind_method(D_METHOD("set_override_pose", "override_pose"), &BoneAttachment3D::set_override_pose); ClassDB::bind_method(D_METHOD("get_override_pose"), &BoneAttachment3D::get_override_pose); diff --git a/scene/3d/bone_attachment_3d.h b/scene/3d/bone_attachment_3d.h index ec0f7344d7..e19180b0ea 100644 --- a/scene/3d/bone_attachment_3d.h +++ b/scene/3d/bone_attachment_3d.h @@ -67,6 +67,10 @@ protected: void _notification(int p_what); static void _bind_methods(); +#ifndef DISABLE_DEPRECATED + virtual void _on_bone_pose_update_bind_compat_90575(int p_bone_index); + static void _bind_compatibility_methods(); +#endif public: #ifdef TOOLS_ENABLED @@ -89,7 +93,7 @@ public: void set_external_skeleton(NodePath p_skeleton); NodePath get_external_skeleton() const; - virtual void on_bone_pose_update(int p_bone_index); + virtual void on_skeleton_update(); #ifdef TOOLS_ENABLED virtual void notify_rebind_required(); diff --git a/scene/3d/physics/character_body_3d.cpp b/scene/3d/physics/character_body_3d.cpp index 6759033358..b13c279234 100644 --- a/scene/3d/physics/character_body_3d.cpp +++ b/scene/3d/physics/character_body_3d.cpp @@ -704,7 +704,7 @@ Ref<KinematicCollision3D> CharacterBody3D::_get_slide_collision(int p_bounce) { // Create a new instance when the cached reference is invalid or still in use in script. if (slide_colliders[p_bounce].is_null() || slide_colliders[p_bounce]->get_reference_count() > 1) { slide_colliders.write[p_bounce].instantiate(); - slide_colliders.write[p_bounce]->owner = this; + slide_colliders.write[p_bounce]->owner_id = get_instance_id(); } slide_colliders.write[p_bounce]->result = motion_results[p_bounce]; @@ -936,11 +936,3 @@ void CharacterBody3D::_validate_property(PropertyInfo &p_property) const { CharacterBody3D::CharacterBody3D() : PhysicsBody3D(PhysicsServer3D::BODY_MODE_KINEMATIC) { } - -CharacterBody3D::~CharacterBody3D() { - for (int i = 0; i < slide_colliders.size(); i++) { - if (slide_colliders[i].is_valid()) { - slide_colliders.write[i]->owner = nullptr; - } - } -} diff --git a/scene/3d/physics/character_body_3d.h b/scene/3d/physics/character_body_3d.h index cffc0f8e63..430d9c35cb 100644 --- a/scene/3d/physics/character_body_3d.h +++ b/scene/3d/physics/character_body_3d.h @@ -113,7 +113,6 @@ public: PlatformOnLeave get_platform_on_leave() const; CharacterBody3D(); - ~CharacterBody3D(); private: real_t margin = 0.001; diff --git a/scene/3d/physics/kinematic_collision_3d.cpp b/scene/3d/physics/kinematic_collision_3d.cpp index 54371425bc..de13831ac3 100644 --- a/scene/3d/physics/kinematic_collision_3d.cpp +++ b/scene/3d/physics/kinematic_collision_3d.cpp @@ -67,6 +67,7 @@ real_t KinematicCollision3D::get_angle(int p_collision_index, const Vector3 &p_u Object *KinematicCollision3D::get_local_shape(int p_collision_index) const { ERR_FAIL_INDEX_V(p_collision_index, result.collision_count, nullptr); + PhysicsBody3D *owner = Object::cast_to<PhysicsBody3D>(ObjectDB::get_instance(owner_id)); if (!owner) { return nullptr; } diff --git a/scene/3d/physics/kinematic_collision_3d.h b/scene/3d/physics/kinematic_collision_3d.h index 656531c82b..0573af0c21 100644 --- a/scene/3d/physics/kinematic_collision_3d.h +++ b/scene/3d/physics/kinematic_collision_3d.h @@ -40,7 +40,7 @@ class PhysicsBody3D; class KinematicCollision3D : public RefCounted { GDCLASS(KinematicCollision3D, RefCounted); - PhysicsBody3D *owner = nullptr; + ObjectID owner_id; friend class PhysicsBody3D; friend class CharacterBody3D; PhysicsServer3D::MotionResult result; diff --git a/scene/3d/physics/physics_body_3d.cpp b/scene/3d/physics/physics_body_3d.cpp index 711ca60a81..b723b452c1 100644 --- a/scene/3d/physics/physics_body_3d.cpp +++ b/scene/3d/physics/physics_body_3d.cpp @@ -30,8 +30,6 @@ #include "physics_body_3d.h" -#include "scene/scene_string_names.h" - void PhysicsBody3D::_bind_methods() { ClassDB::bind_method(D_METHOD("move_and_collide", "motion", "test_only", "safe_margin", "recovery_as_collision", "max_collisions"), &PhysicsBody3D::_move, DEFVAL(false), DEFVAL(0.001), DEFVAL(false), DEFVAL(1)); ClassDB::bind_method(D_METHOD("test_move", "from", "motion", "collision", "safe_margin", "recovery_as_collision", "max_collisions"), &PhysicsBody3D::test_move, DEFVAL(Variant()), DEFVAL(0.001), DEFVAL(false), DEFVAL(1)); @@ -58,12 +56,6 @@ PhysicsBody3D::PhysicsBody3D(PhysicsServer3D::BodyMode p_mode) : set_body_mode(p_mode); } -PhysicsBody3D::~PhysicsBody3D() { - if (motion_cache.is_valid()) { - motion_cache->owner = nullptr; - } -} - TypedArray<PhysicsBody3D> PhysicsBody3D::get_collision_exceptions() { List<RID> exceptions; PhysicsServer3D::get_singleton()->body_get_collision_exceptions(get_rid(), &exceptions); @@ -102,7 +94,7 @@ Ref<KinematicCollision3D> PhysicsBody3D::_move(const Vector3 &p_motion, bool p_t // Create a new instance when the cached reference is invalid or still in use in script. if (motion_cache.is_null() || motion_cache->get_reference_count() > 1) { motion_cache.instantiate(); - motion_cache->owner = this; + motion_cache->owner_id = get_instance_id(); } motion_cache->result = result; diff --git a/scene/3d/physics/physics_body_3d.h b/scene/3d/physics/physics_body_3d.h index 92b3850085..71253be0b8 100644 --- a/scene/3d/physics/physics_body_3d.h +++ b/scene/3d/physics/physics_body_3d.h @@ -65,8 +65,6 @@ public: TypedArray<PhysicsBody3D> get_collision_exceptions(); void add_collision_exception_with(Node *p_node); //must be physicsbody void remove_collision_exception_with(Node *p_node); - - virtual ~PhysicsBody3D(); }; #endif // PHYSICS_BODY_3D_H diff --git a/scene/3d/skeleton_3d.cpp b/scene/3d/skeleton_3d.cpp index 95e94de0e3..db36a0a630 100644 --- a/scene/3d/skeleton_3d.cpp +++ b/scene/3d/skeleton_3d.cpp @@ -327,6 +327,8 @@ void Skeleton3D::_notification(int p_what) { _process_modifiers(); } + emit_signal(SceneStringNames::get_singleton()->skeleton_updated); + // Update skins. RenderingServer *rs = RenderingServer::get_singleton(); for (SkinReference *E : skin_bindings) { @@ -921,8 +923,6 @@ void Skeleton3D::force_update_bone_children_transforms(int p_bone_idx) { for (int i = 0; i < child_bone_size; i++) { bones_to_process.push_back(b.child_bones[i]); } - - emit_signal(SceneStringNames::get_singleton()->bone_pose_changed, current_bone_idx); } } @@ -1059,7 +1059,7 @@ void Skeleton3D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "modifier_callback_mode_process", PROPERTY_HINT_ENUM, "Physics,Idle"), "set_modifier_callback_mode_process", "get_modifier_callback_mode_process"); ADD_SIGNAL(MethodInfo("pose_updated")); - ADD_SIGNAL(MethodInfo("bone_pose_changed", PropertyInfo(Variant::INT, "bone_idx"))); + ADD_SIGNAL(MethodInfo("skeleton_updated")); ADD_SIGNAL(MethodInfo("bone_enabled_changed", PropertyInfo(Variant::INT, "bone_idx"))); ADD_SIGNAL(MethodInfo("bone_list_changed")); ADD_SIGNAL(MethodInfo("show_rest_only_changed")); diff --git a/scene/main/window.cpp b/scene/main/window.cpp index 65f1365e67..de6bc29f05 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -1215,10 +1215,10 @@ void Window::set_force_native(bool p_force_native) { if (force_native == p_force_native) { return; } - force_native = p_force_native; if (is_visible() && !is_in_edited_scene_root()) { - WARN_PRINT("Can't change \"force_native\" while a window is displayed. Consider hiding window before changing this value."); + ERR_FAIL_MSG("Can't change \"force_native\" while a window is displayed. Consider hiding window before changing this value."); } + force_native = p_force_native; } bool Window::get_force_native() const { diff --git a/scene/scene_string_names.cpp b/scene/scene_string_names.cpp index cf8ece0d4c..5610b2f642 100644 --- a/scene/scene_string_names.cpp +++ b/scene/scene_string_names.cpp @@ -63,7 +63,7 @@ SceneStringNames::SceneStringNames() { RESET = StaticCString::create("RESET"); pose_updated = StaticCString::create("pose_updated"); - bone_pose_changed = StaticCString::create("bone_pose_changed"); + skeleton_updated = StaticCString::create("skeleton_updated"); bone_enabled_changed = StaticCString::create("bone_enabled_changed"); show_rest_only_changed = StaticCString::create("show_rest_only_changed"); diff --git a/scene/scene_string_names.h b/scene/scene_string_names.h index 10b71e2a2a..60254e3006 100644 --- a/scene/scene_string_names.h +++ b/scene/scene_string_names.h @@ -99,7 +99,7 @@ public: StringName RESET; StringName pose_updated; - StringName bone_pose_changed; + StringName skeleton_updated; StringName bone_enabled_changed; StringName show_rest_only_changed; |