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

Fix wrong usage of parameters_base_path StringName #91944

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented May 14, 2024

parameters_base_path was registered as a scene string name, but all of its usages, except 1, converted it to String. I changed it to a constant String in Animation and the single StringName usage was converted to SNAME.

@KoBeWi KoBeWi added this to the 4.3 milestone May 14, 2024
@KoBeWi KoBeWi requested a review from a team as a code owner May 14, 2024 11:31
@@ -626,7 +626,7 @@ bool AnimationTree::_blend_pre_process(double p_delta, int p_track_count, const
for (int i = 0; i < p_track_count; i++) {
src_blendsw[i] = 1.0; // By default all go to 1 for the root input.
}
root_animation_node->node_state.base_path = SceneStringName(parameters_base_path);
root_animation_node->node_state.base_path = SNAME(Animation::PARAMETERS_BASE_PATH.ascii().get_data());
Copy link
Member Author

Choose a reason for hiding this comment

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

This should be working correctly, but it would be nice if someone can confirm that this doesn't break anything. SNAME creates a static object, so .ascii().get_data() is done only once.

@akien-mga
Copy link
Member

Needs rebase.

@KoBeWi KoBeWi force-pushed the even_though_StringName_contains_String_in_its_name,_it's_not_actually_a_String branch from 3a3f639 to a345160 Compare May 30, 2024 10:03
@akien-mga akien-mga merged commit af249e8 into godotengine:master May 30, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@KoBeWi KoBeWi deleted the even_though_StringName_contains_String_in_its_name,_it's_not_actually_a_String branch May 31, 2024 09:02
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.

2 participants