Animation data processing method and device and electronic equipment
By generating a target binding file that does not contain the intermediate target body, and using animation parameters and the second deformation parameter to determine the weight of the mixed deformation node, the problem that the intermediate target body cannot be directly imported into the game engine is solved, and the display effect of the animation and the user is improved Experience.
Patent Information
- Application Number
- CN202411329075.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-02-18
AI Technical Summary
The prior art is difficult to directly import the intermediate target body in the hybrid deformation system into the game engine, resulting in poor expression control, poor display effect, and increased calculation pressure.
By generating a target binding file, the file does not contain the mixed deformation nodes of the intermediate target body, the target weights of each mixed deformation node are determined using the animation parameters and the second deformation parameters, thereby determining the display form of the character model in the animation frame.
This enables the game engine and software that do not support intermediate targets to generate animations directly through binding files, improving the animation display effect and user experience.
Smart Images

Figure CN119478151A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of animation technology, and in particular to a method, device and electronic device for processing animation data. Background Art
[0002] In traditional animation film production, characters widely use complex blendshape systems to simulate expressions, and its effects have been verified by a large number of movies. With the continuous improvement of game production level and hardware performance, in order to control production costs and avoid the difference between cutscenes and actual game screens, more and more games choose to render cutscenes in real time in game engines.
[0003] However, the binding files and animations of the blend deformation system cannot be directly imported from the production software to the game engine. For example, when the nodes in the binding file include intermediate target bodies, after the binding file is imported into the game engine, the data of the intermediate target body cannot be recognized by the game engine. Correspondingly, it is also difficult to achieve more sophisticated expression control through the intermediate target body. In the related art, it is usually manually processed by production personnel to develop an expression binding system that relies on bones to control expressions instead of relying on the intermediate target body, and uses bones with simple blendshape binding import engines. However, the character expressions generated by the blendshape system can be sculpted by artists, but it is difficult for bones to simulate the same effect, resulting in poor display effects; and the large number of bones used increases the amount of calculation in the animation generation process, increasing the calculation pressure of the system. Summary of the invention
[0004] In view of this, the purpose of the present disclosure is to provide a method, device and electronic device for processing animation data, so that game engines and other software that do not support intermediate targets can also directly generate animations through binding files, thereby improving animation display effects and enhancing user viewing experience.
[0005] In the first aspect, an embodiment of the present disclosure provides a method for processing animation data, the method comprising: obtaining a target binding file and animation parameters; wherein the target binding file comprises a plurality of first blend deformation nodes corresponding to a first character model; the first blend deformation node does not include an intermediate target body; the initial binding file comprises a second blend deformation node corresponding to the first character model; the second blend deformation node comprises an intermediate target body; the intermediate target body has a first deformation parameter; some of the plurality of first blend deformation nodes are generated based on the intermediate target body; the second deformation parameters of some of the blend deformation nodes are determined based on the first deformation parameters; the animation parameters are used to indicate the target deformation parameters corresponding to the first character model in each animation frame; based on the animation parameters and the second deformation parameters, the target weights of the plurality of first blend deformation nodes in the animation frame are determined; based on the target weights of the plurality of first blend deformation nodes and the plurality of first blend deformation nodes, the display form of the first character model in the animation frame is determined.
[0006] In a second aspect, an embodiment of the present disclosure provides a device for processing animation data, which includes: a file acquisition module, used to acquire a target binding file and animation parameters; wherein the target binding file includes multiple first blend deformation nodes corresponding to a first character model; the first blend deformation node does not include an intermediate target body; the initial binding file includes a second blend deformation node corresponding to the first character model; the second blend deformation node includes an intermediate target body; the intermediate target body has a first deformation parameter; some of the multiple first blend deformation nodes are generated based on the intermediate target body; the second deformation parameters of some of the blend deformation nodes are determined based on the first deformation parameters; the animation parameters are used to indicate the target deformation parameters corresponding to the first character model in the animation frame; a weight determination module, used to determine the target weights of the multiple first blend deformation nodes in the animation frame based on the animation parameters and the second deformation parameters; a display form determination module, used to determine the display form of the first character model in the animation frame based on the target weights of the multiple first blend deformation nodes and the multiple first blend deformation nodes.
[0007] In a third aspect, an embodiment of the present invention 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 data processing method.
[0008] In a fourth aspect, an embodiment of the present invention provides a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned animation data processing method.
[0009] The embodiments of the present invention bring the following beneficial effects:
[0010] The above-mentioned method, device and electronic device for processing animation data obtain a target binding file and animation parameters; determine the target weights of multiple first blended deformation nodes in the animation frame based on the animation parameters and the second deformation parameters; determine the display form of the first character model in the animation frame based on the target weights of multiple first blended deformation nodes and multiple first blended deformation nodes. In this method, the target binding file is generated based on the initial binding file, and the intermediate target body of the blended deformation node in the initial binding file is represented by a separate blended deformation node in the target binding file. In the process of generating animation, it is necessary to determine the weight of the blended deformation node in the target binding file based on the target deformation parameters of the animation frame to achieve the same model deformation effect as when using the initial binding file, so that game engines and other software that do not support intermediate target bodies can also directly generate animations through binding files, thereby improving the animation display effect and the user's viewing experience.
[0011] Other features and advantages of the present disclosure will be described in the following description, and partly become apparent from the description, or understood by practicing the present disclosure. The purpose and other advantages of the present disclosure are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0012] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] 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.
[0014] Figure 1 A schematic diagram of a process of changing the position of a model vertex provided by an embodiment of the present disclosure;
[0015] Figure 2 A flowchart of a method for processing animation data provided by an embodiment of the present disclosure;
[0016] Figure 3 A schematic diagram of a software interface provided by an embodiment of the present disclosure;
[0017] Figure 4 A schematic diagram of another model vertex position change process provided by an embodiment of the present disclosure;
[0018] Figure 5A flowchart of a target binding file (New Rig FIle) generation process provided by an embodiment of the present disclosure;
[0019] Figure 6 A flowchart of an animation generation process provided by an embodiment of the present disclosure;
[0020] Figure 7 A schematic diagram of the structure of an animation data processing device provided by an embodiment of the present disclosure;
[0021] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0023] In traditional animation film production, characters widely use complex blendshape systems to simulate expressions, and its effects have been verified by a large number of movies. With the continuous improvement of 3A game production level and hardware performance, in order to control production costs and avoid the difference between cutscenes and actual game screens, more and more games choose to render cutscenes in real time in game engines. However, complex blendshape systems and animations at the film and television level cannot be directly imported from production software to game engines, which requires finding new alternative binding solutions, increasing production costs and reducing the expression presentation effect of characters in the engine.
[0024] Blendshape, also known as morph targets or shape keys, is a computer graphics technology used to interpolate shapes between three-dimensional models. They are often used in character animation, allowing artists or animators to create and manipulate different shapes of character models to achieve expression changes or deformation animations. By using different shapes (such as smiley faces, frowns, etc.) as targets, smooth transitions can be achieved by interpolating or blending these targets to create various expressions or actions. You can refer to the figure below, where the different expression parts of the character are made into multiple models, and then blendshape them with the original model. This simulates expression animation.
[0025] Blendshape in-between target refers to the intermediate target in the blend shape. Since the original point and the target point of the model are linearly transitioned in the blend shape, for some blinking expressions, arc transition is required, so it is necessary to add some intermediate targets in the original blendshape node to simulate the arc transition. Figure 1 As shown in the figure, original point represents the initial position of a vertex of the model during a certain expression change process, and target point represents the target position of the vertex during the expression change process. Figure 1 The straight line on the left side indicates that the vertex changes from the initial position to the target position along the straight line, and the broken line on the right side indicates that the vertex first changes along the straight line to the position of the vertex determined by in-btween target0.2, and gradually changes along the broken line to the target position.
[0026] However, this kind of in-between target blendshape is only supported by Digital Content Creation (DCC) software, and is not supported by game engines.
[0027] In the related art, the expression rigging system is usually manually developed by the production staff, which relies on bones to control the expression, but does not rely on blendshape including in-between targets. The bones are used with simple blendshape rigging to import the engine for use. However, using the blendshape system, the expression of the character can be sculpted by the artist, and it is difficult to simulate the same effect with bones, and a lot of bones are used.
[0028] Based on this, the embodiments of the present disclosure provide a method, device and electronic device for processing animation data, and the technology can be applied to animation generation scenarios.
[0029] See also Figure 2 First, a method for processing animation data provided by an embodiment of the present invention is introduced. The method comprises the following steps:
[0030] Step S202, obtaining the target binding file and animation parameters; wherein, the target binding file includes multiple first blend deformation nodes corresponding to the first character model; the first blend deformation node does not include the intermediate target body; the initial binding file includes the second blend deformation node corresponding to the first character model; the second blend deformation node includes the intermediate target body; the intermediate target body has a first deformation parameter; some of the multiple first blend deformation nodes are generated based on the intermediate target body; the second deformation parameters of some of the blend deformation nodes are determined based on the first deformation parameters; the animation parameters are used to indicate the target deformation parameters corresponding to the first character model in each animation frame.
[0031] The above-mentioned initial binding file is usually generated by DCC software, and may include model data, skeleton data, and binding relationship data between the two, etc., which are not limited here. The model data in the initial binding file is usually saved in the form of a blend deformation node. Multiple deformation states of the deformation process of a character model can be saved in the same blend deformation node, and the initial state of the character model can also be used as the initial model in a blend deformation node. Other deformation states can be saved in the blend deformation node in the form of intermediate target bodies according to the deformation order.
[0032] Each intermediate target body has a first deformation parameter, and the first deformation parameter can represent the order of the intermediate target in the deformation sequence. For example, the first deformation parameters of the first intermediate target body, the second intermediate target body, and the third intermediate target body can be 1, 2, and 3 respectively, which means that during the deformation process, the initial model first changes to the model corresponding to the first intermediate target body, then changes from the model corresponding to the first intermediate target body to the model corresponding to the second intermediate target body, and then changes from the model of the second intermediate target body to the model of the third intermediate target body.
[0033] However, the above-mentioned first change parameter cannot represent the change time or change progress of the changes between the various models during the deformation process. The first deformation parameters of the first intermediate target body, the second intermediate target body, and the third intermediate target body can be preset to 2, 3, and 5, which can indicate that in the first 40% of the deformation process, the initial model changes to the model corresponding to the first intermediate target body, and in the 40% to 60% of the deformation process, the model corresponding to the first intermediate target body changes to the model corresponding to the second intermediate target body, and in the 60% to 100% of the deformation process, the model of the second intermediate target body changes to the model of the third intermediate target body. In practical applications, the first deformation parameter is usually normalized, for example, 2, 3, and 5 are normalized to 0.4, 0.6, and 1.
[0034] In order to solve the problem that the intermediate target body cannot be directly used by the game engine, it is necessary to generate a target binding file based on the initial binding file. In the target binding file, there is no blending deformation node including the intermediate target body. For the blending deformation nodes in the initial binding file, if a blending deformation node does not contain the intermediate target body, it does not need to be processed. If the blending deformation node includes the intermediate target body, for the convenience of writing, it is called the second blending deformation node, then it is necessary to generate the blending deformation node of the model corresponding to the intermediate target body, and it is also necessary to generate the blending deformation node corresponding to the initial model in the blending deformation node.
[0035] It is worth noting that the deformation process from the initial model to the model corresponding to the intermediate target body is often the process of transforming from the model corresponding to one intermediate target body to the model corresponding to another intermediate target body. The change in model morphology between each intermediate target body and the previous intermediate target body (which can be the initial model) is directly used in the deformation process and can be superimposed with the initial model. Therefore, a mixed deformation body is usually not generated directly for the intermediate target body, but a mixed deformation node is generated for the difference model generated by subtracting the adjacent intermediate target bodies, that is, the above-mentioned first mixed deformation node. At the same time, it is also necessary to determine the first deformation parameter of the intermediate target body with a larger deformation parameter for generating the difference model as the second deformation parameter of the mixed deformation node corresponding to the difference model, so as to indicate the deformation order and deformation progress corresponding to the difference model.
[0036] The above animation parameters are usually set for an animation frame sequence. The animation frame sequence usually includes multiple animation frames. The first character model appears in at least one animation frame in the animation sequence. For each animation frame in which the first character model appears, there is a preset target deformation parameter, which usually indicates the deformation progress of the first character model in the animation frame.
[0037] Step S204: determining target weights of the plurality of first blend deformation nodes in the animation frame based on the animation parameter and the second deformation parameter.
[0038] For each target deformation parameter corresponding to an animation frame displaying the first character model, it is necessary to determine the target weights of multiple first blend deformation nodes in the animation frame. The target deformation parameter represents the deformation progress of the first character model in the animation frame. For example, when the entire progress is represented by 1, if the target deformation parameter is 0.5, it means that the display form of the first character model in the animation frame is the display form when the initial model is deformed to 70%. Assume that during the entire deformation process, an intermediate target body is set when the deformation progress is 50%, and an intermediate target body is set when the deformation progress is 80%. The display form when the initial model is deformed to 70% needs to be obtained based on the two, and specifically, the vertex position of the model needs to be calculated based on the weights of the two.
[0039] The method of calculating the target weight is related to the method of generating the first blend deformation node. When the first blend deformation node is generated for the model corresponding to the intermediate target body, it is necessary to first determine the two blend deformation nodes whose deformation progress indicated by the first deformation parameter is located before and after the deformation progress indicated by the target deformation parameter. Then, calculate the target weights corresponding to the two blend deformation nodes. Assuming that the node with the smaller parameter of the two blend deformation nodes is node A, its corresponding parameter is the first parameter, and the node with the larger parameter is node B, its corresponding parameter is the second parameter, the weights of the two nodes can usually be calculated by the following formula:
[0040] Node A + (Node B - Node A)(Target deformation parameter - first parameter) / (Second parameter - first parameter) = {1-(Target deformation parameter - first parameter) / (Second parameter - first parameter)} Node A + {(Target deformation parameter - first parameter) / (Second parameter - first parameter)} Node B.
[0041] Among them, {1-(target deformation parameter-first parameter) / (second parameter-first parameter)} is the target weight of node A, (target deformation parameter-first parameter) / (second parameter-first parameter) is the target weight of node B. The weights of other blend deformation nodes will be set to 0.
[0042] When the first blended deformation node is generated for the difference model corresponding to the adjacent intermediate target body, the difference model needs to be superimposed with the initial model to form the model form of the deformation progress corresponding to the difference model. Therefore, the target weights of the blended deformation nodes corresponding to the first progress parameter located before the deformation progress indicated by the target deformation parameter will be set to 1. The target weights of the blended deformation nodes corresponding to the first progress parameter adjacent to the deformation progress indicated by the target deformation parameter and greater than the deformation progress need to be calculated. Assume that the node with the smaller parameter among the two blended deformation nodes adjacent to the target deformation parameter is the C node, and its corresponding parameter is the third parameter, and the node with the larger parameter is the D node, and its corresponding parameter is the fourth parameter. The target weight of the D node can be expressed by the following formula: (target deformation parameter-third parameter) / (fourth parameter-third parameter). The weights of the blended deformation nodes whose deformation parameters are after the D node are usually set to 0.
[0043] Step S206: Determine the display form of the first character model in the animation frame based on the target weights of the plurality of first blendShape nodes and the plurality of first blendShape nodes.
[0044] After determining the target weights of the plurality of first blend deformation nodes, the plurality of first blend deformation nodes may be superimposed according to the target weights and displayed in the animation frame. At this time, the display form of the first character model in the animation frame conforms to the target deformation parameter.
[0045] The above-mentioned method for processing animation data obtains a target binding file and animation parameters; based on the animation parameters and the second deformation parameters, determines the target weights of multiple first blended deformation nodes in the animation frame; based on the target weights of multiple first blended deformation nodes and multiple first blended deformation nodes, determines the display form of the first character model in the animation frame. In this method, the target binding file is generated based on the initial binding file, and the intermediate target body of the blended deformation node in the initial binding file is represented by a separate blended deformation node in the target binding file. In the process of generating animation, it is necessary to determine the weight of the blended deformation node in the target binding file based on the target deformation parameters of the animation frame to achieve the same model deformation effect as when using the initial binding file, so that game engines and other software that do not support intermediate target bodies can also directly generate animations through binding files, thereby improving the animation display effect and the user's viewing experience.
[0046] In the specific implementation process, the above target binding file is usually generated in the following way:
[0047] (1) Obtaining an initial binding file. The initial binding file may include multiple blend deformation nodes, or may include only one blend deformation node, and the blend deformation node includes an intermediate target body, which is not limited here.
[0048] (2) Based on the deformation parameters of the at least one blendShape node, determine a second blendShape node in the initial binding file; the second blendShape node includes at least one intermediate target body.
[0049] When a blendShape node includes an intermediate target body, the blendShape node usually has multiple deformation parameters. The multiple deformation parameters include a deformation parameter corresponding to the initial model, which is usually 0, and each of the other deformation parameters corresponds to an intermediate target body. When multiple deformation parameters of the blendShape node are read, it can be determined that the blendShape node is the second blendShape node in the initial binding file.
[0050] (3) Based on the second blend deformation node, generate multiple third blend deformation nodes; the third blend deformation nodes do not include the intermediate target body.
[0051] The second blend deformation node usually includes an initial model and an intermediate target body. It is necessary to generate a third blend deformation node corresponding to the initial model. Then, a target model corresponding to the intermediate target body is generated, and a difference model is generated based on the initial model and the target model. When only one intermediate target body is included, in the process of generating the difference model, it is necessary to subtract the position parameters of the corresponding model vertices of the target model and the initial model, and determine the subtraction result as the position parameters of the model vertex, so as to generate the difference model, and further it is necessary to generate a third blend deformation node corresponding to the difference model.
[0052] If there are multiple intermediate target bodies, and the multiple intermediate target bodies have a preset deformation order, it is necessary to generate a first difference model based on the target model and the initial model corresponding to the first intermediate target body in the deformation order, and determine the first deformation parameter of the first intermediate target body as the second deformation parameter of the third blended deformation node corresponding to the first difference model. Then, for any two adjacent intermediate target bodies in the deformation order, a second difference model is generated based on the target models corresponding to the two adjacent intermediate target bodies, and the first deformation parameter of the second target body of the two adjacent intermediate target bodies is determined as the second deformation parameter of the third blended deformation node corresponding to the second difference model.
[0053] (4) Based on the blend shape nodes except the second blend shape node and the third blend shape node in the initial binding file, a target binding file is generated. The target binding file includes all model information of the initial binding file and can be applied to the animation generation process.
[0054] The following embodiment provides a specific method for determining target weights of a plurality of first blendShape nodes in an animation frame based on an animation parameter and a second deformation parameter.
[0055] As described above, the second blend deformation node includes the initial model and the intermediate target body. Among the first blend deformation nodes, the first blend deformation node generated based on the initial model can be called a first node; the first blend deformation node generated based on the initial model and the intermediate target body can be called a second node.
[0056] For each animation frame, if the animation frame includes the first character model, the target weight of the first node is set to 1, that is, the target weight of the initial model is 1. Then, the target weight of the second node needs to be determined based on the target deformation parameter and the second deformation parameter corresponding to the animation frame.
[0057] As described above, the second node is generated based on the difference model corresponding to the initial model and the first intermediate target body in the deformation sequence, or is generated based on the difference model corresponding to two adjacent intermediate target bodies in the deformation sequence. The second deformation parameter of the second node can indicate the order of the intermediate target body in the deformation sequence that generates the difference model corresponding to the second node. In the process of determining the target weight of the second node, it is necessary to determine to compare the target deformation parameter corresponding to the animation frame with the second deformation parameter of the second node, and then determine the target weight of the second node based on the comparison result.
[0058] When there are multiple second nodes, the second deformation parameters can be made to form a parameter sequence according to the indicated order. For example, when the second deformation parameters of multiple second nodes are 0.2, 0.5, 0.8, and 1 respectively, the formed sequence can be [0.2, 0.5, 0.8, 1]. First, the first second deformation parameter in the parameter sequence can be obtained; then the obtained second deformation parameter is determined as the current parameter, that is, 0.2 in the above sequence; and the target deformation parameter corresponding to the animation frame is compared with the current parameter.
[0059] If the target deformation parameter is greater than the current parameter, the target weight of the second node corresponding to the current parameter is determined to be 1. Assuming the target deformation parameter is 0.6, 0.6 is greater than 0.2, and the target weight of the second node corresponding to the second deformation parameter is 1. Then, the second deformation parameter after the current parameter in the parameter sequence is determined as the current parameter; the step of comparing the target deformation parameter with the current parameter is continued until the target deformation parameter is less than or equal to the current parameter. Taking the above parameter sequence as an example, when the current parameter is 0.8, the target deformation parameter is less than the current parameter.
[0060] When the target deformation parameter is less than the current parameter, the target weight of the second node corresponding to the current parameter is determined based on the current parameter and the previous parameter, where the previous parameter is the second deformation parameter before the current parameter in the parameter sequence, for example, when the current parameter is 0.8, the previous parameter is 0.5. The target weight of the second node corresponding to the second deformation parameter after the current parameter in the parameter sequence is set to 0.
[0061] The second deformation parameter of the second node is also used to indicate the deformation progress of the intermediate target body of the difference model corresponding to the second node. If the current parameter is the first second deformation parameter in the parameter sequence, it is necessary to calculate the first difference between the current parameter and the target deformation parameter, and then calculate the first ratio of the first difference to the current parameter, and determine the target weight of the second node corresponding to the current parameter as the first ratio. If the current parameter is not the first second deformation parameter in the parameter sequence, it is necessary to calculate the second difference between the current parameter and the target deformation parameter, calculate the third difference between the current parameter and the previous parameter, calculate the second ratio of the second difference to the third difference, and determine the target weight of the second node corresponding to the current parameter as the second ratio.
[0062] In some cases, when the target deformation parameter may be equal to the current parameter, the target weight of the second node corresponding to the current parameter needs to be determined as 1, and the target weight of the second node corresponding to the second deformation parameter after the current parameter in the parameter sequence needs to be set to 0.
[0063] The present disclosure also provides another method for processing animation data. Figure 1In order to solve the above technical problems, the method provides a way to export the binding and animation of the blended deformation containing the intermediate target from Maya and apply it to the game engine.
[0064] This method mainly includes two processes: the first is the binding export process with In-between target blendshape: query the attribute name with In-between target in the blendshape node, and decompose the blend shape attribute with intermediate target in the binding file into multiple binding files without intermediate target blend shape attribute; the second is the animation export process with In-between target blendshape: query the attribute name with In-between target in the blendshape node, and record the value of this attribute in each frame within the animation range; convert the original value to the value of the new blendshape target attribute frame by frame, and set keyframes.
[0065] The main basis of this method is: according to the principle of vector superposition, the transition of the original In-between target blendshape between two target bodies can be decomposed into the difference between the two target bodies, and then the base value of the previous target body is superimposed.
[0066] Starting from this point, as the first step to improve this method, we first split the blend shape attributes with intermediate targets in the binding file into multiple bindings of blend shape attributes without intermediate targets:
[0067] First, query the blendshape node in the binding file and query its various deformation attributes. If its deformation attribute contains information about the in-between target, record it and get the attribute list attrList containing the intermediate target object.
[0068] Further, the attribute list attrList is polled to query the specific target value of the intermediate target of each attribute in the attribute list to obtain the valList of the attribute, such as [0.2, 0.4, 0.8, 1], that is, this attribute has intermediate targets at 0.2, 0.4, 0.8 and 1.
[0069] Furthermore, according to valList, generate the model ibtModelList under each val. (That is, the model when the attributes are 0.2, 0.4, 0.8, and 1 respectively)
[0070] Furthermore, the difference between each two models is obtained according to valList and ibtModelList, and diffModelList is regenerated. (i.e. the difference between the 0-0.2 model is model_0-0.2, the difference between the 0.2-0.4 model is model_0.2-0.4, and so on) (Detailed description of case 1.8-1.9 in Part 4)
[0071] Further, iterate diffModelList, create new blendshape attributes for the original model, and modify the attribute commands according to the difference in valList to obtain the final attribute list newAttrList (for example, mouthA will eventually become mouthA__0__0_2, mouthA__0_2__0_4, mouthA__0_4__0_8, mouthA__0_8__1).
[0072] Furthermore, replace the original model of the attribute attrList with the original model (that is, when adjusting the mouthA attribute, the model will become the mouth shape of A. After replacing it with the original model, adjusting the mouthA attribute will not change the model), get the new binding, export fbx, and import it into the engine, completing the operation of importing the in-between target blendshape binding into the engine.
[0073] As a second improvement of the present invention, the blendshape attribute values of the animation made by the original binding file are baked into the new binding blendshape attributes, and the animation fbx is exported to the game engine.
[0074] First, get attrList, valList and newAttrList according to the bound blendshape.
[0075] Furthermore, iteratively query the value of attrList in each frame within the animation time range, convert this value into the value of newAttrList, and key the keyframe. (Detailed description in Case 1.14 of Part 4)
[0076] Furthermore, export the new character animation to fbx and import it into the engine to complete the operation of importing the in-between target blendshape animation into the engine.
[0077] For ease of description and understanding, the binding and animation of the exported in-between target blendshape using Maya (animation software) and Unreal Engine (Unreal Game Engine) are used as examples for explanation.
[0078] First, the parameters, terms and tools in this article are described:
[0079] Blendshape node bsNode, BlendShape node is used to control the shape of the mesh model. It allows users to blend and transition between different geometric shapes to create smooth animation effects. These nodes are often used to control the facial expressions, body movements and other deformations of character models, so that they can achieve smooth transitions of various shapes during animation. BlendShape nodes have a wide range of applications in animation production and character modeling.
[0080] BlendShape deformation attributes: BlendShape deformation attributes are attributes used to control the expression or shape of a model. These attributes are often used to adjust the facial expressions of a character model, such as smiling, frowning, opening the mouth, etc. By adjusting the values of these attributes, the appearance of the model can be changed to present different expressions or shapes. BlendShape deformation attributes are often used in animation software, allowing animators to easily create and adjust the facial expressions of characters without remodeling or using complex skeletal animation techniques. The following is represented by allAttrList.
[0081] In-Between target (ibt) deformation attribute: A deformation with an In-Between target in a blended shape deformation attribute. Maya has a method to query whether there is an intermediate target body in a blended shape attribute, as well as the value of the intermediate target body. Figure 3 As shown in the figure, the pSphere4 deformation attribute of the blendshape1 node has two intermediate target bodies, at 0.4 and 0.8 respectively. However, all the deformation attributes (pSphere2, pSphere3, pSphere4) in the blendShape2 node do not contain intermediate target bodies. This is represented by ibtAttrList below.
[0082] Ibt is a list of the values of each target body: Figure 3 As shown, the two intermediate target bodies of the pSphere4 deformation attribute of the blendshape1 node are at 0.4 and 0.8, that is, [0.4, 0.8], which are represented by ValList below.
[0083] Ibt list of each target body: such as Figure 3 As shown, the two intermediate target bodies (model) of the pSphere4 deformation attribute of the blendshape1 node are [model_0_4, model_0_8], which are represented by ibtModelList below.
[0084] diffModelList: the model of the difference (delta) between each ibt target model (equivalent to the above-mentioned "difference model"). Figure 4 As shown in the figure, the transformation of the model points of ibt actually starts with the transformation of the model points of the next layer after satisfying the transformation of the model points of the previous layer. For example, the transformation between 0.8-1 is actually the transformation of the model points from 0.8 to 1 after satisfying the states of 0.3 and 0.5. That is, the transformation of the point from 0.8-1 (such as 0.9) is actually obtained by the vector of (0-0.3) + (0.3-0.5) vector + (0.5-0.8) vector + 0.5*(0.8-1) vector. The formula for calculating the position of the point is OutPoint=Point(n)-Point(n-1)+Point(0). For example, the second model (0.3-0.5) of diffModelList, the position of a point of one of its models is Point(2)-Point(1)+Point(0), that is, the position of the point of the target body at 0.5 minus the position of the point of the target body at 0.3 plus the position of the point (0) in the default state. Thus, a series of new models DiffModel are obtained.
[0085] Ibt attribute conversion formula: According to the number n of valList of ibt attribute, it can be concluded that its attribute control model changes in n+1 intervals, and thus n+1 new attributes can be obtained. For example, if the ibt attribute is MouthA, its ValList is [0.4, 0.8], n=2, and thus the new attributes without ibt (hereinafter represented by nIbt) can be obtained as MouthA__0__0_4 (0-0.4), MouthA__0_4__0_8 (0.4-0.8), MouthA__0_8__1 (0.8-1). (Maya attribute names do not support decimal points, so a single underscore is used to represent the decimal point.)
[0086] In the process of converting the blendshape attribute without ibt, it is necessary to add attributes to the blendshape node of the original model in turn through ValList and DiffModelList, and convert it into nIbtAttrList. For example, if the ibt attribute is MouthA, ValList is [0.4, 0.8], and DiffModelList is [DiffModel_0.0-0.4, DiffModel_0.4-0.8, DiffModel_0.8-1]. Iterate ValList and DiffModelList at the same time, and you can get the first value of 0.4, the first diffModel is DiffModel_0.0-0.4, and use DiffModel to add blendshape to the original model to get the first nIbt attribute MouthA__0__0_4. Similarly, through the second Val and DiffModel, the second nIbt attribute is MouthA__0_4__0_8. Finally, with the value of 1 and the last DiffModel, the third nIbt attribute is MouthA__0_8__1.
[0087] btAttrDict is a typical data structure of a character. There is a correspondence between ibtAttr and nIbtAttrList, so the converted nIbt attribute list is represented by nIbtAttrList below.
[0088] Original binding file OriRig File (equivalent to the above-mentioned "initial binding file"): contains the binding file of inBetween targetsblendshape.
[0089] New Rig File (equivalent to the above-mentioned "target binding file"): Splits the inBetween targets attributes into multiple blendshape attributes and removes the binding file of the inBetween targets blendshape.
[0090] Animation time range T: The time frame range of the shot production, such as 100-120, 0-40, etc.
[0091] In the process of converting the Val of ibtAttr to the attribute list value of nLbtAttrList, taking the current ibtAttr as MouthA for example, its ValList is [0.2, 0.4, 0.6, 0.8], and the actual newValList of all target bodies is [0.2, 0.4, 0.6, 0.8, 1], and its current Val is 0.7. Through 1.9, the converted nIbtAttrList can be obtained as [MouthA__0__0_2, MouthA__0_2__0_4, MouthA__0_4__0_6, MouthA__0_6__0_8, MouthA__0_8__1], and compare Val with newValList one by one (nVal).
[0092] In the specific implementation process, it is necessary to obtain the nVal with the index value (hereinafter represented by index) of newValList as index, and the value pnVal of index - 1 (if index is equal to 0, pnVal = 0), and compare it with Val.
[0093] If Val < pnVal, then the value (hereinafter represented by outVal) of nIbAttr corresponding to the index value of nIbtAttrList is output as 0.
[0094] If Val > nVal, then the value outVal of nIbAttr corresponding to the index value of nIbtAttrList is output as 1.
[0095] If pnVal <= Val <= nVal, outVal = (Val - pnVal) / (nVal - pnVal).
[0096] Calculate the values of each nIbtAttrList when Val = 0.7.
[0097] Calculate index = 0, that is, pnVal is 0, nVal is 0.2. Since Val (0.7) > nVal (0.1), that is, the outVal of nIbtAtt as MouthA__0__0_2 is 1.
[0098] Calculate index = 1, that is, pnVal is 0.2, nVal is 0.4. Since Val (0.7) > nVal (0.4), that is, the outVal of nIbtAtt as MouthA__0_2__0_4 is 1.
[0099] Calculate index = 2, that is, pnVal is 0.4 and nVal is 0.6. Since Val(0.7) > nVal(0.6), that is, nIbtAtt is MouthA__0_4__0_6 and the outVal is 1.
[0100] Calculate index = 3, that is, pnVal is 0.6 and nVal is 0.8. Since pnVal(0.6) < Val(0.7) < nVal(0.8), that is, nIbtAtt is MouthA__0_6__0_8 and the outVal = ((0.7 - 0.6) / (0.8 - 0.6)) = 0.5.
[0101] Calculate index = 4, that is, pnVal is 0.8 and nVal is 1. Since Val(0.7) < pnVal(0.8), that is, nIbtAtt is MouthA__0_6__0_8 and the outVal is 0.
[0102] This method is mainly implemented through the following two steps:
[0103] 1. In the binding file, convert the blendshape nodes with inBetween targets attributes into blendshape nodes without inBetween targets attributes. Generate a new binding and export the binding fbx for use in the engine.
[0104] 2. For the animation made with the original binding file, it is necessary to convert the blendshape attribute value animation of ibtAttrList to the blendshape value animation of the new binding and export the animation fbx for use in the engine.
[0105] Such as Figure 5As shown in the figure, in the process of generating a blendshape binding file without inBetween targets, first open the original binding file OriRig. Get its useful Blendshape nodes; poll these blendshape nodes and get one of the Blendshape nodes bsNode1; query its blendshape attributes to see if it contains ibt transformation attributes; skip if not; if yes, get its ibt transformation attribute list ibtAttrList; poll ibtAttrList to get one of the transformation attributes ibtAttr; get the target body interpolation list ValList of the attribute; get the target body model list ibtModelList according to ValList; generate DiffModelList according to ValList and ibtModelList; convert nIbtAttrList, add a new nIbt deformation attribute to the original bsNode1; delete the intermediate target body of the ibt attribute, and use the original model to replace the target body model of the ibt attribute (MouthA) with the original value of 1. For example, the original ibt attribute ValList has two vals, and now remove the two intermediate target bodies. And use the original model (OrignalModel) to replace the target body with MouthA attribute of 1. As a result, its deformation attribute does not work. 3.4 After iterating all ibtAttrLists, generate new nIbtAttrList (1-n) one by one, and use the original model to replace the original ibtAttr target body. And save the new binding file NewRig, export the fbx made with OriRig animation, and import it into UE for use. In this process, you can get the relationship btAttrDict of the bound ibtAttrList, ValList, and ibtAttr corresponding to nIbtAttrList according to OriRig, and you also need to replace OriRig with NewRig in the animation file.
[0106] like Figure 6In the process shown, in the process of converting the blendshape attribute value animation of ibtAttrList to the new bound blendshape value animation, it is necessary to poll the animation time range T, iterate frame by frame, and obtain the current time t1; poll each attribute of ibtAttrList to obtain the current transformation attribute ibtAttr and the animation attribute value Val of the current frame; according to the ValList of the current attribute ibtAttr and nIbtAttrList. For example, ibtAttr is MouthA, its ValList is [0.2, 0.4, 0.6, 0.8], and its current Val is 0.7. And calculate the values of all attributes of the current nIbtAttrList. After iterating ibtAttrList, the values of all attributes in the current ibtAttrList are obtained and converted into the values of allnIbtAttrList. And set the keyframe. After iterating the animation time range T, the keyframe of the value of all nIbtAttrList is obtained. Select the blendshape node and the skeleton, export the animation fbx, and import it into UE for use.
[0107] This method has the following advantages:
[0108] 1More realistic animation performance: It makes the animated characters smoother and more realistic in motion transitions because they allow shape interpolation between different keyframes.
[0109] 2. Improve animation quality: These additional target shapes provide more detail and precision, which can improve the appearance and quality of animations.
[0110] 3. Optimize the animation production process: It can help animators and riggers create smoother and more realistic animations more easily, thereby optimizing the animation production process.
[0111] For the above method embodiments, see Figure 7 A device for processing animation data shown, the device comprising:
[0112] The file acquisition module 702 is used to acquire a target binding file and animation parameters; wherein the target binding file includes a plurality of first blend deformation nodes corresponding to the first character model; the first blend deformation node does not include an intermediate target body; the initial binding file includes a second blend deformation node corresponding to the first character model; the second blend deformation node includes an intermediate target body; the intermediate target body has a first deformation parameter; some of the plurality of first blend deformation nodes are generated based on the intermediate target body; the second deformation parameters of some of the blend deformation nodes are determined based on the first deformation parameters; the animation parameters are used to indicate the target deformation parameters corresponding to the first character model in the animation frame;
[0113] A weight determination module 704, for determining target weights of the plurality of first blend deformation nodes in the animation frame based on the animation parameter and the second deformation parameter;
[0114] The display form determination module 706 is used to determine the display form of the first character model in the animation frame based on the target weights of the plurality of first blendShape nodes and the plurality of first blendShape nodes.
[0115] The above-mentioned device for processing animation data obtains a target binding file and animation parameters; determines the target weights of multiple first blended deformation nodes in the animation frame based on the animation parameters and the second deformation parameters; and determines the display form of the first character model in the animation frame based on the target weights of the multiple first blended deformation nodes and the multiple first blended deformation nodes. In this method, the target binding file is generated based on the initial binding file, and the intermediate target body of the blended deformation node in the initial binding file is represented by a separate blended deformation node in the target binding file. In the process of generating animation, it is necessary to determine the weight of the blended deformation node in the target binding file based on the target deformation parameters of the animation frame to achieve the same model deformation effect as when using the initial binding file, so that game engines and other software that do not support intermediate target bodies can also directly generate animations through binding files, thereby improving the animation display effect and the user's viewing experience.
[0116] The above-mentioned device also includes a target binding file generation module, which is used to: obtain an initial binding file; the initial binding file includes at least one blended deformation node; based on the deformation parameters of at least one blended deformation node, determine the second blended deformation node in the initial binding file; the second blended deformation node includes at least one intermediate target body; based on the second blended deformation node, generate multiple third blended deformation nodes; the third blended deformation node does not include the intermediate target body; based on the blended deformation nodes except the second blended deformation node and the third blended deformation node in the initial binding file, generate a target binding file.
[0117] The above-mentioned second blend deformation node includes an initial model and an intermediate target body; the target binding file generation module is also used to: generate a third blend deformation node corresponding to the initial model; generate a target model corresponding to the intermediate target body; generate a difference model based on the initial model and the target model; and generate a third blend deformation node corresponding to the difference model.
[0118] The above-mentioned intermediate target bodies include multiple ones; the multiple intermediate target bodies have a preset deformation order; the target binding file generation module is also used to: generate a first difference model based on the target model and the initial model corresponding to the first intermediate target body in the deformation order; for any two adjacent intermediate target bodies in the deformation order, generate a second difference model based on the target models corresponding to the two adjacent intermediate target bodies.
[0119] The above-mentioned two adjacent intermediate target bodies include a first target body and a second target body; in the deformation sequence, the second target body is after the first target body; the above-mentioned device also includes: a first parameter determination module, used to determine the first deformation parameter of the first intermediate target body as the second deformation parameter of the third mixed deformation node corresponding to the first difference model; a second parameter determination module, used to determine the first deformation parameter of the second target body among the two adjacent intermediate target bodies as the second deformation parameter of the third mixed deformation node corresponding to the second difference model.
[0120] The above-mentioned second blend deformation node includes an initial model and an intermediate target body; multiple first blend deformation nodes include a first node and a second node; the first node is generated based on the initial model; the second node is generated based on the initial model and the intermediate target body; based on the animation parameters and the second deformation parameters, the step of determining the target weights of multiple first blend deformation nodes in the animation frame includes: for each animation frame, in response to the animation frame including the first character model, setting the target weight of the first node to 1; determining the target weight of the second node based on the target deformation parameters and the second deformation parameters corresponding to the animation frame.
[0121] The above-mentioned intermediate target bodies include multiple ones; the multiple intermediate target bodies have a preset deformation order; the second node is generated based on the initial model and the difference model corresponding to the first intermediate target body in the deformation order, or, based on the difference model corresponding to two adjacent intermediate target bodies in the deformation order; the second deformation parameter of the second node is used to indicate the order of the intermediate target body that generates the difference model corresponding to the second node in the deformation order; the weight determination module is also used to: compare the target deformation parameter corresponding to the animation frame with the second deformation parameter of the second node, and determine the target weight of the second node based on the comparison result.
[0122] The above-mentioned second node includes multiple nodes; the second deformation parameters form a parameter sequence according to the indicated sequence; the weight determination module is also used to: obtain the first second deformation parameter in the parameter sequence; determine the obtained second deformation parameter as the current parameter; compare the target deformation parameter corresponding to the animation frame with the current parameter; if the target deformation parameter is greater than the current parameter, determine the target weight of the second node corresponding to the current parameter to 1; determine the second deformation parameter after the current parameter in the parameter sequence as the current parameter; continue to perform the step of comparing the target deformation parameter with the current parameter until the target deformation parameter is less than or equal to the current parameter; if the target deformation parameter is equal to the current parameter, determine the target weight of the second node corresponding to the current parameter to 1, and set the target weight of the second node corresponding to the second deformation parameter after the current parameter in the parameter sequence to 0; if the target deformation parameter is less than the current parameter, determine the target weight of the second node corresponding to the current parameter based on the current parameter and the previous parameter, and set the target weight of the second node corresponding to the second deformation parameter after the current parameter in the parameter sequence to 0; the previous parameter is the second deformation parameter before the current parameter in the parameter sequence.
[0123] The second deformation parameter of the above-mentioned second node is also used to indicate the deformation progress of the intermediate target body of the difference model corresponding to the second node; the weight determination module is also used to: if the current parameter is the first second deformation parameter in the parameter sequence, calculate the first difference between the current parameter and the target deformation parameter, calculate the first ratio of the first difference to the current parameter, and determine the target weight of the second node corresponding to the current parameter as the first ratio; if the current parameter is the first second deformation parameter in the non-parameter sequence, calculate the second difference between the current parameter and the target deformation parameter, calculate the third difference between the current parameter and the previous parameter, calculate the second ratio of the second difference to the third difference, and determine the target weight of the second node corresponding to the current parameter as the second ratio.
[0124] 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 data processing method, for example:
[0125] Obtain a target binding file and animation parameters; wherein the target binding file includes a plurality of first blend deformation nodes corresponding to a first character model; the first blend deformation node does not include an intermediate target body; the initial binding file includes a second blend deformation node corresponding to the first character model; the second blend deformation node includes an intermediate target body; the intermediate target body has a first deformation parameter; some of the plurality of first blend deformation nodes are generated based on the intermediate target body; the second deformation parameters of some of the blend deformation nodes are determined based on the first deformation parameters; the animation parameters are used to indicate the target deformation parameters corresponding to the first character model in each animation frame; based on the animation parameters and the second deformation parameters, determine the target weights of the plurality of first blend deformation nodes in the animation frame; based on the target weights of the plurality of first blend deformation nodes and the plurality of first blend deformation nodes, determine the display form of the first character model in the animation frame.
[0126] In the above method, the target binding file is generated based on the initial binding file, and the intermediate target body of the blend deformation node in the initial binding file is represented by a separate blend deformation node in the target binding file. In the process of generating animation, it is necessary to determine the weight of the blend deformation node in the target binding file based on the target deformation parameters of the animation frame to achieve the same model deformation effect as when using the initial binding file, so that game engines and other software that do not support intermediate target bodies can also generate animations directly through binding files, thereby improving the animation display effect and the user's viewing experience.
[0127] Optionally, the target binding file is generated in the following manner: obtaining an initial binding file; the initial binding file includes at least one blended deformation node; based on the deformation parameters of at least one blended deformation node, determining a second blended deformation node in the initial binding file; the second blended deformation node includes at least one intermediate target body; based on the second blended deformation node, generating multiple third blended deformation nodes; the third blended deformation node does not include an intermediate target body; based on the blended deformation nodes except the second blended deformation node and the third blended deformation node in the initial binding file, generating a target binding file.
[0128] Optionally, the above-mentioned second blended deformation node includes an initial model and an intermediate target body; based on the second blended deformation node, the step of generating multiple third blended deformation nodes includes: generating a third blended deformation node corresponding to the initial model; generating a target model corresponding to the intermediate target body; generating a difference model based on the initial model and the target model; generating a third blended deformation node corresponding to the difference model.
[0129] Optionally, the above-mentioned intermediate target bodies include multiple ones; the multiple intermediate target bodies have a preset deformation order; the step of generating a difference model based on the initial model and the target model includes: generating a first difference model based on the target model and the initial model corresponding to the first intermediate target body in the deformation order; for any two adjacent intermediate target bodies in the deformation order, generating a second difference model based on the target models corresponding to the two adjacent intermediate target bodies.
[0130] Optionally, the two adjacent intermediate target bodies include a first target body and a second target body; in the deformation order, the second target body is after the first target body; the method also includes: determining the first deformation parameter of the first intermediate target body as the second deformation parameter of the third mixed deformation node corresponding to the first difference model; determining the first deformation parameter of the second target body among the two adjacent intermediate target bodies as the second deformation parameter of the third mixed deformation node corresponding to the second difference model.
[0131] Optionally, the above-mentioned second blend deformation node includes an initial model and an intermediate target body; multiple first blend deformation nodes include a first node and a second node; the first node is generated based on the initial model; the second node is generated based on the initial model and the intermediate target body; based on the animation parameters and the second deformation parameters, the step of determining the target weights of multiple first blend deformation nodes in the animation frame includes: for each animation frame, in response to the animation frame including the first character model, setting the target weight of the first node to 1; determining the target weight of the second node based on the target deformation parameters and the second deformation parameters corresponding to the animation frame.
[0132] Optionally, the above-mentioned intermediate target bodies include multiple ones; the multiple intermediate target bodies have a preset deformation order; the second node is generated based on the initial model and the difference model corresponding to the first intermediate target body in the deformation order, or, based on the difference model corresponding to two adjacent intermediate target bodies in the deformation order; the second deformation parameter of the second node is used to indicate the sequence of the intermediate target body for generating the difference model corresponding to the second node in the deformation order; based on the target deformation parameter and the second deformation parameter corresponding to the animation frame, the step of determining the target weight of the second node includes: comparing the target deformation parameter corresponding to the animation frame with the second deformation parameter of the second node, and determining the target weight of the second node based on the comparison result.
[0133] Optionally, the above-mentioned second node includes multiple nodes; the second deformation parameters form a parameter sequence according to the indicated sequence; the target deformation parameter corresponding to the animation frame is compared with the second deformation parameter of the second node, and the step of determining the target weight of the second node based on the comparison result includes: obtaining the first second deformation parameter in the parameter sequence; determining the obtained second deformation parameter as the current parameter; comparing the target deformation parameter corresponding to the animation frame with the current parameter; if the target deformation parameter is greater than the current parameter, determining the target weight of the second node corresponding to the current parameter to 1; determining the second deformation parameter after the current parameter in the parameter sequence as the current parameter; continuing to perform the step of comparing the target deformation parameter with the current parameter until the target deformation parameter is less than or equal to the current parameter; if the target deformation parameter is equal to the current parameter, determining the target weight of the second node corresponding to the current parameter to 1, and setting the target weight of the second node corresponding to the second deformation parameter after the current parameter in the parameter sequence to 0; if the target deformation parameter is less than the current parameter, determining the target weight of the second node corresponding to the current parameter based on the current parameter and the previous parameter, and setting the target weight of the second node corresponding to the second deformation parameter after the current parameter in the parameter sequence to 0; the previous parameter is the second deformation parameter before the current parameter in the parameter sequence.
[0134] Optionally, the second deformation parameter of the second node is also used to indicate the deformation progress of the intermediate target body of the difference model corresponding to the second node; based on the current parameter and the previous parameter, the step of determining the target weight of the second node corresponding to the current parameter includes: if the current parameter is the first second deformation parameter in the parameter sequence, calculating the first difference between the current parameter and the target deformation parameter, calculating the first ratio of the first difference to the current parameter, and determining the target weight of the second node corresponding to the current parameter as the first ratio; if the current parameter is not the first second deformation parameter in the parameter sequence, calculating the second difference between the current parameter and the target deformation parameter, calculating the third difference between the current parameter and the previous parameter, calculating the second ratio of the second difference to the third difference, and determining the target weight of the second node corresponding to the current parameter as the second ratio.
[0135] See also Figure 8 As shown, 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 data processing method.
[0136] Further, Figure 8 The electronic device shown 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 .
[0137] The memory 101 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 102 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0138] The processor 100 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 100. The above 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, discrete hardware components. The 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 a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 101, and the processor 100 reads the information in the memory 101 and completes the steps of the method of the above embodiment in combination with its hardware.
[0139] This embodiment also provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned animation data processing method.
[0140] The embodiments of the present disclosure provide a method, device and electronic device for processing animation data, including a computer-readable storage medium storing program codes, wherein the program codes include instructions that can be used to execute the methods described in the above method embodiments, for example:
[0141] Obtain a target binding file and animation parameters; wherein the target binding file includes a plurality of first blend deformation nodes corresponding to a first character model; the first blend deformation node does not include an intermediate target body; the initial binding file includes a second blend deformation node corresponding to the first character model; the second blend deformation node includes an intermediate target body; the intermediate target body has a first deformation parameter; some of the plurality of first blend deformation nodes are generated based on the intermediate target body; the second deformation parameters of some of the blend deformation nodes are determined based on the first deformation parameters; the animation parameters are used to indicate the target deformation parameters corresponding to the first character model in each animation frame; based on the animation parameters and the second deformation parameters, determine the target weights of the plurality of first blend deformation nodes in the animation frame; based on the target weights of the plurality of first blend deformation nodes and the plurality of first blend deformation nodes, determine the display form of the first character model in the animation frame.
[0142] In the above method, the target binding file is generated based on the initial binding file, and the intermediate target body of the blend deformation node in the initial binding file is represented by a separate blend deformation node in the target binding file. In the process of generating animation, it is necessary to determine the weight of the blend deformation node in the target binding file based on the target deformation parameters of the animation frame to achieve the same model deformation effect as when using the initial binding file, so that game engines and other software that do not support intermediate target bodies can also generate animations directly through binding files, thereby improving the animation display effect and the user's viewing experience.
[0143] Optionally, the target binding file is generated in the following manner: obtaining an initial binding file; the initial binding file includes at least one blended deformation node; based on the deformation parameters of at least one blended deformation node, determining a second blended deformation node in the initial binding file; the second blended deformation node includes at least one intermediate target body; based on the second blended deformation node, generating multiple third blended deformation nodes; the third blended deformation node does not include an intermediate target body; based on the blended deformation nodes except the second blended deformation node and the third blended deformation node in the initial binding file, generating a target binding file.
[0144] Optionally, the above-mentioned second blended deformation node includes an initial model and an intermediate target body; based on the second blended deformation node, the step of generating multiple third blended deformation nodes includes: generating a third blended deformation node corresponding to the initial model; generating a target model corresponding to the intermediate target body; generating a difference model based on the initial model and the target model; generating a third blended deformation node corresponding to the difference model.
[0145] Optionally, the above-mentioned intermediate target bodies include multiple ones; the multiple intermediate target bodies have a preset deformation order; the step of generating a difference model based on the initial model and the target model includes: generating a first difference model based on the target model and the initial model corresponding to the first intermediate target body in the deformation order; for any two adjacent intermediate target bodies in the deformation order, generating a second difference model based on the target models corresponding to the two adjacent intermediate target bodies.
[0146] Optionally, the two adjacent intermediate target bodies include a first target body and a second target body; in the deformation order, the second target body is after the first target body; the method also includes: determining the first deformation parameter of the first intermediate target body as the second deformation parameter of the third mixed deformation node corresponding to the first difference model; determining the first deformation parameter of the second target body among the two adjacent intermediate target bodies as the second deformation parameter of the third mixed deformation node corresponding to the second difference model.
[0147] Optionally, the above-mentioned second blend deformation node includes an initial model and an intermediate target body; multiple first blend deformation nodes include a first node and a second node; the first node is generated based on the initial model; the second node is generated based on the initial model and the intermediate target body; based on the animation parameters and the second deformation parameters, the step of determining the target weights of multiple first blend deformation nodes in the animation frame includes: for each animation frame, in response to the animation frame including the first character model, setting the target weight of the first node to 1; determining the target weight of the second node based on the target deformation parameters and the second deformation parameters corresponding to the animation frame.
[0148] Optionally, the above-mentioned intermediate target bodies include multiple ones; the multiple intermediate target bodies have a preset deformation order; the second node is generated based on the initial model and the difference model corresponding to the first intermediate target body in the deformation order, or, based on the difference model corresponding to two adjacent intermediate target bodies in the deformation order; the second deformation parameter of the second node is used to indicate the sequence of the intermediate target body for generating the difference model corresponding to the second node in the deformation order; based on the target deformation parameter and the second deformation parameter corresponding to the animation frame, the step of determining the target weight of the second node includes: comparing the target deformation parameter corresponding to the animation frame with the second deformation parameter of the second node, and determining the target weight of the second node based on the comparison result.
[0149] Optionally, the above-mentioned second node includes multiple nodes; the second deformation parameters form a parameter sequence according to the indicated sequence; the target deformation parameter corresponding to the animation frame is compared with the second deformation parameter of the second node, and the step of determining the target weight of the second node based on the comparison result includes: obtaining the first second deformation parameter in the parameter sequence; determining the obtained second deformation parameter as the current parameter; comparing the target deformation parameter corresponding to the animation frame with the current parameter; if the target deformation parameter is greater than the current parameter, determining the target weight of the second node corresponding to the current parameter to 1; determining the second deformation parameter after the current parameter in the parameter sequence as the current parameter; continuing to perform the step of comparing the target deformation parameter with the current parameter until the target deformation parameter is less than or equal to the current parameter; if the target deformation parameter is equal to the current parameter, determining the target weight of the second node corresponding to the current parameter to 1, and setting the target weight of the second node corresponding to the second deformation parameter after the current parameter in the parameter sequence to 0; if the target deformation parameter is less than the current parameter, determining the target weight of the second node corresponding to the current parameter based on the current parameter and the previous parameter, and setting the target weight of the second node corresponding to the second deformation parameter after the current parameter in the parameter sequence to 0; the previous parameter is the second deformation parameter before the current parameter in the parameter sequence.
[0150] Optionally, the second deformation parameter of the second node is also used to indicate the deformation progress of the intermediate target body of the difference model corresponding to the second node; based on the current parameter and the previous parameter, the step of determining the target weight of the second node corresponding to the current parameter includes: if the current parameter is the first second deformation parameter in the parameter sequence, calculating the first difference between the current parameter and the target deformation parameter, calculating the first ratio of the first difference to the current parameter, and determining the target weight of the second node corresponding to the current parameter as the first ratio; if the current parameter is not the first second deformation parameter in the parameter sequence, calculating the second difference between the current parameter and the target deformation parameter, calculating the third difference between the current parameter and the previous parameter, calculating the second ratio of the second difference to the third difference, and determining the target weight of the second node corresponding to the current parameter as the second ratio.
[0151] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0152] In addition, in the description of the embodiments of the present disclosure, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present disclosure can be understood according to specific circumstances.
[0153] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it 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, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0154] In the description of the present disclosure, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present disclosure and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present disclosure. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0155] 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 protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above embodiments, those skilled in the art should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A method for processing animation data, characterized in that: The method comprises: Get the target binding file and animation parameters; Wherein, the target binding file includes a plurality of first blend deformation nodes corresponding to the first character model; the first blend deformation node does not include an intermediate target body; the initial binding file includes a second blend deformation node corresponding to the first character model; the second blend deformation node includes an intermediate target body; the intermediate target body has a first deformation parameter; some blend deformation nodes among the plurality of first blend deformation nodes are generated based on the intermediate target body; the second deformation parameters of some blend deformation nodes are determined based on the first deformation parameters; the animation parameters are used to indicate the target deformation parameters corresponding to the first character model in each animation frame; determining target weights of the plurality of first blendShape nodes in the animation frame based on the animation parameter and the second deformation parameter; A display form of the first character model in the animation frame is determined based on the target weights of the plurality of first blendShape nodes and the plurality of first blendShape nodes.
2. The method according to claim 1, characterized in that The target binding file is generated in the following way: Obtaining an initial binding file; the initial binding file includes at least one blend deformation node; determining a second blendShape node in the initial binding file based on a deformation parameter of the at least one blendShape node; The second blendShape node includes at least one intermediate target volume; generating a plurality of third blendShape nodes based on the second blendShape node; The third blend deformation node does not include an intermediate target body; A target binding file is generated based on the blendShape nodes in the initial binding file except the second blendShape node and the third blendShape node.
3. The method according to claim 2, characterized in that The second blend deformation node includes an initial model and an intermediate target body; The step of generating a plurality of third blend deformation nodes based on the second blend deformation node comprises: generating a third blend deformation node corresponding to the initial model; Generating a target model corresponding to the intermediate target body; Based on the initial model and the target model, a difference model is generated; A third blend deformation node corresponding to the difference model is generated.
4. The method according to claim 3, characterized in that The intermediate target bodies include a plurality of intermediate target bodies; the plurality of intermediate target bodies have a preset deformation order; The step of generating a difference model based on the initial model and the target model comprises: Generate a first difference model based on the target model corresponding to the first intermediate target body in the deformation sequence and the initial model; For any two adjacent intermediate target bodies in the deformation sequence, a second difference model is generated based on the target models corresponding to the two adjacent intermediate target bodies.
5. The method according to claim 4, characterized in that The two adjacent intermediate targets include a first target and a second target; In the deformation sequence, the second target body is after the first target body; The method further comprises: Determining the first deformation parameter of the first intermediate target body as the second deformation parameter of the third blend deformation node corresponding to the first difference model; The first deformation parameter of the second target body among the two adjacent intermediate target bodies is determined as the second deformation parameter of the third blend deformation node corresponding to the second difference model.
6. The method according to claim 1, characterized in that The second blend deformation node includes an initial model and an intermediate target body; the plurality of first blend deformation nodes include a first node and a second node; the first node is generated based on the initial model; The second node is generated based on the initial model and the intermediate target body; The step of determining target weights of the plurality of first blend deformation nodes in the animation frame based on the animation parameter and the second deformation parameter comprises: For each of the animation frames, in response to the animation frame including the first character model, setting the target weight of the first node to 1; A target weight of the second node is determined based on the target deformation parameter corresponding to the animation frame and the second deformation parameter.
7. The method according to claim 6, characterized in that The intermediate target bodies include a plurality of intermediate target bodies; the plurality of intermediate target bodies have a preset deformation sequence; the second node is generated based on the initial model and a differential model corresponding to the first intermediate target body in the deformation sequence, or based on differential models corresponding to two adjacent intermediate target bodies in the deformation sequence; the second deformation parameter of the second node is used to indicate the sequence of the intermediate target body of the differential model corresponding to the second node in the deformation sequence; The step of determining the target weight of the second node based on the target deformation parameter corresponding to the animation frame and the second deformation parameter comprises: The target deformation parameter corresponding to the animation frame is compared with the second deformation parameter of the second node, and the target weight of the second node is determined based on the comparison result.
8. The method according to claim 7, characterized in that The second nodes include a plurality of nodes; the second deformation parameters form a parameter sequence according to the indicated sequence; The step of comparing the target deformation parameter corresponding to the animation frame with the second deformation parameter of the second node, and determining the target weight of the second node based on the comparison result, comprises: Obtaining the first second deformation parameter in the parameter sequence; Determine the acquired second deformation parameter as the current parameter; Comparing the target deformation parameter corresponding to the animation frame with the current parameter; If the target deformation parameter is greater than the current parameter, determining the target weight of the second node corresponding to the current parameter to be 1; Determine a second deformation parameter following the current parameter in the parameter sequence as the current parameter; Continue to perform the step of comparing the target deformation parameter with the current parameter until the target deformation parameter is less than or equal to the current parameter; If the target deformation parameter is equal to the current parameter, the target weight of the second node corresponding to the current parameter is determined to be 1, and the target weight of the second node corresponding to the second deformation parameter after the current parameter in the parameter sequence is set to 0; If the target deformation parameter is less than the current parameter, the target weight of the second node corresponding to the current parameter is determined based on the current parameter and the previous parameter, and the target weight of the second node corresponding to the second deformation parameter located after the current parameter in the parameter sequence is set to 0; the previous parameter is the second deformation parameter located before the current parameter in the parameter sequence.
9. The method according to claim 8, characterized in that The second deformation parameter of the second node is also used to indicate the deformation progress of the intermediate target body of the difference model corresponding to the second node; The step of determining the target weight of the second node corresponding to the current parameter based on the current parameter and the previous parameter includes: If the current parameter is the first second deformation parameter in the parameter sequence, calculating a first difference between the current parameter and the target deformation parameter, calculating a first ratio between the first difference and the current parameter, and determining the target weight of the second node corresponding to the current parameter as the first ratio; If the current parameter is not the first second deformation parameter in the parameter sequence, calculate the second difference between the current parameter and the target deformation parameter, calculate the third difference between the current parameter and the previous parameter, calculate the second ratio of the second difference to the third difference, and determine the target weight of the second node corresponding to the current parameter as the second ratio.
10. An animation data processing device, characterized in that: The device comprises: File acquisition module, used to obtain target binding files and animation parameters; Wherein, the target binding file includes a plurality of first blend deformation nodes corresponding to the first character model; the first blend deformation node does not include an intermediate target body; the initial binding file includes a second blend deformation node corresponding to the first character model; the second blend deformation node includes an intermediate target body; the intermediate target body has a first deformation parameter; some blend deformation nodes among the plurality of first blend deformation nodes are generated based on the intermediate target body; the second deformation parameters of some blend deformation nodes are determined based on the first deformation parameters; the animation parameters are used to indicate the target deformation parameters corresponding to the first character model in the animation frame; a weight determination module, configured to determine target weights of the plurality of first blend deformation nodes in the animation frame based on the animation parameter and the second deformation parameter; The display form determination module is used to determine the display form of the first character model in the animation frame based on the target weights of the plurality of first blend deformation nodes and the plurality of first blend deformation nodes.
11. An electronic device, characterized in that: The invention comprises 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 method for processing animation data according to any one of claims 1 to 9.
12. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the method for processing animation data according to any one of claims 1 to 9.