-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Add animation slices for individual animations #40274
Add animation slices for individual animations #40274
Conversation
0343e19
to
824b668
Compare
I attach a sample project anim-clips.zip |
Is this merged on stable? Any ETAs? |
Well this needs a review from @reduz who is more familiar with animation workflow. For what it's worth, while I see value in allowing the use of other default animations than one named "default", I don't like that it arbitrarily picks the first one. It's a valid workflow to actually have an animation named "default", which may not be the first one, but which you want to be used as default. |
Me neither but I've noticed more than one animator struggling with this and it seems that when using clips having one animation is the most common use case, while having it named "default" isn't, but rather the default named assigned by the 3dcg sofware. The engine doesn't report any error when you try to clip with a different name, it just creates the wrong animations, so it becomes a RTFM moment for the integrator/animator. If you a dozen of purchased assets it means re exporting every one of those which might even involve getting the software and learning how to do it in what would otherwise work by default. I think a way it can work without breaking the workflow of those who are following the docs would be the following:
That would work well for people explicitly using "default" as well as for assets with only one animation with whatever name. |
I can sense the usefulness of using the first track if it isn't named "default". However, the usage of "default" when there there are two tracks needs to be designed. |
Is this still the case in 4.0? |
I haven't been able to use clips successfully in master branch with the test model I attached above. It keeps being imported as one animation track |
@godotengine/animation Can you confirm if this is still needed? And review, if it is :) |
I think it is good, but @fire is the best judge of this feature. |
Common workflow is to use one track and then split. Very wanted |
Right, then this needs a rebase and a review. |
This makes sense, would be good to salvage. |
I'll take another look into it |
This improves the workflow for animations in a single timeline. The users are no longer forced to slice one animation named "default". Instead users can choose which animation(s) to break and how. Changes: - Remove slicing options from the animation player import menu - Add such options to the animation import menu - Rename clips to slices wherever was left
824b668
to
8ad3f8f
Compare
All right. Here's what I did:
So the import menu looks like this. Now instead of using "default" or picking arbitrarily the first one, the user can decide which animation to slice. Here for example there are two timelines that needed slicing: One the body movement and another for facial animations. Such workflow is now possible with this PR. Here is my demo project. Let me know what you think: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
40274-sample.mp4
The animation slice feature works like this:
- for each animation ".anim" we have slices
- You can set the slice to 0, the clips in the files or some number.
- The point of this feature is for each "clip" you can remix the slices order and naming based on the frame count.
- When the number is less, less clips are output
- When the number is equal, there is no splitting
- When it is more, clips are invented.
- Might want to have a reset to default number of slices.
This is a feature review. Need to review the code.
bool save_to_file = p_clips[i + 4]; | ||
String save_to_path = p_clips[i + 5]; | ||
bool keep_current = p_clips[i + 6]; | ||
for (int i = 0; i < p_slices.size(); i += 7) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does 7 mean, can you make it a named constant and the same with the ones below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't touch most of the slicing logic, I just updated the variable names. I see it's 7 because each slice contains 7 import options. But it was like that before. I can refactor it once I get some more free time. Also I would like to see if there are more comments on this PR.
Thanks! And congrats for your first merged Godot contribution 🎉 |
The clips method only worked if the imported model had an animation named "default". This PR allows clips to be created no matter what the one-track animation name is.
This closes my other PR #36709.
Bugsquad edit: