Method, device, medium and equipment for generating root bone keyframe data
By automating the generation of root skeleton keyframe data, the motion trend parameters of the virtual model are used to simplify the processing of pelvic skeleton motion data, solving the problems of low efficiency and redundant data in manually determining root skeleton motion data, and achieving efficient and accurate root skeleton data generation and storage optimization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NETEASE (HANGZHOU) NETWORK CO LTD
- Filing Date
- 2022-11-02
- Publication Date
- 2026-04-21
AI Technical Summary
In existing technologies, manually determining root skeleton motion data is not only wasteful of manpower and prone to errors, but also leads to wasted storage space and consumption of animation rendering computing resources due to the presence of redundant data in the root skeleton motion data.
By using a method to automatically generate root skeleton keyframe data, the motion trend parameters of the virtual model are used to simplify the processing of pelvic skeleton motion data. Motion data vector operations are performed frame by frame to remove redundant data and generate simplified root skeleton animation data.
It improves the efficiency and accuracy of determining root skeleton motion data, reduces manpower consumption, and reduces data storage space and animation rendering performance pressure without affecting the animation rendering effect.
Smart Images

Figure CN115713580B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of rendering technology, and more specifically, to a method for generating root skeleton keyframe data, an apparatus for generating root skeleton keyframe data, a computer-readable storage medium, and an electronic device. Background Technology
[0002] The virtual world constructed by computers includes virtual objects such as virtual models. It is necessary to control the virtual models to interact with them, which includes identifying the character's position and orientation through the motion data of the root skeleton.
[0003] Normally, animation files do not include motion data for the root bone. Since the root bone is the parent node of the pelvic bone, the motion data of the pelvic bone can be used to determine the motion data of the root bone.
[0004] In related technologies, determining the motion data of the root bones manually based on the motion data of the pelvic bones is not only wasteful of manpower but also prone to errors. Furthermore, since there is redundant data in the motion data of the root bones, it wastes storage space and also leads to the consumption of computing resources during the animation display process.
[0005] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0006] The purpose of this disclosure is to provide a method, apparatus, medium, and electronic device for generating root bone keyframe data. By automatically determining the second motion data of the root bones in an animation file and deleting redundant data from the second motion data of the root bones, the efficiency and accuracy of determining the second motion data of the root bones can be improved to a certain extent, while reducing the storage space occupied by the animation file and reducing the performance pressure of animation rendering.
[0007] A first aspect of this disclosure provides a method for generating root skeleton keyframe data, the method comprising:
[0008] Obtain an initial animation file, the animation file including multiple frames of skeletal keyframes corresponding to the virtual model, the skeletal keyframes including at least the first motion data corresponding to the pelvic bone;
[0009] Based on the first motion data, determine the motion trend parameters of the virtual model during the motion process;
[0010] Based on the motion trend parameters, the first motion data is simplified to obtain the second motion data of the root bones corresponding to the pelvic bones.
[0011] Based on the second motion data of the root bone in each bone keyframe, frame-by-frame motion data vector operations are performed on the multi-frame bone keyframes to obtain a velocity difference vector that characterizes the motion changes of the root bone in the multi-frame bone keyframes.
[0012] When the sum of the velocity difference vectors corresponding to the multiple adjacent bone keyframes is greater than a preset threshold, the second motion data in the middle bone keyframe of the multiple adjacent frame bone keyframes is deleted to obtain the simplified keyframe data required to generate the root bone animation corresponding to the initial animation file. The number of frames of the multiple adjacent bone keyframes includes at least three frames.
[0013] According to a second aspect of the present disclosure, an apparatus for generating root skeleton keyframe data is provided, characterized in that the apparatus comprises:
[0014] The acquisition module is configured to acquire an initial animation file, the animation file including multiple frames of skeletal keyframes corresponding to the virtual model, the skeletal keyframes including at least the first motion data corresponding to the pelvic bone;
[0015] The determination module is configured to determine the motion trend parameters of the virtual model during the motion process based on the first motion data;
[0016] The processing module is configured to simplify the first motion data based on the motion trend parameters to obtain the second motion data of the root bones corresponding to the pelvic bones.
[0017] The calculation module is configured to perform frame-by-frame motion data vector calculation on the multi-frame skeletal keyframes based on the second motion data of the root bone in each skeletal keyframe, so as to obtain a velocity difference vector that characterizes the motion change of the root bone in the multi-frame skeletal keyframes.
[0018] The deletion module is configured to delete the second motion data in the middle bone keyframe of the multiple adjacent frame bone keyframes when the sum of the velocity difference vectors corresponding to the multiple adjacent frame bone keyframes is greater than a preset threshold, so as to obtain the simplified keyframe data required to generate the root bone animation corresponding to the initial animation file. The number of frames of the multiple adjacent frame bone keyframes includes at least three frames.
[0019] According to a third aspect of the present disclosure, a computer-readable storage medium is provided having a computer program stored thereon, characterized in that the program, when executed by a processor, implements the method described in the first aspect of the above embodiments.
[0020] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to perform the method described in the first aspect of the above embodiments.
[0021] According to a fifth aspect of this disclosure, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various alternative implementations described above.
[0022] The technical solutions provided in this disclosure may have the following beneficial effects:
[0023] The root skeleton keyframe data generation method, apparatus, device, and medium provided in this disclosure can, on the one hand, simplify the first motion data of the pelvic bone of the virtual model according to the motion trend parameters of the virtual model to obtain the second motion data of the root skeleton, thereby realizing the automated generation of the second motion data of the root skeleton, reducing the consumption of human resources, and improving the accuracy of the determined second motion data of the root skeleton; on the other hand, the second motion data in the bone keyframes where the motion trend does not change significantly can be deleted, thereby reducing the waste of data storage space and reducing the performance pressure of animation rendering without affecting the animation rendering effect.
[0024] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0025] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0026] Figure 1 This illustration schematically shows a root skeleton keyframe data generation system to which embodiments of the present disclosure may be applied;
[0027] Figure 2 A flowchart illustrating a method for generating root skeleton keyframe data according to an embodiment of the present disclosure is shown schematically.
[0028] Figure 3This schematically illustrates the position of the pelvic bones and radicular bones when the virtual model is not in motion, according to one embodiment of the present disclosure.
[0029] Figure 4 This schematically illustrates a flowchart showing the position of the pelvic bones and radicular bones during movement of a virtual model according to one embodiment of the present disclosure.
[0030] Figure 5 This illustration schematically shows a change in the displacement difference vector between skeletal keyframes according to one embodiment of the present disclosure;
[0031] Figure 6 A schematic diagram illustrating the velocity difference vector between skeletal keyframes according to one embodiment of the present disclosure is shown.
[0032] Figure 7 The illustration schematically shows the sum of a plurality of adjacent velocity difference vectors according to one embodiment of the present disclosure;
[0033] Figure 8 This illustration schematically shows a simplified diagram of the root bone position change according to one embodiment of the present disclosure;
[0034] Figure 9 This schematic diagram illustrates a structural block diagram of an apparatus for generating root skeleton keyframe data according to one embodiment of the present disclosure.
[0035] Figure 10 The schematic diagram illustrates a structural schematic of a computer system suitable for implementing an electronic device according to embodiments of the present disclosure. Detailed Implementation
[0036] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure may be practiced with one or more of these specific details omitted, or other methods, components, apparatuses, steps, etc., may be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.
[0037] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0038] In related technologies, for animation files, the motion data of the pelvic bone can be manually copied and pasted into the root bone, and the motion data of the root bone can be obtained by deleting the motion data of the pelvic bone that does not need axial motion data.
[0039] However, this method of manually determining the motion data of the root skeleton usually requires a lot of time and manpower and is prone to errors. At the same time, since the motion data of the root skeleton is mainly used to calibrate the position and orientation of the virtual model, directly using the motion data of the root skeleton determined based on the motion data of the pelvic skeleton to display the animation not only wastes storage space, but also leads to the consumption of computing resources during the animation display process.
[0040] In view of the above problems, the exemplary embodiments of this disclosure provide a method for generating root skeleton keyframe data for animation processing. Application scenarios of this root skeleton keyframe data generation method include, but are not limited to: in the generation of motion data for the root skeleton of a virtual model, obtaining an initial animation file, the animation file including multiple frames of skeleton keyframes corresponding to the virtual model, the skeleton keyframes including at least first motion data corresponding to the pelvic bone; based on the first motion data, determining motion trend parameters of the virtual model during the motion process; based on the motion trend parameters, simplifying the first motion data to obtain second motion data of the root skeleton corresponding to the pelvic bone; according to the second motion data of the root skeleton in each skeleton keyframe, performing frame-by-frame motion data vector operations on the multiple skeleton keyframes to obtain a velocity difference vector characterizing the motion changes of the root skeleton in the multiple skeleton keyframes; when the sum of the velocity difference vectors corresponding to the multiple adjacent skeleton keyframes is greater than a preset threshold, deleting the second motion data in the intermediate skeleton keyframes of the multiple adjacent skeleton keyframes to obtain simplified keyframe data required for generating the root skeleton animation corresponding to the initial animation file, the number of frames in the multiple adjacent skeleton keyframes including at least three frames. Based on the first motion data of the pelvic bones, the second motion data of the root bones can be automatically determined, improving the efficiency and accuracy of determining the second motion data of the root bones and reducing manpower consumption. Furthermore, redundant data in the second motion data of the root bones can be deleted, reducing the waste of data storage space without affecting the animation rendering effect.
[0041] To implement the above-described method for generating root skeleton keyframe data, an exemplary embodiment of this disclosure provides a system for generating root skeleton keyframe data. Figure 1 A schematic architecture diagram of the system for generating root skeleton keyframe data is shown. Figure 1 As shown, the root skeleton keyframe data generation system may include a terminal device 110 and a server 120. The terminal device 110 can be various electronic devices with display capabilities, including but not limited to desktop computers, laptops, smartphones, and tablets. The terminal device can install 3D animation software, game programs, or other programs capable of animation rendering. The server 120 may be a server deployed by the game developer.
[0042] In an optional implementation, the initial animation file may be stored in the terminal device 110, which may execute the root skeleton keyframe data generation scheme provided in this embodiment of the present disclosure.
[0043] In another alternative implementation, the initial animation file can be stored in the server 120. When the game developer needs to process the initial animation file, the terminal device 110 can generate an initial animation file retrieval instruction based on the initial animation file loading operation associated with the initial animation file identifier, and send the initial animation file retrieval instruction to the server 120. The server 120 can retrieve the initial animation file based on the initial animation file identifier in the initial animation file retrieval instruction, and send the initial animation file to the terminal device 110, so that the terminal device 110 executes the root skeleton keyframe data generation scheme provided in this embodiment.
[0044] This example implementation provides a method for generating root skeleton keyframe data, which can be applied to terminal devices, such as... Figure 2 As shown, the method for generating root skeleton keyframe data includes:
[0045] Step S201: Obtain the initial animation file;
[0046] The animation file includes multiple skeleton keyframes corresponding to the virtual model, and the skeleton keyframes include at least the first motion data corresponding to the pelvic bone.
[0047] Step S202: Based on the first motion data, determine the motion trend parameters of the virtual model during the motion process;
[0048] Step S203: Based on the motion trend parameters, the first motion data is simplified to obtain the second motion data of the root bones corresponding to the pelvic bones;
[0049] Step S204: Based on the second motion data of the root bone in each bone keyframe, perform frame-by-frame motion data vector operation on multiple bone keyframes to obtain a velocity difference vector that characterizes the motion change of the root bone in multiple bone keyframes.
[0050] Step S205: When the sum of the velocity difference vectors corresponding to the bone keyframes adjacent to multiple frames is greater than a preset threshold, delete the second motion data in the middle bone keyframe of the bone keyframes of the multiple adjacent frames to obtain the simplified keyframe data required to generate the root bone animation corresponding to the initial animation file.
[0051] Among them, the number of frames in a multi-frame skeletal keyframe includes at least three frames.
[0052] In summary, the root skeleton keyframe data generation method provided in this embodiment can, on the one hand, simplify the first motion data of the pelvic bone of the virtual model according to the motion trend parameters of the virtual model to obtain the second motion data of the root skeleton, thereby realizing the automated generation of the second motion data of the root skeleton, reducing the consumption of human resources, and improving the accuracy of the determined second motion data of the root skeleton; on the other hand, it can delete the second motion data in the bone keyframes where the motion trend does not change significantly, thereby reducing the waste of data storage space and reducing the performance pressure of animation rendering without affecting the animation rendering effect.
[0053] The following explains the concepts involved in this disclosure:
[0054] A static model is a 3D model composed of surfaces formed by connecting points in space. It has no skeleton rigging and is stationary. Once a skeleton is rigged into a static model, the movement of the skeleton will cause the model to move.
[0055] Pelvic skeleton: The skeletal system of a 3D model is a tree structure. The parent node of the skull is the cervical skeleton, and the parent node of the cervical skeleton is the spinal skeleton. A complete human skeleton generally starts from the pelvic skeleton. The position and orientation of the pelvis can be approximately equal to the position and orientation of the human body.
[0056] Root Bone: The root bone is the root node of a tree-like bone system, and its parent node is the pelvic bone. The root bone is not bound to a model and can be used to identify the position and orientation of virtual objects such as virtual models. It can also be used to attach objects such as colliders. In 3D games, when the shape of a virtual object is complex, it is difficult to simulate physical calculations. Therefore, a collider, which is a simple geometric shape approximating the object's shape, is attached to the root bone to simulate the object's physical surface.
[0057] For example, such as Figure 3As shown in the image, the virtual 3D model is displayed in each frame when it performs a set of in-place release actions. The pelvic bone is located at the pelvic position of the 3D model, the root bone is located at the bottom of the 3D model, and the box represents the collider attached to the root bone. Figure 3 As shown, the pelvic bone moves in every frame and is in a different position, while the root bone does not have animation so its position remains unchanged, and the collider also does not change.
[0058] If the virtual model is not stationary or is performing a displacement action, the root skeleton needs to move together with the 3D model or pelvic skeleton; otherwise, the position of the collider will not change, leading to problems such as the inability to perform further interactions.
[0059] For example, such as Figure 4 As shown. Figure 4 The upper part is a virtual model performing a running motion. Since the root bones do not move together with the pelvic bones, the actual position of the colliding body does not change. Figure 3 The lower part also uses a virtual model to perform running movements. The root bones and pelvic bones move together, and the actual position of the collision body follows the virtual model.
[0060] The steps described above in this example implementation will now be explained in more detail.
[0061] In step S201, the terminal device can obtain the initial animation file.
[0062] In this embodiment of the disclosure, the initial animation file may be an animation information file of a virtual model. The animation file includes multiple frames of skeletal keyframes corresponding to the virtual model. The skeletal keyframes include at least the first motion data corresponding to the pelvic bones. The first motion data corresponding to the pelvic bones includes at least the position data of the pelvic bones. The first motion data corresponding to the pelvic bones may also include the orientation data of the pelvic bones.
[0063] In one alternative implementation, the process of the terminal device acquiring the initial animation file may include: when the terminal device is running 3D animation processing software, in response to the selection operation of the initial animation file, acquiring the initial animation file, wherein the initial animation file can be any animation file stored in the terminal device.
[0064] In one optional implementation, the process of the terminal device obtaining the initial animation file may include: when the terminal device is running 3D animation processing software, the terminal device obtains an initial animation file loading operation associated with the initial animation file identifier, generates an initial animation file acquisition instruction based on the initial animation file identifier, and sends the initial animation file acquisition instruction to the server. The server can obtain the initial animation file based on the initial animation file identifier in the initial animation file acquisition instruction and return the initial animation file to the terminal device.
[0065] In step S202, the terminal device can determine the motion trend parameters of the virtual model during the motion process based on the first motion data.
[0066] In this embodiment of the disclosure, motion trend parameters are used to characterize the motion trend of the virtual model. The motion trend includes at least one of position trend and orientation trend. For example, the position trend may include: in the three-dimensional virtual scene, the virtual model moves along the y-axis; the motion trend parameters may include the position axis parameters (xp, yp, zp) of the three-dimensional virtual model and the rotation axis parameter zr, wherein xp is the axis parameter of the x-axis in the three-dimensional virtual scene, yp is the axis parameter of the y-axis in the three-dimensional virtual scene, and zp is the axis parameter of the z-axis in the three-dimensional virtual scene.
[0067] It should be noted that in the embodiments of this disclosure, the position axis parameter can be 0 or 1. A position axis parameter of 0 indicates that the virtual model has not moved along the position axis, and a position axis parameter of 1 indicates that the virtual model has moved along the position axis. For example, if the axial parameter xp of the x-axis is 1, it indicates that the virtual model has moved along the x-axis.
[0068] In one optional implementation, the process by which the terminal device determines the motion trend parameters of the virtual model during motion based on the first motion data may include: obtaining pre-generated motion trend parameters associated with the initial animation file, wherein the motion trend parameters of the virtual model associated with the initial animation file during motion are determined based on the first motion data associated with the initial animation file.
[0069] The process by which the terminal device determines the motion trend parameters of the virtual model during motion based on the first motion data associated with the initial animation file may include: when the terminal device runs 3D animation processing software, in response to the rendering operation associated with the initial animation file, rendering and displaying the animation screen corresponding to the initial animation file according to the first motion data corresponding to the pelvic bone in each frame of the skeletal keyframe; and in response to obtaining the motion trend parameters input by the user, obtaining the motion trend parameters of the virtual model associated with the initial animation file during motion.
[0070] In step S203, the terminal device can simplify the first motion data based on motion trend parameters to obtain the second motion data of the root bones corresponding to the pelvic bones.
[0071] In one optional implementation, the first motion data includes pelvic bone position data. The terminal device simplifies the first motion data based on motion trend parameters to obtain second motion data for the root bones corresponding to the pelvic bones. This includes: acquiring position axis parameters from the motion trend parameters; determining root bone position data based on the pelvic bone position data and the position axis parameters; and identifying the root bone position data as the second motion data for the root bones corresponding to the pelvic bones. This allows for rapid and accurate determination of root bone position data based on the position axis parameters used to characterize the positional changes of the virtual model, and the pelvic bone position data of the pelvic bones (which are child nodes of the root bones), simplifying the difficulty of determining the motion data of the root bones.
[0072] The process of determining the root bone position data based on the pelvic bone position data and its axial parameters may include: determining the root bone position data p2 based on the pelvic bone position data, its axial parameters, and the first formula (Formula 1).
[0073] p2 = (p1.x·xp, p1.y·yp, p1.z·zp); Formula 1
[0074] Wherein, p1.x represents the position data of the pelvic bones on the x-axis, p1.y represents the position data of the pelvic bones on the y-axis, and p1.z represents the position data of the pelvic bones on the z-axis. It should be noted that if xp is 0, it means that the position of the virtual model has not moved on the x-axis, and p1.x·xp means that the position data of the pelvic bones on the x-axis is not retained when determining the position data of the root bones; or if xp is 1, it means that the position of the virtual model has moved on the x-axis, and p1.x·xp means that the position data of the pelvic bones on the x-axis is retained when determining the position data of the root bones. p1.y·yp and p1.z·zp are similar to p1.x·xp, and will not be described again in this embodiment.
[0075] In one optional implementation, the first motion data includes pelvic bone orientation data. The process by which the terminal device simplifies the first motion data based on motion trend parameters to obtain the second motion data of the root bones corresponding to the pelvic bones may include: acquiring the rotation axis parameter in the motion trend parameters; determining the root bone orientation data based on the pelvic bone orientation data and the rotation axis parameter; and determining the root bone orientation data as the second motion data of the root bones corresponding to the pelvic bones. The root bone orientation data can be quickly and accurately determined based on the rotation axis parameter used to characterize the orientation changes of the virtual model, and the pelvic bone orientation data of the pelvic bones, which are child nodes of the root bones, simplifying the difficulty of determining the motion data of the root bones.
[0076] The process by which the terminal device determines the root bone orientation data based on the pelvic bone orientation data and rotation axis parameters may include: determining the root bone orientation data r2 based on the pelvic bone orientation data, position axis parameters, and the second formula (Formula 2).
[0077]
[0078] Where, r1. This represents the position vector of the pelvic bones on the z-axis in the pelvic bone orientation data.
[0079] It is understandable that the second motion data of the root bones corresponding to the pelvic bones includes at least the root bone position data, and the second motion data of the root bones corresponding to the pelvic bones may also include orientation data.
[0080] In step S204, the terminal device can perform frame-by-frame motion data vector operations on multiple bone keyframes based on the second motion data of the root bone in each bone keyframe to obtain a velocity difference vector that characterizes the motion changes of the root bone in multiple bone keyframes.
[0081] In one optional implementation, the process by which the terminal device performs frame-by-frame motion data vector operations on multiple skeletal keyframes based on the second motion data of the root bone in each skeletal keyframe to obtain a velocity difference vector characterizing the motion changes of the root bone in multiple skeletal keyframes may include:
[0082] Starting from the second skeletal keyframe in a multi-frame skeletal keyframe sequence, the root bone position data in the current skeletal keyframe is determined sequentially, along with the first difference between the root bone position data in the previous skeletal keyframe, resulting in a displacement difference vector associated with each skeletal keyframe. Similarly, starting from the second skeletal keyframe in a multi-frame skeletal keyframe sequence, the displacement difference vector associated with the current skeletal keyframe is determined sequentially, along with the second difference between the displacement difference vector associated with the previous skeletal keyframe, resulting in a velocity difference vector associated with each skeletal keyframe. The displacement difference vector characterizes the degree of positional change between adjacent frames, and the velocity difference vector characterizes the degree of velocity change between adjacent frames. By using the root bone position data in adjacent skeletal keyframes, the velocity changes of the virtual model can be determined, improving the accuracy of the determined velocity changes.
[0083] For example, such as Figure 5 As shown, Figure 5The circles in the diagram represent the positions of the root bones. From left to right, the diagram shows the gradual movement of the root bone position across multiple frames of the initial animation file's skeletal keyframes, moving from the position of the first circle to the position of the second circle, corresponding to one frame. Starting from the second skeletal keyframe, the first difference between the root bone position data 502 in the second skeletal keyframe and the root bone position data 501 in the first skeletal keyframe is determined, yielding the displacement difference vector V1 associated with the second skeletal keyframe. Next, the first difference between the root bone position data 503 in the third skeletal keyframe and the root bone position data 502 in the second skeletal keyframe is determined, yielding the displacement difference vector V2 associated with the third skeletal keyframe. This process continues, obtaining the displacement difference vector associated with each skeletal keyframe based on the root bone position data from all skeletal keyframes. It's important to understand that the displacement difference vector associated with each skeletal keyframe does not include the displacement difference vector associated with the first skeletal keyframe.
[0084] Furthermore, such as Figure 6 As shown, starting from the second skeletal keyframe, the displacement difference vector V1 associated with the second skeletal keyframe and the second difference value of the displacement difference vector V1 associated with the first skeletal keyframe are determined, thus obtaining the velocity difference vector associated with the second skeletal keyframe. Next, the displacement difference vector V2 associated with the third skeletal keyframe and the second difference value of the displacement difference vector V1 associated with the second skeletal keyframe are determined, thus obtaining the velocity difference vector 601 associated with the third skeletal keyframe. Next, the displacement difference vector V3 associated with the fourth skeletal keyframe and the second difference value of the displacement difference vector V2 associated with the third skeletal keyframe are determined, thus obtaining the velocity difference vector 602 associated with the fourth skeletal keyframe.
[0085] In one optional implementation, the process by which the terminal device performs frame-by-frame motion data vector operations on multiple skeletal keyframes based on the second motion data of the root bone in each skeletal keyframe to obtain a velocity difference vector characterizing the motion changes of the root bone in multiple skeletal keyframes may include:
[0086] Starting from the third skeletal keyframe in a multi-frame skeletal keyframe sequence, the root bone position data in the current keyframe is determined after a one-frame interval. The first difference between this root bone position data and the root bone position data in the previous keyframe is used to obtain a displacement difference vector associated with the odd-numbered skeletal keyframes. Similarly, starting from the third skeletal keyframe in a multi-frame skeletal keyframe sequence, the displacement difference vector associated with the current keyframe is determined after a one-frame interval. The second difference between this displacement difference vector and the displacement difference vector associated with the previous keyframe is used to obtain a velocity difference vector associated with the odd-numbered skeletal keyframes. By using the root bone position data in the intervald keyframes, the velocity changes of the virtual model can be determined, improving the efficiency of determining the velocity changes of the virtual model.
[0087] It is understandable that the process by which the terminal device determines the root bone position data in the current bone keyframe and the first difference between the root bone position data in the previous bone keyframe, starting from the third bone keyframe in a multi-frame skeletal keyframe, with an interval of one frame, and obtains the displacement difference vector associated with the odd-numbered bone keyframes, can be referred to in the above embodiment. The process by which the terminal device determines the root bone position data in the current bone keyframe and the first difference between the root bone position data in the previous bone keyframe, starting from the second bone keyframe in a multi-frame skeletal keyframe, and obtains the displacement difference vector associated with each bone keyframe, is not described in detail in this embodiment.
[0088] Similarly, the process by which the terminal device, starting from the third skeletal keyframe in a multi-frame skeletal keyframe sequence, determines the displacement difference vector associated with the current skeletal keyframe and the second difference value of the displacement difference vector associated with the previous skeletal keyframe at intervals of one frame, to obtain the velocity difference vector associated with the odd-numbered skeletal keyframes, can be referred to in the above embodiment. This embodiment describes the process by which the terminal device, starting from the second skeletal keyframe in a multi-frame skeletal keyframe sequence, sequentially determines the displacement difference vector associated with the current skeletal keyframe and the second difference value of the displacement difference vector associated with the previous skeletal keyframe, to obtain the velocity difference vector associated with each skeletal keyframe. This disclosure will not elaborate further on this process.
[0089] In step S205, when the sum of the velocity difference vectors corresponding to the bone keyframes adjacent to multiple frames is greater than a preset threshold, the second motion data in the intermediate bone keyframe of the bone keyframes adjacent to multiple frames is deleted to obtain the simplified keyframe data required to generate the root bone animation corresponding to the initial animation file.
[0090] In this embodiment of the disclosure, when the sum of the velocity difference vectors corresponding to the multiple adjacent skeletal keyframes is greater than a preset threshold, it can be determined that the motion trend of the virtual model in the intermediate skeletal keyframes of the multiple adjacent skeletal keyframes has not changed significantly. The second motion data in the intermediate skeletal keyframes of the multiple adjacent skeletal keyframes can be deleted without affecting the visual effect of the virtual model. The number of frames in the multiple adjacent skeletal keyframes includes at least three frames.
[0091] In one optional implementation, when the sum of the velocity difference vectors corresponding to multiple adjacent skeletal keyframes exceeds a preset threshold, the terminal device may delete the second motion data in the intermediate skeletal keyframes of the multiple adjacent skeletal keyframes. This deletion may include: determining the sum of the velocity difference vectors associated with any skeletal keyframe to the target skeletal keyframe, thus obtaining a cumulative velocity difference vector; if the cumulative velocity difference vector exceeds the preset threshold, then deleting the second motion data in the skeletal keyframe between any skeletal keyframe and the target skeletal keyframe. The target skeletal keyframe is located after any skeletal keyframe and is at least one frame apart from any skeletal keyframe. Redundant data in the multiple skeletal keyframes can be deleted starting from any skeletal keyframe, satisfying the user's diverse and simplified requirements for the second motion data of the root bone.
[0092] It should be noted that the preset threshold can be determined based on actual needs, and this disclosure does not limit it. For example, different preset thresholds can be configured for different animation files based on reference factors such as animation accuracy and rendering performance.
[0093] In one optional implementation, when the sum of the velocity difference vectors corresponding to multiple adjacent skeletal keyframes is greater than a preset threshold, the terminal device may delete the second motion data in the intermediate skeletal keyframe of the multiple adjacent frame skeletal keyframes, which may include:
[0094] The sum of the velocity difference vectors associated with the first to the target bone keyframes in a multi-frame skeletal keyframe structure is determined to obtain the cumulative velocity difference vector. If the cumulative velocity difference vector is greater than a preset threshold, the second motion data in the skeletal keyframes between the first and target bone keyframes is deleted. The target bone keyframe is located after the first bone keyframe and at least one frame apart from it; for example, the target bone keyframe could be the third bone keyframe. Redundant second motion data in the multi-frame skeletal keyframe structure can be deleted starting from the first bone keyframe, reducing the amount of simplified keyframe data required to generate the root bone animation corresponding to the initial animation file, and reducing data storage space usage.
[0095] In one optional implementation, if the first cumulative velocity difference vector is less than or equal to a preset threshold, then the next bone keyframe following the target bone keyframe in the multi-frame skeletal keyframes is determined as the updated target bone keyframe; the sum of the velocity difference vectors associated with the first bone keyframe to the updated target bone keyframe is determined to obtain the first updated cumulative velocity difference vector; if the first updated cumulative velocity difference vector is greater than the preset threshold, then the bone keyframes between the first bone keyframe and the updated target bone keyframe are deleted. Starting from the first bone keyframe in the multi-frame skeletal keyframes, when it is determined that there are no redundant second motion data bone shutdown keyframes in the first bone keyframe to the target bone keyframe, the target keyframe is updated until each bone keyframe in the multi-frame skeletal keyframes is traversed, further reducing the amount of simplified keyframe data required to generate the root bone animation corresponding to the initial animation file.
[0096] For example, such as Figure 7 As shown. Figure 7 This includes a displacement difference vector connecting circles, a velocity difference vector, and a sum of velocity difference vectors corresponding to multiple adjacent skeletal keyframes. The displacement difference vector is... Figure 7 The first arrow indicates the velocity difference vector. Figure 7 The second arrow indicates that the sum of the velocity difference vectors is in... Figure 7 The third arrow indicates the middle; in Figure 7 In the middle, the sum of the velocity difference vectors corresponding to multiple adjacent skeletal keyframes includes vectors 701 and 702.
[0097] Then, after taking the second motion data from the intermediate bone keyframe of multiple adjacent frame skeletal keyframes, the second motion data of the root bone is simplified. For example, continuing to refer to... Figure 7 From left to right, these can be the first, second, third, and fourth skeletal keyframes. If the sum of the cumulative velocity difference vectors from the first to the fourth skeletal keyframe exceeds a preset threshold, it indicates a significant change in the virtual model's motion trend at the fourth skeletal keyframe. Conversely, if the sum of the cumulative velocity difference vectors from the first to the fourth skeletal keyframe exceeds a preset threshold, it means the virtual model's motion trend did not change significantly in the second and third skeletal keyframes between the first and fourth skeletal keyframes. In this case, the second motion data in the second and third keyframes can be deleted without affecting the visual effect of the animation.
[0098] In one optional implementation, after deleting the second motion data in the skeletal keyframes between the first skeletal keyframe and the target skeletal keyframe, the terminal device may further: determine the next skeletal keyframe after the target skeletal keyframe from the multiple skeletal keyframes as the updated first skeletal keyframe; determine the skeletal keyframe after the updated first skeletal keyframe and at least one frame apart from the updated first skeletal keyframe from the multiple skeletal keyframes as the updated target skeletal keyframe; determine the sum of the velocity difference vectors associated with the updated first skeletal keyframe to the updated target skeletal keyframe to obtain a second updated cumulative velocity difference vector; if the second updated cumulative velocity difference vector is greater than a preset threshold, then delete the second motion data in the skeletal keyframes between the updated first skeletal keyframe and the updated target skeletal keyframe. Starting from the first bone keyframe in a multi-frame skeletal keyframe, after determining the bone keyframes containing redundant second motion data from the first bone keyframe to the target bone keyframe, and deleting the redundant second motion data, continue to determine new first bone keyframes and new target bone keyframes, until every bone keyframe in the multi-frame skeletal keyframe is traversed, deleting all redundant data in the multi-frame skeletal keyframes, further reducing the amount of simplified keyframe data required to generate the root bone animation corresponding to the initial animation file.
[0099] like Figure 8 As shown, Figure 8 Yes Figure 7 The diagram shows the positional changes of the root skeleton, with two simplified versions of the original diagram. Figure 7 This includes nine skeletal keyframes, two of which indicate significant changes in the root bone animation. Therefore... Figure 8 In the middle, delete the second and third keyframes from left to right out of the nine keyframes, and delete the fifth and sixth keyframes to obtain the root bone position change diagram after two simplifications.
[0100] It should be noted that, in this embodiment of the disclosure, after obtaining the simplified keyframe data required to generate the root bone animation corresponding to the initial animation file, during the rendering process of the initial animation file, when rendering to the first bone keyframe that retains the second motion data of the root bone, the motion state of the virtual model can be rendered according to the second motion data of the root bone. When rendering to the second bone keyframe that does not retain the second motion data of the root bone, the second motion data of the root bone in the second bone keyframe can be automatically supplemented by the previous bone keyframe that retains the second motion data of the root bone and the next bone keyframe that retains the second motion data of the root bone, so as to render the motion state of the virtual model.
[0101] In this example embodiment, a root skeleton keyframe data generation apparatus 900 is also provided. (See reference...) Figure 9 As shown, the root skeleton keyframe data generation device 900 may include:
[0102] The acquisition module 901 is configured to acquire an initial animation file, which includes multiple frames of skeletal keyframes corresponding to the virtual model, and the skeletal keyframes include at least the first motion data corresponding to the pelvic bone.
[0103] The determination module 902 is configured to determine the motion trend parameters of the virtual model during the motion process based on the first motion data.
[0104] The processing module 903 is configured to simplify the first motion data based on motion trend parameters to obtain the second motion data of the root bones corresponding to the pelvic bones.
[0105] The calculation module 904 is configured to perform frame-by-frame motion data vector calculation on multiple bone keyframes based on the second motion data of the root bone in each bone keyframe, so as to obtain a velocity difference vector that characterizes the motion change of the root bone in multiple bone keyframes.
[0106] The deletion module 905 is configured to delete the second motion data in the middle bone keyframe of the multiple adjacent frame bone keyframes when the sum of the velocity difference vectors corresponding to the multiple adjacent frame bone keyframes is greater than a preset threshold, so as to obtain the simplified keyframe data required to generate the root bone animation corresponding to the initial animation file. The number of frames of the multiple adjacent frame bone keyframes includes at least three frames.
[0107] Optionally, the first motion data includes pelvic bone position data, and the processing module 903 is configured as follows:
[0108] Obtain the position axis parameter from the motion trend parameters;
[0109] Based on the pelvic bone position data and position axis parameters, the root bone position data is determined, and the root bone position data is used as the second motion data of the root bone corresponding to the pelvic bone.
[0110] Optionally, the first motion data includes pelvic bone orientation data, and the processing module 903 is configured as follows:
[0111] Obtain the rotation axis parameter from the motion trend parameters;
[0112] Based on the pelvic bone orientation data and rotation axis parameters, the root bone orientation data is determined, and the root bone orientation data is used as the second motion data of the root bone corresponding to the pelvic bone.
[0113] Optionally, the arithmetic module 904 is configured as follows:
[0114] Starting from the second bone keyframe in a multi-frame skeletal keyframe, the root bone position data in the current bone keyframe and the first difference between the root bone position data in the previous bone keyframe are determined sequentially to obtain the displacement difference vector associated with each bone keyframe.
[0115] Starting from the second skeletal keyframe in a multi-frame skeletal keyframe, the displacement difference vector associated with the current skeletal keyframe and the second difference value of the displacement difference vector associated with the previous skeletal keyframe are determined sequentially to obtain the velocity difference vector associated with each skeletal keyframe.
[0116] Optionally, module 905 is deleted and configured as follows:
[0117] Determine the sum of the velocity difference vectors associated with the first bone keyframe to the target bone keyframe in the multi-frame skeletal keyframes to obtain the cumulative velocity difference vector. The target bone keyframe is located after the first bone keyframe and is at least one frame apart from the first bone keyframe.
[0118] If the cumulative velocity difference vector is greater than a preset threshold, then delete the second motion data in the skeletal keyframe between the first frame skeletal keyframe and the target skeletal keyframe.
[0119] Optional, such as Figure 9 As shown, the root skeleton keyframe data generation device 900 further includes a first update module 906, configured to:
[0120] If the first cumulative velocity difference vector is less than or equal to a preset threshold, then the next frame of bone keyframes after the target frame of bone keyframes in the multi-frame bone keyframes will be determined as the updated target bone keyframe.
[0121] The sum of the velocity difference vectors associated with the first frame of the skeleton keyframe and the updated target skeleton keyframe is determined to obtain the first updated cumulative velocity difference vector.
[0122] If the cumulative velocity difference vector of the first update is greater than a preset threshold, then delete the bone keyframes between the first frame bone keyframe and the updated target bone keyframe.
[0123] Optional, such as Figure 9 As shown, the root skeleton keyframe data generation device further includes a second update module 907, configured to:
[0124] In a multi-frame skeleton keyframe, the next skeleton keyframe after the target skeleton keyframe is determined as the updated first skeleton keyframe.
[0125] Among multiple skeletal keyframes, the skeletal keyframe that is after the updated first skeletal keyframe and is at least one frame apart from the updated first skeletal keyframe is determined as the updated target skeletal keyframe.
[0126] The sum of the velocity difference vectors associated with the updated first frame skeletal keyframe to the updated target skeletal keyframe is determined to obtain the second updated cumulative velocity difference vector.
[0127] If the second updated cumulative velocity difference vector is greater than a preset threshold, then the second motion data in the bone keyframe between the updated first frame bone keyframe and the updated target bone keyframe is deleted.
[0128] Figure 10 A schematic diagram of the structure of a computer system suitable for implementing an electronic device according to embodiments of the present disclosure is shown. The electronic device may be a terminal device.
[0129] It should be noted that, Figure 10 The computer system of the electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.
[0130] like Figure 10 As shown, a computer system includes a central processing unit (CPU), which performs various appropriate actions and processes based on programs stored in read-only memory (ROM) or loaded from memory into random access memory (RAM). RAM also stores various programs and data required for system operation. The CPU, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.
[0131] The following components are connected to the (I / O) interface: input sections including keyboards, mice, etc.; output sections including cathode ray tubes (CRTs), liquid crystal displays (LCDs), and speakers; storage sections including hard disks, etc.; and communication sections including network interface cards such as LAN cards and modems. The communication sections perform communication processing via networks such as the Internet. Drives are also connected to the (I / O) interface as needed. Removable media, such as disks, optical disks, magneto-optical disks, semiconductor memories, etc., are installed on the drive as needed so that computer programs read from them can be installed into the storage section as required.
[0132] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0133] Since the functional modules of the root skeleton animation simplification device in the example embodiments of this disclosure correspond to the steps of the example embodiments of the root skeleton animation generation method described above, for details and effects not disclosed in the device embodiments of this disclosure, please refer to the embodiments of the root skeleton animation generation method described above.
[0134] These modules can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more Digital Signal Processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs). Alternatively, when a module is implemented using processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these modules can be integrated together as a System-on-a-Chip (SOC).
[0135] In the embodiments provided in this disclosure, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0136] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0137] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of the present invention.
[0138] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for generating root skeleton keyframe data, characterized in that, The method includes: Obtain an initial animation file, the animation file including multiple frames of skeletal keyframes corresponding to the virtual model, the skeletal keyframes including at least the first motion data corresponding to the pelvic bone; Based on the first motion data, determine the motion trend parameters of the virtual model during the motion process; Based on the motion trend parameters, the first motion data is simplified to obtain the second motion data of the root bones corresponding to the pelvic bones. Based on the second motion data of the root bone in each bone keyframe, frame-by-frame motion data vector operations are performed on the multi-frame bone keyframes to obtain a velocity difference vector that characterizes the motion changes of the root bone in the multi-frame bone keyframes. The sum of the velocity difference vectors associated with the first bone keyframe to the target bone keyframe in the multiple adjacent bone keyframes is determined to obtain the cumulative velocity difference vector. The target bone keyframe is located after the first bone keyframe and is separated from the first bone keyframe by at least one frame. If the cumulative velocity difference vector is greater than a preset threshold, the second motion data in the bone keyframe between the first frame bone keyframe and the target bone keyframe is deleted to obtain the simplified keyframe data required to generate the root bone animation corresponding to the initial animation file. The number of frames of the multiple adjacent bone keyframes includes at least three frames.
2. The method according to claim 1, characterized in that, The first motion data includes pelvic bone position data. The step of simplifying the first motion data based on the motion trend parameters to obtain second motion data of the root bones corresponding to the pelvic bones includes: Obtain the position axial parameter from the motion trend parameters; Based on the pelvic bone position data and the position axial parameters, the root bone position data is determined, and the root bone position data is determined as the second motion data of the root bone corresponding to the pelvic bone.
3. The method according to claim 1, characterized in that, The first motion data includes pelvic bone orientation data. The step of simplifying the first motion data based on the motion trend parameters to obtain second motion data for the root bones corresponding to the pelvic bones includes: Obtain the rotation axis parameter from the motion trend parameters; Based on the pelvic bone orientation data and the rotation axis parameter, the root bone orientation data is determined, and the root bone orientation data is determined as the second motion data of the root bone corresponding to the pelvic bone.
4. The method according to claim 1, characterized in that, The second motion data includes root bone position data. The step of performing frame-by-frame motion data vector operations on the multi-frame bone keyframes based on the second motion data of the root bone in each bone keyframe to obtain a velocity difference vector characterizing the motion changes of the root bone in the multi-frame bone keyframes includes: Starting from the second bone keyframe in the multi-frame bone keyframes, the root bone position data in the current bone keyframe and the first difference of the root bone position data in the previous bone keyframe are determined sequentially to obtain the displacement difference vector associated with each bone keyframe. Starting from the second skeletal keyframe in the multi-frame skeletal keyframes, the displacement difference vector associated with the current skeletal keyframe and the second difference value of the displacement difference vector associated with the previous skeletal keyframe are determined sequentially to obtain the velocity difference vector associated with each skeletal keyframe.
5. The method according to claim 1, characterized in that, The method further includes: If the cumulative velocity difference vector is less than or equal to the preset threshold, then the next frame of the skeleton keyframes that is after the target skeleton keyframe in the multi-frame skeleton keyframes is determined as the updated target skeleton keyframe. The sum of the velocity difference vectors associated with the first frame skeletal keyframe to the updated target skeletal keyframe is determined to obtain the first updated cumulative velocity difference vector. If the first updated cumulative velocity difference vector is greater than the preset threshold, then delete the bone keyframe between the first frame bone keyframe and the updated target bone keyframe.
6. The method according to claim 1, characterized in that, After deleting the second motion data in the skeletal keyframes between the first frame and the target frame, the method further includes: The next frame of skeletal keyframe after the target skeletal keyframe in the multi-frame skeletal keyframes is determined as the updated first frame of skeletal keyframe. Among the multiple skeletal keyframes, the skeletal keyframe that is after the updated first skeletal keyframe and is separated from the updated first skeletal keyframe by at least one frame is determined as the updated target skeletal keyframe. The sum of the velocity difference vectors associated with the updated first frame skeletal keyframe to the updated target skeletal keyframe is determined to obtain the second updated cumulative velocity difference vector. If the second updated cumulative velocity difference vector is greater than the preset threshold, then the second motion data in the skeletal keyframe between the updated first frame skeletal keyframe and the updated target skeletal keyframe is deleted.
7. A device for generating root skeleton keyframe data, characterized in that, The device includes: The acquisition module is configured to acquire an initial animation file, the animation file including multiple frames of skeletal keyframes corresponding to the virtual model, the skeletal keyframes including at least the first motion data corresponding to the pelvic bone; The determination module is configured to determine the motion trend parameters of the virtual model during the motion process based on the first motion data; The processing module is configured to simplify the first motion data based on the motion trend parameters to obtain the second motion data of the root bones corresponding to the pelvic bones. The calculation module is configured to perform frame-by-frame motion data vector calculation on the multi-frame skeletal keyframes based on the second motion data of the root bone in each skeletal keyframe, so as to obtain a velocity difference vector that characterizes the motion change of the root bone in the multi-frame skeletal keyframes. The deletion module is configured to determine the sum of the velocity difference vectors associated with the first bone keyframe to the target bone keyframe in a multi-frame set of adjacent bone keyframes, thereby obtaining a cumulative velocity difference vector. The target bone keyframe is located after the first bone keyframe and is separated from the first bone keyframe by at least one frame. If the cumulative velocity difference vector is greater than a preset threshold, the second motion data in the bone keyframes between the first bone keyframe and the target bone keyframe is deleted to obtain simplified keyframe data required to generate the root bone animation corresponding to the initial animation file. The number of frames in the multi-frame set of adjacent bone keyframes includes at least three frames.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method for generating root skeleton keyframe data as described in any one of claims 1 to 6.
9. An electronic device, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the method for generating root skeleton keyframe data as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Animation data processing method, apparatus, electronic device and readable storage medium
CN109544664A
Animation data compression program, animation data restoration program, animation data compression device, and animation data compression method
JP6526775B1