Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't try updating wrong NodePaths in resources #83263

Merged
merged 1 commit into from
Oct 16, 2023

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Oct 13, 2023

Fixes #83209

@KoBeWi KoBeWi added this to the 4.2 milestone Oct 13, 2023
@KoBeWi KoBeWi requested a review from a team as a code owner October 13, 2023 11:31
@tom95
Copy link
Contributor

tom95 commented Oct 13, 2023

Thanks a lot @KoBeWi!

The one error is indeed fixed, I just verified as well.

The error with renaming nodes used in an AnimationPlayer persists. As I understand it, it occurs because the AnimationPlayer handles its tracks specially (it is the only Resource that already supported renaming nested NodePaths, controlled via the autorename_animation_tracks setting). Consequently, when first encountering the AnimationPlayer, the special-cased code performs the rename, and then we descend into the AnimationPlayer object and try to perform the rename once again, thus erroring. A suggested fix that I verified fixed the other scenario, too, is to add this check:

diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index a38487635f..81805a45d2 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -1689,6 +1689,10 @@ bool SceneTreeDock::_check_node_path_recursive(Node *p_root_node, Variant &r_var
                                break;
                        }
 
+                       if (Object::cast_to<Animation>(r_variant)) {
+                               break;
+                       }
+
                        List<PropertyInfo> properties;
                        resource->get_property_list(&properties);

...such that we never descend into Animation resources.

@KoBeWi
Copy link
Member Author

KoBeWi commented Oct 13, 2023

I can't reproduce the renaming error. The track gets correctly updated too.

@tom95
Copy link
Contributor

tom95 commented Oct 14, 2023

@KoBeWi yep you're right. I must have mixed up branches. Everything is working perfectly with your change.

Sorry for the noise and thanks again for the swift fix :)

@akien-mga akien-mga merged commit 81f4953 into godotengine:master Oct 16, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@KoBeWi KoBeWi deleted the invalid_node﹖oh_no…_anyway branch October 16, 2023 09:11
@eviltrout
Copy link
Contributor

Thanks so much this bug was really slowing me down! I can confirm it works for me too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[4.2 beta1] Relative paths in nodes referenced as PackedScenes cause errors in console
4 participants