Animation generation method and apparatus and electronic device

By automatically controlling the bone movement of the object model, efficient animation effects are generated, which solves the time-consuming and laborious and complex problems of manual animation production in the existing technology, and realizes a simpler and more efficient animation generation process.

WO2025001731A9PCT designated stage expired Publication Date: 2025-03-20NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/096363
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-06-29
Filing Date
2024-05-30
Publication Date
2025-03-20

AI Technical Summary

Technical Problem

In the prior art, manual production of video frames and setting driver keyframes is time-consuming and labor-intensive when creating model animations, and it is complicated and difficult to achieve efficient automatic collision or squeezing effects, resulting in poor animation effects.

Method used

By obtaining two object models and their bound bones, obtaining preset movement values ​​of the bones, and automatically controlling bone movement based on these values, generating moving animations or extrusion animations of the object model.

Benefits of technology

Simplifies the animation generation process, improves the animation generation efficiency and effect, and reduces the time and error of manual adjustment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024096363_20032025_PF_FP_ABST
    Figure CN2024096363_20032025_PF_FP_ABST
Patent Text Reader

Abstract

An animation generation method and apparatus and an electronic device. The method comprises: acquiring a first object model and a second object model, wherein the first object model is bound with a first skeleton, and the second object model is bound with a second skeleton (S302); acquiring a first preset movement value of the first skeleton in a first direction and a second preset movement value of the second skeleton in a second direction (S304); and on the basis of the first preset movement value and the second preset movement value, controlling the movement of the first skeleton and the second skeleton to generate movement animations of the first object model and the second object model (S306). Thus, a small number of skeletons are set in object models, model vertexes of different object models are controlled by means of the skeletons, arithmetic logic of movement values is directly added in a skeleton binding link, and by means of preset movement values, the movement of the skeletons is automatically controlled to generate movement animations of the models, so that the production process is simple, and the animation generation efficiency and the animation effect are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Animation generation method, device and electronic device

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to Chinese patent application number 202310792895.6, filed on June 29, 2023, entitled “Animation Generation Method, Device and Electronic Device”, the entire contents of which are incorporated herein by reference. Technical Field

[0003] The present disclosure relates to the field of computer technology, and in particular to an animation generation method, an animation generation device, a computer-readable storage medium, and an electronic device. Background Art

[0004] When making model animations, it is usually necessary to make animations of two models or two parts of a model moving, colliding or squeezing each other, such as eyelids blinking, eyelids squeezing and colliding, mouths opening and closing and colliding when speaking, muscles squeezing each other, etc. In related technologies, bones are usually created at the local model where the collision occurs, and the bones and models are bound, and video frames of moving animations or collision animations are manually made by adjusting the bone controller. The animation effects of moving animations, local collisions or squeezing are achieved by setting driving keyframes. However, the manual production of video frames is time-consuming and labor-intensive, and the method of setting driving keyframes is also relatively complicated. It can only simulate automated movement or collision effects by manually setting numerical constraints within a certain range. In the case of squeezing, there may also be problems with the mold penetration, resulting in poor animation effects.

[0005] Summary of the Invention

[0006] In view of this, the present disclosure provides an animation generation method, an animation generation device, a computer-readable storage medium, and an electronic device, which can improve animation generation efficiency and animation effects.

[0007] According to a first aspect of the present disclosure, an animation generation method is provided, the method comprising: obtaining a first object model and a second object model; wherein the first object model is bound to a first bone, and the second object model is bound to a second bone; the first bone is used to control at least part of the model vertices of the first object model, and the second bone is used to control at least part of the model vertices of the second object model; obtaining a first preset movement value of the first bone in a first direction and a second preset movement value of the second bone in a second direction; controlling the movement of the first bone and the second bone according to the first preset movement value and the second preset movement value to generate movement animations of the first object model and the second object model.

[0008] According to a second aspect of the present disclosure, an animation generation device is provided, which includes: a model acquisition module, configured to execute acquisition of a first object model and a second object model; wherein the first object model is bound to a first skeleton, and the second object model is bound to a second skeleton; the first skeleton is used to control at least part of the model vertices of the first object model, and the second skeleton is used to control at least part of the model vertices of the second object model; a movement value acquisition module, configured to execute according to a first preset movement value of the first skeleton in a first direction and a second preset movement value of the second skeleton in a second direction; an animation generation module, configured to execute according to the first preset movement value and the second preset movement value, control the movement of the first skeleton and the second skeleton, and generate movement animation of the first object model and the second object model.

[0009] According to a third aspect of the present disclosure, an electronic device is provided, including a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement any one of the animation generation methods of the first aspect.

[0010] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement any animation generation method of the first aspect.

[0011] Compared with the related art, the embodiments of the present disclosure bring the following beneficial effects:

[0012] The embodiments of the present disclosure provide an animation generation method, an animation generation device, a computer-readable storage medium, and an electronic device, which are configured by obtaining a first object model and a second object model; the first object model is bound to a first bone, and the second object model is bound to a second bone; obtaining a first preset movement value of the first bone in a first direction and a second preset movement value of the second bone in a second direction; and controlling the movement of the first bone and the second bone according to the first preset movement value and the second preset movement value to generate a movement animation of the first object model and the second object model. In this method, a small number of bones are set in the object model, and the model vertices of different object models are controlled by the bones. The calculation logic of the movement value is directly added to the bone binding link. The movement animation of the model is automatically controlled by the preset movement value. The production process is simple, and the animation generation efficiency and animation effect are improved.

[0013] Other features and advantages of the present disclosure will be described in the following description, and in part will become apparent from the description, or understood by practicing the present disclosure. The objectives and other advantages of the present disclosure are realized and obtained by the structures particularly pointed out in the description, claims and drawings.

[0014] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0016] FIG1 is a schematic diagram of binding an eye model according to one embodiment of the present disclosure;

[0017] FIG2 is a flowchart of a traditional eye model binding process according to one embodiment of the present disclosure;

[0018] FIG3 is a flowchart of an animation generation method according to one embodiment of the present disclosure;

[0019] FIG4 is a schematic diagram of binding another eye model according to one of the embodiments of the present disclosure;

[0020] FIG5 is a schematic diagram of a node command connection according to one embodiment of the present disclosure;

[0021] FIG6 is a flowchart of an eye model binding process according to one embodiment of the present disclosure;

[0022] FIG7 is a schematic diagram of an extrusion of an eye model according to one embodiment of the present disclosure;

[0023] FIG8 is a partial connection diagram of a node command according to one embodiment of the present disclosure;

[0024] FIG9 is a partial connection diagram of another node command according to one embodiment of the present disclosure;

[0025] FIG10 is a partial connection diagram of another node command according to one embodiment of the present disclosure;

[0026] FIG11 is a partial connection diagram of another node command according to one embodiment of the present disclosure;

[0027] FIG12 is a partial connection diagram of another node command according to one embodiment of the present disclosure;

[0028] FIG13 is a schematic structural diagram of an animation generating device according to one embodiment of the present disclosure;

[0029] FIG14 is a schematic structural diagram of an electronic device according to one of the embodiments of the present disclosure. DETAILED DESCRIPTION

[0030] To make the purpose, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of the present disclosure, not all of them. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present disclosure.

[0031] When making model animations at present, it is usually necessary to make animations of two models or two parts of a model moving in a related manner, colliding with each other or squeezing each other, such as eyelid blinking, eyelid squeezing and colliding, mouth opening and closing and colliding when speaking, muscles squeezing each other, etc. In related technologies, bones are usually created at the local model where the collision occurs, and the bones and the model are bound, and video frames of the related moving animation or collision animation are manually made by adjusting the bone controller. The animation effects of moving animation, local collision or squeezing are achieved by setting the driven keyframe (SetDrivenKey). However, the manual production of video frames is time-consuming and labor-intensive, and there are also defects such as inconvenient animation adjustment or inaccurate collision positions and data values, which result in poor animation effects.

[0032] Among them, setting driven keyframes is a function used to control and automatically generate animations under manual assisted settings. It can constrain and place on the same channel of an object and merge the two states. It links one attribute (Driven) with another attribute (Driver), so that the value of another attribute can be automatically adjusted by controlling one attribute. For example, by linking the shape attribute of an object with its position attribute, the position attribute can be automatically adjusted by controlling the shape attribute, realizing automatic adjustment of the object's position when the shape changes. The core command of this tool is the setRange node, which is used to map the input value from one range to another, specify the minimum and maximum values ​​of the input value, and specify a new minimum and maximum output value. In this way, when the input value is within the input range, the setRange node will map it to the output range, achieving the effect of local simulation of automatic animation.

[0033] However, setting driven keyframes requires a certain degree of professional skills and training to be proficient in use. It is relatively complex and can only simulate automation effects by manually setting numerical constraints within a certain range. It does not have the function of automatic collision or squeezing. The specific technical problems are as follows:

[0034] 1. Low degree of freedom: SetDrivenKey has a relatively small degree of freedom and cannot perform arbitrary animation operations freely. It can only display linear effects within a fixed range in the preset control.

[0035] 2. Limited animation effects: Certain operations in SetDrivenKey may restrict animation effects and have poor flexibility. Only fixed follow amplitudes and values ​​can be set. Exceeding the set value will not produce any effect. However, setting a larger value may result in poor effects or clipping in the middle of the animation, making it impossible to achieve more complex and flexible performance.

[0036] 3. Error-prone: Errors are prone to occur during the SetDrivenKey operation. If you make an error in the operation, it is likely to cause problems, which will require a certain amount of debugging and repair time.

[0037] 4. Inconvenient adjustment: When using SetDrivenKey for animation and deformation operations, many nodes and controls need to be created, and the generated setRange nodes are difficult to find if they are not checked one by one, which may cause accidental touches and result in effect errors. Too many nodes and controls make management more troublesome, and nodes need to be retrieved one by one and deleted and rebuilt, which is not conducive to work efficiency.

[0038] 5. Inaccuracy: Since SetDrivenKey is a preset effect, when manually setting constraints, there may be deviations from the manually adjusted effect, especially for complex collisions with multiple controllers, making it difficult to achieve a more rigorous effect.

[0039] Taking the eye model as an example, to ensure the effect and quality of the eyeball and eyelid tracking, the number of bones involved in the skinning generally depends on the number of wiring segments of the eye model. A typical model requires approximately 20-40 bones. As shown in Figure 1, the spheres surrounding the eyes represent multiple bound bones, and the crescent-shaped patterns surrounding the bones represent the controllers of the bones (including multiple). Therefore, traditional eye rigging is time-consuming and complex. In addition to building multiple bones and assigning skinning weights, multiple steps are required, such as establishing locators for mutual control between bones, curve deformation, parent-child constraints, controller construction for creating the eye-closing effect, and constraining eyelid tracking. Figure 2 shows the traditional eye rigging production flow chart.

[0040] Based on this, the embodiments of the present disclosure provide an animation generation method, an animation generation device, a computer-readable storage medium, and an electronic device. This technology can be applied to electronic devices with animation production functions, such as notebooks, desktops, and other devices.

[0041] To facilitate understanding of this embodiment, a method for generating an animation disclosed in this embodiment is first introduced in detail. As shown in FIG3 , the method includes the following steps:

[0042] Step S302: Acquire a first object model and a second object model; wherein the first object model is bound to a first skeleton, and the second object model is bound to a second skeleton; the first skeleton is used to control at least some of the model vertices of the first object model, and the second skeleton is used to control at least some of the model vertices of the second object model;

[0043] The first object model and the second object model can be local models corresponding to two regions of the same model, or they can be two models. For example, the first object model can be the upper eyelid of the virtual model, and the second object model can be the lower eyelid of the virtual model; another example, the first object model can be the upper lip of the virtual model, and the second object model can be the lower lip of the virtual model; another example, the first object model can be the fingers of the first virtual model, and the second object model can be the belly of the second virtual model or the first virtual model, etc.

[0044] The first skeleton bound to the above-mentioned first object model usually includes one, which is used to control the shape and movement of the model. Usually, after the skeleton is bound to the model, the vertices of the model can be deformed according to the operation of the skeleton. One skeleton can control multiple model vertices, and one model vertex can also be controlled by multiple skeletons. Usually, in order to improve the control of the skeleton over the deformation of the model, the control weights of each model vertex controlled by the skeleton are set, that is, the brush weight in 3D software, so that the skeleton has different control weights for different model vertices.

[0045] Furthermore, in the initial state, the first object model and the second object model may or may not be in contact with each other. If they are in contact, this can be understood as the vertices of some of the first object model and some of the vertices of the second object model being in contact, such as when the upper and lower eyelids of the avatar are closed (i.e., eyes are closed) or the upper and lower lips are closed (i.e., mouth is closed). Another example is when the fingers of the first avatar are in contact with the face of the second avatar.

[0046] Step S304, obtaining a first preset movement value of the first bone in the first direction and a second preset movement value of the second bone in the second direction;

[0047] The first direction and the second direction can be any direction such as vertical direction, horizontal direction or front-back direction, and the first direction and the second direction can be the same or different. Specifically, a two-dimensional or three-dimensional coordinate system can be set in the first skeleton and the second skeleton respectively. The center position of the first skeleton is located at the origin of the first coordinate system, the center position of the second skeleton is located at the origin of the second coordinate system, and the directions of the coordinate axes of the first coordinate system and the second coordinate system are the same, usually including the X-axis, the Y-axis and the Z-axis. The first direction can be the X-axis, the Y-axis and the Z-axis direction, or any other direction of the coordinate axis.

[0048] The above-mentioned first preset movement value and second preset movement value may be the same or different, wherein the first movement value generally refers to the first coordinate value of the first coordinate system, or the first distance value of the first bone after movement from the origin. For example, if the first bone moves 0.7 in the negative direction of the Y-axis, the above-mentioned first movement value is "-0.7", and if the first bone moves 0.7 in the positive direction of the Y-axis, the above-mentioned first movement value is "0.7". Similarly, the second movement value generally refers to the second coordinate value of the second coordinate system, or the first distance value of the second bone after movement from the origin. For example, if the second bone moves 0.2 in the negative direction of the Y-axis, the above-mentioned second movement value is "-0.2", and if the second bone moves 0.2 in the positive direction of the Y-axis, the above-mentioned second movement value is "0.2". In other words, the above-mentioned first preset movement value and the second preset movement value can represent (or indicate) the movement direction of the bone.

[0049] Step S306 : Control the movement of the first skeleton and the second skeleton according to the first preset movement value and the second preset movement value, and generate movement animations of the first object model and the second object model.

[0050] Specifically, it is usually necessary to first determine whether extrusion will occur if the first bone and the second bone move according to the first preset movement value and the second preset movement value. If extrusion will occur, the first bone and the second bone can be controlled to move first. When the first object model and the second object model begin to contact, the extrusion function is triggered. At this time, the target movement value for the first bone and the second bone to move together will be calculated. When the first object model and the second object model just start to contact, the target movement value for the first bone and the second bone to move together is controlled to generate a moving extrusion animation of the first object model and the second object model.

[0051] If squeezing does not occur, the first bone and the second bone can be directly controlled to move according to the first preset movement value and the second preset movement value to generate movement animations of the first object model and the second object model.

[0052] The disclosed embodiment provides an animation generation method, which obtains a first object model and a second object model; the first object model is bound to a first bone, and the second object model is bound to a second bone; a first preset movement value of the first bone in a first direction and a second preset movement value of the second bone in a second direction are obtained; according to the first preset movement value and the second preset movement value, the movement of the first bone and the second bone are controlled to generate a movement animation of the first object model and the second object model. In this method, a small number of bones are set in the object model, and the model vertices of different object models are controlled by the bones. The calculation logic of the movement value is directly added to the bone binding link. The movement animation of the model is automatically controlled by the preset movement value. The production process is simple, and the animation generation efficiency and animation effect are improved.

[0053] A possible implementation of the above steps of controlling the movement of the first skeleton and the second skeleton according to the first preset movement value and the second preset movement value to generate the movement animation of the first object model and the second object model is as follows:

[0054] Step 1: determining whether the first object model and the second object model are squeezed according to the first preset movement value and the second preset movement value;

[0055] Determine whether overlap occurs between the first object model and the second object model after the first bone moves a first preset movement value in the first direction and the second bone moves a second preset movement value in the second direction; if so, determine whether the first object model and the second object model are squeezed; if not, determine whether the first object model and the second object model are not squeezed.

[0056] Alternatively, if in the initial state, the first object model and the second object model are in contact with each other, the first bone and the second bone can be controlled to move first. If the first object model and the second object model are in contact, the first bone and the second bone still need to move the first distance and the second distance. At this time, it can be determined whether the first object model and the second object model are squeezed based on the first distance and the second distance; the first distance and the second distance have directions, such as "+2" means moving upward.

[0057] Specifically, if the first distance is greater than or equal to the second distance, it is determined that the first object model and the second object model are not squeezed; if the first distance is less than the second distance, it is determined that the first object model and the second object model are squeezed.

[0058] Step 2: If the first object model and the second object model are not squeezed, control the first bone to move in the first direction by a first preset movement value, and control the second bone to move in the second direction by a second preset movement value, to generate a movement animation of the first object model and the second object model;

[0059] Specifically, if the first object model and the second object model are not squeezed, the first bone is controlled to move in a first direction by a first preset movement value, or by a first product of the first preset movement value and a preset first target value, and the second bone is controlled to move in a second direction by a second preset movement value, or by a second product of the second preset movement value and a preset second target value, to generate a movement animation of the first object model and the second object model. This animation is a deformation animation of a different type and does not have a squeezing effect.

[0060] Step 3: If the first object model and the second object model are squeezed, the first bone and the second bone are controlled to move according to the first preset movement value and the second preset movement value to generate a squeezing animation of the first object model and the second object model.

[0061] First, a third target movement value is determined based on the first and second preset movement values; the third target movement value is the squeezing distance between the first and second object models. Then, the first and second bones are controlled to move by the third target movement value to generate a squeezing animation of the first and second object models.

[0062] Specifically, it is possible to first determine whether the first object model and the second object model are in contact. If so, the third target movement value can be directly determined based on the first preset movement value and the second preset movement value; then the first bone and the second bone are directly controlled to move simultaneously, and the third target movement value is moved simultaneously. When controlling the movement of the first bone and the second bone, some model vertices in the first object model and some model vertices in the second object model are also controlled to move. For example, controlling the upper eyelid to move downward by 0.8 and controlling the lower eyelid to move downward by 0.8 at the same time can show the animation effect of the upper eyelid squeezing the lower eyelid. In specific implementation, the first bone and the second bone are usually controlled by a controller to facilitate developers to control the first bone and the second bone.

[0063] If they are not in contact, the first bone and the second bone can be controlled to move first. After the first object model and the second object model are in contact, the third target movement value is calculated, and the first bone and the second bone are controlled to move the third target movement value to generate an extrusion animation of the first object model and the second object model.

[0064] A possible implementation method of determining the third target movement value based on the first preset movement value and the second preset movement value is as follows:

[0065] (1) If, in an initial state, the first object model and the second object model are not in contact, a first target movement value and a second target movement value are determined according to the first preset movement value and the second preset movement value, and the first bone is controlled to move the first target movement value and the second bone is controlled to move the second target movement value so that the first object model and the second object model are in contact with each other; then, the first preset movement value is subtracted from the first target movement value to obtain a first squeezing value; and the second preset movement value is subtracted from the second target movement value to obtain a second squeezing value;

[0066] Specifically, the preset movement value corresponding to the smaller absolute value of the absolute values ​​of the first preset movement value and the second preset movement value can be determined. If the preset movement value is the first preset movement value, the first preset movement value is determined as the first target movement value, and then the smaller absolute value is subtracted from the distance between the first object model and the second object model to obtain a target difference, which is determined as the second target movement value of the second bone in the second direction. If the preset movement value is the second preset movement value, the second preset movement value is determined as the second target movement value. Then the smaller absolute value is subtracted from the distance between the first object model and the second object model to obtain a target difference, which is determined as the first target movement value of the first bone in the first direction.

[0067] Alternatively, the first preset movement value may be directly determined as the first target movement value, and then the absolute value of the first target movement value may be subtracted from the distance between the first object model and the second object model, and the obtained difference may be determined as the second target movement value of the second bone in the second direction.

[0068] A possible implementation method is to simultaneously control the first bone to move according to a first preset movement value and control the second bone to move according to a second preset movement value. When the first object model and the second object model are in contact, the movement value of the first bone is determined to be a first target movement value, and the movement value of the second bone is determined to be a second target movement value.

[0069] (2) If the first object model and the second object model are in contact with each other in the initial state, the first preset movement value is determined as the first squeezing value, and the second preset movement value is determined as the second squeezing value.

[0070] (3) Determine a third target movement value based on the first squeeze value and the second squeeze value.

[0071] Specifically, the average of the first squeeze value and the second squeeze value can be calculated and the average value can be determined as the third target movement value; the first squeeze value can be determined as the third target movement value or the second squeeze value can be determined as the third target movement value; the first specified multiple of the first squeeze value and the second specified multiple of the second squeeze value can also be calculated, and the calculation result can be determined as the third target movement value, or the average value of the calculation result can be determined as the third target movement value.

[0072] In the above method, a small number of bones are set in the object model, and the calculation logic of the movement value is directly added to the bone binding link. Through the preset movement value, the first object model and the second object model are first controlled to contact each other, and then the first extrusion value and the second extrusion value after contact are determined, and the actual movement value of the bone is calculated, that is, the third target movement value. The bone is automatically controlled to move the third target movement value to generate the extrusion animation of the model. The production process is simple, and the animation generation efficiency and animation effect are further improved.

[0073] A possible implementation of the above step of determining the third target movement value based on the first squeeze value and the second squeeze value is as follows:

[0074] Step 1, calculating a first product value of a first squeeze value and a preset first target value, and a second product value of a second squeeze value and a preset second target value;

[0075] The first target value and the second target value can be the same or different and can be set as needed. For example, the first target value can be 1, 2, etc., and the second target value can also be 1, 2, etc. The above steps are usually implemented through multiplyDivid, which is a command node type. It is mainly used for mathematical operations and can perform operations such as addition, subtraction, multiplication and division. It controls the output value by setting numerical calculations in the input channel. It can be used in various 3D scenes, such as modeling, animation and special effects production. It is calculated in the following way:

[0076] Output X=Input 1x*Input 2x;

[0077] Output Y=Input 1y*Input 2y;

[0078] Among them, Input 1x is the first extrusion value mentioned above, Input 1y is the second extrusion value mentioned above, Input 2x is the first target value mentioned above, Input 2y is the second target value mentioned above, Output X is the first product value mentioned above, and Output Y is the second product value mentioned above.

[0079] Step 2, calculating a third target movement value according to the first product value and the second product value;

[0080] Specifically, a third product value of the first product value and the preset first parameter, and a fourth product value of the third product value and the preset second parameter are calculated; and the sum of the third product value and the fourth product value is determined as the third target movement value.

[0081] The above first parameter and second parameter can be the same or different, and can be specifically set according to needs. For example, both the first parameter and the second parameter are 0.5, etc. The above steps are usually implemented through blendColor. blendColor is a command node type, which is mainly used for color blending. It can blend two colors to achieve color transformation and adjustment of objects. Through input channels and parameter adjustment, operations such as object coloring, blending, and adjustment can be conveniently achieved.

[0082] Specifically, it is calculated through the following method:

[0083] Output R = Color 1R * Blender1 + Color 2R * Blender2;

[0084] Among them, Color 1R is the above first product value, that is, Output X, Color 2R is the above second product value, that is, Output Y; Blender1 is the above first parameter, Blender2 is the above second parameter, and Output R is the above third target movement value.

[0085] If Output X >= Output Y, it is determined that the first object model and the second object model do not undergo extrusion. For example, if the upper eyelid moves upward and the lower eyelid does not move, there will be no extrusion between the upper and lower eyelids. If Output X < Output Y, it is determined that the first object model and the second object model undergo extrusion. For example, if the upper eyelid moves downward and the lower eyelid does not move, there will be extrusion between the upper and lower eyelids.

[0086] The above step of determining whether the first object model and the second object model are extruded is usually implemented through Condition. Condition is a command node type, which is mainly used for controlling data flow and logical operations. It can select two different output methods by judging the true or false of a certain condition. In the binding field, the condition node can be used to control transformations such as the rotation and translation of the model. For example, the bone controller of the model can be compared with the positions of other objects to achieve the effect of the controller controlling the model.

[0087] Specifically, it includes two Conditions (Condition1 and Condition2). Condition1 outputs the target movement value of the first bone, and Condition2 outputs the target movement value of the second bone. For the first bone, the first product value and the second product value are specifically compared. If the first product value is greater than or equal to the second product value, it is determined that the first object model and the second object model are not squeezed, and the target movement value of the first bone is determined to be the first product value; if the first product value is less than the second product value, it is determined that the first object model and the second object model are squeezed, and the target movement value of the first bone is determined to be the third target movement value. Similarly, for the second bone, the first product value and the second product value are specifically compared. If the first product value is greater than or equal to the second product value, it is determined that the first object model and the second object model are not squeezed, and the target movement value of the second bone is determined to be the second product value; if the first product value is less than the second product value, it is determined that the first object model and the second object model are squeezed, and the target movement value of the second bone is determined to be the third target movement value.

[0088] In addition, the first skeleton is used to control the first model vertex of the first object model through a preset first control weight, and the second skeleton is used to control the second model vertex of the second object model through a preset second control weight.

[0089] The first bone has different first control weights for different first model vertices in the first object model. For example, the first control weights for first model vertices that are closer to the first bone are larger, while the first control weights for first model vertices that are farther from the first bone are smaller, so as to achieve a natural deformation effect. The same second bone has different second control weights for different second model vertices in the second object model. For example, the second control weights for second model vertices that are closer to the second bone are larger, while the second control weights for second model vertices that are farther from the second bone are smaller, so as to achieve a deformation effect that conforms to natural extrusion.

[0090] In order to further improve the animation effect, the above-mentioned first object model is also bound to at least one first sub-bone, which is used to control at least one first sub-bone, and the first sub-bone is used to control at least part of the model vertices of the first object model; the second object model is also bound to at least one second sub-bone, which is used to control at least one second sub-bone, and the second sub-bone is used to control at least part of the model vertices of the second object model.

[0091] At least one first child bone can be used to increase the local squashing and deformation effects of the first object model. Specifically, when the first bone moves, it does not directly control the deformation of the model. Instead, it controls the movement of the first child bone, and thus controls the deformation of the model by controlling at least some of the model's vertices. This can further enhance and enrich the squashing and collision effects of the model.

[0092] If the first object model and the second object model are located on the same target model, and the deformation of the first object model and the second object model is also affected by a third object model in the target model, for example, the deformation of the eyelid in the eye model is also affected by the eyeball, if only the up and down displacement is used, it is not possible to well show the movement of the eyelid around the eyeball. Therefore, the above method further includes:

[0093] Acquire a third object model; wherein the third object model is bound to a third skeleton, and the third skeleton is used to control at least part of the model vertices of the third object model;

[0094] Obtain a third preset movement value of the third object model, control the movement of the third object model according to the third preset movement value, and determine the target rotation value of the first bone and the second bone according to the third preset movement value; control the rotation of the first bone and the second bone based on the target rotation value to generate an extrusion animation of the first object model and the second object model.

[0095] Specifically, the ratio of the preset rotation angle to the third preset movement value is calculated, and the approximate value of the absolute value of the ratio is determined as the target value; the product of the third preset movement value and the target value is calculated to obtain the target rotation value of the first bone and the second bone. The preset rotation angle is set according to actual needs. For example, for the eye model, the reasonable rotation range of the eyeball is generally -45 degrees to 45 degrees. The above-mentioned preset rotation angle can generally be 15 degrees. Calculate 15 / (-0.45) = -33.33, and determine the approximate value of the absolute value of the ratio -33.33 as the target value 30. Calculate the product of the third preset movement value -0.45 and the target value 30 to obtain the target rotation value of the first bone and the second bone -13.5 degrees. And assign the final output target rotation value to the bone rotation value of the upper and lower eyelids.

[0096] It should be noted that the above animation generation method can be implemented through code and applied to any 3D software.

[0097] Referring to the eye model shown in FIG4 , this embodiment takes the eye model as an example for explanation:

[0098] For example, through Maya software (a three-dimensional animation software), the eye model first includes an upper eyelid model (corresponding to the first object model mentioned above) and a lower eyelid model (corresponding to the second object model mentioned above), and three bones are configured in the eye model, wherein the upper eyelid model is bound to a first bone, the lower eyelid model is bound to a second bone, and the eyeball model is bound to a third bone. By cooperating with node commands such as multiplyDivid, blendcolor, and Condition, the eyeball and eyelid can follow the movement, and blinking and automatic collision avoidance can be achieved through calculation.

[0099] While this solution also includes all the effects of traditional eye rigging, it's much quicker and requires fewer bones to be created for skinning and controllers to be added. This solution then connects and calculates via command nodes, allowing for autonomous collision control. If secondary control is required, simply add the desired secondary bones (i.e., the first and second child bones mentioned above). Typically, fewer than four secondary bones are needed (two each for the upper and lower sub-bones) to achieve a sufficiently detailed effect.

[0100] As shown in Figure 5, the node command connection diagram (implemented in Maya software) calculates collision avoidance effects through conditional commands, and its logical functions can also be implemented through code. Figure 6 shows the eye model rigging production flow chart. Skeletons and controllers are built according to the model requirements, skinning is created, and weights are drawn to establish a basic rigging framework. This is the basic condition of the rigging process: the rigging structure requires the participation of the model and skeletons, and the skeleton and model are connected through skinning. Weights are drawn according to the required motion effects to achieve the effect of animation through skeleton control.

[0101] Building a skeleton based on model controller requirements involves using the bone tools in Maya to create the skeletal structure of a character or object to support subsequent animation operations. During this stage, the skeleton architecture must be appropriately constructed based on the scene and model structure, determining the number, size, position, and relative relationships of the bones. The controllers provide a more intuitive and convenient way to control the bones' movement, rotation, and scaling. Creating a skin and painting weights involves binding the skeleton to the model to form the skin. Skinning separates the skeleton from the model surface, using weights to determine which bones influence and control the deformation of the model surface. During this stage, the model must be bound and weighted to ensure that the skeleton appropriately affects each part of the model. Building a basic binding framework involves further binding the skeleton to the model, building on the foundation of skinning, to support richer animation operations. During this stage, each bone must be bound and its corresponding object, such as a controller, assigned to it for control during subsequent animation. During this process, tracks can be set for the controllers and constraints can be added to further control the animation.

[0102] Taking the eyes as an example, the initial eyelids are in a closed state, and the initial movement value of the upper and lower eyelid controllers is 0, as shown in Figure 7 (implemented in Maya software). The Y-axis translate movement value of the controller that controls the up and down movement of the upper eyelid bone (that is, the above-mentioned first preset movement value) is used as variable 1, and the Y-axis translate movement value of the controller that controls the up and down movement of the lower eyelid bone (that is, the above-mentioned second preset movement value) is used as variable 2.

[0103] For example, move the Y-axis movement value of the upper eyelid controller down to -0.7, and the Y-axis movement value of the lower eyelid controller down to -0.2. The following steps are explained in detail.

[0104] As shown in Figure 8 (implemented in Maya software), variable 1 is used as the input value input 1x, and variable 2 is used as the input value input 1y, and input to the node multiplyDivid. The node mode is set to multiplication. The input values ​​2X (i.e. the first target value) and 2Y (i.e. the second target value) in the node represent multiples. The values ​​here can be set according to the effect requirements. Here you can set it to 1 first.

[0105] That is, the result of multiplying input 1x and input 2x is output, and the calculated value is output X. Similarly, the result of multiplying input 1y and input 2y is output, and the calculated value is output Y. The purpose of this calculation step is to use the eyelid movement value as the initial variable, set the multiplier to 1, and then perform numerical multiplication. The results of the two calculated variables of the upper and lower eyelids are statistically combined and transmitted as a new variable to the next calculation step.

[0106] At this time, variable 1 is -0.7, and variable 2 is -0.2, as shown in FIG8 . The output value of Output X is = Input 1x * Input 2x = -0.7 * 1 = -0.7; the output value of Output Y is = Input 1y * Input 2y = -0.2 * 1 = -0.2.

[0107] After obtaining the variables Output X and Output Y of the upper and lower eyelid movement values, use the blendColor node to use their output values ​​as new input values. The blendColor node here is originally a color mixing node, mostly used in the rendering process, but in this embodiment, the blend control command of this node can be used to introduce color into the value of the input and apply it to the binding process. The logic and purpose of this blend command operation is to add the values ​​of the upper and lower eyelid movement output and take 0.5 times (i.e., the first and second parameters mentioned above), which is the intermediate value. In other words, the two originally different variable values ​​are neutralized and output, becoming the same intermediate output value, and given as the reserve variable output value to the downstream conditional command link.

[0108] As shown in Figure 9 (implemented in Maya software), the blendColor color input is generally divided into R, G, and B, which represent the basic red, green, and blue primary color values. Here, the upper eyelid variable output Output X can be used as a new variable input into Color 1R, and the lower eyelid variable output Output Y can be used as a new variable input into Color 2R. The Blender parameters (i.e., the first and second parameters mentioned above) are mixed values ​​and can be set according to the effect requirements. In this embodiment, the first and second parameters can be set to 0.5. The output formula here is: Output R = Color 1R * Blender1 + Color 2R * Blender2. That is, Output R = upper eyelid variable output Output X * Blender1 + lower eyelid variable output Output Y * Blender2, that is, Output R = -0.7 * 0.5 + -0.2 * 0.5 = -0.45.

[0109] After obtaining the calculated result of the secondary output value Output R, this value is used as the output variable, and the conditional command is used to start the true hypothesis determination and execution. Two conditions are required here, and their meanings are as follows:

[0110] Condition1 is the output value command condition of the lower eyelid controller:

[0111] If the "upper eyelid variable output value Output X" is greater than the "lower eyelid variable output value Output Y", then the "conditional output value Out Color R" is the "lower eyelid variable output value Output Y", otherwise the "conditional output value Out Color R" is the "mixed color node output value Output R".

[0112] Condition2 is the output value command condition of the upper eyelid controller:

[0113] If the "upper eyelid variable output value Output X" is greater than the "lower eyelid variable output value Output Y", then the "conditional output value Out Color R" is the "upper eyelid variable output value Output X", otherwise the "conditional output value Out Color R" is the "mixed color node output value Output R".

[0114] The logic of this conditional command is that in the same world coordinate, if the upper eyelid controller moves upward, the upper eyelid controller Y-axis movement value > the lower eyelid controller Y-axis movement value. At this time, the lower eyelid does not need to be affected by the upper eyelid, so the output value is the Y-axis displacement value of the lower eyelid controller itself, and there is no collision effect; if the upper eyelid controller moves downward to a position below the lower eyelid controller, the upper eyelid controller Y-axis movement value < the lower eyelid controller Y-axis movement value. At this time, the lower eyelid needs to move downward with the same displacement as the upper eyelid touches the critical point of the lower eyelid position. At this time, the Y-axis displacement values ​​of the upper and lower eyelid controllers simultaneously become the same intermediate mixed value in the blendColor output node.

[0115] The same applies to moving the lower eyelid controller upwards, using the touching critical point as the judgment standard to achieve the effect of automatic collision avoidance.

[0116] As shown in Figure 10 (implemented in Maya software), when the Y-axis movement value of the upper eyelid controller is -0.7 and the Y-axis movement value of the lower eyelid controller is -0.2, the upper eyelid controller Y-axis < the lower eyelid controller Y-axis, that is, the upper eyelid controller has moved down below the lower eyelid controller. At this time, the condition is recognized as False, and the output values ​​of the upper and lower eyelid controllers are the same mixed intermediate value of -0.45.

[0117] As we all know, the eyelid closes around the eyeball. If only the up and down displacement is used, the eyelid movement effect around the eyeball cannot be well displayed. Here, the node converts the third preset movement value of the third bone of the eyeball model into a rotation output value around the eyeball through calculation, which can better output the effect.

[0118] The third preset movement value can be considered as a basic variable. It can be multiplied by the multiplyDivid node operation to convert it into a rotation output value of a reasonable amplitude. The specific multiple can be tested according to the effect of the model.

[0119] As shown in Figure 11 (implemented in Maya software), -0.45 is the third preset movement value mentioned above. Generally, the reasonable rotation range of the eyeball is -45 degrees to 45 degrees. The common range of 10-20 degrees can be taken for reverse calculation. This embodiment assumes that the general rotation amplitude of the eyeball is 15 degrees, that is, 15 / -0.45=33.33 times. This is only used to roughly calculate the multiple number, and there is no need to be too rigorous, so you can fill in the approximate number 30 times multiplied, that is, -0.45*30=-13.5, and assign the final output value to the bone rotation value of the upper and lower eyelids, as shown in Figure 12 (implemented in Maya software).

[0120] In the above method, the effect is produced directly in the binding link, which saves the manual k-frame time of animation, and achieves automated collision more conveniently, efficiently and accurately, reducing the time and labor of manual adjustment of animation. It improves the efficiency and accuracy of animation and avoids the errors that may occur in manual collision or extrusion. While achieving the effect, it saves the tedious production process and transfers the main work to the node operation for independent realization. It greatly shortens the time of animation production and improves work efficiency and productivity. This solution can be applied to all target models that require collision, regardless of category. Common application targets such as eyes, mouths, muscles and other binding links can also be used for collisions between scene elements, simulated fluid extrusion effects, and combined with special effects and other link technologies for application in other fields.

[0121] This case has perfect logic, can be output in code and supports automatic construction. It does not need to add too many complex steps and production difficulties in traditional binding, which lowers the technical threshold for users and improves its applicability to people in different fields.

[0122] Corresponding to the above method embodiment, the present disclosure provides an animation generation device, as shown in FIG13 , which includes:

[0123] The model acquisition module 131 is configured to acquire a first object model and a second object model; wherein the first object model is bound to a first skeleton, and the second object model is bound to a second skeleton; the first skeleton is used to control at least some of the model vertices of the first object model, and the second skeleton is used to control at least some of the model vertices of the second object model;

[0124] The movement value acquisition module 132 is configured to acquire a first preset movement value of the first bone in the first direction and a second preset movement value of the second bone in the second direction;

[0125] The animation generation module 133 is configured to control the movement of the first skeleton and the second skeleton according to the first preset movement value and the second preset movement value, and generate movement animations of the first object model and the second object model.

[0126] In the above method, a small number of bones are set in the object model, and the model vertices of different object models are controlled by the bones. The calculation logic of the movement value is directly added to the bone binding link. Through the preset movement value, the movement of the bones is automatically controlled to generate the movement animation of the model. The production process is simple and the animation generation efficiency and animation effect are improved.

[0127] The above-mentioned animation generation module is also configured to perform: determining whether the first object model and the second object model are squeezed according to the first preset movement value and the second preset movement value; if the first object model and the second object model are not squeezed, controlling the first bone to move the first preset movement value in the first direction, and controlling the second bone to move the second preset movement value in the second direction, to generate a movement animation of the first object model and the second object model; if the first object model and the second object model are squeezed, controlling the first bone and the second bone to move according to the first preset movement value and the second preset movement value, to generate a squeeze animation of the first object model and the second object model.

[0128] The animation generation module is configured to execute: determining a third target movement value based on the first preset movement value and the second preset movement value; controlling the first bone and the second bone to move the third target movement value to generate an extrusion animation of the first object model and the second object model.

[0129] The above-mentioned animation generation module is also configured to execute: if in the initial state, the first object model and the second object model are not in contact, determine the first target movement value and the second target movement value according to the first preset movement value and the second preset movement value, control the first bone to move the first target movement value and the second bone to move the second target movement value so that the first object model and the second object model are in contact with each other; calculate the first preset movement value minus the first target movement value to obtain the first extrusion value; calculate the second preset movement value minus the second target movement value to obtain the second extrusion value; determine the third target movement value according to the first extrusion value and the second extrusion value.

[0130] The animation generation module is further configured to execute: if the first object model and the second object model are in contact with each other in the initial state, determine the first preset movement value as the first squeezing value and determine the second preset movement value as the second squeezing value.

[0131] The animation generation module is further configured to: calculate a first product value of the first extrusion value and a preset first target value, and a second product value of the second extrusion value and a preset second target value; and calculate a third target movement value based on the first product value and the second product value.

[0132] The animation generation module is further configured to execute: calculating a third product value of the first product value and a preset first parameter, and a fourth product value of the third product value and a preset second parameter; and determining the sum of the third product value and the fourth product value as a third target movement value.

[0133] The above-mentioned animation generation module is also configured to perform: determining whether overlap occurs between the first object model and the second object model after the first bone moves a first preset movement value in the first direction and the second bone moves a second preset movement value in the second direction; if so, determining whether the first object model and the second object model are squeezed; if not, determining whether the first object model and the second object model are not squeezed.

[0134] The above-mentioned animation generation module is also configured to execute: simultaneously controlling the first bone to move according to the first preset movement value, controlling the second bone to move according to the second preset movement value, and when the first object model and the second object model contact, determining the movement value of the first bone to be the first target movement value, and determining the movement value of the second bone to be the second target movement value.

[0135] The first bone is used to control the first model vertex of the first object model through a preset first control weight, and the second bone is used to control the second model vertex of the second object model through a preset second control weight.

[0136] The above-mentioned first object model is also bound to at least one first sub-bone, which is used to control at least one first sub-bone, and the first sub-bone is used to control at least part of the model vertices of the first object model; the second object model is also bound to at least one second sub-bone, which is used to control at least one second sub-bone, and the second sub-bone is used to control at least part of the model vertices of the second object model.

[0137] The above-mentioned device also includes a rotation value determination module, which is configured to perform: obtaining a third object model; wherein the third object model is bound to a third bone, and the third bone is used to control at least part of the model vertices of the third object model; obtaining a third preset movement value of the third object model, controlling the movement of the third object model according to the third preset movement value, and determining the target rotation value of the first bone and the second bone according to the third preset movement value; and controlling the rotation of the first bone and the second bone based on the target rotation value.

[0138] The above-mentioned rotation value determination module is also configured to perform: calculating the ratio of the preset rotation angle to the third preset movement value, and determining the approximate value of the absolute value of the ratio as the target value; calculating the product of the third preset movement value and the target value to obtain the target rotation value of the first bone and the second bone.

[0139] The animation generation device provided in the embodiment of the present disclosure has the same technical features as the animation generation method provided in the above embodiment, and therefore can also solve the same technical problems and achieve the same technical effects.

[0140] This embodiment further provides an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the above-mentioned animation generation method. The electronic device can be a server or a terminal device.

[0141] As shown in FIG. 14 , the electronic device includes a processor 100 and a memory 101 . The memory 101 stores machine-executable instructions that can be executed by the processor 100 . The processor 100 executes the machine-executable instructions to implement the above-mentioned animation generation method.

[0142] Furthermore, the electronic device shown in FIG14 further includes a bus 102 and a communication interface 103 , and the processor 100 , the communication interface 103 and the memory 101 are connected via the bus 102 .

[0143] Memory 101 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage. Communication between the system network element and at least one other network element is achieved through at least one communication interface 103 (which may be wired or wireless), and may utilize the Internet, a wide area network, a local area network, a metropolitan area network, etc. Bus 102 may be an ISA bus, a PCI bus, or an EISA bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, FIG14 uses only one bidirectional arrow, but this does not mean that there is only one bus or only one type of bus.

[0144] The processor 100 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 100 or by instructions in the form of software. The above-mentioned processor 100 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, or discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as a random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or register. The storage medium is located in the memory 101. The processor 100 reads the information in the memory 101 and, in conjunction with its hardware, completes the steps of the method of the aforementioned embodiment.

[0145] The processor in the electronic device can implement the following operations in the animation generation method by executing machine-executable instructions:

[0146] Obtain a first object model and a second object model; wherein the first object model is bound to a first bone, and the second object model is bound to a second bone; the first bone is used to control at least some of the model vertices of the first object model, and the second bone is used to control at least some of the model vertices of the second object model; obtain a first preset movement value of the first bone in a first direction and a second preset movement value of the second bone in a second direction; control the movement of the first bone and the second bone according to the first preset movement value and the second preset movement value to generate an extrusion animation of the first object model and the second object model. In this method, a small number of bones are set in the object model, and the model vertices of different object models are controlled by the bones. The movement value calculation logic is directly added to the bone binding link. The preset movement value is used to automatically control the movement of the bones to generate the movement animation of the model. The production process is simple and the animation generation efficiency and animation effect are improved.

[0147] The above-mentioned steps of controlling the movement of the first bone and the second bone according to the first preset movement value and the second preset movement value to generate the movement animation of the first object model and the second object model include: determining whether the first object model and the second object model are squeezed according to the first preset movement value and the second preset movement value; if the first object model and the second object model are not squeezed, controlling the first bone to move the first preset movement value in the first direction, and controlling the second bone to move the second preset movement value in the second direction to generate the movement animation of the first object model and the second object model; if the first object model and the second object model are squeezed, controlling the first bone and the second bone to move according to the first preset movement value and the second preset movement value to generate the squeezing animation of the first object model and the second object model.

[0148] The above-mentioned steps of controlling the movement of the first bone and the second bone according to the first preset movement value and the second preset movement value to generate the extrusion animation of the first object model and the second object model include: determining the third target movement value according to the first preset movement value and the second preset movement value; controlling the first bone and the second bone to move the third target movement value to generate the extrusion animation of the first object model and the second object model.

[0149] The above-mentioned step of determining the third target movement value based on the first preset movement value and the second preset movement value includes: if in the initial state, the first object model and the second object model are not in contact, determining the first target movement value and the second target movement value based on the first preset movement value and the second preset movement value, controlling the first bone to move the first target movement value and the second bone to move the second target movement value so that the first object model and the second object model are in contact with each other; calculating the first preset movement value minus the first target movement value to obtain the first extrusion value; calculating the second preset movement value minus the second target movement value to obtain the second extrusion value; and determining the third target movement value based on the first extrusion value and the second extrusion value.

[0150] Before the step of determining the third target movement value based on the first squeezing value and the second squeezing value, the method further includes: if in an initial state, the first object model and the second object model are in contact with each other, determining the first preset movement value as the first squeezing value and determining the second preset movement value as the second squeezing value.

[0151] The above-mentioned step of determining the third target movement value based on the first squeezing value and the second squeezing value includes: calculating a first product value of the first squeezing value and a preset first target value, and a second product value of the second squeezing value and a preset second target value; and calculating the third target movement value based on the first product value and the second product value.

[0152] The above-mentioned step of calculating the third target movement value based on the first product value and the second product value includes: calculating a third product value of the first product value and a preset first parameter, and a fourth product value of the third product value and a preset second parameter; and determining the sum of the third product value and the fourth product value as the third target movement value.

[0153] The above-mentioned step of determining whether the first object model and the second object model are squeezed according to the first preset movement value and the second preset movement value includes: determining whether the first object model and the second object model overlap after the first bone moves the first preset movement value in the first direction and the second bone moves the second preset movement value in the second direction; if so, determining that the first object model and the second object model are squeezed; if not, determining that the first object model and the second object model are not squeezed.

[0154] The above-mentioned steps of determining the first target movement value and the second target movement value based on the first preset movement value and the second preset movement value include: simultaneously controlling the first bone to move according to the first preset movement value, and controlling the second bone to move according to the second preset movement value; when the first object model and the second object model are in contact, determining the movement value of the first bone to be the first target movement value, and determining the movement value of the second bone to be the second target movement value.

[0155] The first bone is used to control the first model vertex of the first object model through a preset first control weight, and the second bone is used to control the second model vertex of the second object model through a preset second control weight.

[0156] The above-mentioned first object model is also bound to at least one first sub-bone, which is used to control at least one first sub-bone, and the first sub-bone is used to control at least part of the model vertices of the first object model; the second object model is also bound to at least one second sub-bone, which is used to control at least one second sub-bone, and the second sub-bone is used to control at least part of the model vertices of the second object model.

[0157] The above method also includes: obtaining a third object model; wherein the third object model is bound to a third bone, and the third bone is used to control at least part of the model vertices of the third object model; obtaining a third preset movement value of the third object model, controlling the movement of the third object model according to the third preset movement value, and determining the target rotation value of the first bone and the second bone according to the third preset movement value; and controlling the rotation of the first bone and the second bone based on the target rotation value.

[0158] The above-mentioned step of determining the target rotation value of the first bone and the second bone based on the third preset movement value includes: calculating the ratio of the preset rotation angle to the third preset movement value, and determining the approximate value of the absolute value of the ratio as the target value; calculating the product of the third preset movement value and the target value to obtain the target rotation value of the first bone and the second bone.

[0159] This embodiment further provides a computer-readable storage medium storing machine-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned animation generation method.

[0160] The computer-executable instructions stored in the computer-readable storage medium can implement the following operations in the animation generation method by executing the computer-executable instructions:

[0161] Obtain a first object model and a second object model; wherein the first object model is bound to a first bone, and the second object model is bound to a second bone; the first bone is used to control at least some of the model vertices of the first object model, and the second bone is used to control at least some of the model vertices of the second object model; obtain a first preset movement value of the first bone in a first direction and a second preset movement value of the second bone in a second direction; control the movement of the first bone and the second bone according to the first preset movement value and the second preset movement value to generate an extrusion animation of the first object model and the second object model. In this method, a small number of bones are set in the object model, and the model vertices of different object models are controlled by the bones. The movement value calculation logic is directly added to the bone binding link. The preset movement value is used to automatically control the movement of the bones to generate the movement animation of the model. The production process is simple and the animation generation efficiency and animation effect are improved.

[0162] The above-mentioned steps of controlling the movement of the first bone and the second bone according to the first preset movement value and the second preset movement value to generate the movement animation of the first object model and the second object model include: determining whether the first object model and the second object model are squeezed according to the first preset movement value and the second preset movement value; if the first object model and the second object model are not squeezed, controlling the first bone to move the first preset movement value in the first direction, and controlling the second bone to move the second preset movement value in the second direction to generate the movement animation of the first object model and the second object model; if the first object model and the second object model are squeezed, controlling the first bone and the second bone to move according to the first preset movement value and the second preset movement value to generate the squeezing animation of the first object model and the second object model.

[0163] The above-mentioned steps of controlling the movement of the first bone and the second bone according to the first preset movement value and the second preset movement value to generate the extrusion animation of the first object model and the second object model include: determining the third target movement value according to the first preset movement value and the second preset movement value; controlling the first bone and the second bone to move the third target movement value to generate the extrusion animation of the first object model and the second object model.

[0164] The above-mentioned step of determining the third target movement value based on the first preset movement value and the second preset movement value includes: if in the initial state, the first object model and the second object model are not in contact, determining the first target movement value and the second target movement value based on the first preset movement value and the second preset movement value, controlling the first bone to move the first target movement value and the second bone to move the second target movement value so that the first object model and the second object model are in contact with each other; calculating the first preset movement value minus the first target movement value to obtain the first extrusion value; calculating the second preset movement value minus the second target movement value to obtain the second extrusion value; and determining the third target movement value based on the first extrusion value and the second extrusion value.

[0165] Before the step of determining the third target movement value based on the first squeezing value and the second squeezing value, the method further includes: if in an initial state, the first object model and the second object model are in contact with each other, determining the first preset movement value as the first squeezing value and determining the second preset movement value as the second squeezing value.

[0166] The above-mentioned step of determining the third target movement value based on the first squeezing value and the second squeezing value includes: calculating a first product value of the first squeezing value and a preset first target value, and a second product value of the second squeezing value and a preset second target value; and calculating the third target movement value based on the first product value and the second product value.

[0167] The above-mentioned step of calculating the third target movement value based on the first product value and the second product value includes: calculating a third product value of the first product value and a preset first parameter, and a fourth product value of the third product value and a preset second parameter; and determining the sum of the third product value and the fourth product value as the third target movement value.

[0168] The above-mentioned step of determining whether the first object model and the second object model are squeezed according to the first preset movement value and the second preset movement value includes: determining whether the first object model and the second object model overlap after the first bone moves the first preset movement value in the first direction and the second bone moves the second preset movement value in the second direction; if so, determining that the first object model and the second object model are squeezed; if not, determining that the first object model and the second object model are not squeezed.

[0169] The above-mentioned steps of determining the first target movement value and the second target movement value based on the first preset movement value and the second preset movement value include: simultaneously controlling the first bone to move according to the first preset movement value, and controlling the second bone to move according to the second preset movement value; when the first object model and the second object model are in contact, determining the movement value of the first bone to be the first target movement value, and determining the movement value of the second bone to be the second target movement value.

[0170] The first bone is used to control the first model vertex of the first object model through a preset first control weight, and the second bone is used to control the second model vertex of the second object model through a preset second control weight.

[0171] The above-mentioned first object model is also bound to at least one first sub-bone, which is used to control at least one first sub-bone, and the first sub-bone is used to control at least part of the model vertices of the first object model; the second object model is also bound to at least one second sub-bone, which is used to control at least one second sub-bone, and the second sub-bone is used to control at least part of the model vertices of the second object model.

[0172] The above method also includes: obtaining a third object model; wherein the third object model is bound to a third bone, and the third bone is used to control at least part of the model vertices of the third object model; obtaining a third preset movement value of the third object model, controlling the movement of the third object model according to the third preset movement value, and determining the target rotation value of the first bone and the second bone according to the third preset movement value; and controlling the rotation of the first bone and the second bone based on the target rotation value.

[0173] The above-mentioned step of determining the target rotation value of the first bone and the second bone based on the third preset movement value includes: calculating the ratio of the preset rotation angle to the third preset movement value, and determining the approximate value of the absolute value of the ratio as the target value; calculating the product of the third preset movement value and the target value to obtain the target rotation value of the first bone and the second bone.

[0174] The computer program products of the animation generation method, apparatus, and system provided in the embodiments of the present disclosure include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the previous method embodiments. For specific implementation, please refer to the method embodiments and will not be repeated here.

[0175] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems and devices can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0176] In addition, in the description of the embodiments of the present disclosure, unless otherwise expressly specified or limited, the terms "installed," "connected," and "connected" should be understood in a broad sense. For example, they can refer to fixed connections, detachable connections, or integral connections; they can refer to mechanical connections or electrical connections; they can refer to direct connections or indirect connections through an intermediate medium; and they can refer to internal connections between two components. Those skilled in the art will understand the specific meanings of the above terms in the present disclosure based on the specific circumstances.

[0177] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0178] In the description of this disclosure, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings and are intended solely to facilitate the description of this disclosure and simplify the description. They do not indicate or imply that the devices or components referred to must have a specific orientation, be constructed, or operate in a specific orientation. Therefore, they should not be construed as limitations on this disclosure. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0179] Finally, it should be noted that the above embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The scope of protection of the present disclosure is not limited thereto. Although the present disclosure has been described in detail with reference to the above embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above embodiments within the technical scope disclosed in the present disclosure, or replace some of the technical features therein with equivalents. Such modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure should be based on the scope of protection of the claims.

Claims

1. A method for generating an animation, the method comprising: Acquire a first object model and a second object model; wherein the first object model is bound to a first bone, and the second object model is bound to a second bone; the first bone is used to control at least part of the model vertices of the first object model, and the second bone is used to control at least part of the model vertices of the second object model; Obtain a first preset movement value of the first bone in the first direction and a second preset movement value of the second bone in the second direction; According to the first preset movement value and the second preset movement value, the first skeleton and the second skeleton are controlled to move, and movement animations of the first object model and the second object model are generated.

2. The method according to claim 1, wherein: The step of controlling the movement of the first skeleton and the second skeleton according to the first preset movement value and the second preset movement value to generate movement animation of the first object model and the second object model comprises: determining whether the first object model and the second object model are squeezed according to the first preset movement value and the second preset movement value; If the first object model and the second object model are not squeezed, control the first bone to move in the first direction by the first preset movement value, and control the second bone to move in the second direction by the second preset movement value, to generate movement animations of the first object model and the second object model; If the first object model and the second object model are squeezed, the first bone and the second bone are controlled to move according to the first preset movement value and the second preset movement value to generate a squeezing animation of the first object model and the second object model.

3. The method according to claim 2, wherein: The step of controlling the movement of the first bone and the second bone according to the first preset movement value and the second preset movement value to generate the squeezing animation of the first object model and the second object model comprises: Determining a third target movement value according to the first preset movement value and the second preset movement value; The first bone and the second bone are controlled to move the third target movement value to generate a squeezing animation of the first object model and the second object model.

4. The method according to claim 3, wherein: The step of determining a third target movement value according to the first preset movement value and the second preset movement value comprises: If in an initial state, the first object model is not in contact with the second object model, determining a first target movement value and a second target movement value according to the first preset movement value and the second preset movement value, and controlling the first bone to move the first target movement value and the second bone to move the second target movement value, so that the first object model and the second object model are in contact with each other; Calculate the first preset movement value minus the first target movement value to obtain a first squeeze value; calculate the second preset movement value minus the second target movement value to obtain a second squeeze value; A third target movement value is determined according to the first squeeze value and the second squeeze value.

5. The method according to claim 4, wherein: Before the step of determining a third target movement value according to the first squeezing value and the second squeezing value, the method further includes: If, in an initial state, the first object model and the second object model are in contact with each other, the first preset movement value is determined as the first squeezing value, and the second preset movement value is determined as the second squeezing value.

6. The method according to claim 4, wherein: The step of determining a third target movement value according to the first squeezing value and the second squeezing value comprises: Calculating a first product value of the first squeezing value and a preset first target value, and a second product value of the second squeezing value and a preset second target value; The third target movement value is calculated according to the first product value and the second product value.

7. The method according to claim 6, wherein: The step of calculating the third target movement value according to the first product value and the second product value comprises: Calculating a third product value of the first product value and a preset first parameter, and a fourth product value of the third product value and a preset second parameter; The sum of the third product value and the fourth product value is determined as the third target movement value.

8. The method according to claim 2, wherein: The step of determining whether the first object model and the second object model are squeezed according to the first preset movement value and the second preset movement value comprises: Determine whether the first object model and the second object model overlap after the first bone moves the first preset movement value in the first direction and the second bone moves the second preset movement value in the second direction; If yes, determining that the first object model and the second object model are squeezed; If not, it is determined that the first object model and the second object model are not squeezed.

9. The method according to claim 4, wherein: The step of determining a first target movement value and a second target movement value according to the first preset movement value and the second preset movement value comprises: At the same time, the first bone is controlled to move according to the first preset movement value, and the second bone is controlled to move according to the second preset movement value. When the first object model and the second object model are in contact, the movement value of the first bone is determined to be the first target movement value, and the movement value of the second bone is determined to be the second target movement value.

10. The method according to claim 1, wherein: The first bone is used to control a first model vertex of the first object model through a preset first control weight, and the second bone is used to control a second model vertex of the second object model through a preset second control weight.

11. The method according to claim 1, wherein: The first object model is also bound to at least one first sub-bone, the first bone is used to control the at least one first sub-bone, and the first sub-bone is used to control at least part of the model vertices of the first object model; The second object model is also bound to at least one second sub-bone, and the second bone is used to control the at least one second sub-bone, and the second sub-bone is used to control at least part of the model vertices of the second object model.

12. The method according to claim 1, wherein: The method further comprises: Acquire a third object model; wherein the third object model is bound to a third skeleton, and the third skeleton is used to control at least part of the model vertices of the third object model; Acquire a third preset movement value of the third object model, control the movement of the third object model according to the third preset movement value, and determine target rotation values ​​of the first bone and the second bone according to the third preset movement value; The first bone and the second bone are controlled to rotate based on the target rotation value.

13. The method according to claim 12, wherein: The step of determining target rotation values ​​of the first bone and the second bone according to the third preset movement value comprises: Calculating a ratio of a preset rotation angle to the third preset movement value, and determining an approximate value of an absolute value of the ratio as a target value; The product of the third preset movement value and the target value is calculated to obtain the target rotation values ​​of the first bone and the second bone.

14. An animation generating device, comprising: A model acquisition module is configured to acquire a first object model and a second object model; wherein the first object model is bound to a first skeleton, and the second object model is bound to a second skeleton; the first skeleton is used to control at least part of the model vertices of the first object model, and the second skeleton is used to control at least part of the model vertices of the second object model; A movement value acquisition module, configured to execute acquisition of a first preset movement value of the first bone in a first direction and a second preset movement value of the second bone in a second direction; The animation generation module is configured to control the movement of the first skeleton and the second skeleton according to the first preset movement value and the second preset movement value, and generate an extrusion animation of the first object model and the second object model.

15. An electronic device comprising a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the animation generation method according to any one of claims 1 to 13.

16. A computer-readable storage medium storing computer-executable instructions, wherein when the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the animation generation method according to any one of claims 1 to 13.