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

feat: add skeleton animation & vertex aimation #286

Closed
wants to merge 7 commits into from

Conversation

JiepengTan
Copy link
Collaborator

@JiepengTan JiepengTan commented Jun 15, 2024

project file
06-Skeleton.zip

config file : "assets/sprites/Tom/index.json"
skeleton animation

{

   ... // other fields
  "animator": "skeleton.animator",
  "avatar": "skeleton.avatar",
   ... // other fields
}

skeleton animation

vertex animation

{
   ... // other fields
  "animator": "vertex.animator",
  "avatar": "vertex.avatar",
   ... // other fields
}

animated_drawing

@JiepengTan JiepengTan force-pushed the skeleton_animation branch from 9b1dc9d to 0831660 Compare June 15, 2024 04:14
@JiepengTan JiepengTan changed the title add skeleton animation & vertex aimation feat: add skeleton animation & vertex aimation Jun 15, 2024
@JiepengTan JiepengTan requested a review from xushiwei June 15, 2024 04:27
@JiepengTan JiepengTan changed the title feat: add skeleton animation & vertex aimation [WIP] feat: add skeleton animation & vertex aimation Jun 20, 2024
spgdi.go Outdated Show resolved Hide resolved
@JiepengTan JiepengTan marked this pull request as draft August 13, 2024 01:14
@JiepengTan JiepengTan force-pushed the skeleton_animation branch 3 times, most recently from 1629b74 to 5ff12bf Compare August 13, 2024 05:41
@JiepengTan JiepengTan requested a review from nighca August 13, 2024 06:40
@JiepengTan JiepengTan marked this pull request as ready for review August 13, 2024 06:40
@JiepengTan JiepengTan changed the title [WIP] feat: add skeleton animation & vertex aimation feat: add skeleton animation & vertex aimation Aug 13, 2024
@JiepengTan JiepengTan requested a review from xushiwei August 13, 2024 06:42
}

var animator IAnimator
if config.Type == ANIMATOR_TYPE_VERTEX {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will there be a "frame animator" in the future? That is to say, will we implement frame-animation with concept Animator?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

for now, we will not expose this concept to the users, they will not be aware of this implementation detail.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The users will notice that there's animator (with type: skeletal | vertex) in sprite config to support skeletal or vertex animations.

In the long term, is it in plan to move config of frame-animations to some "animator file", just like skeletal & vertex animation?

Copy link
Collaborator

Choose a reason for hiding this comment

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

In the long term, is it in plan to move config of frame-animations to some "animator file", just like skeletal & vertex animation?

Yes, as discussed in the voice conference.

type AnimatorConfig struct {
Name string `json:"name"`
Type string `json:"type"`
DefaultClip string `json:"defaultClip"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does defaultClip play the role just like sprite.defaultAnimation plays in frame-animation?

Copy link
Collaborator

Choose a reason for hiding this comment

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

And is there any alternative to animBindings?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, the priority of sprite.defaultAnimation is higher than animator.defaultClip. Currently, this animation system is still in the experimental stage and is not intended to be made available to users. This PR is to support the development of Builder, which depends on skeletal animations.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Currently, this animation system is still in the experimental stage and is not intended to be made available to users. This PR is to support the development of Builder, which depends on skeletal animations.

Sure.

As there's no sample projects in this PR now, I'm not sure:

  1. Is it supported for one sprite to contain both some frame-animations and some skeletal-animations?
  2. How are we supposed do animation binding with skeletal-animations? For example, bind clip "dying" to behavior die? Do we use animBindings: { die: "dying" } in sprite config just like frame-animations?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

project file
06-Skeleton.zip

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Currently, this animation system is still in the experimental stage and is not intended to be made available to users. This PR is to support the development of Builder, which depends on skeletal animations.

Sure.

As there's no sample projects in this PR now, I'm not sure:

  1. Is it supported for one sprite to contain both some frame-animations and some skeletal-animations?
  2. How are we supposed do animation binding with skeletal-animations? For example, bind clip "dying" to behavior die? Do we use animBindings: { die: "dying" } in sprite config just like frame-animations?

@nighca
The skeletal animation at the current stage is not intended to be open to users, but is designed to facilitate the development of the "Training camp". If it becomes available in the future, we will add a frame Animator to ensure that skeleton animation is consistent with frame animation.

Copy link
Collaborator

Choose a reason for hiding this comment

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

As discussed in the voice conference, this PR is not intended for merging into the main branch, as its APIs are not yet stable.

Similar to the trailhead_asset branch of the builder, the "Training Camp" development will maintain dependencies on a standalone branch of spx.

config.go Outdated Show resolved Hide resolved
@JiepengTan JiepengTan marked this pull request as draft August 15, 2024 10:22
@JiepengTan JiepengTan marked this pull request as ready for review August 27, 2024 09:13
@JiepengTan JiepengTan requested review from nighca and removed request for xushiwei August 27, 2024 09:49
@JiepengTan JiepengTan marked this pull request as draft August 28, 2024 06:56
1: add vector3
2: add matrix4 (temp code for serialize)
3: add sprite prefab
4: add sprite skeleton
5: rename this => pself to remove compiler warning
6: add skeleton tutorial demo
7: skeleton animation:  cpu skinning
8: draw mesh
9: render skin mesh with texture (add uv info && render order)
10: add sprite animator
11: integrating the skeletal animation system into SPX
12: move animator to anim dir
13: update animator path
14: add vertex animator
15: unify the JSON configuration to be in littleCamelCase format
16: remove useless property
17: add frame animator type
18: add time class
19: integrate the animator into SPX
20: If the animation fails to play, try playing the skeletal animation.
21: Move the animator, animation, avatar directories to the top-level directory, these files can be shared among different sprites
22: Set the animation directory as a subdirectory of sprite
23: Export Animator interface to builder
@JiepengTan JiepengTan closed this Sep 23, 2024
@JiepengTan JiepengTan deleted the skeleton_animation branch September 23, 2024 07:01
@JiepengTan JiepengTan restored the skeleton_animation branch September 23, 2024 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants