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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove AnimationMixer bindings only bound in the editor
  • Loading branch information
raulsntos committed Oct 16, 2023
commit ae9ac5c76e78081d1d46ef8ae24cfd06dc54b757
6 changes: 1 addition & 5 deletions scene/animation/animation_mixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1857,7 +1857,6 @@ Vector3 AnimationMixer::get_root_motion_scale_accumulator() const {
return root_motion_scale_accumulator;
}

#ifdef TOOLS_ENABLED
void AnimationMixer::set_reset_on_save_enabled(bool p_enabled) {
reset_on_save = p_enabled;
}
Expand All @@ -1866,6 +1865,7 @@ bool AnimationMixer::is_reset_on_save_enabled() const {
return reset_on_save;
}

#ifdef TOOLS_ENABLED
bool AnimationMixer::can_apply_reset() const {
return has_animation(SceneStringNames::get_singleton()->RESET);
}
Expand Down Expand Up @@ -2095,14 +2095,10 @@ void AnimationMixer::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "active"), "set_active", "is_active");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "deterministic"), "set_deterministic", "is_deterministic");

#ifdef TOOLS_ENABLED
ClassDB::bind_method(D_METHOD("_reset"), &AnimationMixer::reset);
ClassDB::bind_method(D_METHOD("_restore", "backup"), &AnimationMixer::restore);
Comment on lines -2099 to -2100
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.

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.

#endif // TOOLS_ENABLED

ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "root_node"), "set_root_node", "get_root_node");

Expand Down
8 changes: 5 additions & 3 deletions scene/animation/animation_mixer.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ class AnimationMixer : public Node {
GDCLASS(AnimationMixer, Node);
#ifdef TOOLS_ENABLED
friend AnimatedValuesBackup;
bool reset_on_save = true;
bool editing = false;
bool dummy = false;
#endif // TOOLS_ENABLED

bool reset_on_save = true;

public:
enum AnimationCallbackModeProcess {
ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS,
Expand Down Expand Up @@ -346,15 +347,16 @@ class AnimationMixer : public Node {
virtual void advance(double p_time);
virtual void clear_caches(); ///< must be called by hand if an animation was modified after added

void set_reset_on_save_enabled(bool p_enabled);
bool is_reset_on_save_enabled() const;

#ifdef TOOLS_ENABLED
void set_editing(bool p_editing);
bool is_editing() const;

void set_dummy(bool p_dummy);
bool is_dummy() const;

void set_reset_on_save_enabled(bool p_enabled);
bool is_reset_on_save_enabled() const;
bool can_apply_reset() const;
void _build_backup_track_cache();
Ref<AnimatedValuesBackup> make_backup();
Expand Down
Loading