Animation generation method and device, computer equipment and computer readable storage medium

The displacement information of the virtual joint connection is determined and the animation has been resolved, which solves the difficulty of the existing technologies for the discerning of the animation of multiple subject bone model animation, and achieves simplification and efficiency improvement of animation generation.

CN119379870APending Publication Date: 2025-01-28NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411477275.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-21
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

The existing animation redirection technology can only animation redirect a single subject, and cannot effectively process the bone model bound to multiple subjects, resulting in difficulty in animation generation.

Method used

By obtaining the source of the skeletal model and the target skeletal model, the displacement information is determined by using the virtual joint connection relationship, and the skeletal animation is made based on this to the target skeletal model to generate animation frames.

Benefits of technology

Activating the animation orientation of the bone model bound to multiple subjects, simplify the animation generation process, improve the efficiency of animation generation, and ensure that the bone models in the animation are subjective.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119379870A_ABST
    Figure CN119379870A_ABST
Patent Text Reader

Abstract

Embodiments of the invention disclose an animation generation method and apparatus, a computer device and a computer readable storage medium. The method comprises the steps of obtaining a source skeleton animation corresponding to a source skeleton model; obtaining a target skeleton model to be added with animations; according to a first virtual connection relationship between the first source skeleton model and the second source skeleton model, determining displacement information of a second source virtual joint in a first animation frame of the source skeleton animation relative to the first source virtual joint; determining second target position information of a second target virtual joint of the second target skeleton model according to first target position information and displacement information of a first target virtual joint of the second target skeleton model; based on the second target position information, determining third target position information of a root joint of the second target skeleton model; and based on the third target position information, the source skeleton animation is refixed to the target skeleton model, a target skeleton animation of the target skeleton model is generated, and the animation generation effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of skeletal animation, and in particular to an animation generation method, apparatus, computer device and computer-readable storage medium. Background Art

[0002] Currently, animation redirection only supports animation redirection of a single subject. For skeletal models with multiple subjects bound, only the main subject can be animated, and the secondary subjects need to be animated separately. For example, for a person riding a horse or a person holding a sword, only the horse in the person riding a horse and the person holding a sword can be animated, which makes animation generation difficult. Summary of the invention

[0003] The embodiments of the present application provide an animation generation method, apparatus, computer device, and computer-readable storage medium, which can improve the generation efficiency of animation.

[0004] An animation generation method provided in an embodiment of the present application includes:

[0005] Acquire a source skeleton animation corresponding to a source skeleton model, wherein the source skeleton model includes a first source skeleton model and a second source skeleton model, and the second source skeleton model is bound to the first source skeleton model;

[0006] Acquire a target skeleton model to be added with animation, wherein the target skeleton model includes a first target skeleton model and a second target skeleton model;

[0007] Determine, according to a first virtual connection relationship between a first source virtual joint of the first source skeletal model and a second source virtual joint of the second source skeletal model, displacement information of the second source virtual joint relative to the first source virtual joint in a first animation frame of the source skeletal animation;

[0008] Determine, according to the first target position information of the first target virtual joint of the second target skeleton model corresponding to the first source virtual joint, and the displacement information, the second target position information of the second target virtual joint of the second target skeleton model corresponding to the second source virtual joint;

[0009] Based on the second target position information, determining third target position information of the root joint of the second target skeleton model;

[0010] The source skeletal animation is repositioned onto the target skeletal model based on the third target position information, a second animation frame corresponding to the first animation frame is generated, and a target skeletal animation of the target skeletal model is obtained based on the second animation frame.

[0011] Accordingly, an embodiment of the present application further provides an animation generating device, comprising:

[0012] A first acquisition unit is used to acquire a source skeleton animation corresponding to a source skeleton model, wherein the source skeleton model includes a first source skeleton model and a second source skeleton model, and the second source skeleton model is bound to the first source skeleton model;

[0013] A second acquisition unit is used to acquire a target skeleton model to be added with animation, wherein the target skeleton model includes a first target skeleton model and a second target skeleton model;

[0014] a displacement determining unit, configured to determine, according to a first virtual connection relationship between a first source virtual joint of the first source skeleton model and a second source virtual joint of the second source skeleton model, displacement information of the second source virtual joint relative to the first source virtual joint in a first animation frame of the source skeleton animation;

[0015] A first position determining unit, configured to determine second target position information of a second target virtual joint of the second target skeleton model corresponding to the second source virtual joint according to the first target position information of the first target virtual joint of the second target skeleton model corresponding to the first source virtual joint and the displacement information;

[0016] A second position determining unit, configured to determine third target position information of a root joint of the second target skeleton model based on the second target position information;

[0017] The animation generation unit is used to reposition the source skeleton animation to the target skeleton model based on the third target position information, generate a second animation frame corresponding to the first animation frame, and obtain the target skeleton animation of the target skeleton model based on the second animation frame.

[0018] Correspondingly, an embodiment of the present application also provides a computer device, including a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute any animation generation method provided in the embodiment of the present application.

[0019] Correspondingly, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is loaded by a processor to execute any one of the animation generation methods provided in the embodiments of the present application.

[0020] The embodiment of the present application obtains a source skeletal animation corresponding to a source skeletal model, wherein the source skeletal model includes a first source skeletal model and a second source skeletal model, and the second source skeletal model is bound to the first source skeletal model; obtains a target skeletal model to be added with animation, wherein the target skeletal model includes a first target skeletal model and a second target skeletal model; determines displacement information of the second source virtual joint relative to the first source virtual joint in a first animation frame of the source skeletal animation according to a first virtual connection relationship between a first source virtual joint of the first source skeletal model and a second source virtual joint of the second source skeletal model; determines second target position information of a second target virtual joint corresponding to the second source virtual joint of the second target skeletal model according to first target position information of the first target virtual joint corresponding to the first source virtual joint of the second target skeletal model, and displacement information; determines third target position information of a root joint of the second target skeletal model based on the second target position information; and repositions the source skeletal animation to the target skeletal model based on the third target position information, generates a second animation frame corresponding to the first animation frame, and obtains target skeletal animation of the target skeletal model based on the second animation frame.

[0021] As can be seen from the above, the embodiment of the present application links the first source skeleton model and the second source skeleton model through the first source virtual joint and the second source virtual joint, hiding the bone hierarchical relationship between the first source skeleton model and the second source skeleton model; and links the first target skeleton model and the second target skeleton model through the first target virtual joint and the second target virtual joint, hiding the bone hierarchical relationship between the first target skeleton model and the second target skeleton model, and reconstructs the position information of the root joint of the second target skeleton model relative to the first target virtual joint, so that the second target skeleton model can be animatedly redirected, and the animation redirection process only needs to focus on the position information of the root joint of the reconstructed second target skeleton model, making the animation generation process simpler and improving the animation generation efficiency.

[0022] Furthermore, since the first target virtual joint and the second target virtual joint are not parent-child nodes, the first target skeleton model and the second target skeleton model in the generated animation both have subjectivity, thereby improving the generation effect of the animation. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0024] Figure 1 is a flowchart of the animation generation method provided in an embodiment of the present application;

[0025] Figure 2 is a schematic diagram of the positional relationship between the virtual joint and the real joint provided in an embodiment of the present application;

[0026] Figure 3 is a schematic diagram of the position of the second target virtual joint before and after correction provided in an embodiment of the present application;

[0027] Figure 4 is a schematic diagram of the position relative to the animation observation point provided in an embodiment of the present application;

[0028] Figure 5 is a schematic diagram of an animation generating device provided in an embodiment of the present application;

[0029] Figure 6 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0031] The embodiment of the present application provides an animation generation method, device, computer equipment and computer readable storage medium. The animation generation device can be integrated in a computer equipment, which can be a server or a terminal.

[0032] The terminal may include a mobile phone, a wearable smart device, a tablet computer, a laptop computer, a personal computer (PC), and a vehicle-mounted computer.

[0033] Among them, the server can be an independent 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 communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms.

[0034] It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.

[0035] This embodiment will be described from the perspective of an animation generating device. The animation generating device may be integrated into a computer device, which may be a server or a terminal.

[0036] An animation generation method provided in an embodiment of the present application is as follows: Figure 1 As shown, the specific process of the animation generation method can be as follows:

[0037] 101. Obtain a source skeleton animation corresponding to a source skeleton model, where the source skeleton model includes a first source skeleton model and a second source skeleton model, and the second source skeleton model is bound to the first source skeleton model.

[0038] Among them, skeletal animation is a type of model animation, which generates animation for the model by changing the orientation and position of the bones. The source skeletal animation is the skeletal animation corresponding to the source skeletal model. The movement of the source skeletal model can be controlled based on the source skeletal animation.

[0039] The source skeleton model adds source skeleton animation, and the source skeleton model may include at least two skeleton models, wherein one skeleton model is the main body in the main source skeleton model, and the remaining skeleton models are secondary bodies, which are bound to the main body. Under the control of the source skeleton animation, the secondary bodies follow the movement of the main body, that is, the source skeleton model includes a first source skeleton model and a second source skeleton model, the first source skeleton model is the main body of the source skeleton model, the second source skeleton model is the secondary body of the source skeleton model, and the second source skeleton model is bound to the first source skeleton model. The second source skeleton model is bound to the first source skeleton model, which may mean that the first source skeleton model and the second source skeleton model correspond to the same root node, that is, the first source skeleton model and the second source skeleton model are included under one root node, or it may mean that the root joints of the first source skeleton model and the second source skeleton model are located at the same skeleton level.

[0040] For example, in the source skeleton model of a person riding a horse, the person moves with the horse, so the horse is the first source skeleton model and the person is the second source skeleton model; in the source skeleton model of a person holding a sword, the sword moves under the control of the person, so the person is the first source skeleton model and the sword is the second source skeleton model.

[0041] 102. Obtain a target skeleton model to which animation is to be added, where the target skeleton model includes a first target skeleton model and a second target skeleton model.

[0042] The target skeleton model is to be bound to the source skeleton animation. The target skeleton model may include at least two skeleton models, that is, the target skeleton model includes a first target skeleton model and a second target skeleton model. The first target skeleton model is the main body of the target skeleton model, and the second target skeleton model is the secondary body of the target skeleton model. The second target skeleton model is bound to the first target skeleton model, and the second target skeleton model follows the movement of the first target skeleton model.

[0043] For example, the target skeleton model to which animation needs to be added may be obtained according to user instructions.

[0044] 103. Determine displacement information of the second source virtual joint relative to the first source virtual joint in the first animation frame of the source skeletal animation according to a first virtual connection relationship between the first source virtual joint of the first source skeletal model and the second source virtual joint of the second source skeletal model.

[0045] The first target skeleton model, the second target skeleton model, the first source skeleton model and the second source skeleton model correspond to a virtual joint respectively, wherein the first source skeleton model corresponds to the first source virtual joint, the second source skeleton model corresponds to the second source virtual joint, the first target skeleton model corresponds to the first target virtual joint, and the second target skeleton model corresponds to the second target virtual joint. The virtual joint may be located on the skeleton model or not.

[0046] The virtual joints are not the joints that constitute the skeleton model and do not affect the skeleton structure of the skeleton model. The function of the first source virtual joint and the second source virtual joint is to establish a first virtual connection relationship between the first source skeleton model and the second source skeleton model to hide the skeleton hierarchical relationship between the first source skeleton model and the second source skeleton model. The function of the first target virtual joint and the second target virtual joint is to establish a second virtual connection relationship between the first target skeleton model and the second target skeleton model to hide the skeleton hierarchical relationship between the first source skeleton model and the second source skeleton model.

[0047] The bone hierarchical relationship is usually complex. Through the virtual connection relationship (the first virtual connection relationship and the second virtual connection relationship), there is no need to pay attention to the bone hierarchical relationship between the first source bone model and the second source bone model, and the bone hierarchical relationship between the first target bone model and the second target bone model during the animation generation process, making the animation generation process simpler.

[0048] For the source skeleton model, the first virtual connection relationship between the first source skeleton model and the second source skeleton model points from the first source virtual joint to the second source virtual joint, linking the first source skeleton model and the second source skeleton model. The first virtual connection relationship can indicate the displacement relationship between the first source virtual joint and the second source virtual joint, so as to determine the position of the second source virtual joint according to the position of the first source virtual joint, and then determine the displacement of the second source skeleton model relative to the first source skeleton model.

[0049] For the target skeleton model, the second virtual connection relationship between the first target skeleton model and the second target skeleton model points from the first target virtual joint to the second target virtual joint, links the first target skeleton model and the second target skeleton model, and determines the position of the second target virtual joint based on the position of the first target virtual joint and the association relationship between the first virtual connection relationship and the second virtual relationship.

[0050] like Figure 2 As shown, the first virtual connection relationship points from the first source virtual joint to the second source virtual joint, so the first virtual connection relationship [SP, EP] satisfies the relational expression (1):

[0051] Among them, SP is the world position of the first source virtual joint, EP is the world position of the second source virtual joint, and J s is the world position of the root joint of the second source skeleton model, It is the offset vector of the second source virtual joint relative to the root joint of the second source skeleton model.

[0052] Based on the second virtual connection relationship, according to the position information of the root node of the second source skeleton model in each animation frame of the source skeleton animation, the position information corresponding to the first virtual joint to the first frame of animation, and the second offset information, the displacement information of the second source virtual joint relative to the first source virtual joint can be calculated.

[0053] The second offset information may be pre-set or determined according to the position feature of the second source virtual joint, that is, in one embodiment, the first virtual connection relationship indicates the connection relationship between the second source virtual joint and the first source virtual joint, and the step of "determining the displacement information of the second source virtual joint relative to the first source virtual joint in the first animation frame of the source skeleton animation according to the first virtual connection relationship between the first source virtual joint of the first source skeleton model and the second source virtual joint of the second source skeleton model" includes:

[0054] Determine second offset information of the second source virtual joint relative to the root joint of the second source skeleton model;

[0055] According to the first virtual connection relationship, the second offset information, the source position information of the root joint of the second source skeleton model and the position information of the second source virtual joint are calculated and processed to obtain the displacement information of the second source virtual joint relative to the first source virtual joint in the first animation frame.

[0056] Among them, the position of the second source virtual joint can be pre-set, and according to the position of the root joint of the second source skeleton model, the offset vector of the second source virtual joint relative to the root joint of the second source skeleton model, that is, the second offset information, can be calculated.

[0057] The position of the second source virtual joint can also be determined according to the preset positional relationship between the first source virtual joint and the second source virtual joint. That is, in one embodiment, the step of "determining the second offset information of the second source virtual joint relative to the root joint of the second source skeleton model" includes:

[0058] determining a source real joint corresponding to the first source virtual joint from the first source skeletal model;

[0059] Determine first offset information of a first source virtual joint relative to a real joint;

[0060] According to the first offset information and a preset initial position relationship between the first source virtual joint and the second source virtual joint, second offset information of the second source virtual joint relative to the root joint of the second source skeleton model is determined.

[0061] The first source skeleton model, the second source skeleton model, the first source virtual joint and the second source virtual joint can be as follows Figure 2 As shown, the world position information SP of the first source virtual joint and the world position information EP of the second source virtual joint satisfy the following relationship.

[0062]

[0063]

[0064] Among them, M w To convert the position information of the source real joint into the transformation matrix of the world space, the source real joint can be a joint on the first source skeleton model, M s The transformation matrix M is used to convert the position information of the root joint of the second source skeleton model to the world space. w To transform the real joint position information into the world space transformation matrix, is the offset vector of the first source virtual joint relative to a real joint of the first source skeleton model, is the offset vector of the second source virtual joint relative to the root joint of the second source skeleton model (i.e., the second offset information), J w-1is the position information of the first source virtual joint in the binding posture, J s-1 It is the position information of the second source virtual joint in the binding posture.

[0065] The first source virtual joint may be pre-set, so SP is known. For example, SP may be a contact point where the first source skeleton model and the second source skeleton model contact each other in the first frame of the source skeleton animation. The first virtual source joint may also be a non-contact point. It can be determined based on the source real joint and the first source virtual joint. In the first frame of the skeletal animation, the positions of SP and EP can be set to coincide, so By combining equations (2) and (3), we can get

[0066] Sure That is, after obtaining the second offset information, according to the aforementioned relational expression (1), the displacement information of the second source virtual joint relative to the first source virtual joint can be obtained based on the second target root joint and the first source virtual joint.

[0067] The second virtual connection relationship between the first target skeleton model and the second target skeleton model can be established by aligning the target skeleton model with the source skeleton model in a binding posture, determining the first target virtual node of the first target skeleton model under the binding posture, and determining the second target virtual node of the second target model. That is, in one embodiment, before the step of "determining the second target position information of the second target virtual joint corresponding to the first source virtual joint of the second target skeleton model according to the first target position information of the first target virtual joint of the second target skeleton model and the displacement information", the animation generation method provided in the embodiment of the present application can also include:

[0068] Align the target skeleton model with the source skeleton model in binding pose;

[0069] Based on the target skeleton model in the binding posture, a first target virtual joint of the first target skeleton model is determined, and a second target virtual joint of the second target skeleton model is determined to establish a second virtual connection relationship between the first target skeleton model and the second target skeleton model.

[0070] Among them, the binding posture can be the posture of the target skeleton model before adding animation. Aligning the binding posture of the target skeleton model and the source skeleton model means setting the posture of the target skeleton model at -1 frame (that is, before adding animation) to be the same as the binding posture of the target skeleton model.

[0071] For the target skeleton model in the binding posture, the contact position of the first target skeleton model and the second target skeleton model is set as the first target virtual joint, and the contact position of the second target skeleton model and the first target skeleton model is set as the second target virtual joint.

[0072] Optionally, when the target skeleton model is in a binding posture, the first target virtual joint and the second target virtual joint may be manually set in space, and the positions of the first target virtual joint and the second target virtual joint may be set to overlap at -1 frame.

[0073] Since the positions of the first target virtual joint and the second target virtual joint in the -1 frame coincide with each other, the offset information of the second target virtual joint relative to the root node of the second target skeleton model can be calculated (for the sake of distinction, it can be called the second target offset information). The calculation process of the second target offset information can refer to the process of calculating the second offset information of the second source virtual joint relative to the root node of the second source skeleton model, which will not be repeated here.

[0074] 104. Determine the second target position information of the second target virtual joint of the second target skeleton model corresponding to the second source virtual joint according to the first target position information of the first target virtual joint of the second target skeleton model corresponding to the first source virtual joint and the displacement information.

[0075] For example, in each animation frame of the source skeletal animation, the displacement information of the second source virtual joint relative to the first source virtual joint (which can be called source displacement information) can be the same as the displacement information of the second target virtual joint relative to the first target virtual joint (which can be called target displacement information). Then, based on the source displacement information and the first target position information of the first target virtual joint, the position information of the second target virtual joint corresponding to the second source virtual joint, that is, the second target position information, can be determined.

[0076] Since the size of the target skeleton model for animation redirection may be different from that of the source skeleton model, if the target displacement information remains consistent with the source displacement information, the movement of the second target skeleton model may be uncoordinated, for example, too far or too close to the first target skeleton model, so the target displacement information can be corrected according to the size difference between the target skeleton model and the source skeleton model, so that the position of the root node reconstructed based on the second target virtual node is more accurate, that is, in one embodiment, the step of "determining the second target position information of the second target virtual joint corresponding to the first source virtual joint of the second target skeleton model according to the first target position information of the first target virtual joint corresponding to the first source virtual joint of the second target skeleton model, and the displacement information" may include:

[0077] Determine the size ratio of the source skeleton model and the target skeleton model;

[0078] Calculating candidate position information of the second target virtual joint according to the displacement information of the second source virtual joint in the first animation frame and the first target position information of the first target virtual joint;

[0079] The candidate position information is corrected according to the size ratio to obtain second target position information of the second target virtual joint in the second animation frame.

[0080] The size ratio includes the ratio of the length, width and height of the three-dimensional bounding box of the source skeleton model and the three-dimensional bounding box of the target skeleton model, that is, the size ratio can be a three-dimensional vector.

[0081] For example, the candidate position information of the second target virtual joint at time t may be:

[0082] in, is the candidate position information of the second target virtual joint, [SP t ,EP t ] is the position information of the second source virtual joint relative to the first source virtual joint at time t, SP′ t is the position information of the first target virtual joint at time t.

[0083] Correcting the candidate position information according to the size ratio may include scaling the candidate position information. Specifically, the candidate position information may be scaled using the following formula to obtain the second target position information.

[0084] EP′ t =Scale([SP t ,EP t ])+SP′ t

[0085] Among them, Scale is the size ratio, among them, EP′ t The second target position information of the second target virtual joint at time t.

[0086] By scaling, the human target can make the offset distance of the second target virtual joint relative to the first target virtual joint more reasonable. When the relative size of the first target skeleton model and the second target skeleton model is greatly different from the relative size of the first source skeleton model and the second source skeleton model, the offset angle of the second target skeleton model relative to the first target skeleton model, if the offset angle of the second source skeleton model relative to the first source skeleton model is the same as the offset angle of the second source skeleton model relative to the first source skeleton model, will result in an unnatural motion effect. For example, a little man rides a big horse, and a giant rides a donkey. If the offset angle of the little man and the horse is the same as the offset direction angle of the giant and the donkey, the offset position of the little man relative to the horse is not obvious, and the animation effect is poor. Therefore, the scaled position information can be adjusted according to the size difference between the first source skeleton model and the first target skeleton model, and the size difference between the second source skeleton model and the second target skeleton model. That is, in one embodiment, the step of "correcting the candidate position information according to the size ratio to obtain the second target position information of the second target virtual joint in the second animation frame" may include:

[0087] Scaling the candidate position information according to the size ratio to obtain scaled position information of the second target virtual joint;

[0088] Determining a first scaling compensation in at least one direction according to a size ratio of the second source skeleton model and the second target skeleton model in at least one direction;

[0089] Determining a second scaling compensation in at least one direction according to a size ratio of the first source skeleton model and the first target skeleton model in at least one direction;

[0090] The scaled position information is adjusted according to the first scaling compensation and the second scaling compensation to obtain second target position information of the second target virtual joint in the first animation frame.

[0091] For example, there are three directions, x, y and z, in three-dimensional space, and at least one direction may be one or more of them.

[0092] The second target position information can be calculated using the following formula.

[0093]

[0094] in, Among them, S x is the scaling compensation in the x direction, S y is the scaling compensation in the y direction, S z is the scaling compensation in the z direction, It can be obtained according to the first scaling compensation and the second scaling compensation.

[0095] For example, if the x direction is the forward direction of the target skeleton model and the z direction is the height direction, then S x Can be 1, that is For the first source skeleton model and the first target skeleton model, a scaling compensation in the y direction can be determined. Specifically, the ratio between the size of the first target skeleton model in the y direction and the size of the first source skeleton model in the y direction under the initial posture can be calculated to obtain the first scaling compensation S y .

[0096] For the second source skeleton model and the second target skeleton model, a scaling compensation in the z direction can be determined. Specifically, the ratio between the z component of the root node of the second target skeleton model and the z component of the second source skeleton model in the initial posture can be calculated to obtain the second scaling compensation. For example, if the second source skeleton model and the second target skeleton model are people or other virtual characters, the second scaling compensation can be determined based on the knee height and the root node. Specifically, the second scaling compensation S can be calculated by the following formula z .

[0097]

[0098]

[0099]

[0100] Among them, S z is the second scaling compensation, Z0 is the z component (i.e., height) of the left knee of the second source skeleton model, Z1 is the z component (i.e., height) of the right knee of the second source skeleton model, and Z SP It is the z component (i.e. height) of the root joint of the second source skeleton model.

[0101] Wherein, Z0′ is the z component (i.e., height) of the left knee of the second target skeleton model, Z1′ is the z component (i.e., height) of the right knee of the second target skeleton model, and Z S ' P It is the z component (i.e. height) of the root joint of the second target skeleton model.

[0102] Exemplarily, the second target position of the second target virtual joint before and after the correction process can be as follows: Figure 3 As shown, EP is the second source virtual joint, SP is a real joint of the first source skeleton model, SP` is a real joint of the second target skeleton model, EP` before correction and EP` after correction are the second target positions of the second target virtual joint before and after the correction process.

[0103] 105. Based on the second target position information, determine third target position information of the root joint of the second target skeleton model.

[0104] For example, the position information of the second target root joint may be determined based on an offset vector of the second target virtual joint relative to the root joint of the second target skeleton model (also referred to as the second target root joint).

[0105] 106. Reposition the source skeletal animation onto the target skeletal model based on the third target position information, generate a second animation frame corresponding to the first animation frame, and obtain the target skeletal animation of the target skeletal model based on the second animation frame.

[0106] For example, the third target position information is constrained to the displacement of the root joint of the second target skeleton model, and the displacement information of the root joint of the first source skeleton model is overlaid on the first target skeleton model to achieve displacement redirection of the second target skeleton model, generate a second animation frame sequence, and obtain the target skeleton animation corresponding to the target skeleton model according to the second animation frame sequence.

[0107] Optionally, the joint rotation of the second source skeletal model in the source skeletal animation can also be overlaid on the second target skeletal model, and the skeletal animation of the second target skeletal model can be generated by combining the redirected joint rotation information of the second target skeletal model and the position information of the root node. Overlaying the joint rotation of the second source skeletal model in the source skeletal animation on the second target skeletal model can be performed before step 103, or step 106 can include redirection of the joint rotation information.

[0108] In one embodiment, a hanging point animation can also be generated for the first target skeletal model based on the position information of the second target virtual joint. The hanging point animation separates the originally coupled first and second target skeletal models, and stores the position change information of the second target skeletal model relative to the first target skeletal model, so as to facilitate the dynamic addition or removal of the second target skeletal model and its animation with the hanging point as the parent when the game is running.

[0109] The conditions for generating hanging point animation are: first, separating the first target skeleton model from the second target skeleton model; second, requiring animation observation points and hanging points, wherein the animation observation points and hanging points are joints that have been added and actually exist in the first target skeleton model.

[0110] In one embodiment, the second target position information obtained by step 104 indicates the position of the second target virtual joint in the world space, and the hanging point position information driven by the animation observation point local transformation information needs to be determined to generate the target skeleton animation including the hanging point animation; that is, the step of "determining the third target position information of the root joint of the second target skeleton model based on the second target position information" includes:

[0111] Determine the animation observation point, and use the second target virtual joint as the animation hanging point;

[0112] Determine the hanging point animation of the animation hanging point according to the second target position information of the second target virtual joint and the position information of the animation observation point;

[0113] Based on the position information of the animation hanging point in the hanging point animation and the second offset information of the second source virtual joint relative to the root joint of the second source skeleton model, the third target position information of the root joint of the second target skeleton model is determined.

[0114] For example, a position is determined in space to deploy the animation observation point, and the animation observation point is used as the parent joint of the hanging point in the hanging point animation. The animation observation point can be set on the joint of the first target skeleton model, for example, on the root joint of the first target skeleton model, or the animation observation point can be the root joint of the first target skeleton model as the parent joint.

[0115] Based on the animation observation point, the second target position information of the second target virtual joint is converted into position information relative to the animation observation point to obtain the hanging point position information of the animation hanging point, and the hanging point animation is generated based on the hanging point position information of the animation hanging point.

[0116] After obtaining the hanging point animation, the third target position information of the root joint of the second target skeleton model can be calculated according to the hanging point position information and the second offset information of the animation hanging point.

[0117] The second target position information is converted into position information relative to the animation observation point, and the obtained hanging point animation can be converted specifically by the local transformation information of the animation observation point. That is, in one embodiment, the step of "determining the hanging point animation of the animation hanging point according to the second target position information of the second target virtual joint and the position information of the animation observation point" may include:

[0118] Determine local transformation information corresponding to the animation observation point according to the second target position information and the position information of the animation observation point;

[0119] Determine the hanging point position information of the animation hanging point of the first target skeleton model relative to the animation observation point according to the local transformation information and the position information of the animation observation point;

[0120] Generate hanging point animation of animation hanging points according to hanging point position information.

[0121] Based on the second target position information of the second target virtual joint and the position information of the animation observation point, the local transformation information of the animation observation point is determined. The second target position information of the second virtual joint can be converted into position information relative to the animation observation point through the local transformation information to obtain the hanging point position information of the animation hanging point relative to the animation observation point.

[0122] After the attachment point position information of the animation attachment point of the first target skeleton model is determined, the attachment point animation of the first target skeleton model may be generated.

[0123] The step of “determining the local transformation information corresponding to the animation observation point according to the second target position information and the position information of the animation observation point” may include:

[0124] Determine the offset vector of the animation hanging point relative to the animation observation point;

[0125] For each second animation frame, determining the rotation information between the second target virtual joint of the second animation frame and the adjacent second animation frame relative to the animation observation point according to the second target position information of the second target virtual joint in the second animation frame and the adjacent second animation frame and the position information of the observation point;

[0126] According to the rotation information and the offset vector, the local transformation information is obtained.

[0127] The offset vector T of the animation hanging point relative to the animation observation point may refer to the offset vector of the animation hanging point relative to the animation observation point in the adjacent second animation frame. In one embodiment, the animation hanging point relative to the animation observation point may also be set to the offset vector of the animation hanging point relative to the animation observation point in the binding posture.

[0128] The adjacent second animation frame may be the previous second animation frame. For each second animation frame, the rotation information required for the second target virtual joint of the previous second animation frame to rotate to the second target virtual joint of the second animation frame relative to the animation observation point of the previous frame is determined. The position relationship between the animation observation point OP′ and the second target virtual joint at time t of the second animation frame sequence [OP′, EP′ t ],like Figure 4 The vector [OP′,EP′ t ].

[0129] Figure 4 [OP′,CP′ t+1 ] can be considered as a vector [OP′,EP′ t ] rigid body transformation result, [OP′,CP′ t+1 ] and [OP′,EP′ t ] are equal in modulus length, and the calculation is from [OP′, EP′ t ] to [OP′,CP′ t+1 ] and convert the rotation information into a matrix form to obtain a rotation matrix R. Optionally, the rotation matrix R can be calculated by a Rodrigues' rotation formula.

[0130] According to the rotation matrix R and the translation vector T, the local transformation information M(R,T) of the animation observation point is obtained.

[0131] The step of "determining the hanging point position information of the animation hanging point of the first target skeleton model relative to the animation observation point according to the local transformation information and the position information of the animation observation point" includes:

[0132] For each second animation frame, according to the displacement ratio of the second target virtual joint in the second animation frame and the adjacent second animation frame relative to the animation observation point in the adjacent animation frame;

[0133] The hanging point position information of the animation hanging point relative to the animation observation point in the second animation frame is calculated according to the local transformation information, the position information of the animation observation point in the adjacent second animation frame, and the displacement ratio.

[0134] In order to obtain the actual hanging point position information, it is also necessary to determine the stretching ratio of the animation hanging point relative to the animation observation point through the second target position information at time t+1. The calculation formula is as follows:

[0135]

[0136] So you can get the hanging point location information:

[0137]

[0138] in, is the position information of the animation hanging point relative to the animation observation point at time t+1, OP′ t is the position of the animation observation point based on the world space at time t. The symbol ⊙ represents the element product, and the symbol Represents transpose.

[0139] When the hanging point position information of the animation hanging point of the first target skeletal model is obtained, the second target skeletal model and its skeletal animation can be placed in the child of the animation hanging point through a program or a constraint relationship. Among them, the offset vector of the root joint of the second target skeletal model relative to the animation hanging point is the second target offset vector. At this time, the position of the root joint of the second target skeletal model is the third target position. So far, the target skeletal animation based on the animation hanging point can be obtained, and the second target skeletal model and its skeletal animation can be arbitrarily loaded and unloaded from the hanging point of the first target skeletal model.

[0140] As can be seen from the above, the embodiment of the present application obtains the source skeletal animation corresponding to the source skeletal model, the source skeletal model includes a first source skeletal model and a second source skeletal model, and the second source skeletal model is bound to the first source skeletal model; obtains the target skeletal model to be added with animation, the target skeletal model includes a first target skeletal model and a second target skeletal model; according to the first virtual connection relationship between the first source virtual joint of the first source skeletal model and the second source virtual joint of the second source skeletal model, determines the displacement information of the second source virtual joint relative to the first source virtual joint in the first animation frame of the source skeletal animation; according to the first target position information of the first target virtual joint corresponding to the first source virtual joint of the second target skeletal model, and the displacement information, determines the second target position information of the second target virtual joint corresponding to the second source virtual joint of the second target skeletal model; based on the second target position information, determines the third target position information of the root joint of the second target skeletal model; based on the third target position information, resets the source skeletal animation to the target skeletal model, generates a second animation frame corresponding to the first animation frame, and obtains the target skeletal animation of the target skeletal model based on the second animation frame.

[0141] The embodiment of the present application links the first source skeleton model and the second source skeleton model through the first source virtual joint and the second source virtual joint, hiding the skeleton hierarchical relationship between the first source skeleton model and the second source skeleton model; and links the first target skeleton model and the second target skeleton model through the first target virtual joint and the second target virtual joint, hiding the skeleton hierarchical relationship between the first target skeleton model and the second target skeleton model, and reconstructs the position information of the root joint of the second target skeleton model relative to the first target virtual joint, so that the second target skeleton model can be animatedly redirected, and the animation redirection process only needs to focus on the position information of the root joint of the reconstructed second target skeleton model, making the animation generation process simpler and improving the animation generation efficiency.

[0142] Furthermore, since the first target virtual joint and the second target virtual joint are not parent-child nodes, the first target skeleton model and the second target skeleton model in the generated animation both have subjectivity, thereby improving the generation effect of the animation.

[0143] In order to better implement the animation generation method provided in the embodiment of the present application, an animation generation device is also provided in one embodiment. The meanings of the terms are the same as those in the above animation generation method, and the specific implementation details can refer to the description in the method embodiment.

[0144] The animation generating device can be integrated into a computer device, such as Figure 5As shown, the animation generating device may include: a first acquiring unit 301, a second acquiring unit 302, a displacement determining unit 303, a first position determining unit 304, a second position determining unit 305 and an animation generating unit 306, as follows:

[0145] (1) A first acquisition unit 301 is used to acquire a source skeleton animation corresponding to a source skeleton model. The source skeleton model includes a first source skeleton model and a second source skeleton model. The second source skeleton model is bound to the first source skeleton model.

[0146] (2) A second acquisition unit 302 is used to acquire a target skeleton model to which animation is to be added, where the target skeleton model includes a first target skeleton model and a second target skeleton model.

[0147] (3) A displacement determination unit 303, which is used to determine the displacement information of the second source virtual joint relative to the first source virtual joint in the first animation frame of the source skeletal animation according to the first virtual connection relationship between the first source virtual joint of the first source skeletal model and the second source virtual joint of the second source skeletal model.

[0148] In one embodiment, the displacement determination unit 303 may also be used to:

[0149] Determine second offset information of the second source virtual joint relative to the root joint of the second source skeleton model;

[0150] According to the first virtual connection relationship, the second offset information, the source position information of the root joint of the second source skeleton model and the position information of the second source virtual joint are calculated and processed to obtain the displacement information of the second source virtual joint relative to the first source virtual joint in the first animation frame.

[0151] In one embodiment, the displacement determination unit 303 may also be used to:

[0152] determining a source real joint corresponding to the first source virtual joint from the first source skeletal model;

[0153] Determine first offset information of a first source virtual joint relative to a real joint;

[0154] According to the first offset information and a preset initial position relationship between the first source virtual joint and the second source virtual joint, second offset information of the second source virtual joint relative to the root joint of the second source skeleton model is determined.

[0155] (4) A first position determination unit 304 is used to determine the second target position information of the second target virtual joint of the second target skeleton model corresponding to the second source virtual joint based on the first target position information of the first target virtual joint of the second target skeleton model corresponding to the first source virtual joint and the displacement information.

[0156] In one embodiment, the first position determining unit 304 may also be used to:

[0157] Determine the size ratio of the source skeleton model and the target skeleton model;

[0158] Calculating candidate position information of the second target virtual joint according to the displacement information of the second source virtual joint in the first animation frame and the first target position information of the first target virtual joint;

[0159] The candidate position information is corrected according to the size ratio to obtain second target position information of the second target virtual joint in the second animation frame.

[0160] In one embodiment, the first position determining unit 304 may also be used to:

[0161] Scaling the candidate position information according to the size ratio to obtain scaled position information of the second target virtual joint;

[0162] Determining a first scaling compensation in at least one direction according to a size ratio of the second source skeleton model and the second target skeleton model in at least one direction;

[0163] Determining a second scaling compensation in at least one direction according to a size ratio of the first source skeleton model and the first target skeleton model in at least one direction;

[0164] The scaled position information is adjusted according to the first scaling compensation and the second scaling compensation to obtain second target position information of the second target virtual joint in the first animation frame.

[0165] (5) A second position determining unit 305, configured to determine third target position information of a root joint of the second target skeleton model based on the second target position information.

[0166] In one embodiment, the second position determination unit 305 may also be used for:

[0167] Determine the animation observation point, and use the second target virtual joint as the animation hanging point;

[0168] Determine the hanging point animation of the animation hanging point according to the second target position information of the second target virtual joint and the position information of the animation observation point;

[0169] Based on the position information of the animation hanging point in the hanging point animation and the second offset information of the second source virtual joint relative to the root joint of the second source skeleton model, the third target position information of the root joint of the second target skeleton model is determined.

[0170] In one embodiment, the second position determination unit 305 may also be used for:

[0171] Determine local transformation information corresponding to the animation observation point according to the second target position information and the position information of the animation observation point;

[0172] Determine the hanging point position information of the animation hanging point of the first target skeleton model relative to the animation observation point according to the local transformation information and the position information of the animation observation point;

[0173] Generate hanging point animation of animation hanging points according to hanging point position information.

[0174] In one embodiment, the second position determination unit 305 may also be used for:

[0175] Determine the offset vector of the animation hanging point relative to the animation observation point;

[0176] For each second animation frame, determining the rotation information between the second target virtual joint of the second animation frame and the adjacent second animation frame relative to the animation observation point according to the second target position information of the second target virtual joint in the second animation frame and the adjacent second animation frame and the position information of the observation point;

[0177] According to the rotation information and the offset vector, the local transformation information is obtained.

[0178] In one embodiment, the second position determination unit 305 may also be used for:

[0179] For each second animation frame, according to the displacement ratio of the second target virtual joint in the second animation frame and the adjacent second animation frame relative to the animation observation point in the adjacent animation frame;

[0180] The hanging point position information of the animation hanging point relative to the animation observation point in the second animation frame is calculated according to the local transformation information, the position information of the animation observation point in the adjacent second animation frame, and the displacement ratio.

[0181] (6) Animation generation unit 306, used to reposition the source skeletal animation to the target skeletal model based on the third target position information, generate a second animation frame corresponding to the first animation frame, and obtain the target skeletal animation of the target skeletal model based on the second animation frame.

[0182] In one embodiment, the animation generating device may further include:

[0183] Align the target skeleton model with the source skeleton model in binding pose;

[0184] Based on the target skeleton model in the binding posture, a first target virtual joint of the first target skeleton model is determined, and a second target virtual joint of the second target skeleton model is determined to establish a second virtual connection relationship between the first target skeleton model and the second target skeleton model.

[0185] As can be seen from the above, the animation generating device of the embodiment of the present application obtains the source skeleton animation corresponding to the source skeleton model through the first obtaining unit 301, the source skeleton model includes the first source skeleton model and the second source skeleton model, and the second source skeleton model is bound to the first source skeleton model; the second obtaining unit 302 obtains the target skeleton model to be added with animation, the target skeleton model includes the first target skeleton model and the second target skeleton model; the displacement determining unit 303 determines the position of the second source virtual joint relative to the first source virtual joint in the first animation frame of the source skeleton animation according to the first virtual connection relationship between the first source virtual joint of the first source skeleton model and the second source virtual joint of the second source skeleton model. The first position determining unit 304 determines the second target position information of the second target virtual joint corresponding to the second source virtual joint of the second target skeleton model according to the first target position information of the first target virtual joint corresponding to the first source virtual joint of the second target skeleton model and the displacement information; the second position determining unit 305 determines the third target position information of the root joint of the second target skeleton model based on the second target position information; the animation generating unit 306 resets the source skeleton animation to the target skeleton model based on the third target position information, generates a second animation frame corresponding to the first animation frame, and obtains the target skeleton animation of the target skeleton model based on the second animation frame.

[0186] The embodiment of the present application links the first source skeleton model and the second source skeleton model through the first source virtual joint and the second source virtual joint, hiding the skeleton hierarchical relationship between the first source skeleton model and the second source skeleton model; and links the first target skeleton model and the second target skeleton model through the first target virtual joint and the second target virtual joint, hiding the skeleton hierarchical relationship between the first target skeleton model and the second target skeleton model, and reconstructs the position information of the root joint of the second target skeleton model relative to the first target virtual joint, so that the second target skeleton model can be animatedly redirected, and the animation redirection process only needs to focus on the position information of the root joint of the reconstructed second target skeleton model, making the animation generation process simpler and improving the animation generation efficiency.

[0187] Furthermore, since the first target virtual joint and the second target virtual joint are not parent-child nodes, the first target skeleton model and the second target skeleton model in the generated animation both have subjectivity, thereby improving the generation effect of the animation.

[0188] Accordingly, the embodiment of the present application also provides a computer device, which may be a terminal. Figure 6 As shown, Figure 6A schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device 500 includes a processor 501 having one or more processing cores, a memory 502 having one or more computer-readable storage media, and a computer program stored in the memory 502 and executable on the processor. The processor 501 is electrically connected to the memory 502. It will be understood by those skilled in the art that the computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0189] The processor 501 is the control center of the computer device 500. It uses various interfaces and lines to connect the various parts of the entire computer device 500, executes various functions of the computer device 500 and processes data by running or loading software programs and / or modules stored in the memory 502, and calling data stored in the memory 502, thereby monitoring the computer device 500 as a whole.

[0190] In the embodiment of the present application, the processor 501 in the computer device 500 will load instructions corresponding to the processes of one or more application programs into the memory 502 according to the following steps, and the processor 501 will run the application programs stored in the memory 502 to implement various functions:

[0191] Obtaining a source skeleton animation corresponding to a source skeleton model, where the source skeleton model includes a first source skeleton model and a second source skeleton model, and the second source skeleton model is bound to the first source skeleton model;

[0192] Obtain a target skeleton model to be added with animation, where the target skeleton model includes a first target skeleton model and a second target skeleton model;

[0193] Determine, according to a first virtual connection relationship between a first source virtual joint of the first source skeleton model and a second source virtual joint of the second source skeleton model, displacement information of the second source virtual joint relative to the first source virtual joint in a first animation frame of the source skeleton animation;

[0194] Determine second target position information of a second target virtual joint of the second target skeleton model corresponding to the second source virtual joint according to first target position information of the first target virtual joint of the second target skeleton model corresponding to the first source virtual joint and displacement information;

[0195] Based on the second target position information, determine third target position information of the root joint of the second target skeleton model;

[0196] The source skeletal animation is repositioned onto the target skeletal model based on the third target position information, a second animation frame corresponding to the first animation frame is generated, and a target skeletal animation of the target skeletal model is obtained based on the second animation frame.

[0197] The embodiment of the present application links the first source skeleton model and the second source skeleton model through the first source virtual joint and the second source virtual joint, hiding the skeleton hierarchical relationship between the first source skeleton model and the second source skeleton model; and links the first target skeleton model and the second target skeleton model through the first target virtual joint and the second target virtual joint, hiding the skeleton hierarchical relationship between the first target skeleton model and the second target skeleton model, and reconstructs the position information of the root joint of the second target skeleton model relative to the first target virtual joint, so that the second target skeleton model can be animatedly redirected, and the animation redirection process only needs to focus on the position information of the root joint of the reconstructed second target skeleton model, making the animation generation process simpler and improving the animation generation efficiency.

[0198] Furthermore, since the first target virtual joint and the second target virtual joint are not parent-child nodes, the first target skeleton model and the second target skeleton model in the generated animation both have subjectivity, thereby improving the generation effect of the animation.

[0199] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0200] Optional, such as Figure 6 As shown, the computer device 500 further includes: a touch screen 503, a radio frequency circuit 504, an audio circuit 505, an input unit 506, and a power supply 507. The processor 501 is electrically connected to the touch screen 503, the radio frequency circuit 504, the audio circuit 505, the input unit 506, and the power supply 507, respectively. Those skilled in the art can understand that Figure 6 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0201] The touch display screen 503 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 503 may include a display panel and a touch panel. Among them, the display panel may be used to display information input by the user or information provided to the user and various graphical user interfaces of computer equipment, and these graphical user interfaces may be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel may be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light emitting diode (OLED, Organic Light-Emitting Diode) and the like. The touch panel may be used to collect the user's touch operation on or near it (such as the user using any suitable object or attachment such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 501, and can receive the command sent by the processor 501 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 501 to determine the type of touch event, and then the processor 501 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 503 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 503 can also be used as a part of the input unit 506 to realize the input function.

[0202] The radio frequency circuit 504 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other computer devices through wireless communication, and to send and receive signals between the network device or other computer devices.

[0203] The audio circuit 505 can be used to provide an audio interface between the user and the computer device through a speaker and a microphone. The audio circuit 505 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 505 and converted into audio data, and then the audio data is output to the processor 501 for processing, and then sent to another computer device through the radio frequency circuit 504, or the audio data is output to the memory 502 for further processing. The audio circuit 505 may also include an earphone jack to provide communication between an external headset and the computer device.

[0204] The input unit 506 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0205] The power supply 507 is used to supply power to various components of the computer device 500. Optionally, the power supply 507 can be logically connected to the processor 501 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The power supply 507 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0206] although Figure 6 Not shown, the computer device 500 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.

[0207] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0208] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0209] To this end, an embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored, and the computer program can be loaded by a processor to execute the steps in any animation generation method provided in the embodiment of the present application. For example, the computer program can execute the following steps:

[0210] Obtaining a source skeleton animation corresponding to a source skeleton model, where the source skeleton model includes a first source skeleton model and a second source skeleton model, and the second source skeleton model is bound to the first source skeleton model;

[0211] Obtain a target skeleton model to be added with animation, where the target skeleton model includes a first target skeleton model and a second target skeleton model;

[0212] Determine, according to a first virtual connection relationship between a first source virtual joint of the first source skeleton model and a second source virtual joint of the second source skeleton model, displacement information of the second source virtual joint relative to the first source virtual joint in a first animation frame of the source skeleton animation;

[0213] Determine second target position information of a second target virtual joint of the second target skeleton model corresponding to the second source virtual joint according to first target position information of the first target virtual joint of the second target skeleton model corresponding to the first source virtual joint and displacement information;

[0214] Based on the second target position information, determine third target position information of the root joint of the second target skeleton model;

[0215] The source skeletal animation is repositioned onto the target skeletal model based on the third target position information, a second animation frame corresponding to the first animation frame is generated, and a target skeletal animation of the target skeletal model is obtained based on the second animation frame.

[0216] The embodiment of the present application links the first source skeleton model and the second source skeleton model through the first source virtual joint and the second source virtual joint, hiding the skeleton hierarchical relationship between the first source skeleton model and the second source skeleton model; and links the first target skeleton model and the second target skeleton model through the first target virtual joint and the second target virtual joint, hiding the skeleton hierarchical relationship between the first target skeleton model and the second target skeleton model, and reconstructs the position information of the root joint of the second target skeleton model relative to the first target virtual joint, so that the second target skeleton model can be animatedly redirected, and the animation redirection process only needs to focus on the position information of the root joint of the reconstructed second target skeleton model, making the animation generation process simpler and improving the animation generation efficiency.

[0217] Furthermore, since the first target virtual joint and the second target virtual joint are not parent-child nodes, the first target skeleton model and the second target skeleton model in the generated animation both have subjectivity, thereby improving the generation effect of the animation.

[0218] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0219] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0220] The above is a detailed introduction to an animation generation method, device, computer equipment and computer storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. An animation generation method, characterized in that: include: Acquire a source skeleton animation corresponding to a source skeleton model, wherein the source skeleton model includes a first source skeleton model and a second source skeleton model, and the second source skeleton model is bound to the first source skeleton model; Acquire a target skeleton model to be added with animation, wherein the target skeleton model includes a first target skeleton model and a second target skeleton model; Determine, according to a first virtual connection relationship between a first source virtual joint of the first source skeletal model and a second source virtual joint of the second source skeletal model, displacement information of the second source virtual joint relative to the first source virtual joint in a first animation frame of the source skeletal animation; Determine, according to the first target position information of the first target virtual joint of the second target skeleton model corresponding to the first source virtual joint, and the displacement information, the second target position information of the second target virtual joint of the second target skeleton model corresponding to the second source virtual joint; Based on the second target position information, determining third target position information of the root joint of the second target skeleton model; The source skeletal animation is repositioned onto the target skeletal model based on the third target position information, a second animation frame corresponding to the first animation frame is generated, and a target skeletal animation of the target skeletal model is obtained based on the second animation frame.

2. The method according to claim 1, characterized in that: The first virtual connection relationship indicates a connection relationship between the second source virtual joint and the first source virtual joint, and determining, according to the first virtual connection relationship between the first source virtual joint of the first source skeletal model and the second source virtual joint of the second source skeletal model, displacement information of the second source virtual joint relative to the first source virtual joint in the first animation frame of the source skeletal animation comprises: Determine second offset information of the second source virtual joint relative to the root joint of the second source skeleton model; According to the first virtual connection relationship, the second offset information, the source position information of the root joint of the second source skeleton model, and the position information of the second source virtual joint are calculated and processed to obtain the displacement information of the second source virtual joint relative to the first source virtual joint in the first animation frame.

3. The method according to claim 2, characterized in that The method of determining, according to the first target position information of the first target virtual joint of the second target skeleton model corresponding to the first source virtual joint and the displacement information, the second target position information of the second target virtual joint of the second target skeleton model corresponding to the second source virtual joint comprises: Determining a size ratio between the source skeleton model and the target skeleton model; Calculating candidate position information of the second target virtual joint according to the displacement information of the second source virtual joint in the first animation frame and the first target position information of the first target virtual joint; The candidate position information is corrected according to the size ratio to obtain second target position information of the second target virtual joint in the second animation frame.

4. The method according to claim 3, characterized in that The correcting the candidate position information according to the size ratio to obtain the second target position information of the second target virtual joint in the second animation frame includes: Scaling the candidate position information according to the size ratio to obtain scaled position information of the second target virtual joint; Determine a first scaling compensation in at least one direction according to a size ratio of the second source skeleton model to the second target skeleton model in at least one direction; Determine a second scaling compensation in at least one direction according to a size ratio of the first source skeleton model to the first target skeleton model in at least one direction; The scaled position information is adjusted according to the first scaling compensation and the second scaling compensation to obtain second target position information of the second target virtual joint in the first animation frame.

5. The method according to claim 2, characterized in that: The determining of second offset information of the second source virtual joint relative to the root joint of the second source skeleton model includes: Determining a source real joint corresponding to the first source virtual joint from the first source skeleton model; Determine first offset information of the first source virtual joint relative to the real joint; According to the first offset information and a preset initial position relationship between the first source virtual joint and the second source virtual joint, second offset information of the second source virtual joint relative to the root joint of the second source skeleton model is determined.

6. The method according to claim 5, characterized in that Before determining the second target position information of the second target virtual joint corresponding to the second source virtual joint of the second target skeleton model according to the first target position information of the first target virtual joint corresponding to the first source virtual joint of the second target skeleton model and the displacement information, the method further includes: Aligning the target skeleton model with the source skeleton model in binding posture; Based on the target skeleton model in the binding posture, a first target virtual joint of the first target skeleton model is determined, and a second target virtual joint of the second target skeleton model is determined to establish a second virtual connection relationship between the first target skeleton model and the second target skeleton model.

7. The method according to any one of claims 1 to 6, characterized in that: The step of determining the third target position information of the root joint of the second target skeleton model based on the second target position information includes: Determine an animation observation point, and use the second target virtual joint as an animation hanging point; Determine the hanging point animation of the animation hanging point according to the second target position information of the second target virtual joint and the position information of the animation observation point; Based on the position information of the animation hanging point in the hanging point animation and the second offset information of the second source virtual joint relative to the root joint of the second source skeleton model, the third target position information of the root joint of the second target skeleton model is determined.

8. The method according to claim 7, characterized in that Determining the hanging point animation of the animation hanging point according to the second target position information of the second target virtual joint and the position information of the animation observation point includes: Determining local transformation information corresponding to the animation observation point according to the second target position information and the position information of the animation observation point; Determine the hanging point position information of the animation hanging point of the first target skeleton model relative to the animation observation point according to the local transformation information and the position information of the animation observation point; Generate the hanging point animation of the animation hanging point according to the hanging point position information.

9. The method according to claim 8, characterized in that The determining, according to the second target position information and the position information of the animation observation point, the local transformation information corresponding to the animation observation point comprises: Determine an offset vector of the animation hanging point relative to the animation observation point; For each of the second animation frames, determining, relative to the animation observation point, rotation information between the second target virtual joint of the second animation frame and the adjacent second animation frame according to the second target position information of the second target virtual joint in the second animation frame and the adjacent second animation frame and the position information of the observation point; The local transformation information is obtained according to the rotation information and the offset vector.

10. The method according to claim 8, characterized in that The step of determining the hanging point position information of the animation hanging point of the first target skeleton model relative to the animation observation point according to the local transformation information and the position information of the animation observation point comprises: For each second animation frame, according to the displacement ratio of the second target virtual joint in the second animation frame and the adjacent second animation frame relative to the animation observation point in the adjacent animation frame; The hanging point position information of the animation hanging point relative to the animation observation point in the second animation frame is calculated according to the local transformation information, the position information of the animation observation point in the adjacent second animation frame, and the displacement ratio.

11. An animation generating device, characterized in that: include: A first acquisition unit is used to acquire a source skeleton animation corresponding to a source skeleton model, wherein the source skeleton model includes a first source skeleton model and a second source skeleton model, and the second source skeleton model is bound to the first source skeleton model; A second acquisition unit is used to acquire a target skeleton model to be added with animation, wherein the target skeleton model includes a first target skeleton model and a second target skeleton model; a displacement determining unit, configured to determine, according to a first virtual connection relationship between a first source virtual joint of the first source skeleton model and a second source virtual joint of the second source skeleton model, displacement information of the second source virtual joint relative to the first source virtual joint in a first animation frame of the source skeleton animation; A first position determining unit, configured to determine second target position information of a second target virtual joint of the second target skeleton model corresponding to the second source virtual joint according to the first target position information of the first target virtual joint of the second target skeleton model corresponding to the first source virtual joint and the displacement information; A second position determining unit, configured to determine third target position information of a root joint of the second target skeleton model based on the second target position information; The animation generation unit is used to reposition the source skeleton animation to the target skeleton model based on the third target position information, generate a second animation frame corresponding to the first animation frame, and obtain the target skeleton animation of the target skeleton model based on the second animation frame.

12. A computer device, characterized in that: It comprises a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the animation generation method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is loaded by a processor to execute the animation generation method according to any one of claims 1 to 10.