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

Additive Animation Request #772

Open
AnthonyPython opened this issue Oct 29, 2023 · 5 comments
Open

Additive Animation Request #772

AnthonyPython opened this issue Oct 29, 2023 · 5 comments
Labels
feature request Discuss request for missing feature

Comments

@AnthonyPython
Copy link

The kind of additive animation I would like to see is that a animation could be played on top of any existing animation being played but not overriding all bones just because it has a weight of 1 for it, just for the bones that should be affected that animation does. for example lets say we have a IDLE animation being played, main animation, secondary animation a weapon specific pose for lets say for the AR2, while the bottom legs have movement specific animations for different directions.

currently if we do this now with how it works one of these will override all bones even if they don't animate in that specific animation. the kinds of "gesture" animation are only animations that animated specific bones say like a flinch or pose , or some sort of movement that affect these sections, most modern engines have a way to add these additive animations in their own way. and this would help many devs. specifically would help cut down on the amount of animations we would need to use.

now I could add a masking system to solve it but figured I'd put this together so we have an idea how it should work.

perhaps we could introduce some sort of index layer number to determine what order any extra animations are played on top to determine for example IDLE and other movements could be on 0 (main animation), arm pose animations on 1, and flinches and others on layer index 2 as an example

The example video given was the medic doing a flinch animation when he was hurt. while he is in his primary animation , in this case his primary weapon animation standing idle but it is also applied if running or air born since those are layered under the flinch.
The 2nd example is my player model doing a layered animation for a battle cry, this works for any position or animation.

hopefully this explains what I would need for future projects.

2023-10-29.18-16-43.mp4
2023-10-29.18-21-50.mp4
@turanszkij turanszkij added the feature request Discuss request for missing feature label Oct 30, 2023
@turanszkij
Copy link
Owner

currently if we do this now with how it works one of these will override all bones even if they don't animate in that specific animation

In this case why is the bone contained in the animation? If only the hand animates, then only those hand bones should be in the anim, and then you can blend them on top of the idle/crouch anim. You could also consider using this technique in the current system.

To make animations additively blendable, we would need to store the animation data in relative to parent's T-pose transform, while they are currently stored in relative to their parent world transform. Not sure yet at which point this should be computed and what to do with currently existing animation datas.

@AnthonyPython
Copy link
Author

AnthonyPython commented Oct 30, 2023

As far as I know they shouldn't have any keys, only the parts that are animated, when I tried last time but I will look later.
but regardless it would be nice to have in general since many others have this capability.

@VinnyVicious
Copy link

Is this an approximation of what you need?

https://docs.unrealengine.com/5.3/en-US/using-layered-animations-in-unreal-engine/

@AnthonyPython
Copy link
Author

AnthonyPython commented Nov 7, 2023

Like the montages yes something like that, with the layer blending. It would be rather bad to have to make say a pain flinch animation for every weapon pose/ stance

@VinnyVicious
Copy link

VinnyVicious commented Nov 8, 2023

yeah, totally agree with you. in a pinch, however, you can do the blending in Blender and export as a "binary" to the engine. You would have your flinch anim, then the poses, then Blender does the blending and bakes into an animation, which then your code just reads dynamically depending on the anim tree state.

https://blender.stackexchange.com/questions/137483/how-to-bake-animation-in-blender-2-8

that is how i did ragdolls without ragdolls in the past. baked and prerecorded around 100 different variations in Blender, and in code, had a random integer to dynamically load the anim. death_001, death_002, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Discuss request for missing feature
Projects
None yet
Development

No branches or pull requests

3 participants