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

Remove AnimationMixer bindings only bound in the editor #83440

Merged

Conversation

raulsntos
Copy link
Member

Removes bindings inside #ifdef TOOL_ENABLED that would only be bound in the editor and break the C# bindings in exported games.

Comment on lines -2099 to -2100
ClassDB::bind_method(D_METHOD("_reset"), &AnimationMixer::reset);
ClassDB::bind_method(D_METHOD("_restore", "backup"), &AnimationMixer::restore);
Copy link
Member Author

Choose a reason for hiding this comment

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

These don't seem to need to be bound, so I just removed them.

Comment on lines 2101 to 2103
ClassDB::bind_method(D_METHOD("set_reset_on_save_enabled", "enabled"), &AnimationMixer::set_reset_on_save_enabled);
ClassDB::bind_method(D_METHOD("is_reset_on_save_enabled"), &AnimationMixer::is_reset_on_save_enabled);
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "reset_on_save", PROPERTY_HINT_NONE, ""), "set_reset_on_save_enabled", "is_reset_on_save_enabled");
Copy link
Member Author

@raulsntos raulsntos Oct 16, 2023

Choose a reason for hiding this comment

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

This seems like it was only bound to add a checkbox to the inspector, so I moved it to _get_property_list, _get and _set.

Unfortunately, it seems we can't document the property if it's added in _get_property_list, so CI complains about it.

Copy link
Member

Choose a reason for hiding this comment

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

I think it should simply be exposed for both tools and non-tools builds. It can be documented that it's only functional in the editor.

Copy link
Member Author

@raulsntos raulsntos Oct 16, 2023

Choose a reason for hiding this comment

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

Oh, actually we have to expose it because it was exposed before so it would break compat not to. I thought it was a new property. By the way, the documentation already says that it's used by the editor.

ClassDB::bind_method(D_METHOD("_restore", "backup"), &AnimationMixer::restore);
ClassDB::bind_method(D_METHOD("set_reset_on_save_enabled", "enabled"), &AnimationMixer::set_reset_on_save_enabled);
ClassDB::bind_method(D_METHOD("is_reset_on_save_enabled"), &AnimationMixer::is_reset_on_save_enabled);
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "reset_on_save", PROPERTY_HINT_NONE, ""), "set_reset_on_save_enabled", "is_reset_on_save_enabled");
ADD_SIGNAL(MethodInfo("mixer_updated")); // For updating dummy player.
Copy link
Member Author

Choose a reason for hiding this comment

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

The signal is now bound in non-editor builds even though it's only emitted in editor builds. I'm not sure if that's OK, but the signal is used by AnimationPlayerEditorPlugin so I think it's still needed.

@raulsntos raulsntos force-pushed the animation/remove-tool-bindings branch 2 times, most recently from 4e67935 to 537075a Compare October 16, 2023 15:03
@raulsntos raulsntos force-pushed the animation/remove-tool-bindings branch from 537075a to ae9ac5c Compare October 16, 2023 15:57
@akien-mga
Copy link
Member

The documentation seems to already properly flag the property and signal as editor-only.

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

Thanks!

@raulsntos raulsntos deleted the animation/remove-tool-bindings branch October 16, 2023 18:18
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.

Calling AnimationPlayer.RootNode from C# errors in exported version
2 participants