X Tutup
Skip to content

Remove default skeleton path in MeshInstance3D#112267

Merged
akien-mga merged 1 commit intogodotengine:masterfrom
KoBeWi:sk8leton
Nov 1, 2025
Merged

Remove default skeleton path in MeshInstance3D#112267
akien-mga merged 1 commit intogodotengine:masterfrom
KoBeWi:sk8leton

Conversation

@KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Oct 31, 2025

Currently MeshInstance3D's skeleton defaults to parent node (..), which results in assigning unrelated nodes as skeleton and causes many problems.


Edit by @akien-mga:

See that PR for discussion about the problem and mitigation of the compat breakage. We came to this solution which fixes the issue by default going forward, but lets users who need it to enable compatibility mode with a project setting, if they relied on the previous behavior.

@KoBeWi KoBeWi added this to the 4.6 milestone Oct 31, 2025
@KoBeWi KoBeWi requested review from a team as code owners October 31, 2025 22:58
Copy link
Contributor

@smix8 smix8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #107526 for old context. Kinda agreed on this PR to avoid having intrusive or "magic" compatibility behavior going further.

Copy link
Member

@aaronfranke aaronfranke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am in favor of this. Personally I prefer a hard break like in PR #107526, but either way works.

@Mickeon
Copy link
Member

Mickeon commented Nov 1, 2025

I suppose it already is a "hard break" as this is off by default. The setting really exists "just in case".

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@lawnjelly You might want to backport this to 3.7 to fix #63210.

@akien-mga akien-mga merged commit 402805d into godotengine:master Nov 1, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks!

@clayjohn
Copy link
Member

clayjohn commented Nov 9, 2025

This completely broke all of our official demos that use skeletons. I suspect this is going to be a much more painful and widespread compat breakage than expected. Given that there wasnt even a bug report for this issue we may want to re-evaluate if merging this was the correct decision.

@stuartcarnie
Copy link
Contributor

Perhaps a safe alternative would be for new projects to set this to false explicitly, and have the default be true, to avoid widespread breakage.

@akien-mga
Copy link
Member

akien-mga commented Nov 10, 2025

Given that there wasnt even a bug report for this issue we may want to re-evaluate if merging this was the correct decision.

There are two bug reports for this issue linked in the OP. I've also seen personally a number of examples of this issue on social media which users seem to not even bother reporting, so it seems to be a widespread papercut that users internalized as background noise.

Perhaps a safe alternative would be for new projects to set this to false explicitly, and have the default be true, to avoid widespread breakage.

Yeah this would be a better approach to only change the behavior for 4.6+ projects. I believe we might have some facility to do this already since #105737.

@Zireael07
Copy link
Contributor

As someone who ran into this, yes it was an annoying UX papercut

@akien-mga
Copy link
Member

Perhaps a safe alternative would be for new projects to set this to false explicitly, and have the default be true, to avoid widespread breakage.

Yeah this would be a better approach to only change the behavior for 4.6+ projects. I believe we might have some facility to do this already since #105737.

Here is code that should do that (untested):

diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp
index 6b865fd470..5ce32f4d60 100644
--- a/core/config/project_settings.cpp
+++ b/core/config/project_settings.cpp
@@ -1687,7 +1687,7 @@ ProjectSettings::ProjectSettings() {
 	GLOBAL_DEF("animation/warnings/check_invalid_track_paths", true);
 	GLOBAL_DEF("animation/warnings/check_angle_interpolation_type_conflicting", true);
 #ifndef DISABLE_DEPRECATED
-	GLOBAL_DEF_RST("animation/compatibility/default_parent_skeleton_in_mesh_instance_3d", false);
+	GLOBAL_DEF_RST("animation/compatibility/default_parent_skeleton_in_mesh_instance_3d", true);
 #endif
 
 	GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "audio/buses/default_bus_layout", PROPERTY_HINT_FILE, "*.tres"), "res://default_bus_layout.tres");
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index a8078b2a4f..5af0371ccd 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -282,8 +282,8 @@
 		<member name="accessibility/general/updates_per_second" type="int" setter="" getter="" default="60">
 			The number of accessibility information updates per second.
 		</member>
-		<member name="animation/compatibility/default_parent_skeleton_in_mesh_instance_3d" type="bool" setter="" getter="" default="false">
-			If [code]true[/code], [member MeshInstance3D.skeleton] will point to the parent node ([code]..[/code]) by default, which was the behavior before Godot 4.6. It's recommended to keep this setting disabled unless the old behavior is needed for compatibility.
+		<member name="animation/compatibility/default_parent_skeleton_in_mesh_instance_3d" type="bool" setter="" getter="" default="true">
+			If [code]true[/code], [member MeshInstance3D.skeleton] will point to the parent node ([code]..[/code]) by default, which was the behavior before Godot 4.6. This setting is enabled by default for compatibility with pre-existing projects, but newly created projects after Godot 4.6 have it set to false.
 		</member>
 		<member name="animation/warnings/check_angle_interpolation_type_conflicting" type="bool" setter="" getter="" default="true">
 			If [code]true[/code], [AnimationMixer] prints the warning of interpolation being forced to choose the shortest rotation path due to multiple angle interpolation types being mixed in the [AnimationMixer] cache.
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 16350ad101..64966275ca 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -7784,6 +7784,9 @@ void EditorNode::notify_settings_overrides_changed() {
 HashMap<String, Variant> EditorNode::get_initial_settings() {
 	HashMap<String, Variant> settings;
 	settings["physics/3d/physics_engine"] = "Jolt Physics";
+#ifndef DISABLE_DEPRECATED
+	settings["animation/compatibility/default_parent_skeleton_in_mesh_instance_3d"] = "false";
+#endif
 	return settings;
 }

The downside however is that all new projects until Godot 5.0 will have animation/compatibility/default_parent_skeleton_in_mesh_instance_3d = false written in their project.godot. It's fine but it's a bit annoying to have all projects forever have to explicitly disable compatibility code.

My preference would be to have an automated conversion of scenes when loading projects in 4.6 to set any unsaved skeleton_path to NodePath(".."), preserving the old behavior, but giving users a chance to unset these paths on a case by case basis (and not applying to new projects which won't need it).

So let's revert for now and work on a better approach instead of patching the hole further.

akien-mga added a commit to akien-mga/godot that referenced this pull request Nov 10, 2025
This reverts commit d27fb9b.

This change is still wanted, but the compatibility handling needs to be
improved to avoid disrupting existing projets relying on that default skeleton
path.

See discussion in godotengine#112267.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

MeshInstance3D's auto-initialized skeleton_path property leads to confusing errors when no skeleton is desired

8 participants

X Tutup