cocos / cocos-engine

Cocos simplifies game creation and distribution with Cocos Creator, a free, open-source, cross-platform game engine. Empowering millions of developers to create high-performance, engaging 2D/3D games and instant web entertainment.
https://www.cocos.com/en/creator
Other
8.66k stars 2.02k forks source link

Support for unique parameter values for AnimationCurve in AnimationGraph #13842

Closed wada-at-live2d-com closed 7 months ago

wada-at-live2d-com commented 1 year ago

Use Case

Animation in Live2D Cubism SDK Playing motion, fade animation...

Problem Description

Live2D does not have a TRS for animation data.

Live2D animations use values called "Parameters". Parameters play an important role in the animation of a model.

In 3D, the TRS is used to deform the mesh; Live2D does not use the TRS directly, but instead uses parameters. Parameters are represented as 1-dimensional floating point numbers, and the unique value of the parameter indicates the state of the TRS that deforms the mesh of the model. The mesh deformation is performed by CubismCore, and the mesh deformation state tied to the parameter is held by the model data.

When the user animates Live2D, the parameter values are set to CubismCore. CubismCore deforms the mesh based on the received parameter values. The deformed mesh is output from CubismCore as a "deformed triangle list" that can be received by OpenGL and other applications.

The AnimationCurve values that flow into CocosCreator's AnimationGraph are parameter values, not TRS values, in the Live2D SDK. The Live2D SDK must receive the interpolated AnimationCurve values in the AnimationGraph.

Transformations are not performed using the CocosCreator engine, but by CubismCore. CocosCreator only displays the deformed triangle list output from CubismCore.

The Cubism SDK for Cocos Creator alpha version only supports simple animations using cc.Animation The Cubism SDK for other platforms supports animation transitions, animation management using animation graphs, and fades.

Live2D Cubism SDK for Cocos Creator R1 alpha 1 https://docs.live2d.com/en/cubism-sdk-manual/download-sdk-for-cc-alpha/

Proposed Solution

No response

How it works

No response

Alternatives Considered

Implement your own animation transitions and fades without using AnimationGraph. However, this idea is not user friendly for Cocos Creator users.

Additional Information

No response

shrinktofit commented 1 year ago

Creator's considering with supporting floating point value animation in animation graph which allows to animate general-purposed values. The ideal workflow would be:

Let me know if the explaination is clear and if the considering-feature can help you.