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

Show a selected Bone Gizmo when Clicking on it keyframe #99696

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

alavacek
Copy link

@alavacek alavacek commented Nov 25, 2024

Closes #95994

@amarsero
Copy link

Hello! This is my first PR review so please let me know if I've got something wrong.

I compiled the changes and can confirm it does 2 things:

  1. Selects the bone when clicking on the animation key frame if the Skeleton3D is in edit mode.
  2. Doesn't turn off edit mode for the Skeleton3D when clicking the key frame

Code LGTM 👍

There are spelling errors in the comments as pointed out by Github Actions

If you need any help just @me and I'll gladly help!

@AThousandShips
Copy link
Member

You have a lot of commented out code, did you mean to mark this as a draft?

@alavacek
Copy link
Author

You have a lot of commented out code, did you mean to mark this as a draft?

Hey sorry I am new to making changes in Godot! I have since removed the commented out code.

@fire fire requested a review from a team November 26, 2024 18:47
@fire
Copy link
Member

fire commented Nov 26, 2024

I'll bring it to the godot animation team meeting for review

Skeleton3DEditor *se = Skeleton3DEditor::get_singleton();

// Only show selected gizmos if we have a skeleton3DEditor instance and it is in editor mode
if (track_type == Animation::TYPE_ROTATION_3D && se && se->is_edit_mode()) {
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't TYPE_POSITION_3D and TYPE_SCALE_3D also be handled?

Comment on lines +5781 to +5783
// Clear current selection
se->select_bone(-1);

Copy link
Member

@TokageItLab TokageItLab Nov 27, 2024

Choose a reason for hiding this comment

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

Suggested change
// Clear current selection
se->select_bone(-1);

This should not be necessary since bone_idx is -1 if no bones are found.

// Only show selected gizmos if we have a skeleton3DEditor instance and it is in editor mode
if (track_type == Animation::TYPE_ROTATION_3D && se && se->is_edit_mode()) {
NodePath path = animation->track_get_path(key_edit->track);
// Node *root_path = nullptr;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Node *root_path = nullptr;

Copy link
Member

@TokageItLab TokageItLab left a comment

Choose a reason for hiding this comment

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

The biggest problem is that this is implemented as a too special case and hard coded only for the Skeleton3D. If we want to implement this, we need to implement a common method somewhere in the AnimationTrackEditor first that will handle Gizmo in Node2D and Node3D as well as Skeleton3D. So I am not against this PR, but there needs to be a more fundamental implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Work in progress
Development

Successfully merging this pull request may close these issues.

Show a selected Bone Gizmo when Clicking on it keyframe
5 participants