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

Refactor SkeletonModificationStack2D and SkeletonModifier2D* to Node2Ds #10247

Open
beicause opened this issue Jul 19, 2024 · 5 comments
Open
Labels
breaks compat Proposal will inevitably break compatibility topic:animation topic:2d

Comments

@beicause
Copy link

Describe the project you are working on

A 2D game with heavy use of 2D skeletons.

Describe the problem or limitation you are having in your project

Current 2D skeleton modifications are resources, which is not a good design and has some bugs (see https://github.com/godotengine/godot/issues?q=is%3Aissue+is%3Aopen+skeleton+modification+2d). And it's not convinent to use or extend them since they are nested resources.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

As disscussed in #4863 and godotengine/godot#71137

In the first place, it was pointed out that the ModificationStack as a resource is out of favor with Godot's design. It should not have an API for IK within the Skeleton class. By separating it from the Skeleton by making it a Node, it may be easier to share settings among multiple Skeletons and prioritize them with animations.
At the very least, ModificationStack2D being a Resource is "not make sense" and "needs to be fixed". So, it should still keep being experimental and definitely needs to be ported as a Node in the future.

Refactoring the 2D skeleton modifications to Nodes is expected to fix these bugs above and improve usability, paving the way for future improvements in 2D skeleton modifiers.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Remove SkeletonModificationStack2D, implement SkeletonModifier2D that retrieves its Skeleton2D parent and applies modification, like SkeletonModifier3D and PhysicalBoneSimulator3D. And extend it to implement other modifiers such as IK and 2D physical bones.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No, this needs lots of work if we start from scratch.

Is there a reason why this should be core and not an add-on in the asset library?

Skeleton2D is core.

@AThousandShips AThousandShips added topic:animation breaks compat Proposal will inevitably break compatibility labels Jul 19, 2024
@fire
Copy link
Member

fire commented Jul 24, 2024

@lyuma @TokageItLab I saw this and thought it would be good to keep on the todo list

@TokageItLab
Copy link
Member

TokageItLab commented Jul 25, 2024

I think that SkeletonModificationStack2D cannot be removed during 4.x, as it is probably already used in a good number of projects.

Of course, SkeletonModifier2D can be added, so we will need to work on implementing SkeletonModifier2D to deprecate SkeletonModificationStack2D and removing them in 5.0 sometime in the future.

@TokageItLab TokageItLab changed the title Refactor SkeletonModificationStack2D and SkeletonModification2D* to Node2Ds Refactor SkeletonModificationStack2D and SkeletonModifier2D* to Node2Ds Jul 25, 2024
@beicause
Copy link
Author

I have already made an attempt to add 2d skeleton modifier in beicause/godot@e20709b and ported FABR IK and jiggle. Perhaps physical bone and jiggle can be achieved without the need for modifiers. There is a workaround by using RemoteTransform2D to push the transform of physical body to the corresponding bone.

@Ughuuu
Copy link

Ughuuu commented Oct 26, 2024

Impressive, are willing to open a PR with this. Either way I might be interested to help on this.

@gaoyan2659365465
Copy link

SkeletonModificationStack2D overall adjustment weights only. No individual adjustment each modifier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaks compat Proposal will inevitably break compatibility topic:animation topic:2d
Projects
Status: No status
Development

No branches or pull requests

7 participants