Method, device and electronic equipment for repairing animation file

By replacing and matching the standard hand model data in the animation file, the problem of inaccurate hand-ball position relationship caused by the difference in height between the player and the actor was solved, achieving precise matching of hands and ball and improving the realism of the game.

CN119951142BActive Publication Date: 2026-01-20NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311484071.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-08
Publication Date
2026-01-20
Estimated Expiration
2043-11-08

AI Technical Summary

Technical Problem

Because the player model's height is different from the actor's height, the positional relationship between the ball and the hands in the motion capture data cannot be accurately located, resulting in a large gap between the hands and the ball, which affects the realism of the game.

Method used

By acquiring the target frame data from the animation file, replacing the non-fitted hand model data with standard hand model data, and determining the fittable sphere center position based on the standard hand model, the virtual sphere model is fitted to repair the hand fit data in the animation file.

Benefits of technology

It achieves precise contact between the hands and the ball, improving the realism of the movements in the game and reducing the gap between the hands and the ball.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119951142B_ABST
    Figure CN119951142B_ABST
Patent Text Reader

Abstract

The application provides a repairing method and device of an animation file and electronic equipment, the method comprises the following steps: obtaining first target frame data in the animation file; replacing hand model data in the first target frame data by applying standard double-hand model data; the standard double-hand model data is hand model data of a virtual character's hand fitting a spherical surface of a virtual sphere; determining a position of a sphere center that can be fitted according to the standard double-hand model data; setting a virtual sphere model at the position of the sphere center that can be fitted; and performing fitting processing on the standard double-hand model and the virtual sphere model to repair the animation file. The application replaces hand data in target frame data by using hand model data that can accurately fit a spherical surface, and completes double-hand fitting processing on a virtual sphere model at a position of a sphere center that can be fitted, to repair double-hand fitting data in the animation file, aiming at a target frame in which a virtual character's hand and a virtual sphere are in a non-fitting state.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the game technical field, and particularly to an animation file repairing method and device and electronic equipment. BACKGROUND

[0002] In some game motion capture source data, since the height of the player model is not completely consistent with the height of the actor, the data of the ball and the hands in the motion capture data is inaccurate, and the positions of the ball and the hands and the positional relationship therebetween cannot be accurately positioned, resulting in a large gap between the hands and the ball in the action of holding the ball. SUMMARY

[0003] The present application aims to provide an animation file repairing method and device and electronic equipment, for a target frame in which a virtual character's hand and a virtual ball are in a non-adhering state, the hand model data capable of adhering to the surface of the ball is used to replace the hand data in the target frame data, and the double-hand adhering processing with the virtual ball model at the position capable of adhering to the ball center is completed, so as to complete the repairing of the double-hand adhering data in the animation file.

[0004] In a first aspect, the present application provides a basketball animation file repairing method, which comprises: obtaining first target frame data in an animation file; the hand of a virtual character in the first target frame data is in a non-adhering state with a virtual ball; applying standard double-hand model data to replace the double-hand model data in the first target frame data; the standard double-hand model data is hand model data adhering to the surface of the virtual ball; determining a position capable of adhering to the ball center according to the standard double-hand model data; setting a virtual ball model at the position capable of adhering to the ball center, and performing adhering processing between the standard double-hand model and the virtual ball model, so as to repair the animation file.

[0005] In a second aspect, the present application further provides an animation file repairing device, which comprises: a data obtaining module, configured to obtain first target frame data in an animation file; the hand of a virtual character in the first target frame data is in a non-adhering state with a virtual ball; a data replacing module, configured to apply standard double-hand model data to replace the double-hand model data in the first target frame data; the standard double-hand model data is hand model data adhering to the surface of the virtual ball; a position determining module, configured to determine a position capable of adhering to the ball center according to the standard double-hand model data; an adhering processing module, configured to set a virtual ball model at the position capable of adhering to the ball center; and perform adhering processing between the standard double-hand model and the virtual ball model, so as to repair the animation file.

[0006] In a third aspect, the present application further provides an electronic device, comprising a processor and a memory, the memory stores computer executable instructions capable of being executed by the processor, and the processor executes the computer executable instructions to implement the method of the first aspect.

[0007] In a fourth aspect, the present application also provides a computer readable storage medium, which stores computer executable instructions. When the computer executable instructions are invoked and executed by a processor, the computer executable instructions cause the processor to implement the method of the first aspect.

[0008] In the method, the device and the electronic equipment for repairing an animation file provided by the present application, first, first target frame data in which a hand of a virtual character and a virtual sphere are in a non-fitting state is acquired; then, standard double-hand model data is applied to replace double-hand model data in the first target frame data; the standard double-hand model data is hand model data that fits a spherical surface of the virtual sphere; a position at which the virtual sphere can be fitted is determined according to the standard double-hand model data; a virtual sphere model is set at the position at which the virtual sphere can be fitted; finally, the standard double-hand model and the virtual sphere model are fitted to repair hand-fitting data in the animation file. In this way, for a target frame in which the hand of the virtual character and the virtual sphere are in the non-fitting state, hand data in the target frame data is replaced by hand model data that can accurately fit the spherical surface, and double-hand fitting processing with the virtual sphere model at the position at which the virtual sphere can be fitted is completed, so as to complete repair of hand-fitting data in the animation file. BRIEF DESCRIPTION OF DRAWINGS

[0009] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the drawings needed in the description of the embodiments or the prior art will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.

[0010] Figure 1 A schematic diagram of a non-fitting hand-sphere in the prior art;

[0011] Figure 2 A flowchart of a method for repairing a basketball animation file provided by an embodiment of the present application;

[0012] Figure 3 A schematic diagram of a sphere center calculation process provided by an embodiment of the present application;

[0013] Figure 4 An interface schematic diagram of a repairing tool for a basketball animation file provided by an embodiment of the present application;

[0014] Figure 5 A structural block diagram of a repairing device for a basketball animation file provided by an embodiment of the present application;

[0015] Figure 6 A structural schematic diagram of an electronic equipment provided by an embodiment of the present application. Detailed Implementation

[0016] The technical solutions of this application will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0017] like Figure 1 As shown, in existing basketball games, the height of the player model in the motion capture source data is not completely consistent with the height of the actor, which leads to inaccurate data on the ball and hands. The position of the ball and hands and the positional relationship between them cannot be accurately located, resulting in a large gap between the hands and the ball in the action of holding the ball with both hands.

[0018] Based on this, embodiments of this application provide a method, apparatus, and electronic device for repairing animation files. For target frames where the hands of a virtual character are not in a fitted state with a virtual sphere, the hand data in the target frame data is replaced by hand model data that can accurately fit the sphere surface, and the hands are fitted with the virtual sphere model at the center position of the sphere to complete the repair of the hand fitting data in the animation file.

[0019] To facilitate understanding of this embodiment, a method for repairing animation files disclosed in this application embodiment will first be described in detail.

[0020] Figure 2 The flowchart illustrates a method for repairing animation files provided in this application embodiment. This method can be applied to a terminal configured with repair tools, and specifically includes the following steps:

[0021] Step S202: Obtain the first target frame data from the animation file; the virtual character's hand and the virtual sphere in the first target frame data are not in contact.

[0022] The animation file can be various ball animation files, and a basketball animation file is taken as an example for illustration in the embodiment of the application. The animation file includes a plurality of frame data, wherein a frame in which both hands need to be attached to a ball is a first target frame. In a ball game, when a virtual character's hands catch a ball, the virtual character's hand model needs to be attached to the surface of the virtual ball to improve the authenticity of the game. In the embodiment of the application, the virtual character's hand model needs to be attached to the surface of the virtual ball, but the animation frame in which the current state is not attached is taken as the first target frame. In a specific implementation, the distance between the two hand models and the virtual ball can be detected to determine whether the frame is the first target frame in which both hands need to be attached to the ball. If the detected distance between the two hand models and the virtual ball is less than a first preset distance threshold, it is determined that the frame is the first target frame in which both hands need to be attached to the ball. The data corresponding to the first target frame is first target frame data, including the position data of the whole body skeleton of the character model.

[0023] In step S204, standard hand model data is applied to replace the hand model data in the first target frame data.

[0024] The standard hand model data is hand model data that is attached to the surface of the virtual ball. Here, it refers to hand model data in which the two hand models of the virtual character are accurately attached to the surface of the virtual ball, which can be obtained by mirroring the single-hand model data in the single-hand ball-attachment template file.

[0025] In step S206, the position of the ball center that can be attached is determined according to the standard hand model data.

[0026] Specifically, the position of the ball center that can be attached can be calculated according to the hand model skeleton position data by using mathematical knowledge.

[0027] In step S208, a virtual ball model is set at the position of the ball center that can be attached, and the standard hand model is attached to the virtual ball model to repair the animation file.

[0028] The radius of the virtual ball model is a preset value, that is, a value determined according to the size of a real basketball. In the embodiment of the application, the IK algorithm can be used to process the ball-attachment to make the posture of the character model change reasonably.

[0029] In the method for repairing an animation file provided in the application, for a target frame in which both hands need to be attached to a ball, the hand data in the target frame data is replaced by hand model data that can be accurately attached to the surface of the ball, the position of the ball center that can be attached is determined, and then the hand-attachment to the virtual ball model at the position of the ball center that can be attached is completed, thereby repairing the hand-attachment data in the animation file.

[0030] The embodiment of the application further provides another method for repairing an animation file, which is implemented based on the method described above. The embodiment focuses on the determination of the ball center position, the fitting process, and the repairing process of other frames.

[0031] To obtain the standard double-hand model data conveniently and quickly, the embodiment of the application can first obtain a single-hand ball hand fitting template file, wherein the single hand includes a left hand or a right hand; then perform mirror calculation on the first hand model data in the single-hand ball hand fitting template file to obtain second hand model data; and take the first hand model data and the second hand model data as the standard double-hand model data. This method is very fast and simple.

[0032] The step of determining the fitting ball center position according to the standard double-hand model data includes:

[0033] (1) generating a line segment between the wrist position and the corresponding fingertip position according to the first hand model data and the second hand model data in the standard double-hand model data respectively; in the specific implementation, for each hand model data, a line segment between the wrist position and the corresponding five fingertip positions is generated, that is, each hand model data corresponds to five line segments; and two hand model data correspond to ten line segments.

[0034] (2) calculating a point with the minimum sum of distances to the line segments as the fitting ball center position.

[0035] The fitting ball center position has the minimum sum of distances to the ten line segments, and thus the distance required for the double hands to fit the ball is also the minimum, that is, the action amplitude required for the change is the minimum, and the influence on the original action is reduced to the minimum.

[0036] Further, the step of fitting the standard double-hand model and the virtual sphere model includes:

[0037] (1) determining the wrist displacement vector corresponding to each hand model according to the double-hand model data in the standard double-hand model. In the specific implementation, for each hand model, the corresponding circumscribed ball center position can be determined according to the fingertip position of the hand model; and then the fitting ball center position is subtracted from the circumscribed ball center position to obtain the wrist displacement vector corresponding to the hand model.

[0038] The process of determining the corresponding circumscribed ball center position according to the fingertip position of the hand model is as follows:

[0039] 1) forming multiple triangles according to the five fingertip positions of the hand model;

[0040] 2) For each triangle, a normal vector perpendicular to the plane where the triangle is located and passing through the circumcenter position of the triangle is determined; according to a preset sphere radius, the normal vector, the circumcenter position and a vertex position of the triangle, a circum-sphere center position corresponding to the triangle is determined.

[0041] As shown in Figure 3 , is the preset sphere radius, is the normal vector, is the circumcenter position and a vertex position of the triangle , the calculation process of the circum-sphere center position corresponding to the triangle is as follows:

[0042] ; ;

[0043] wherein, represents the distance between the circum-sphere center position and the circumcenter position, satisfying the Pythagorean theorem.

[0044] 3) The arithmetic mean of the circum-sphere center positions corresponding to the plurality of triangles is obtained, and the circum-sphere center position corresponding to the hand model is obtained.

[0045] (2) Based on the wrist displacement vector corresponding to each hand model, the fitting process of the standard double-hand model and the virtual sphere model is performed.

[0046] The IK algorithm is used to move the initial position of the wrist in the corresponding hand model according to the wrist displacement vector corresponding to each hand model, and the fitting process of the standard double-hand model and the virtual sphere model is completed.

[0047] In specific implementation, the shoulder-elbow-wrist is regarded as a Two Bone IK system, and the current shoulder, elbow and wrist positions are initial poses; the Two Bone IK algorithm is used to move the wrist in the corresponding direction of the wrist displacement vector by the vector length corresponding to the wrist displacement vector; at this time, the palm circum-sphere center position coincides with the aforementioned fittable sphere center position, and the palm and the sphere are circum-scribed, i.e. the palm and the sphere are fitted; during the fitting process, the minimum motion variation range is ensured.

[0048] The basic idea of the hand and sphere fitting processing method provided by the embodiments of the present application is as follows:

[0049] In the case that the accurate position relationship between the two hands model and the virtual ball cannot be determined, since the position relationship between the two hands model is less error and the motion data of the two hands fingers cannot be captured, the posture data of the two hands in the correct ball fitting condition is pasted to the two hands first; then the position of the ball is calculated through the position relationship of the two hands, and the position information of a bone point of the ball skeleton is obtained; then a standard ball model is given on the ball skeleton, and the two hands are fitted to the ball model along the direction of the palm of each hand; in the process of fitting the two hands to the ball, other joint bones of the character model body (such as the elbow, shoulder, etc.) will change, so IK is used to make the posture of the character model change reasonably.

[0050] In the basketball animation file, in addition to the frame in which the two hands are fitted to the ball, there are other frame data that need to be repaired. The following will introduce several actions in the basketball game in detail:

[0051] All the dribbling actions containing the two hands holding the ball and the non-dribbling actions can be abstracted as the following model:

[0052] The ball receiving action (when dribbling, the ball bounces back into the hand): two hands without ball -> one hand first touches the ball -> one hand holds the ball -> two hands hold the ball (the other hand touches the ball);

[0053] The ball releasing action (when dribbling, the ball is pushed out of the hand): two hands hold the ball -> one hand holds the ball -> one hand releases the ball (in the case of two hands releasing the ball, there can be no one hand holding the ball stage) -> two hands without ball;

[0054] For the ball receiving action:

[0055] When one hand touches the ball: the algorithm automatically judges the ball touching frame according to the distance between the ball and the hand, and applies the one hand touching ball posture template to the ball touching hand and the ball in the ball touching frame;

[0056] Ball trajectory offset before touching the ball: since the position of the ball in the ball touching frame is modified when the ball touching posture template is applied, the ball trajectory before the ball touching frame also needs to be repaired; the ball trajectory before the ball touching frame in the file to be repaired can be translated according to the difference between the position of the ball in the one hand touching ball posture template and the position of the ball in the ball touching frame in the file to be repaired.

[0057] One hand holding the ball: the ball and the hand in this stage can be applied with the ball fitting posture template at the same time.

[0058] Two hands holding the ball: it is the processing method for the two hands fitting to the ball as described above.

[0059] For the ball releasing action:

[0060] Two hands holding the ball: it is the processing method for the two hands fitting to the ball as described above.

[0061] Single-handed holding ball: the ball and the hand are used simultaneously in this stage, and the ball-hand template is used.

[0062] Single-handed throwing ball: similar to single-handed touching ball, the algorithm automatically determines the throwing frame according to the distance between the ball and the hand, and applies the single-handed throwing ball template to the ball and the throwing hand in the throwing frame.

[0063] Ball trajectory deviation after throwing: the same processing method as the trajectory deviation before touching the ball.

[0064] A transition time can be selected between any two stages, and a motion linear interpolation method is used to smoothly transition from one motion to another.

[0065] Further, the above method further comprises:

[0066] Obtaining second target frame data of hand touching ball or ball throwing in the animation file; applying standard single-handed touching ball template data to replace single-handed model data in the second target frame data, to repair the frame data of hand touching ball or ball throwing in the animation file.

[0067] In a ball game, there are often cases where a virtual character's hand model throws a virtual ball, and there are cases where the hand model catches a virtual ball. The second target frame of hand touching ball can be understood as the animation frame when the hand model just touches the virtual ball. Specifically, the ball-holding hand model needs to be detected first, and the skeletal data of the other hand model is invalid at this time. Then, a sequence of animation in which the ball-holding hand model and the virtual ball are both in a state of adhesion is detected from the animation, i.e., a sequence of animation in which the distance between the ball-holding hand model and the virtual ball is less than a second preset distance threshold. The first frame in this sequence is taken as the second target frame of ball touching hand. The second target frame of ball throwing can be understood as the animation frame when the virtual character's hand model just throws the virtual ball. Taking the above example, the last frame in the sequence of animation in which the distance between the ball-holding hand model and the virtual ball is less than the second preset distance threshold is taken as the second target frame of ball throwing.

[0068] In the embodiments of the present application, the first preset distance threshold and the second preset distance threshold can be the same or different.

[0069] Further, the above method further comprises processing of ball trajectory deviation after throwing and processing of ball trajectory deviation before touching, specifically comprising:

[0070] (1) Determining a plurality of frames to be processed corresponding to the second target frame; for the second target frame of hand touching ball, a plurality of sequence frames before the second target frame are obtained as a plurality of frames to be processed; for the second target frame of ball throwing, a plurality of sequence frames after the second target frame are obtained as a plurality of frames to be processed.

[0071] (2) calculate the difference between the position of the virtual sphere model in the standard single-hand ball-touching template data and the position of the virtual sphere model in the single-hand model data;

[0072] (3) adjust the trace of the virtual sphere model in the plurality of frames to be processed according to the difference.

[0073] The above processes can be automatically completed by a repair tool, and the tool can also smoothly transition from the ball-on-hand and ball-off-hand motion to the state of the two hands adhering to the ball, i.e., the case of holding the ball with two hands to the case of releasing the ball, or the case of catching the ball to the case of holding the ball with two hands. One frame of the ball release or the ball catch and one frame of the single-hand ball adhesion are loaded into a template file of the ball release or the ball catch, the corresponding hand posture data is pasted to the motion data to be corrected, and then a smooth transition is made to the motion stage of the two hands adhering to the ball.

[0074] Referring to Figure 4 the operation interface of one repair tool, the specific operation process is as follows:

[0075] 1. Input the source folder path and the output folder path:

[0076] The source folder path corresponds to the animation file to be repaired, which can be multiple. It can be simply understood that each file contains the position data of the full-body skeleton in each frame of the animation. The output folder path corresponds to the repaired animation file.

[0077] 2. Configure the ball handler:

[0078] There are four options here: left hand, right hand, automatic judgment, and read table. When automatic judgment is selected, the tool will automatically select the hand that the ball first touches as the ball handler. Here, it is to determine which hand the ball trajectory data exists under, and after the ball center position is calculated, the position of the ball in which frame is modified. Of course, the left hand or the right hand can also be directly selected in the drop-down menu, or it can be obtained by reading the configuration table. In the configuration table path, the corresponding configuration table is selected; in the configuration table, the file name of each motion and its corresponding ball handler are filled in.

[0079] 3. Input the pose fusion time:

[0080] The above pose fusion time can determine the time of interpolating the transition from the original posture to the template posture.

[0081] 4. Specify the ball-touching / frame:

[0082] Input the frame of the ball release or the ball touch that needs to be modified, and the tool will automatically determine whether the motion is the ball release or the ball touch.

[0083] 5. Configure the ball-hand adhesion distance variation threshold:

[0084] If the value is greater than the threshold, it will be judged as a shot. If the value is less than or equal to the threshold, it will be judged as a touch.

[0085] The threshold is generally selected as 3, and the unit is the length unit in the MotionBuilder software. The actual situation of the animation file needs to be selected.

[0086] 6. Related information configuration (such as Figure 4 The 8th to 13th lines in the figure): According to whether the action to be modified is a shot or a touch, fill in the corresponding option. Input the template file of the shot, input the frame of the template file of the shot / touch and the frame of the hand fitting, and select the player.

[0087] The shot / touch pose position in the figure refers to which frame of which hand pose in the template file is used as the hand template pose. The first template file path refers to the shot pose template file, and the second template file path refers to the touch pose template file.

[0088] If the touch animation is to be modified, the touch-related content is necessary to fill in, and if the shot animation is to be modified, the shot-related content is necessary to fill in. If a plurality of animation files are processed in batches, and these files are mixed with touch and shot animations, these contents are all needed to fill in.

[0089] 7. Check the box to enable the double-hand fitting logic, as shown in the 14th line in the figure.

[0090] 8. Input the fine-tuning action of double-hand fitting, input the frame of the double-hand fitting and the player, as shown in the 15th to 16th lines in the figure.

[0091] 9. If the position of the hand needs to be fine-tuned, input the offset value of each hand, as shown in the 17th and 18th lines in the figure. Because the height of the player in different animation files may have errors, and the algorithm may also have precision errors in calculation, additional adjustment parameters are provided here.

[0092] The offset here refers to moving the palm outward along the ball center->“palm center” (actually the circumcenter of a triangle formed by three fingers of the same hand) by the input distance, to prevent the palm from sinking into the ball or not fitting the ball surface.

[0093] 10. Click “One-click processing” to complete the batch double-hand fitting processing and achieve the repair of the animation file.

[0094] The animation file repairing method provided by the embodiments of the present application can calculate the position that can be fitted to the ball center by accurately fitting the double-hand model template data, and then fit the double-hand model to the virtual sphere model at the ball center position, so as to repair the double-hand and ball fitting data in the animation file. In addition, the template file can be used to repair the target frame data when the ball is touched or the ball is thrown, and the corresponding trajectory repairing processing can be performed on the multiple frames before the ball touch frame or the multiple frames after the ball throw frame.

[0095] Based on the above method embodiments, the embodiments of the present application further provide an animation file repairing device, as shown in Figure 5 The device comprises: a data acquisition module 52, configured to acquire first target frame data in an animation file; the virtual character hand and the virtual sphere in the first target frame data are in a non-fitting state; a data replacement module 54, configured to replace double-hand model data in the first target frame data by using standard double-hand model data; the standard double-hand model data is hand model data fitting to the surface of the virtual sphere; a position determination module 56, configured to determine a position that can be fitted to the ball center according to the standard double-hand model data; and a fitting processing module 58, configured to set a virtual sphere model at the position that can be fitted to the ball center, and fit the standard double-hand model to the virtual sphere model to repair the animation file.

[0096] Further, the standard double-hand model data is acquired in the following manner: a single-hand ball-hand fitting template file is acquired; first hand model data in the single-hand ball-hand fitting template file is mirror calculated to obtain second hand model data; and the first hand model data and the second hand model data are used as the standard double-hand model data.

[0097] Further, the position determination module 56 is configured to respectively generate a line segment between a wrist position and a corresponding fingertip position according to the first hand model data and the second hand model data in the standard double-hand model data; and calculate a point with the minimum sum of distances to each line segment as the position that can be fitted to the ball center.

[0098] Further, the fitting processing module 58 is configured to: determine a wrist displacement vector corresponding to each hand model according to double-hand model data in the standard double-hand model; and fit the standard double-hand model to the virtual sphere model based on the wrist displacement vector corresponding to each hand model.

[0099] Further, the fitting processing module 58 is configured to: for each hand model, determine a circumscribed sphere center position corresponding to the hand model according to a fingertip position of the hand model; and obtain a wrist displacement vector corresponding to the hand model by subtracting the circumscribed sphere center position from the position that can be fitted to the ball center.

[0100] Further, the fitting processing module 58 is configured to: compose a plurality of triangles according to the positions of the fingertips of the hand model; determine, for each triangle, a normal vector that is perpendicular to a plane on which the triangle is located and that passes through a circumcenter position of the triangle; determine a circum-sphere center position corresponding to the triangle according to a preset sphere radius, the normal vector, the circumcenter position, and a position of one vertex of the triangle; and obtain an arithmetic mean of the circum-sphere center positions corresponding to the plurality of triangles respectively to obtain a circum-sphere center position corresponding to the hand model.

[0101] Further, the fitting processing module 58 is configured to: use an IK algorithm to move an initial position of a wrist in the corresponding hand model according to a wrist displacement vector corresponding to each hand model, so as to complete the fitting processing of the standard double-hand model and the virtual sphere model.

[0102] Further, the device further includes a data repairing module configured to: obtain second target frame data of a hand touching a ball or a ball being taken out of a hand in the animation file; and replace single-hand model data in the second target frame data with standard single-hand ball touching template data, so as to repair the frame data of the hand touching the ball or the ball being taken out of the hand in the animation file.

[0103] Further, the data repairing module is configured to: determine a plurality of frames to be processed corresponding to the second target frame; calculate a difference value between a position of a virtual sphere model in the standard single-hand ball touching template data and a position of the virtual sphere model in the single-hand model data; and adjust a trajectory of the virtual sphere model in the plurality of frames to be processed according to the difference value.

[0104] Further, the data repairing module is configured to: for the second target frame of the hand touching the ball, obtain a plurality of sequence frames before the second target frame as the plurality of frames to be processed; and for the second target frame of the ball being taken out of the hand, obtain a plurality of sequence frames after the second target frame as the plurality of frames to be processed.

[0105] The device provided in the embodiments of the present application has the same implementation principles and technical effects as the foregoing method embodiments, and for brevity and description, the part of the device embodiments not mentioned in the foregoing method embodiments can be referred to the corresponding content in the foregoing method embodiments.

[0106] The embodiments of the present application further provide an electronic device, as shown in Figure 6 The electronic device includes a processor 61 and a memory 60, the memory 60 stores computer executable instructions capable of being executed by the processor 61, and the processor 61 executes the computer executable instructions to implement the foregoing method.

[0107] In Figure 6 In the embodiment shown, the electronic device further includes a bus 62 and a communication interface 63, wherein the processor 61, the communication interface 63, and the memory 60 are connected through the bus 62.

[0108] The memory 60 can include a high-speed random access memory (RAM), and can also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 63 (which can be wired or wireless), and the Internet, a wide area network, a local area network, a metropolitan area network, etc. can be used. The bus 62 can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 62 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one bidirectional arrow is used in the figure to represent only one bus or one type of bus.

[0109] The processor 61 can be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above method can be completed by the integrated logic circuit of hardware in the processor 61 or the instructions in the form of software. The processor 61 described above 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 device, a discrete gate or transistor logic device, a discrete hardware component. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in combination with the embodiments of the present application 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 can be located in a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, or other mature storage media in the art. The storage medium is located in the memory, and the processor 61 reads the information in the memory and combines the hardware to complete the steps of the method of the above embodiments.

[0110] The embodiment of the present application further provides a computer readable storage medium storing computer executable instructions, when the computer executable instructions are invoked and executed by a processor, the computer executable instructions cause the processor to implement the method described above, and specific implementation can be referred to the foregoing method embodiments, and will not be described here.

[0111] The computer program product of the method, the device and the electronic device provided by the embodiment of the present application includes a computer readable storage medium storing program codes, and the instructions included in the program codes can be used to execute the method described in the foregoing method embodiments, and specific implementation can be referred to the method embodiments, and will not be described here.

[0112] Unless otherwise specified, the relative steps, numerical expressions and numerical values of the components and steps set forth in these embodiments do not limit the scope of the present application.

[0113] If the functions are realized in the form of software function units and sold or used as independent products, the functions can be stored in a nonvolatile computer readable storage medium executable by a processor. Based on such understanding, the technical solutions of the present application or the part of the technical solutions that make essential contributions to the prior art or the part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0114] In the description of the present application, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer" and the like indicate the orientation or positional relationship shown in the drawings, and are only for the purpose of facilitating the description of the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the present application. In addition, the terms "first", "second", "third" are only for the purpose of description, and cannot be understood as indicating or implying relative importance.

[0115] Finally, it should be noted that the above-described embodiments are merely specific embodiments of the present application, which are used to illustrate the technical solutions of the present application, but not to limit the same. The protection scope of the present application is not limited thereto. Although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those skilled in the art that any skilled person in the art can still modify or easily think of changes to the technical solutions recorded in the foregoing embodiments, or make equivalent replacements to some of the technical features, within the technical scope disclosed by the present application. The modifications, changes or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method of repairing an animation file, characterized by, The method comprises: Obtaining first target frame data in an animation file, wherein a virtual character hand and a virtual sphere in the first target frame data are in a non-adhesion state; wherein the first target frame needs to be judged by detecting the distance between two hand models and the virtual sphere; if the detected distances of the two are both less than a first preset distance threshold, it is determined that the frame is a first target frame in which the hands need to be adhered to the sphere; the data corresponding to the first target frame is the first target frame data, including the position data of the whole body skeleton of the character model; Applying standard double-hand model data to replace the double-hand model data in the first target frame data; the standard double-hand model data is hand model data in which the two hand models of the virtual character adhere to the spherical surface of the virtual sphere; Determining a sphere center position that can be adhered to according to the standard double-hand model data; Setting a virtual sphere model at the sphere center position that can be adhered to, and performing adhesion processing on the standard double-hand model and the virtual sphere model to repair the animation file.

2. The method of claim 1, wherein, The standard double-hand model data is obtained in the following manner: Obtaining a single-hand sphere hand adhesion template file; Performing mirror calculation processing on the first hand model data in the single-hand sphere hand adhesion template file to obtain second hand model data; Taking the first hand model data and the second hand model data as standard double-hand model data.

3. The method of claim 1, wherein, Determining a sphere center position that can be adhered to according to the standard double-hand model data comprises: Generating a line segment between a wrist position and a corresponding fingertip position according to the first hand model data and the second hand model data in the standard double-hand model data, respectively; Calculating a point with the smallest sum of distances to each line segment as the sphere center position that can be adhered to.

4. The method of claim 1, wherein, The adhesion processing on the standard double-hand model and the virtual sphere model comprises: Determining a wrist displacement vector corresponding to each hand model according to the double-hand model data in the standard double-hand model; Performing adhesion processing on the standard double-hand model and the virtual sphere model based on the wrist displacement vector corresponding to each hand model.

5. The method of claim 4, wherein, Determining a wrist displacement vector corresponding to each hand model according to the double-hand model data in the standard double-hand model comprises: For each hand model, determining a corresponding circumscribed sphere center position according to the fingertip position of the hand model; Applying the sphere center position that can be adhered to minus the circumscribed sphere center position to obtain the wrist displacement vector corresponding to the hand model.

6. The method of claim 5, wherein, Determining a corresponding circumscribed sphere center position according to the fingertip position of the hand model comprises: Forming multiple triangles according to the fingertip position of the hand model; For each triangle, determining a normal vector perpendicular to the plane on which the triangle is located and passing through the circumcenter position of the triangle; determining a corresponding circumscribed sphere center position of the triangle according to a preset sphere radius, the normal vector, the circumcenter position, and a vertex position of the triangle; Obtaining an arithmetic mean of the circumscribed sphere center positions corresponding to the multiple triangles to obtain the circumscribed sphere center position corresponding to the hand model.

7. The method of claim 4, wherein, Fitting the standard double-hand model and the virtual sphere model based on the wrist displacement vector corresponding to each hand model, comprising: Using the IK algorithm, moving the initial position of the wrist in the corresponding hand model according to the wrist displacement vector corresponding to each hand model, and completing the fitting of the standard double-hand model and the virtual sphere model.

8. The method of claim 1, wherein, The method further comprises: Obtaining second target frame data of hand touching ball or ball out of hand in the animation file; Applying standard single-hand ball touching template data to replace single-hand model data in the second target frame data to realize repair of hand touching ball or ball out of hand frame data in the animation file.

9. The method of claim 8, wherein, The method further comprises: Determining a plurality of frames to be processed corresponding to the second target frame; Calculating the difference between the position of the virtual sphere model in the standard single-hand ball touching template data and the position of the virtual sphere model in the single-hand model data; Adjusting the trajectory of the virtual sphere model in a plurality of the frames to be processed according to the difference.

10. The method of claim 9, wherein, Determining a plurality of frames to be processed corresponding to the second target frame, comprising: For the second target frame of hand touching ball, a plurality of sequence frames before the second target frame are obtained as a plurality of frames to be processed; For the second target frame of ball out of hand, a plurality of sequence frames after the second target frame are obtained as a plurality of frames to be processed.

11. A repair apparatus of an animation file, characterized by comprising: The device comprises: A data acquisition module is configured to acquire first target frame data in an animation file; a virtual character hand and a virtual sphere in the first target frame data are in a non-fitting state; wherein the first target frame needs to be determined by detecting the distance between the two hand models and the virtual sphere; if the detected two distances are both less than a first preset distance threshold, it is determined that the frame is a first target frame in which the double hands and the ball need to be fitted; the data corresponding to the first target frame is the first target frame data, including the position data of the whole body skeleton of the character model; A data replacement module is configured to apply standard double-hand model data to replace double-hand model data in the first target frame data; the standard double-hand model data is hand model data in which the two hand models of the virtual character are fitted to the surface of the virtual sphere; A position determination module is configured to determine a ball center fitting position according to the standard double-hand model data; A fitting processing module is configured to set a virtual sphere model at the ball center fitting position; and to fit the standard double-hand model and the virtual sphere model to repair the animation file.

12. An electronic device, comprising: The computer readable storage medium stores computer executable instructions, and the computer executable instructions, when invoked and executed by a processor, cause the processor to implement the method of any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer executable instructions, and the computer executable instructions, when invoked and executed by a processor, cause the processor to implement the method of any one of claims 1 to 10.

Citation Information

Patent Citations

  • Game data processing method and device and storage medium

    CN112870704A

  • Animation mold penetrating repair method and device and electronic equipment

    CN115482319A