Skeletal animation generation method and device, computer program product and electronic equipment

By parsing and separating the stretching components of the local spatial matrix in skeletal animation, skeletal scaling animation is generated, solving the problems of skeletal misalignment and high complexity in existing technologies, and realizing efficient and low-cost skeletal animation production.

CN121685778APending Publication Date: 2026-03-17NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-28
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

In existing skeletal animation production, adding subbones and animation controllers leads to structural complexity, which is prone to misalignment, affecting production efficiency and cost, and also negatively impacting animation performance.

Method used

By obtaining the scaling parameters of the bone to be scaled, parsing the initial animation to obtain stretch transformation data, and separating the stretch components of the local space matrix, a bone scaling animation is generated, avoiding the addition of extra bones and directly achieving the scaling effect on the original bone.

Benefits of technology

It maintains the original posture and structural correctness of the animation, reduces production complexity and cost, improves production efficiency, is applicable to existing or new skeletons, and speeds up development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121685778A_ABST
    Figure CN121685778A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, in particular to a skeletal animation generation method and device, a computer program product and electronic equipment. The skeletal animation generation method comprises the steps of obtaining a scaling parameter of a to-be-scaled skeletal, adding the scaling parameter to original skeletal data to obtain target skeletal data, and generating an initial animation based on the target skeletal data; analyzing the initial animation to obtain stretching transformation data of each skeleton; based on the stretching transformation data, carrying out stretching component separation processing on a local space matrix of a skeleton in the initial animation to obtain effective stretching data and local space matrix data after the effective stretching data is removed; and according to the effective stretching data and the local space matrix data, generating a skeleton zooming animation in the game engine. According to the invention, the manufacturing effect and efficiency of the skeleton zooming animation can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more specifically, to a method for generating skeletal animation, an apparatus for generating skeletal animation, a computer program product, and an electronic device. Background Technology

[0002] With the development of computer technology, users have increasingly higher requirements for animation display in online games. Some animation effects require showing scaling animations such as stretching, elongating, and shrinking virtual objects.

[0003] The current method for implementing scaling animation requires adding a set of sub-bones for scaling inside the existing skeleton and constraining them by the basic limb bones. This is achieved by adding an intermediate animation controller to achieve the stretching and scaling effect of the model. This method is structurally complex, and the main bones and sub-bones are prone to misalignment. In addition, the added bones need to incorporate character resources, which not only affects production efficiency and increases production costs, but also affects the running performance of the animation.

[0004] It should be noted that the information in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0005] The purpose of this disclosure is to provide a method and apparatus for generating skeletal animation, a computer program product, and an electronic device, thereby improving the production effect and efficiency of skeletal scaling animation to at least a certain extent.

[0006] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part from practice of this disclosure.

[0007] According to one aspect of this disclosure, a method for generating skeletal animation is provided, comprising: obtaining scaling parameters of a bone to be scaled; adding the scaling parameters to original bone data to obtain target bone data; and generating an initial animation based on the target bone data; parsing the initial animation to obtain stretch transformation data for each bone; performing stretch component separation processing on the local spatial matrix of the bones in the initial animation based on the stretch transformation data to obtain effective stretch data and local spatial matrix data after removing the effective stretch data; and generating a skeletal scaling animation within a game engine based on the effective stretch data and the local spatial matrix data.

[0008] In one exemplary embodiment of this disclosure, parsing the initial animation to obtain stretch transformation data for each bone includes: performing matrix decomposition on the local spatial matrix of each bone for each frame of animation data in the initial animation to obtain a first decomposition result; and extracting scaling components from the first decomposition result to obtain stretch transformation data for each bone.

[0009] In one exemplary embodiment of this disclosure, parsing the initial animation to obtain stretch transformation data for each bone includes: performing matrix decomposition on the stretch matrix of each bone for each frame of animation data in the initial animation to obtain a second decomposition result; and extracting stretch components from the second decomposition result to obtain stretch transformation data for each bone.

[0010] In one exemplary embodiment of this disclosure, based on stretch transformation data, the local spatial matrix of bones in the initial animation is processed to separate the stretch components to obtain effective stretch data and local spatial matrix data after removing the effective stretch data. This includes: traversing each bone in the initial animation and determining the bones with scaling based on the stretch transformation data; separating the stretch components in the local spatial matrix corresponding to the scaling bones to obtain effective stretch data; and removing the effective stretch data from the local spatial matrix of the bones in the initial animation to obtain local spatial matrix data.

[0011] In one exemplary embodiment of this disclosure, before generating a bone scaling animation within a game engine based on effective stretch data and local spatial matrix data, the method further includes: for each bone that is being scaled, converting the effective stretch data into curve data containing a three-dimensional scaling vector; merging the curve data and the local spatial matrix data into engine animation data, which is used to generate a bone scaling animation within the game engine.

[0012] In one exemplary embodiment of this disclosure, local spatial matrix data is used to characterize the transformation of each bone in local space; generating bone scaling animation within the game engine based on effective stretching data and local spatial matrix data includes: for each frame of animation, determining the global spatial matrix of each bone in world coordinates based on the local spatial matrix data; performing local stretching transformation on the global spatial matrix of the corresponding bone in world coordinates based on the effective stretching data to obtain the world space transformation matrix of the bone; and performing animation skinning processing based on the world space transformation matrix of the bone to generate bone scaling animation effect.

[0013] In one exemplary embodiment of this disclosure, obtaining scaling parameters of a bone to be scaled includes: in response to a bone determination operation, determining a corresponding bone to be scaled based on the bone determination operation; and in response to an attribute adjustment operation for the bone to be scaled, determining scaling parameters corresponding to the attribute adjustment operation.

[0014] According to one aspect of this disclosure, a skeletal animation generation apparatus is provided, comprising: a data acquisition module for acquiring scaling parameters of a bone to be scaled, adding the scaling parameters to original bone data to obtain target bone data, and generating an initial animation based on the target bone data; a first processing module for parsing the initial animation to obtain stretch transformation data for each bone; a second processing module for separating stretch components of the local spatial matrix of the bones in the initial animation based on the stretch transformation data to obtain effective stretch data and local spatial matrix data after removing the effective stretch data; and an animation generation module for generating a skeletal scaling animation within a game engine based on the effective stretch data and the local spatial matrix data.

[0015] According to one aspect of this disclosure, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method described in any of the foregoing descriptions.

[0016] According to one aspect of this disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the method described in any of the preceding methods by executing the executable instructions.

[0017] The skeletal animation generation method in the exemplary embodiments of this disclosure obtains scaling parameters of the bone to be scaled, adds the scaling parameters to the original bone data to obtain target bone data, and generates an initial animation based on the target bone data; parses the initial animation to obtain stretch transformation data for each bone; based on the stretch transformation data, performs stretch component separation processing on the local space matrix of the bones in the initial animation to obtain effective stretch data and local space matrix data after removing the effective stretch data; and generates a skeletal scaling animation within the game engine based on the effective stretch data and the local space matrix data. On one hand, by separating the stretch components from the local space matrix, it ensures that the basic transformation of the bones is not disturbed by scaling when generating the final animation, maintaining the correctness of the original posture and structure of the animation and improving the animation production effect. On the other hand, this process can realize the production of scaling animation based on the original bones of the virtual object, without the need to create additional bones, reducing production complexity, facilitating maintenance, saving production costs, and thus improving development progress. Furthermore, it can be used in existing skeletons or in the development of new bones, possessing high flexibility, without completely overhauling the structure of existing skeletons and recreating them, thus improving production efficiency.

[0018] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0019] The above and other objects, features, and advantages of this disclosure will become readily apparent from the following detailed description of exemplary embodiments, taken in conjunction with the accompanying drawings. Several embodiments of this disclosure are illustrated in the drawings by way of example and not limitation.

[0020] Figure 1 An application environment according to an exemplary embodiment of this disclosure is shown.

[0021] Figure 2 A flowchart of a method for generating skeletal animation according to an exemplary embodiment of the present disclosure is shown.

[0022] Figure 3 A flowchart illustrating an implementation of a method for separating a stretching component according to an exemplary embodiment of the present disclosure is shown.

[0023] Figure 4 A schematic diagram is shown of separating the stretching components in the local spatial matrix of a skeleton according to an exemplary embodiment of the present disclosure.

[0024] Figure 5 A flowchart illustrating an implementation of generating skeletal scaling animation within a game engine according to an exemplary embodiment of the present disclosure is shown.

[0025] Figure 6 A schematic diagram of an interface for determining a bone to be scaled is shown according to an exemplary embodiment of the present disclosure.

[0026] Figure 7 A diagram illustrating the effect of spring tension according to an exemplary embodiment of the present disclosure is shown.

[0027] Figure 8 A schematic diagram of the composition of a skeletal animation generation apparatus according to an exemplary embodiment of the present disclosure is shown.

[0028] Figure 9 A block diagram of an electronic device according to an exemplary embodiment of the present disclosure is shown.

[0029] In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts. Detailed Implementation

[0030] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be more comprehensive and complete, and will fully convey the concept of exemplary embodiments to those skilled in the art. The same reference numerals in the drawings denote the same or similar structures, and therefore their detailed description will be omitted.

[0031] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced without one or more of the specific details described, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known structures, methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this disclosure.

[0032] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, or in one or more software-hardened modules, or in different network and / or processor devices and / or microcontroller devices.

[0033] Currently, methods for implementing scaling animations require adding a set of sub-bones for scaling within the existing skeleton, constrained by the basic limb bones. This is achieved by adding an intermediate animation controller to realize the model's stretching and scaling effect. This method is structurally complex, prone to misalignment between the main and sub-bones, and the added bones require the integration of character assets, impacting production efficiency, increasing costs, and affecting animation performance. Specifically, the model scaling part requires creating new bones and adding them to the final character assets, significantly impacting animation performance. Furthermore, the animation creation of the added bones and controllers increases production costs and development time. If a virtual object requires additional animation, high animation production and maintenance costs are also incurred.

[0034] Based on this, exemplary embodiments of this disclosure provide a method for generating skeletal animation, which can achieve scaling animation using existing bone data without creating additional bones. Based on this method, a skeletal animation generation service is implemented. This service can be configured within a game engine as an embedded service. For example, the code corresponding to the skeletal animation generation method can be part of the game engine program. During the running of the game engine program, the skeletal animation generation service is implemented by loading and executing the code corresponding to the skeletal animation generation method. Alternatively, the service can be configured outside the game engine as an external service or function. For example, the code corresponding to the skeletal animation generation method can be a standalone program outside the game engine program, such as an auxiliary program accompanying the game engine. During the running of the game engine program, this auxiliary program can be run simultaneously to implement the skeletal animation generation service.

[0035] Whether it is an embedded service or an external service, all services obtain and use the necessary information, including scaling parameters of the skeleton to be scaled and original skeleton data, only with the authorization of the user and other relevant parties and in accordance with relevant regulations.

[0036] The skeletal animation generation method provided in the exemplary embodiments of this disclosure can be applied to, for example... Figure 1 The application environment shown is illustrated. Terminal 101 communicates with server 102 via a network. A data storage system can store the data that server 102 needs to process. The data storage system can be integrated onto server 102, or it can be located in the cloud or on another network server.

[0037] In one exemplary embodiment, the provided skeletal animation generation method can be executed by server 102, and the corresponding skeletal animation generation apparatus is disposed in server 102. Correspondingly, in this manner executed by server 102, server 102 can begin executing the steps of the technical solution in the exemplary embodiment of this disclosure in response to a triggering command, wherein the triggering command can be sent by a terminal used by a user, or can be triggered locally by the server in response to some automated event.

[0038] Server 102 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Server 102 can execute background tasks.

[0039] Furthermore, in another exemplary embodiment, terminal 101 may also have similar functions to server 102, thereby executing the skeletal animation generation method provided by the exemplary embodiments of this disclosure. Terminal 101 may be a smartphone, tablet, laptop, desktop computer, IoT device, or portable wearable device. IoT devices may include smart TVs and smart in-vehicle devices, etc. Portable wearable devices may include smartwatches, smart bracelets, head-mounted devices, etc. Terminal 101 may also be referred to as a mobile terminal, terminal device, mobile device, etc., and the exemplary embodiments of this disclosure do not limit the type of terminal 101.

[0040] Furthermore, the technical solutions of the exemplary embodiments of this disclosure can also be executed collaboratively by terminal 101 and server 102. In this collaborative execution method, some steps of the technical solutions provided in the exemplary embodiments of this disclosure are executed by terminal 101, while other steps are executed by server 102. In this collaborative execution method, the steps executed by terminal 101 and server 102 respectively can be dynamically adjusted according to actual conditions, and no special restrictions are placed on this. Terminal 101 and server 102 can be directly or indirectly connected via wireless communication, and no special restrictions are placed on this in the exemplary embodiments of this disclosure.

[0041] refer to Figure 2 The diagram shown is a flowchart of a method for generating skeletal animation, an exemplary embodiment of this disclosure. Figure 2 As shown, the method for generating the skeletal animation includes steps S210 to S240, as detailed below: Step S210: Obtain the scaling parameters of the bone to be scaled, add the scaling parameters to the original bone data to obtain the target bone data, and generate the initial animation based on the target bone data.

[0042] Step S220: Analyze the initial animation to obtain the stretching transformation data for each bone.

[0043] Step S230: Based on the stretch transformation data, perform stretch component separation processing on the local spatial matrix of the bones in the initial animation to obtain effective stretch data and local spatial matrix data after removing the effective stretch data.

[0044] Step S240: Generate a skeletal scaling animation within the game engine based on the effective stretching data and local spatial matrix data.

[0045] The skeletal animation generation method in the exemplary embodiments of this disclosure, on the one hand, separates the stretching components from the local spatial matrix through a separation process, thereby ensuring that the basic transformations of the skeleton are not affected by scaling when generating the final animation, maintaining the correctness of the original posture and structure of the animation, and improving the animation production effect. On the other hand, this process can realize the production of scaling animation based on the original skeleton of the virtual object, without the need to create additional skeletons, reducing production complexity, facilitating maintenance, saving production costs, and thus improving development progress. Furthermore, it can be used in existing skeletons or in the development of new skeletons, with a high degree of flexibility, without having to completely overturn the structure of existing skeletons and rebuild them, thus improving production efficiency.

[0046] Steps S210 to S240 will be described in more detail below.

[0047] In step S210, the scaling parameters of the bone to be scaled are obtained, the scaling parameters are added to the original bone data to obtain the target bone data, and the initial animation is generated based on the target bone data.

[0048] In the exemplary embodiments of this disclosure, the raw bone data refers to the bones of a character that have already been bound, i.e., the original bone data to be processed, such as CS (Character Studio, Amphibian Skeletal System) bones. Initially, this raw bone data does not yet include animation scaling effects. The bone to be scaled is a specific bone in the bone hierarchy that the designer or program specifies needs to undergo scaling transformation; for example, when depicting the effect of a character's arm lengthening, the "forearm bone" is the bone to be scaled. Adding scaling parameters to the raw bone data bakes the scaling transformation into the raw bone data, resulting in target bone data, where the transformation of this bone and its corresponding sub-bones is affected by the scaling parameters. Methods of adding to the raw bone data include, but are not limited to, matrix multiplication, integrating scaling into quaternion transformations, or directly modifying the scaling component values ​​of the transformation matrix; any of these can be flexibly selected according to actual task requirements.

[0049] The initial animation refers to the complete and continuous sequence of animation frames generated based on the target skeletal data. It can be understood as replacing the original skeletal data with the target skeletal data and running a standard skeletal animation calculation process. The specific skeletal animation calculation process is not specifically limited here. It should be noted that the steps for obtaining the initial animation can be preprocessing or offline processing, which can further improve overall processing performance.

[0050] Optionally, obtain the scaling parameters of the bone to be scaled, including: In response to the skeleton determination operation, determine the corresponding skeleton to be scaled based on the skeleton determination operation.

[0051] In response to an attribute adjustment operation on the bone to be scaled, determine the scaling parameters corresponding to the attribute adjustment operation.

[0052] The skeleton selection operation involves choosing one or more specific bones from the character's skeletal hierarchy. This can be done by clicking on a bone or its affected model area in the graphical user interface, or by clicking on it in a dedicated bone tree list. This will trigger the skeleton selection operation, designating the corresponding bone as the bone to be scaled. The attribute adjustment operation modifies the scaling attribute value of a bone. This can be achieved through controls in the graphical user interface, such as dragging a slider to continuously change the scaling value, directly entering precise values ​​into an input box, or dragging a scaling control in the 3D view. This allows the corresponding scaling parameters to be determined in response to the attribute adjustment operation. Bone scaling is used for bones bound to the character, manipulating their 3D scaling values ​​to control the length and compression / stretching of the bones.

[0053] The exemplary embodiments of this disclosure, through the skeleton determination operation, can ensure that the scaling effect is accurately applied to the target part, avoiding the overall scaling or unrelated bones being affected. Through the attribute adjustment operation, users can adjust the scaling parameters in real time and visually, which lowers the technical threshold. By integrating the setting of scaling parameters into the graphical animation production process, a foundation can be provided for the efficient generation of skeletal scaling animations.

[0054] In step S220, the initial animation is parsed to obtain the stretching transformation data of each bone.

[0055] In exemplary embodiments of this disclosure, stretch transformation data refers to data extracted from the transformation matrix of the skeleton and used to characterize the scaling / stretching effect. It should be understood that this stretch transformation data is not the original scaling parameters, but rather the final, effective scaling state data presented in the current animation frame after the scaling parameters have been passed through the bone hierarchy and interacted with other transformations (e.g., rotation, translation).

[0056] In one exemplary embodiment, the initial animation is parsed to obtain stretch transformation data for each bone, including: For each frame of animation data in the initial animation, matrix decomposition is performed on the local space matrix of each bone to obtain the first decomposition result; The scaling component is extracted from the first decomposition result to obtain the stretch transformation data for each bone.

[0057] The processing is performed frame-by-frame to ensure that every moment of the entire animation sequence is correctly parsed. The local space matrix is ​​a matrix (e.g., a 4x4 matrix) representing the transformations (translation, rotation, scaling) of a bone relative to its direct parent bone; it is the fundamental transformation unit in the bone hierarchy.

[0058] For example, for a biped skeleton, the local space matrix can be resolved using Equation 1: Formula 1 in, Let represent the stretching coefficient (stretching transformation data) of the i-th bone. `Decomp` represents matrix decomposition, and `GetScale` represents obtaining the scaling component from the first decomposition result. The stretching transformation data of the bone is obtained by decomposing the local space matrix of the biped bone and directly extracting the scaling component.

[0059] Optionally, if all stretch transformation data are 1, it indicates that the bone has not been stretched, i.e., there is no stretch information. For example, if the stretch transformation data of the biped bone is (1,1,1), it means that the bone has no stretch information and will not be considered as valid stretch data in the future.

[0060] Biped skeletons typically possess complex hierarchical structures and kinematic constraints. Their local space matrix represents the combined state resulting from scaling, rotation, and translation coupling. Direct decomposition of this matrix captures the final, realistic deformation effect produced by the propagation and superposition of scaling parameters within the skeleton chain, ensuring the accuracy of subsequent separation processing.

[0061] In one exemplary embodiment, the initial animation is parsed to obtain stretch transformation data for each bone, including: For each frame of animation data in the initial animation, the stretching matrix of each bone is decomposed to obtain the second decomposition result; The stretching component is extracted from the second decomposition result to obtain the stretching transformation data for each bone.

[0062] The processing is performed frame-by-frame to ensure that every moment of the entire animation sequence is correctly parsed. For the bone, its scaling is passed to all child bones, and a stretch matrix can be created by additionally specifying stretch components. Furthermore, the stretch matrix of each bone can be decomposed to obtain a second decomposition result, from which the stretch components can be extracted.

[0063] For example, the stretching matrix can be analyzed using Formula 2: Formula 2 Among them, here MS is the stretching matrix of the skeleton. i This is the stretching matrix for the i-th bone type. For example, in 3D computer graphics software, this matrix can correspond to the Stretch Transform matrix of a node.

[0064] The exemplary embodiments of this disclosure are designed to reproduce the stretching data of bones created by 3D computer graphics software in a game engine. By parsing the information of each bone (local spatial matrix, stretching matrix), the stretching information of each bone can be saved as stretching transformation data. Regardless of which matrix it is, the stretching transformation data is obtained by decomposition, ensuring that the extraction process is deterministic, numerically stable, and traceable. This provides a foundation for the subsequent accurate and efficient implementation of bone scaling animation in the game engine.

[0065] In one exemplary embodiment, an implementation method for separating the stretching component is provided. For example... Figure 3 As shown, based on the stretch transformation data, the local space matrix of the bones in the initial animation is processed by separating the stretch components to obtain effective stretch data and local space matrix data after removing the effective stretch data, which may include: Step S310: Traverse each bone in the initial animation and determine the bones that are scaled based on the stretch transformation data.

[0066] In practice, not all bones participate in the scaling animation. The process involves iterating through each bone in the initial animation and selecting those that truly need processing. For example, based on the stretch transformation data, if a bone's scaling factor is (1,1,1) or very close to (1,1,1), meaning it's within the tolerance range (which can be preset) of the scaling factor (1,1,1), then the bone is determined to be non-scalable. Conversely, if the scaling matrix is ​​an identity matrix and doesn't contain additional scaling and shear transformations, then the corresponding bone is considered non-scalable.

[0067] Step S320: Separate the stretching components in the local space matrix corresponding to the scaled bones to obtain effective stretching data.

[0068] Step S330: Remove the effective stretching data from the local space matrix of the bones in the initial animation to obtain the local space matrix data.

[0069] The stretch component is the scaling portion of the bone's local space matrix that causes unintended deformation. Effective stretch data refers to the pure scaling information extracted from the local space matrix. Eliminating effective stretch data means subtracting or canceling out the separated effective stretch data from the original local space matrix. The local space matrix data is the bone transformation data obtained after separating and eliminating the stretch components; it describes the correct position and rotational orientation of the bone, without containing any scaling interference that causes deformation.

[0070] For example, Figure 4The diagram shows a method for separating the stretching components in the local spatial matrix of a bone. Matrix A is the local spatial matrix of the bone. After separating the stretching components [1,2,3,1], the effective stretching data is removed, and the resulting local spatial matrix data is matrix B.

[0071] It should be understood that, for each bone, effective stretch data and local spatial matrix data for each frame of animation are acquired. This results in two sets of animation data: effective stretch data and local spatial matrix data. The exemplary embodiments of this disclosure are illustrated using the processing of one bone as an example.

[0072] The exemplary embodiments disclosed herein, by traversing and identifying scaled bones, can filter out the targets that truly need processing, rather than indiscriminately processing all bones, thus reducing unnecessary computational overhead. Scaling interference is removed from the original data, resulting in local spatial matrix data that only describes the correct position and rotational posture of the bones. This allows the game engine to build the correct skeleton using the posture data during subsequent skeletal animation generation, and then reapply the scaling effect, ultimately achieving smooth, undistorted animation with a clear scaling effect. This ensures the effective scaling of the bones without increasing the number of bones.

[0073] In one exemplary embodiment, before generating the skeletal scaling animation within the game engine based on the effective stretching data and the local spatial matrix data, the process may further include: For each bone that is scaled, the effective stretch data is converted into curve data containing a three-dimensional scaling vector; The curve data and local spatial matrix data are merged into engine animation data, which is used to generate skeletal scaling animations within the game engine.

[0074] The 3D scaling vector represents the scaling factor along the X, Y, and Z axes. Curve data is a data structure used in animation systems to describe a numerical value that changes continuously over time. A corresponding curve can be created for each scaling vector component of each bone. Merging refers to packaging, associating, and serializing two different types of animation data into the same animation resource file to obtain engine animation data. Engine animation data can be understood as standardized animation data that the game engine can directly recognize and play, integrating traditional skeletal transformation animation (from local spatial matrix data) and scaling curve animation (curve data).

[0075] Specifically, for each bone with scaling, processing is done frame by frame. For each frame, the scaling factor on the diagonal is extracted from the bone's stretching matrix (effective stretching data) to form a 3D scaling vector, and a curve is created or updated for each component. Then, during game runtime, the game engine can correlate the two sets of data: obtaining the position and rotation of each bone over time (from local space matrix data) and upsampling the scaling curve to obtain the scaling vector of the bone at the current moment, and then combining these two sets of data to generate the final bone scaling animation.

[0076] The exemplary embodiments disclosed herein convert effectively stretched data into curve data that the engine animation system excels at processing and editing. This allows scaling animations to be visually edited, blended, and logically controlled within the engine's animation editor, state machine, and blend tree, just like standard position and rotation animations. This lowers the technical barrier to entry, allowing artists and designers to create and adjust scaling effects directly within a familiar workflow without needing to understand the underlying algorithms, significantly improving development efficiency. Furthermore, the runtime engine only performs curve sampling, resulting in minimal computational overhead, which meets the performance requirements of real-time rendering.

[0077] In step S240, a skeletal scaling animation is generated within the game engine based on the effective stretching data and the local spatial matrix data.

[0078] Generating skeletal scaling animation within a game engine involves using processed data during the game engine's real-time runtime or rendering process to drive a 3D model to produce dynamic visuals that maintain the correct posture while exhibiting scaling effects. The effective stretching data and local spatial matrix data here can be the engine animation data mentioned above.

[0079] The local spatial matrix data is used to represent the transformation of each bone in local space. This can be understood as the ability to reconstruct the effective stretching data and local spatial matrix data into the game scene when generating bone scaling animations within the game engine.

[0080] In one exemplary embodiment, an implementation method for generating skeletal scaling animation within a game engine is provided. For example... Figure 5 As shown, based on the effective stretching data and local spatial matrix data, a skeletal scaling animation is generated within the game engine, including: Step S510: For each frame of animation, determine the global spatial matrix of each bone in world coordinates based on the local spatial matrix data.

[0081] In actual game execution, to reproduce the animation effects, it is necessary to calculate the transformation matrix of the bones in world coordinates frame by frame based on the exported animation data, namely the effective stretching data and local space matrix data: the global space matrix. The global space matrix is ​​the transformation matrix of the bones in the entire world coordinate system. The motion data of each bone is based on the space of its parent node. During animation playback, the local space matrix of each bone can be obtained based on the local space matrix data. Based on the local space matrix, the global space matrix of each bone can be determined using Formula 3: Formula 3 in, Let be the global space matrix of the i-th bone. It is the parent bone of the i-th bone. Let be the local space matrix of the i-th bone, derived from the local space matrix data.

[0082] Step S520: Based on the effective stretching data, perform local stretching transformation on the global space matrix of the corresponding bone in world coordinates to obtain the world space transformation matrix of the bone.

[0083] Local stretching transformation is the operation of applying effective stretching data to the global space matrix. To restore the local stretching effect, the world space transformation matrix of the skeleton can be obtained by multiplying the global space matrix by the empty global space matrix (local stretching transformation). This can be represented by Equation 4: Formula 4 in, The world space transformation matrix of the skeleton. To effectively stretch the data, it is obtained according to at least one of the methods described above.

[0084] Step S530: Perform animation skinning based on the world space transformation matrix of the skeleton to generate a skeleton scaling animation effect.

[0085] The animation skinning process calculates the final position of each vertex of the 3D model (skinned) attached to the skeleton based on the skeleton's world space transformation matrix. For example, the engine passes the skeleton's world space transformation matrix to the GPU (Graphics Processing Unit). In the vertex shader, for each vertex of the model, the final screen position of the vertex is calculated with respect to its attached bones and weights, thereby achieving the correct local stretching effect. The exemplary embodiments disclosed herein do not specifically limit this process.

[0086] In the exemplary embodiments of this disclosure, after the global spatial matrix calculation is completed, the effective stretching data is applied as a local transformation to the corresponding bone. This ensures that the scaling effect only affects the current bone itself and does not interfere with the transformation of its subbones. Therefore, the scaling effect is strictly limited to the target bone, improving the accuracy of bone scaling. Furthermore, since unstretched stretching data, such as identity stretching data (all components are 1), is removed when exporting the effective stretching data and local spatial matrix data, no additional computational resources are introduced when there is no local stretching in the animation, thus enabling efficient restoration of the bone scaling animation state.

[0087] The following describes a specific example of an exemplary method for generating skeletal animation according to the present disclosure.

[0088] First, identify the virtual object whose skeleton has been bound.

[0089] Secondly, in response to the skeleton determination operation, the corresponding skeleton to be scaled is determined based on the skeleton determination operation. And, in response to the attribute adjustment operation for the skeleton to be scaled, the scaling parameters corresponding to the attribute adjustment operation are determined.

[0090] Users can specify the bones for which scaling parameters need to be added, and then add those parameters. For example... Figure 6 In the graphical user interface, select the bones to be scaled by drawing a box, and then add scaling parameters to them.

[0091] Next, the scaling parameters of the bone to be scaled can be obtained, the scaling parameters can be added to the original bone data to obtain the target bone data, and the initial animation can be generated based on the target bone data.

[0092] In actual implementation, the secondary animation switch can be turned on, and the stretching animation can be created normally to obtain the initial animation.

[0093] Furthermore, after the initial animation is completed, it is parsed to obtain the stretch transformation data for each bone. Based on the stretch transformation data, the stretch components of the local space matrix of the bones in the initial animation are separated to obtain effective stretch data and local space matrix data after removing the effective stretch data. Specifically, for each bone with scaling, the effective stretch data can be converted into curve data containing a 3D scaling vector, and the curve data and local space matrix data can be merged into engine animation data.

[0094] Optionally, the engine editor can be used to compare whether the animation stretching effect of the skeleton in the 3D computer graphics software is consistent with the animation effect after restoring the stretching from the exported data (engine animation data), and to determine whether the generated result is reasonable.

[0095] Finally, the engine animation data can be integrated into the game engine to generate skeletal scaling animations within the game engine, which can then be used by players in the game. Figure 7 The spring stretching effect is shown.

[0096] It should be noted that the details of this example have already been described in the exemplary embodiments above, and will not be repeated here.

[0097] The skeletal animation generation method in the exemplary embodiments of this disclosure obtains scaling parameters of the bone to be scaled, adds the scaling parameters to the original bone data to obtain target bone data, and generates an initial animation based on the target bone data; parses the initial animation to obtain stretch transformation data for each bone; based on the stretch transformation data, performs stretch component separation processing on the local space matrix of the bones in the initial animation to obtain effective stretch data and local space matrix data after removing the effective stretch data; and generates a skeletal scaling animation within the game engine based on the effective stretch data and the local space matrix data. On one hand, by separating the stretch components from the local space matrix, it ensures that the basic transformation of the bones is not disturbed by scaling when generating the final animation, maintaining the correctness of the original posture and structure of the animation and improving the animation production effect. On the other hand, this process can realize the production of scaling animation based on the original bones of the virtual object, without the need to create additional bones, reducing production complexity, facilitating maintenance, saving production costs, and thus improving development progress. Furthermore, it can be used in existing skeletons or in the development of new bones, possessing high flexibility, without completely overhauling the structure of existing skeletons and recreating them, thus improving production efficiency.

[0098] In an exemplary embodiment of this disclosure, an apparatus for generating skeletal animation is also provided. (See reference...) Figure 8 As shown, the skeletal animation generation device 800 may include a data acquisition module 810, a first processing module 820, a second processing module 830, and an animation generation module 840. Specifically: The data acquisition module 810 is used to acquire the scaling parameters of the bone to be scaled, add the scaling parameters to the original bone data to obtain the target bone data, and generate an initial animation based on the target bone data; the first processing module 820 is used to parse the initial animation to obtain the stretch transformation data of each bone; the second processing module 830 is used to separate the stretch components of the local space matrix of the bones in the initial animation based on the stretch transformation data to obtain the effective stretch data and the local space matrix data after removing the effective stretch data; the animation generation module 840 is used to generate the bone scaling animation in the game engine according to the effective stretch data and the local space matrix data.

[0099] In one exemplary embodiment of this disclosure, parsing the initial animation to obtain stretch transformation data for each bone includes: performing matrix decomposition on the local spatial matrix of each bone for each frame of animation data in the initial animation to obtain a first decomposition result; and extracting scaling components from the first decomposition result to obtain stretch transformation data for each bone.

[0100] In one exemplary embodiment of this disclosure, parsing the initial animation to obtain stretch transformation data for each bone includes: performing matrix decomposition on the stretch matrix of each bone for each frame of animation data in the initial animation to obtain a second decomposition result; and extracting stretch components from the second decomposition result to obtain stretch transformation data for each bone.

[0101] In one exemplary embodiment of this disclosure, based on stretch transformation data, the local spatial matrix of bones in the initial animation is processed to separate the stretch components to obtain effective stretch data and local spatial matrix data after removing the effective stretch data. This includes: traversing each bone in the initial animation and determining the bones with scaling based on the stretch transformation data; separating the stretch components in the local spatial matrix corresponding to the scaling bones to obtain effective stretch data; and removing the effective stretch data from the local spatial matrix of the bones in the initial animation to obtain local spatial matrix data.

[0102] In one exemplary embodiment of this disclosure, the second processing module 830 is further configured to perform: before generating a bone scaling animation within the game engine based on the effective stretch data and the local spatial matrix data, for each bone that is being scaled, converting the effective stretch data into curve data containing a three-dimensional scaling vector; merging the curve data and the local spatial matrix data into engine animation data, which is used to generate a bone scaling animation within the game engine.

[0103] In one exemplary embodiment of this disclosure, local spatial matrix data is used to characterize the transformation of each bone in local space; generating bone scaling animation within the game engine based on effective stretching data and local spatial matrix data includes: for each frame of animation, determining the global spatial matrix of each bone in world coordinates based on the local spatial matrix data; performing local stretching transformation on the global spatial matrix of the corresponding bone in world coordinates based on the effective stretching data to obtain the world space transformation matrix of the bone; and performing animation skinning processing based on the world space transformation matrix of the bone to generate bone scaling animation effect.

[0104] In one exemplary embodiment of this disclosure, obtaining scaling parameters of a bone to be scaled includes: in response to a bone determination operation, determining a corresponding bone to be scaled based on the bone determination operation; and in response to an attribute adjustment operation for the bone to be scaled, determining scaling parameters corresponding to the attribute adjustment operation.

[0105] Since the details of each functional module of the skeletal animation generation apparatus of the exemplary embodiments of this disclosure have been described in the exemplary embodiments of the skeletal animation generation method described above, they will not be repeated here.

[0106] It should be noted that although several modules or units of the skeletal animation generation apparatus have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0107] Exemplary embodiments of this disclosure also provide a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the above-described method for generating skeletal animation.

[0108] In one implementation, the computer program product can be a tangible product containing a computer program, such as a computer-readable storage medium storing the computer program. The readable storage medium can be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory, hard disk drive (HDD), solid-state drive (SSD), etc. For example, the computer program product can be implemented as a non-volatile storage medium storing a computer program, such as read-only memory, NAND flash memory, etc.

[0109] In one implementation, the computer program product can be an intangible product containing a computer program. For example, the computer program product can be implemented as a virtual digital product, such as an executable file, installation package, or other digital file storing the computer program.

[0110] Computer program code can be written in one or more programming languages. Examples of programming languages ​​include C, Java, and C++. Program code can execute entirely on the user's computing device, partially on the user's computing device, or as a standalone software package. It can also execute partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, such as a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via an internet connection provided by a mobile network operator).

[0111] Computer programs can be carried or transmitted via signals such as electricity, magnetism, light, electromagnetic fields, and infrared radiation. Electronic devices can convert the signals carrying computer programs into digital signals, thereby running the computer programs. When a computer program runs on an electronic device, its code causes the electronic device to execute (more specifically, its processor) the method steps of various exemplary embodiments of this disclosure, such as the skeletal animation generation method described above. Specifically, the following can be executed: Obtain the scaling parameters of the bone to be scaled, add the scaling parameters to the original bone data to obtain the target bone data, and generate an initial animation based on the target bone data; parse the initial animation to obtain the stretch transformation data of each bone; based on the stretch transformation data, separate the stretch components of the local space matrix of the bones in the initial animation to obtain the effective stretch data and the local space matrix data after removing the effective stretch data; generate the bone scaling animation in the game engine based on the effective stretch data and the local space matrix data.

[0112] In one exemplary embodiment of this disclosure, parsing the initial animation to obtain stretch transformation data for each bone includes: performing matrix decomposition on the local spatial matrix of each bone for each frame of animation data in the initial animation to obtain a first decomposition result; and extracting scaling components from the first decomposition result to obtain stretch transformation data for each bone.

[0113] In one exemplary embodiment of this disclosure, parsing the initial animation to obtain stretch transformation data for each bone includes: performing matrix decomposition on the stretch matrix of each bone for each frame of animation data in the initial animation to obtain a second decomposition result; and extracting stretch components from the second decomposition result to obtain stretch transformation data for each bone.

[0114] In one exemplary embodiment of this disclosure, based on stretch transformation data, the local spatial matrix of bones in the initial animation is processed to separate the stretch components to obtain effective stretch data and local spatial matrix data after removing the effective stretch data. This includes: traversing each bone in the initial animation and determining the bones with scaling based on the stretch transformation data; separating the stretch components in the local spatial matrix corresponding to the scaling bones to obtain effective stretch data; and removing the effective stretch data from the local spatial matrix of the bones in the initial animation to obtain local spatial matrix data.

[0115] In one exemplary embodiment of this disclosure, before generating a bone scaling animation within a game engine based on effective stretch data and local spatial matrix data, the method further includes: for each bone that is being scaled, converting the effective stretch data into curve data containing a three-dimensional scaling vector; merging the curve data and the local spatial matrix data into engine animation data, which is used to generate a bone scaling animation within the game engine.

[0116] In one exemplary embodiment of this disclosure, local spatial matrix data is used to characterize the transformation of each bone in local space; generating bone scaling animation within the game engine based on effective stretching data and local spatial matrix data includes: for each frame of animation, determining the global spatial matrix of each bone in world coordinates based on the local spatial matrix data; performing local stretching transformation on the global spatial matrix of the corresponding bone in world coordinates based on the effective stretching data to obtain the world space transformation matrix of the bone; and performing animation skinning processing based on the world space transformation matrix of the bone to generate bone scaling animation effect.

[0117] In one exemplary embodiment of this disclosure, obtaining scaling parameters of a bone to be scaled includes: in response to a bone determination operation, determining a corresponding bone to be scaled based on the bone determination operation; and in response to an attribute adjustment operation for the bone to be scaled, determining scaling parameters corresponding to the attribute adjustment operation.

[0118] Furthermore, in exemplary embodiments of this disclosure, an electronic device capable of implementing the above-described methods is also provided. Those skilled in the art will understand that various aspects of this disclosure can be implemented as systems, methods, or program products. Therefore, various aspects of this disclosure can be specifically implemented as: entirely hardware embodiments, entirely software embodiments (including firmware, microcode, etc.), or embodiments combining hardware and software aspects, collectively referred to herein as "circuit," "module," or "system."

[0119] The following reference Figure 9 To describe an electronic device 900 according to such an embodiment of the present disclosure. Figure 9 The electronic device 900 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.

[0120] like Figure 9 As shown, the electronic device 900 is presented in the form of a general-purpose computing device. The components of the electronic device 900 may include, but are not limited to: at least one processing unit 910, at least one storage unit 920, a bus 930 connecting different system components (including storage unit 920 and processing unit 910), and a display unit 940.

[0121] The storage unit stores program code that can be executed by the processing unit 910, causing the processing unit 910 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure. For example, the processing unit 910 is used to perform: Obtain the scaling parameters of the bone to be scaled, add the scaling parameters to the original bone data to obtain the target bone data, and generate an initial animation based on the target bone data; parse the initial animation to obtain the stretch transformation data of each bone; based on the stretch transformation data, separate the stretch components of the local space matrix of the bones in the initial animation to obtain the effective stretch data and the local space matrix data after removing the effective stretch data; generate the bone scaling animation in the game engine based on the effective stretch data and the local space matrix data.

[0122] Storage unit 920 may include readable media in the form of volatile storage units, such as random access memory (RAM) 921 and / or cache memory 922, and may further include read-only memory (ROM) 923.

[0123] Storage unit 920 may also include a program / utility 924 having a set (at least one) program module 925, such program module 925 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.

[0124] Bus 930 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.

[0125] Electronic device 900 can also communicate with one or more external devices 1000 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 900, and / or with any device that enables electronic device 900 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 950. Furthermore, electronic device 900 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 960. As shown, network adapter 960 communicates with other modules of electronic device 900 via bus 930. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0126] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.

[0127] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of this disclosure and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0128] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.

Claims

1. A method of generating a skeletal animation, the method comprising: The method comprises: obtaining a scaling parameter of a to-be-scaled bone, adding the scaling parameter to original bone data to obtain target bone data, and generating an initial animation based on the target bone data; parsing the initial animation to obtain stretch transformation data of each bone; based on the stretch transformation data, performing separation processing on the local space matrix of the bone in the initial animation to obtain effective stretch data and local space matrix data after removing the effective stretch data; generating a bone scaling animation in a game engine according to the effective stretch data and the local space matrix data.

2. The method of claim 1, wherein, The parsing of the initial animation to obtain the stretch transformation data of each bone comprises: for each frame of animation data in the initial animation, performing matrix decomposition on the local space matrix of each bone to obtain a first decomposition result; extracting the scaling component from the first decomposition result to obtain the stretch transformation data of each bone.

3. The method of claim 1, wherein, The parsing of the initial animation to obtain the stretch transformation data of each bone comprises: for each frame of animation data in the initial animation, performing matrix decomposition on the stretch matrix of each bone to obtain a second decomposition result; extracting the stretch component from the second decomposition result to obtain the stretch transformation data of each bone.

4. The method of claim 1, wherein, The separation processing of the stretch component on the local space matrix of the bone in the initial animation based on the stretch transformation data comprises: traversing each bone in the initial animation, and determining a bone with scaling based on the stretch transformation data; separating the stretch component in the local space matrix corresponding to the bone with scaling to obtain the effective stretch data; removing the local space matrix of the bone in the initial animation by the effective stretch data to obtain the local space matrix data.

5. The method of claim 4, wherein, Before the bone scaling animation is generated in the game engine according to the effective stretch data and the local space matrix data, the method further comprises: for each bone with scaling, converting the effective stretch data into curve data containing a three-dimensional scaling vector; merging the curve data and the local space matrix data into engine animation data, which is used to generate the bone scaling animation in the game engine.

6. The method of claim 1, wherein, The local space matrix data is used to represent the transformation of each bone in the local space; The generation of the bone scaling animation in the game engine according to the effective stretch data and the local space matrix data comprises: for each frame of animation, determining a global space matrix of each bone in the world coordinate based on the local space matrix data; performing local stretch transformation on the global space matrix of the corresponding bone in the world coordinate according to the effective stretch data to obtain a world space transformation matrix of the bone; performing animation skinning processing according to the world space transformation matrix of the bone to generate a bone scaling animation effect.

7. The method according to any one of claims 1 to 6, characterized in that, The obtaining of the scaling parameter of the to-be-scaled bone comprises: in response to a bone determination operation, determining a corresponding to-be-scaled bone according to the bone determination operation; In response to an attribute adjustment operation on the bone to be scaled, a scaling parameter corresponding to the attribute adjustment operation is determined.

8. An apparatus for generating a skeletal animation, the apparatus comprising: The device comprises: a data acquisition module, configured to acquire a scaling parameter of a bone to be scaled, add the scaling parameter to original bone data to obtain target bone data, and generate an initial animation based on the target bone data; a first processing module, configured to parse the initial animation to obtain stretch transformation data of each bone; a second processing module, configured to perform separation processing on a local space matrix of a bone in the initial animation based on the stretch transformation data, to obtain effective stretch data and local space matrix data after the effective stretch data is removed; an animation generation module, configured to generate a bone scaling animation in a game engine according to the effective stretch data and the local space matrix data.

9. A computer program product comprising a computer program, characterized in that, The computer program, when executed by a processor, implements the method of any one of claims 1 to 7.

10. An electronic device, comprising: comprises: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to implement the method of any one of claims 1 to 7 via execution of the executable instructions.