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

Skeleton animates physical bones #36008

Merged
merged 2 commits into from
Feb 9, 2020

Conversation

AndreaCatania
Copy link
Contributor

@AndreaCatania AndreaCatania commented Feb 8, 2020

Added feature to move physical bones with skeleton when not simulating physics.

So now we have the possibility to:

  • Don't simulate physics and don't animate the physical bones
  • Don't simulate physics and animate the physical bones
  • Simulates the physics

Fixes #24359
Fixes: #26060
Fixes: #24836

ezgif com-video-to-gif(13)

@AndreaCatania
Copy link
Contributor Author

I've added another commit to fix the Physical Skeleton generation:

Screenshot from 2020-02-09 09-43-38

Fixes: #26060
Fixes: #24836

@akien-mga akien-mga merged commit 2353120 into godotengine:master Feb 9, 2020
@akien-mga
Copy link
Member

Thanks!

@NHodgesVFX
Copy link
Contributor

NHodgesVFX commented Apr 24, 2020

@akien-mga can this be added to 3.2.2 its really tedious to setup a rag doll when all the physical bones have a incorrect alignment.

@akien-mga
Copy link
Member

The removal of is_static_body() breaks compatibility, and I haven't taken time to think about how to handle this gracefully in the 3.2 branch.

@jedStevens
Copy link

jedStevens commented Apr 25, 2020

I did my own cherry pick of this PR, and I'm having some odd issues with it. It seems to only animate using the AnimationPlayer because when I use an AnimationTree, my character's PhysicalBones become frozen on a frame from the AnimatoinPlayer.

I wrote a small gdscript file to help fix this issue and I noticed that when not using the new animate_skeleton property, the collisions do not occur, however I can give them correct alignment to the skeleton by changing the process_priority of the AnimationTree to -1 and the PhysicalBones to 1. I haven't messed around with the process priority so much so I'm not sure if this is actually what made it work because I was just looking to make this code as safe as possible. I'm also not too sure if doing this incorrectly would result in collisions a frame behind the animation, but I didn't want to risk it.
-- Edit: I think I may not be getting collisions because I am moving a PhysicalBone every frame by changing it's global transform. I will experiment and come rewrite this middle section

@NHodgesVFX I found this easy to fix by writing a custom importer for characters, where you could write a script generating the exact ragdoll (and other features) you require. This was probably one of the biggest time saves for me.

@S-h-0-X
Copy link

S-h-0-X commented May 19, 2020

Just a quick question, did this changes made it through for 3.2.2 beta?. I'm mentioning it because I just downloaded it and I'm still having issues with the bones having an incorrect rotation

@AndreaCatania
Copy link
Contributor Author

@jedStevens Do you have an open issue for that? I could look into if you upload a a sample project. I would prefer a Godot 4 project (if you can).

@S-h-0-X
Copy link

S-h-0-X commented May 23, 2020

So I did try Godot 3.2.1 and all the betas available for 3.2.2, and this feature (body physics) looks completely broken to me. Not only with my simple model, I downloaded like 4 different gltf models and 1 fbx model and always it puts the capsules incorrectly (orientation wise). If I try to rotate and move them into place, when I enable simulation from the skeleton script the model just explodes and starts to do crazy stuff, (most of the time looks like is catapulted few meters away from original position). So really I don't know if I'm doing something terribly wrong or what. If I can collaborate in any way to fix this please let me know.

@AndreaCatania
Copy link
Contributor Author

Please open a new issue and upload a sample project, I'll be happy to give it a check.

@S-h-0-X
Copy link

S-h-0-X commented May 25, 2020

Hello,
@AndreaCatania , here you have it:
#39054

Thank you very much. If I can do anything else please let me know.

@Zireael07
Copy link
Contributor

Is this in 3.2 or not? I can't find an animate_physical_bone property on Skeleton?

@tavurth
Copy link
Contributor

tavurth commented Mar 29, 2022

Was this ever cherry picked back to 3.x @akien-mga?

@Calinou
Copy link
Member

Calinou commented Mar 29, 2022

Was this ever cherry picked back to 3.x @akien-mga?

No, see the above comments. This PR still has a cherrypick:3.x label since it hasn't been cherry-picked yet.

@tavurth
Copy link
Contributor

tavurth commented Mar 29, 2022

@Calinou there are a bunch of issues relating to this in different aspects.

Since this was two years ago, I guess it has been lost in the shuffle.

@akien-mga
Copy link
Member

Last I tried it was not easy to cherry-pick and would require a dedicated backport.

@tavurth
Copy link
Contributor

tavurth commented Mar 29, 2022

Ok if I get some free time over the next weeks I will try to look into it, seems there are some other PRs already made but they may be incomplete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherrypick:3.x Considered for cherry-picking into a future 3.x release enhancement topic:physics
Projects
None yet
8 participants