Animation data processing method and device based on virtual skeleton, equipment and medium

By obtaining the animation data of the virtual skeleton from Unreal Engine and converting it into data suitable for BVH format, the problem of inability to convert Unreal Engine data is solved, the efficiency and accuracy of data processing are improved, and the basis for animation data correction is provided.

CN118537460APending Publication Date: 2024-08-23BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410592958.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-13
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Animation data in Unreal Engine cannot be converted into the standard BVH format, resulting in low data processing efficiency and accuracy, and the expression of animation data is inconsistent with BVH, affecting AI correction and secondary real-time tuning of actions.

Method used

By obtaining the initial and current animation data of the virtual bone from the Unreal Engine, determine the animation data to be processed representing the position of the virtual bone relative to the parent bone, use a quaternion array to convert it into a matrix form, and then convert the data into a preset format target Animation data, adapted to BVH format.

Benefits of technology

It realizes the automatic conversion of Unreal Engine animation data to BVH format, improves the efficiency and accuracy of data processing, provides a foundation for the upper-layer animation data correction development, and solves the problem of inconsistent expressions of animation data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118537460A
    Figure CN118537460A
Patent Text Reader

Abstract

The invention provides an animation data processing method and device based on a virtual skeleton, equipment and a medium, and relates to the field of artificial intelligence, in particular to the field of virtual skeleton control. According to the specific implementation scheme, initial animation data and current animation data of a virtual skeleton are obtained from a preset unreal engine; the preset unreal engine is used for driving the virtual skeleton to move, the initial animation data represents an initialized posture of the virtual skeleton, and the current animation data represents a current posture of the virtual skeleton; determining to-be-processed animation data of the virtual skeleton according to the initial animation data and the current animation data; the to-be-processed animation data represents the position of the virtual skeleton relative to a parent skeleton of the virtual skeleton; determining target animation data in a preset format according to the to-be-processed animation data; the target animation data characterizes a current posture of the virtual skeleton. The data of the virtual skeleton in the unreal engine is automatically converted into the preset format, and the data processing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of virtual skeleton control in the field of artificial intelligence, and in particular to a method, device, equipment and medium for processing animation data based on virtual skeletons. Background Art

[0002] Unreal Engine is an open source data engine that can control the actions of virtual skeletons and generate animations of skeletal movements.

[0003] In Unreal Engine, the file extension of animation data that controls the actions of virtual skeletons is UASSET. However, common AI (Artificial Intelligence) program codes use files in common formats such as BVH (BiovisionHierarchy). How to convert the format of Unreal Engine animation data so that AI correction can be performed based on Unreal Engine animation data is a problem that needs to be solved at present. Summary of the invention

[0004] The present invention provides a method, device, equipment and medium for processing animation data based on virtual skeleton.

[0005] According to a first aspect of the present disclosure, there is provided a method for processing animation data based on a virtual skeleton, comprising:

[0006] Acquire initial animation data and current animation data of the virtual skeleton from a preset Unreal Engine; wherein the preset Unreal Engine is used to drive the movement of the virtual skeleton, the initial animation data represents the initialization posture of the virtual skeleton, and the current animation data represents the current posture of the virtual skeleton;

[0007] Determine the animation data to be processed of the virtual skeleton according to the initial animation data and the current animation data; wherein the animation data to be processed represents the position of the virtual skeleton relative to the parent skeleton of the virtual skeleton;

[0008] According to the animation data to be processed, target animation data in a preset format is determined; wherein the target animation data represents the current posture of the virtual skeleton.

[0009] According to a second aspect of the present disclosure, there is provided an animation data processing device based on a virtual skeleton, comprising:

[0010] A data acquisition unit, used to acquire initial animation data and current animation data of a virtual skeleton from a preset Unreal Engine; wherein the preset Unreal Engine is used to drive the movement of the virtual skeleton, the initial animation data represents the initialization posture of the virtual skeleton, and the current animation data represents the current posture of the virtual skeleton;

[0011] A first determining unit is used to determine the animation data to be processed of the virtual skeleton according to the initial animation data and the current animation data; wherein the animation data to be processed represents the position of the virtual skeleton relative to the parent skeleton of the virtual skeleton;

[0012] The second determining unit is used to determine target animation data in a preset format according to the animation data to be processed; wherein the target animation data represents the current posture of the virtual skeleton.

[0013] According to a third aspect of the present disclosure, there is provided an electronic device, including:

[0014] at least one processor; and

[0015] a memory communicatively coupled to the at least one processor;

[0016] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect.

[0017] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method described in the first aspect.

[0018] According to a fifth aspect of the present disclosure, a computer program product is provided, the computer program product comprising: a computer program, which implements the method described in the first aspect when executed by a processor.

[0019] According to the technology disclosed in the present invention, the problem that the animation data of the Unreal Engine cannot be converted into data in a preset format is solved, thereby improving the efficiency and accuracy of data processing.

[0020] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0022] Figure 1 It is a flowchart of a method for processing animation data based on a virtual skeleton provided according to an embodiment of the present disclosure;

[0023] Figure 2 It is a flowchart of a method for processing animation data based on a virtual skeleton provided according to an embodiment of the present disclosure;

[0024] Figure 3 is a schematic diagram of changing the origin of a world coordinate system according to an embodiment of the present disclosure;

[0025] Figure 4 It is a flowchart of a method for processing animation data based on a virtual skeleton provided according to an embodiment of the present disclosure;

[0026] Figure 5 is a structural block diagram of an animation data processing device based on a virtual skeleton provided according to an embodiment of the present disclosure;

[0027] Figure 6 is a structural block diagram of an animation data processing device based on a virtual skeleton provided according to an embodiment of the present disclosure;

[0028] Figure 7 is a block diagram of an electronic device for implementing the animation data processing method based on a virtual skeleton according to an embodiment of the present disclosure;

[0029] Figure 8 It is a block diagram of an electronic device used to implement the animation data processing method based on virtual skeleton according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0030] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0031] Unreal Engine animation data is a collection of results affected by various factors such as various animation blends, IK (Inverse Kinematics), FK (Forward Kinematics), and physical calculations at runtime. The usual AI program code uses a universal format file called BVH. If you want to use the real-time dynamic animation data in Unreal Engine for AI correction or other purposes, you need to convert the animation data of Unreal Engine to BVH format.

[0032] There are two ways to express animation data in the Unreal Engine, namely the data of the bones in the world coordinate system and the data of the bones in the parent bone coordinate system. The standard BVH animation data expression method is the data of the bones in the parent bone coordinate system. The Unreal Engine uses a left-handed coordinate system and the parent bone space coordinate system is rotated relative to the world coordinate system, but the BVH uses a right-handed coordinate system and the parent bone space coordinate system is not rotated relative to the world coordinate system. This makes it relatively simple to convert BVH animation data into Unreal Engine animation data, but it is extremely difficult to convert Unreal Engine animation data into BVH animation data. Therefore, it is necessary to solve the problem of inconsistency between the expression of animation data in the Unreal Engine and the expression of standard BVH animation data, so as to facilitate the secondary real-time tuning of actions in subsequent monocular motion capture projects and lay the foundation for upper-level development.

[0033] The present invention discloses a method, device, equipment and medium for processing animation data based on virtual skeletons, which are applied to the field of virtual skeleton control in the field of artificial intelligence to solve the problem that the animation data of the Unreal Engine cannot be converted into BVH animation data, and improve the efficiency and accuracy of data processing.

[0034] It should be noted that the data in this embodiment is not targeted at a specific user and cannot reflect the personal information of a specific user. It should be noted that the data in this embodiment comes from a public data set.

[0035] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0036] In order to enable readers to more deeply understand the implementation principle of the present disclosure, the following Figure 1-Figure 8 The embodiment is further refined.

[0037] Figure 1 FIG. 1 is a flow chart of a method for processing animation data based on a virtual skeleton according to an embodiment of the present disclosure. The method can be executed by a device for processing animation data based on a virtual skeleton. Figure 1 As shown, the method comprises the following steps:

[0038] S101. Acquire initial animation data and current animation data of a virtual skeleton from a preset Unreal Engine; wherein the preset Unreal Engine is used to drive the movement of the virtual skeleton, the initial animation data represents an initialized posture of the virtual skeleton, and the current animation data represents a current posture of the virtual skeleton.

[0039] Exemplarily, the Unreal Engine is an open source engine, and virtual skeletons can be moved through the Unreal Engine. The movement of virtual skeletons in the Unreal Engine corresponds to animation data, which can characterize the movement of virtual skeletons. The animation data of the Unreal Engine can be data affected by various animation blending, IK, FK, physical calculations, and other factors when the virtual skeleton moves. The usual AI program code uses a universal format file such as BVH. If the real-time dynamic Unreal Engine animation data is to be corrected by AI or used for other purposes, the animation data of the Unreal Engine needs to be processed and converted into animation data in the BVH format.

[0040] When performing data processing, the initial animation data and current animation data in the Unreal Engine can be obtained. The initial animation data represents the initialization posture of the virtual skeleton, and the current animation data represents the current posture of the virtual skeleton. The virtual skeleton can be any bone in the human skeleton. An initialization posture can be preset for the virtual skeleton, and the animation data of the virtual skeleton when it is in the initialization posture is determined as the initial animation data, that is, it can represent the initial position and rotation angle of the virtual skeleton. The virtual skeleton starts to move from the initialization posture. During the movement, the current animation data of the virtual skeleton can be obtained in real time, that is, the current position and rotation angle of the virtual skeleton can be determined.

[0041] There are multiple bones in the human body, and each virtual bone can be traversed to determine the initial animation data and current animation data of each virtual bone, so as to process the animation data of each virtual bone. In this embodiment, the initial animation data and the current animation data can both be world space data, and the world space data refers to the coordinate data in the world coordinate system. That is, a world coordinate system is preset in the Unreal Engine, and the initial animation data and the current animation data of the virtual bone are obtained according to the position and rotation angle of the virtual bone in the world coordinate system.

[0042] S102. Determine the animation data to be processed of the virtual skeleton according to the initial animation data and the current animation data; wherein the animation data to be processed represents the position of the virtual skeleton relative to the parent skeleton of the virtual skeleton.

[0043] Exemplarily, there is a preset parent-child relationship between the skeletons of the human body, for example, the skeleton at the elbow is the parent skeleton of the skeleton at the wrist, and the skeleton at the shoulder is the parent skeleton of the skeleton at the elbow. After obtaining the initial animation data and the current animation data, the pending animation data of the virtual skeleton can be determined according to the initial animation data and the current animation data, and the pending animation data refers to the position of the virtual skeleton relative to the parent skeleton of the virtual skeleton. That is, the position of the virtual skeleton is determined with reference to the parent skeleton of the virtual skeleton. The connection positions between the various skeletons are relatively fixed, and therefore, the position of the virtual skeleton in the present embodiment can represent information such as the rotation angle of the virtual skeleton.

[0044] The parent bone of the virtual bone can be directly determined based on the preset parent-child relationship between the bones. The position of the parent bone is used as the origin of the coordinate system to obtain the position of the virtual bone relative to the parent bone. The coordinate system can be a coordinate system containing an X-axis, a Y-axis, and a Z-axis. The bones can be rotated, and the rotation angle of the current posture of the virtual bone relative to the initialized posture can be determined based on the initial animation data and the current animation data. The coordinate system at the parent bone is rotated according to the rotation angle, so that the virtual bone does not rotate relative to the coordinate system, avoiding problems such as large amount of calculation or calculation errors caused by the rotation of the virtual bone relative to the parent bone around the coordinate system.

[0045] In the present embodiment, the position of the virtual skeleton relative to the parent skeleton can be represented in the form of a quaternion array, and the virtual skeleton is non-rotating relative to the coordinate system. By using a quaternion array, problems caused by different left-hand and right-hand coordinate systems can be avoided when constructing a coordinate system. The quaternion array is converted into a matrix form, and the converted matrix is ​​determined as the animation data to be processed, which is convenient for subsequent matrix calculations, reduces the difficulty of calculation, and improves the efficiency and accuracy of data processing. In the present embodiment, the calculation method for converting the quaternion array into a matrix is ​​not specifically limited.

[0046] S103, determining target animation data in a preset format according to the animation data to be processed; wherein the target animation data represents the current posture of the virtual skeleton.

[0047] Exemplarily, the preset format may be a BVH format, and animation data in the BVH format is determined according to the animation data to be processed as the target animation data. The target animation data represents the current posture of the virtual skeleton in the BVH format.

[0048] The animation data in BVH format can be expressed in a BVH data file, which needs to contain the rotation angles of the virtual skeleton around the X-axis, Y-axis, and Z-axis respectively. That is, the animation data in BVH format can only be obtained if these three rotation angles are obtained. The animation data to be processed is in the form of a matrix, which can represent the position of the virtual skeleton in the coordinate system, that is, it can represent the rotation angle of the virtual skeleton relative to the X-axis, Y-axis, and Z-axis. A calculation formula with an angle can be pre-set, and the rectangular elements in the animation data to be processed are substituted into the preset calculation formula to calculate the rotation angles of the virtual skeleton around the X-axis, Y-axis, and Z-axis respectively. A file template for the data file of BVH is preset, and these three angles are added to the file template to obtain a complete data file in BVH format, that is, to obtain the final target animation data.

[0049] Convert the animation data in Unreal Engine to animation data in the BVH format commonly used for motion capture, providing basic data support. Users can view animation data in BVH format, for example, they can receive a user-triggered viewing command, display the target animation data in a preset format, and apply it to the secondary real-time tuning of actions in monocular motion capture projects, breaking through the data gap between Unreal Engine and BVH, and laying the foundation for the development of upper-level animation data correction.

[0050] In the disclosed embodiment, the initial animation data and current animation data of the virtual skeleton are obtained from the preset Unreal Engine, that is, the animation data in the Unreal Engine is obtained. According to the initial animation data and the current animation data, the animation data to be processed in the form of a matrix is ​​determined to represent the position of the virtual skeleton relative to the parent skeleton of the virtual skeleton. The matrix elements in the animation data to be processed are calculated to obtain the rotation angle of the virtual skeleton represented by the matrix elements around the coordinate axis, and then the target animation data in the BVH format is obtained. The problem of the inconsistency between the expression method of animation data in the Unreal Engine and the expression method of standard BVH animation data is solved, and the animation data in the Unreal Engine is automatically converted into the BVH format data commonly used for motion capture, thereby improving the efficiency of data processing and laying the foundation for the correction and development of upper-level animation data.

[0051] Figure 2 A flowchart of a method for processing animation data based on a virtual skeleton is provided in an embodiment of the present disclosure.

[0052] In this embodiment, the initial animation data and the current animation data are both located in a preset initial coordinate system; based on the initial animation data and the current animation data, the animation data to be processed of the virtual skeleton is determined, including: based on the initial animation data and the current animation data, the preset initial coordinate system is changed to obtain a target coordinate system; and the animation data to be processed of the virtual skeleton in the target coordinate system is determined.

[0053] like Figure 2 As shown, the method comprises the following steps:

[0054] S201. Acquire initial animation data and current animation data of a virtual skeleton from a preset Unreal Engine; wherein the preset Unreal Engine is used to drive the movement of the virtual skeleton, the initial animation data represents an initialized posture of the virtual skeleton, and the current animation data represents a current posture of the virtual skeleton.

[0055] Exemplarily, this step may refer to the above-mentioned step S101 and will not be described in detail.

[0056] S202: According to the initial animation data and the current animation data, the preset initial coordinate system is changed to obtain a target coordinate system.

[0057] Exemplarily, an initial world coordinate system is preset in the Unreal Engine as the initial coordinate system. The human skeleton is in the initial coordinate system, that is, the initial animation data and the current animation data are coordinate data located in the initial coordinate system. For example, the origin of the initial coordinate system is at the midpoint between the two feet, and the initial animation data and the current animation data can be obtained according to the orientation of the virtual skeleton relative to the origin.

[0058] After obtaining the initial animation data and the current animation data, the initial coordinate system can be changed according to the initial animation data and the current animation data, and the initial coordinate system can be changed to the parent bone of the virtual bone, so as to obtain the position of the virtual bone relative to the parent bone. The changed coordinate system is determined as the target coordinate system. For example, if the parent bone of the virtual bone is the bone of the hip, the original origin can be transferred from between the two feet to the hip, and a new world coordinate system can be constructed at the new origin as the target coordinate system.

[0059] When constructing the target coordinate system, the rotation angle of the virtual skeleton relative to the initial coordinate system can be determined based on the initial animation data and the current animation data. According to the determined rotation angle, the newly constructed coordinate system is rotated so that the virtual skeleton does not rotate relative to the target coordinate system, which is convenient for subsequent calculations.

[0060] In this embodiment, the preset initial coordinate system is changed according to the initial animation data and the current animation data to obtain the target coordinate system, including: determining the parent bone of the virtual skeleton; changing the origin of the preset initial coordinate system to the parent bone of the virtual skeleton to obtain the origin of the target coordinate system; determining the direction angle of the origin of the target coordinate system according to the initial animation data and the current animation data; and constructing the target coordinate system according to the direction angle of the origin of the target coordinate system.

[0061] Specifically, each bone in the human body has a preset parent bone, so the parent bone of the virtual bone can be directly determined. The origin of the preset initial coordinate system is changed to the parent bone of the virtual bone, that is, the position of the parent bone is determined as the origin of the target coordinate system. For example, if the virtual bone is a spine bone and the parent bone of the virtual bone is a hip bone, then the origin of the target coordinate system is at the hip bone.

[0062] After determining the position of the target coordinate system, it is also necessary to determine the orientation of the target coordinate system. The orientation angle of the origin of the target coordinate system can be determined based on the initial animation data and the current animation data. For example, the angle of the virtual skeleton represented by the current animation data relative to the angle of the virtual skeleton represented by the initial animation data can be determined, and the angle is determined as the orientation angle. The target coordinate system is constructed based on the orientation angle of the origin of the target coordinate system, that is, the orientation of the target coordinate system can be different from the orientation of the initial coordinate system.

[0063] The beneficial effect of this setting is that the origin of the target coordinate system is transferred to the parent bone of the virtual bone, and the orientation of the target coordinate system also changes relative to the original initial coordinate system, which is conducive to accurately determining the orientation of the virtual bone relative to the parent bone and improving the accuracy of data processing.

[0064] In this embodiment, the orientation angle of the origin of the target coordinate system is determined based on the initial animation data and the current animation data, including: determining the rotation angle of the virtual skeleton in the preset initial coordinate system based on the initial animation data and the current animation data; determining the rotation angle of the virtual skeleton in the preset initial coordinate system as the orientation angle of the origin of the target coordinate system.

[0065] Specifically, the posture of the virtual skeleton represented by the current animation data is different from the posture of the virtual skeleton represented by the initial animation data, and the virtual skeleton may have rotated. According to the initial animation data and the current animation data, the rotation angle of the virtual skeleton in the initial coordinate system can be determined. In this embodiment, the calculation method of the rotation angle is not specifically limited.

[0066] The rotation angle is determined as the orientation angle of the origin of the target coordinate system, so that the virtual bone does not rotate relative to the target coordinate system. That is, the constructed target coordinate system is at the parent bone position of the virtual bone, and the virtual bone does not rotate relative to the target coordinate system.

[0067] The beneficial effect of such a setting is that, by constructing a target coordinate system, the position of the virtual skeleton relative to the parent skeleton can be determined, and other calculation problems caused by the rotation of the coordinate system can be avoided, thereby improving the accuracy of data processing.

[0068] S203: Determine the animation data to be processed of the virtual skeleton in the target coordinate system.

[0069] Exemplarily, after constructing the target coordinate system, the animation data of the virtual skeleton in the target coordinate system is determined as the animation data to be processed. The animation data to be processed can be in the form of a matrix, that is, the coordinate data of the virtual skeleton in the target coordinate system can be determined first, and then the coordinate data is converted into the form of a matrix as the animation data to be processed. In the present embodiment, the coordinate data can be expressed in the form of a quaternion. Using quaternions can avoid the problems caused by the different left and right hand coordinate systems and the different rotation orders of the subsequent coordinate axes.

[0070] In this embodiment, by constructing a target coordinate system and determining the animation data to be processed of the virtual skeleton in the target coordinate system, the calculation process can be saved, and accurate data format conversion can be performed for each virtual bone, thereby converting the animation data of the Unreal Engine into the BVH format, thereby improving the accuracy and efficiency of data processing.

[0071] In this embodiment, determining the animation data to be processed of the virtual skeleton in the target coordinate system includes: determining the position information of the virtual skeleton in the target coordinate system; wherein the position information is in the form of a quaternion array, and the position information represents the position of the virtual skeleton relative to the parent skeleton of the virtual skeleton; converting the position information into a matrix form to obtain the animation data to be processed.

[0072] Specifically, the position information of the virtual skeleton in the target coordinate system is determined. The position information may represent the rotation angle of the virtual skeleton itself relative to the parent skeleton. In this embodiment, the position information is in the form of a quaternion array. For example, the position information may be represented as [x 1 , x 2 , x 3 , x 4 ].

[0073] The position information is converted into a matrix form, and the obtained matrix form data is determined as the animation data to be processed. A calculation formula for converting a quaternion into a matrix can be preset, and in this embodiment, the calculation formula is not specifically limited. The animation data to be processed can be a 3×3 matrix or a 4×4 matrix.

[0074] The beneficial effect of this arrangement is that by determining the quaternion array, the calculation problems caused by the different left-hand coordinate systems and the different rotation order of the coordinate axes can be avoided. By converting the quaternion array into a matrix, it is convenient to quickly calculate the rotation angle of the virtual skeleton around the coordinate axis of the target coordinate system, thereby obtaining animation data in a preset format and improving the efficiency and accuracy of data processing.

[0075] S204, determining target animation data in a preset format according to the animation data to be processed; wherein the target animation data represents the current posture of the virtual skeleton.

[0076] Exemplarily, this step may refer to the above-mentioned step S103 and will not be described in detail.

[0077] Figure 3 Schematic diagram of the change of the origin of the world coordinate system. Figure 3 In the figure, O1 is the origin of the initial coordinate system, and O2 is the origin of the target coordinate system.

[0078] In the disclosed embodiment, the initial animation data and current animation data of the virtual skeleton are obtained from the preset Unreal Engine, that is, the animation data in the Unreal Engine is obtained. According to the initial animation data and the current animation data, the animation data to be processed in the form of a matrix is ​​determined to represent the position of the virtual skeleton relative to the parent skeleton of the virtual skeleton. The matrix elements in the animation data to be processed are calculated to obtain the rotation angle of the virtual skeleton represented by the matrix elements around the coordinate axis, and then the target animation data in the BVH format is obtained. The problem of the inconsistency between the expression method of animation data in the Unreal Engine and the expression method of standard BVH animation data is solved, and the animation data in the Unreal Engine is automatically converted into the BVH format data commonly used for motion capture, thereby improving the efficiency of data processing and laying the foundation for the correction and development of upper-level animation data.

[0079] Figure 4 A flowchart of a method for processing animation data based on a virtual skeleton is provided in an embodiment of the present disclosure.

[0080] In this embodiment, the target coordinate system includes an X-axis, a Y-axis, and a Z-axis; according to the animation data to be processed, the target animation data in a preset format is determined, including: obtaining a preset matrix template; wherein the number of rows and columns of the preset matrix template is the same as the number of rows and columns of the animation data to be processed, and the elements in the preset matrix template represent at least one of a first angle, a second angle, and a third angle, the first angle represents the angle of rotation of the virtual skeleton around the X-axis, the second angle represents the angle of rotation of the virtual skeleton around the Y-axis, and the third angle represents the angle of rotation of the virtual skeleton around the Z-axis, and the first angle, the second angle, and the third angle are unknown; according to the animation data to be processed and the preset matrix template, the target animation data in a preset format is determined.

[0081] like Figure 4 As shown, the method comprises the following steps:

[0082] S401. Acquire initial animation data and current animation data of a virtual skeleton from a preset Unreal Engine; wherein the preset Unreal Engine is used to drive the movement of the virtual skeleton, the initial animation data represents the initialization posture of the virtual skeleton, and the current animation data represents the current posture of the virtual skeleton.

[0083] Exemplarily, this step may refer to the above-mentioned step S101 and will not be described in detail.

[0084] S402: Determine the animation data to be processed of the virtual skeleton according to the initial animation data and the current animation data; wherein the animation data to be processed represents the position of the virtual skeleton relative to the parent skeleton of the virtual skeleton.

[0085] Exemplarily, this step may refer to the above-mentioned step S102 and will not be described in detail.

[0086] S403. Obtain a preset matrix template; wherein the number of rows and columns of the preset matrix template is the same as the number of rows and columns of the animation data to be processed, and the elements in the preset matrix template represent at least one of a first angle, a second angle, and a third angle, wherein the first angle represents the angle of rotation of the virtual skeleton around the X-axis, the second angle represents the angle of rotation of the virtual skeleton around the Y-axis, and the third angle represents the angle of rotation of the virtual skeleton around the Z-axis, and the first angle, the second angle, and the third angle are unknown.

[0087] Exemplarily, a matrix template is pre-set, and the matrix template is a template of data in matrix form, that is, a template of data to be processed. That is, the number of rows and columns of the matrix template is the same as the number of rows and columns of the animation data to be processed. The elements in the matrix template can characterize at least one of the first angle, the second angle, and the third angle, that is to say, the elements corresponding to each row and column in the data to be processed can also characterize at least one of the first angle, the second angle, and the third angle. The first angle represents the angle at which the virtual skeleton rotates around the X axis, the second angle represents the angle at which the virtual skeleton rotates around the Y axis, and the third angle represents the angle at which the virtual skeleton rotates around the Z axis, assuming that the first angle is a, the second angle is b, and the third angle is c. In the matrix template, the first angle, the second angle, and the third angle are unknown numbers. For example, the matrix template can be expressed as:

[0088]

[0089] In the BVH format data file, it is necessary to specify that the virtual bone rotates a degrees around the X axis, b degrees around the Y axis, and c degrees around the Z axis.

[0090] In this embodiment, obtaining a preset matrix template includes: obtaining a preset coordinate axis order; wherein the preset coordinate axis represents the order in which the preset virtual skeleton rotates around the X-axis, Y-axis, and Z-axis; and determining a matrix template corresponding to the preset coordinate axis order.

[0091] Specifically, the coordinate axis order needs to be specified in the BVH format data file. The coordinate axis represents the order in which the virtual skeleton rotates around the X-axis, Y-axis, and Z-axis. For example, it can rotate around the X-axis first, then around the Y-axis, and then around the Z-axis; it can also rotate around the Y-axis first, then around the Z-axis, and then around the X-axis, etc. Different coordinate axis orders will affect the result of the final target animation data.

[0092] Preset the coordinate axis order, and different coordinate axis orders correspond to different matrix templates. Get the preset coordinate axis order and determine the matrix template corresponding to the coordinate axis order.

[0093] The beneficial effect of such a setting is that, according to the preset coordinate axis sequence, the corresponding matrix template is determined, the rotation angle is determined specifically, and the accuracy of data processing is improved.

[0094] In this embodiment, the method also includes: obtaining a preset first matrix, a second matrix, and a third matrix; wherein the first matrix is ​​used to represent the X-axis through a trigonometric function of a first angle, the second matrix is ​​used to represent the Y-axis through a trigonometric function of a second angle, and the third matrix is ​​used to represent the Z-axis through a trigonometric function of a third angle; according to a preset coordinate axis order, performing matrix multiplication on the first matrix, the second matrix, and the third matrix to obtain a matrix template; and storing the preset coordinate axis order in association with the matrix template.

[0095] Specifically, three matrices are pre-set, namely, a first matrix, a second matrix, and a third matrix. The first matrix is ​​used to represent the X-axis through a trigonometric function of a first angle, the second matrix is ​​used to represent the Y-axis through a trigonometric function of a second angle, and the third matrix is ​​used to represent the Z-axis through a trigonometric function of a third angle. The first matrix, the second matrix, and the third matrix can be expressed as:

[0096]

[0097]

[0098]

[0099] Among them, A X is the first matrix, A Y is the second matrix, A Z is the third matrix.

[0100] According to the first matrix, the second matrix, the third matrix, and the preset coordinate axis order, calculations can be performed to obtain a matrix template. That is, the matrix template can be represented by trigonometric functions of a, b, and c. When calculating the matrix template, the first matrix, the second matrix, and the third matrix can be multiplied according to the coordinate axis order. First, the matrices in the first two orders are multiplied, and then the multiplication result is multiplied with the matrix in the third order to obtain the matrix template. For example, if the preset coordinate axis order is first around the X-axis, then around the Y-axis, and then around the Z-axis, the first matrix can be multiplied with the second matrix first, and then the multiplication result is multiplied with the third matrix. According to matrix multiplication, the first matrix and the second matrix are multiplied to obtain:

[0101]

[0102] Multiplying this matrix with the third matrix gives:

[0103]

[0104] Different coordinate axis orders affect the matrix multiplication process, thereby obtaining different matrix templates. After obtaining the matrix template, the matrix template is associated with the corresponding coordinate axis order and stored for easy subsequent retrieval.

[0105] The beneficial effect of such a setting is that the matrix templates corresponding to different coordinate axis orders are determined in advance, which facilitates the subsequent rapid calculation of the rotation angle of the virtual skeleton around the coordinate axis according to the matrix template, thereby improving the pertinence and calculation efficiency of data processing.

[0106] S404: Determine target animation data in a preset format according to the animation data to be processed and a preset matrix template.

[0107] Exemplarily, after obtaining the animation data to be processed and the matrix template, the unknown quantities a, b, and c in the matrix template can be calculated according to the animation data to be processed, that is, the rotation angle around the X-axis, the rotation angle around the Y-axis, and the rotation angle around the Z-axis are determined. According to the three calculated angles, the final target animation data is obtained. The file template of the target animation data can be preset, and the specific values ​​of the three angles are missing in the template. The values ​​of the calculated angles are filled in the file template to obtain complete target animation data. It is worth noting that the values ​​of the obtained angles need to be written into the file template according to the order of the coordinate axes.

[0108] In this embodiment, according to the matrix template, the data to be processed can be quickly calculated and processed to obtain the required data in a preset format, thereby improving the accuracy and efficiency of data processing and realizing the conversion of Unreal Engine animation data to BVH animation data.

[0109] In this embodiment, target animation data in a preset format is determined based on the animation data to be processed and a preset matrix template, including: determining a first angle, a second angle, and a third angle based on the animation data to be processed and the matrix template; adding the first angle, the second angle, and the third angle to a file in a preset format to obtain the target animation data in the preset format.

[0110] Specifically, the matrix elements of the matrix template include unknown first angles, second angles, and third angles, and the animation data to be processed is the value of the specific matrix elements. According to the animation data to be processed and the matrix template, the specific values ​​of the first angle, the second angle, and the third angle can be determined. For example, according to the animation data to be processed, the formula containing the unknown quantity in the matrix template can be calculated to obtain the unknown quantity, that is, the required angle.

[0111] A file with a preset format is preset, that is, a file template with a preset BVH. The first angle, the second angle, and the third angle are added to the preset positions in the file with the preset format to obtain target animation data in the preset format, that is, animation data in the BVH format.

[0112] The beneficial effect of this arrangement is that, through simple calculations, the first angle, the second angle, and the third angle can be quickly obtained, and the obtained angle values ​​are written into a file in a preset order to obtain target animation data, thereby realizing format conversion of the Unreal Engine's animation data and laying the foundation for the correction and development of upper-level animation data.

[0113] In this embodiment, the first angle, the second angle, and the third angle are determined according to the animation data to be processed and the matrix template, including: substituting the elements in the animation data to be processed into the corresponding elements in the matrix template, and determining the first angle, the second angle, and the third angle based on a preset inverse trigonometric function algorithm.

[0114] Specifically, the elements in the matrix template are represented in the form of formulas, and the values ​​represented by the formulas are the values ​​of the corresponding elements in the animation data to be processed. By substituting the elements in the animation data to be processed into the corresponding elements in the matrix template, the unknown quantities in the matrix template can be calculated, that is, the first angle, the second angle, and the third angle can be calculated.

[0115] An inverse trigonometric function algorithm may be preset, and the first angle, the second angle, and the third angle may be determined according to the preset inverse trigonometric function algorithm. An inverse verification processing method may also be preset, and the inverse verification processing method is used to verify the calculated first angle, the second angle, and the third angle to ensure the correctness of the calculation. For example, the inverse verification processing method may be to substitute the calculated first angle into the element containing only the first angle in the matrix template, and determine whether the calculated value is consistent with the value of the corresponding element in the animation data to be processed. If so, it is determined that the first angle is correct; if not, it is determined that the first angle is calculated incorrectly and needs to be recalculated. In this embodiment, the preset inverse verification processing method is not specifically limited.

[0116] The beneficial effect of such an arrangement is that inverse trigonometric functions and inverse verification processing are performed to improve calculation efficiency and accuracy, thereby improving the efficiency and accuracy of data processing.

[0117] In the disclosed embodiment, the initial animation data and current animation data of the virtual skeleton are obtained from the preset Unreal Engine, that is, the animation data in the Unreal Engine is obtained. According to the initial animation data and the current animation data, the animation data to be processed in the form of a matrix is ​​determined to represent the position of the virtual skeleton relative to the parent skeleton of the virtual skeleton. The matrix elements in the animation data to be processed are calculated to obtain the rotation angle of the virtual skeleton represented by the matrix elements around the coordinate axis, and then the target animation data in the BVH format is obtained. The problem of the inconsistency between the expression method of animation data in the Unreal Engine and the expression method of standard BVH animation data is solved, and the animation data in the Unreal Engine is automatically converted into the BVH format data commonly used for motion capture, thereby improving the efficiency of data processing and laying the foundation for the correction and development of upper-level animation data.

[0118] Figure 5 The structure block diagram of a virtual skeleton-based animation data processing device provided by the embodiment of the present disclosure. For the convenience of explanation, only the part related to the embodiment of the present disclosure is shown. Figure 5 The animation data processing device 500 based on virtual skeleton includes: a data acquisition unit 501, a first determination unit 502 and a second determination unit 503.

[0119] The data acquisition unit 501 is used to acquire the initial animation data and the current animation data of the virtual skeleton from a preset Unreal Engine; wherein the preset Unreal Engine is used to drive the movement of the virtual skeleton, the initial animation data represents the initialization posture of the virtual skeleton, and the current animation data represents the current posture of the virtual skeleton;

[0120] A first determining unit 502 is used to determine the animation data to be processed of the virtual skeleton according to the initial animation data and the current animation data; wherein the animation data to be processed represents the position of the virtual skeleton relative to the parent skeleton of the virtual skeleton;

[0121] The second determining unit 503 is used to determine target animation data in a preset format according to the animation data to be processed; wherein the target animation data represents the current posture of the virtual skeleton.

[0122] Figure 6 A structural block diagram of an animation data processing device based on a virtual skeleton provided in an embodiment of the present disclosure, such as Figure 6 As shown, the animation data processing device 600 based on virtual skeleton includes a data acquisition unit 601, a first determination unit 602 and a second determination unit 603, wherein the initial animation data and the current animation data are both located in a preset initial coordinate system, and the first determination unit 602 includes a coordinate system change module 6021 and a data determination module 6022.

[0123] A coordinate system changing module 6021 is used to change the preset initial coordinate system according to the initial animation data and the current animation data to obtain a target coordinate system;

[0124] The data determination module 6022 is used to determine the animation data to be processed of the virtual skeleton in the target coordinate system.

[0125] In one example, the coordinate system changing module 6021 includes:

[0126] A parent bone determination submodule, used for determining the parent bone of the virtual bone;

[0127] An origin determination submodule, used for changing the origin of the preset initial coordinate system to the parent bone of the virtual bone to obtain the origin of the target coordinate system;

[0128] A direction determination submodule, used to determine the direction angle of the origin of the target coordinate system according to the initial animation data and the current animation data;

[0129] The coordinate system construction submodule is used to construct the target coordinate system according to the orientation angle of the origin of the target coordinate system.

[0130] In one example, the orientation determination submodule is specifically used for:

[0131] Determining a rotation angle of the virtual skeleton in the preset initial coordinate system according to the initial animation data and the current animation data;

[0132] The rotation angle of the virtual skeleton in the preset initial coordinate system is determined as the orientation angle of the origin of the target coordinate system.

[0133] In one example, the data determination module 6022 includes:

[0134] A position determination submodule, used to determine the position information of the virtual skeleton in the target coordinate system; wherein the position information is in the form of a quaternion array, and the position information represents the position of the virtual skeleton relative to the parent skeleton of the virtual skeleton;

[0135] The information conversion submodule is used to convert the position information into a matrix form to obtain the animation data to be processed.

[0136] In one example, the target coordinate system includes an X-axis, a Y-axis, and a Z-axis; the second determining unit 603 includes:

[0137] A template acquisition module, used for acquiring a preset matrix template; wherein the number of rows and columns of the preset matrix template is the same as the number of rows and columns of the animation data to be processed, and the elements in the preset matrix template represent at least one of a first angle, a second angle, and a third angle, wherein the first angle represents the angle of rotation of the virtual skeleton around the X-axis, the second angle represents the angle of rotation of the virtual skeleton around the Y-axis, and the third angle represents the angle of rotation of the virtual skeleton around the Z-axis, and the first angle, the second angle, and the third angle are unknown numbers;

[0138] The target determination module is used to determine target animation data in a preset format according to the animation data to be processed and the preset matrix template.

[0139] In one example, the template acquisition module includes:

[0140] A sequence acquisition submodule, used to acquire a preset coordinate axis sequence; wherein the preset coordinate axis represents the sequence in which the preset virtual skeleton rotates around the X-axis, the Y-axis, and the Z-axis;

[0141] The template determination submodule is used to determine the matrix template corresponding to the preset coordinate axis sequence.

[0142] In one example, it also includes:

[0143] A matrix acquisition unit, used to acquire a preset first matrix, a second matrix, and a third matrix; wherein the first matrix is ​​used to represent the X-axis by a trigonometric function of a first angle, the second matrix is ​​used to represent the Y-axis by a trigonometric function of a second angle, and the third matrix is ​​used to represent the Z-axis by a trigonometric function of a third angle;

[0144] A matrix multiplication unit, used for performing matrix multiplication on the first matrix, the second matrix, and the third matrix according to a preset coordinate axis order to obtain a matrix template;

[0145] The template storage unit is used to store the preset coordinate axis sequence in association with the matrix template.

[0146] In one example, the target determination module includes:

[0147] An angle determination submodule, used for determining the first angle, the second angle, and the third angle according to the animation data to be processed and the matrix template;

[0148] The data acquisition submodule is used to add the first angle, the second angle, and the third angle to a file in a preset format to obtain target animation data in a preset format.

[0149] In one example, the angle determination submodule is specifically used to:

[0150] Substitute the elements in the animation data to be processed into the corresponding elements in the matrix template, and determine the first angle, the second angle, and the third angle based on a preset inverse trigonometric function algorithm.

[0151] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device.

[0152] Figure 7 A structural block diagram of an electronic device provided in an embodiment of the present disclosure, the electronic device may be a terminal device or a server, such as Figure 7 As shown, the electronic device 700 includes: at least one processor 702; and a memory 701 communicatively connected to the at least one processor 702; wherein the memory stores instructions executable by the at least one processor 702, and the instructions are executed by the at least one processor 702 so that the at least one processor 702 can execute the virtual skeleton-based animation data processing method disclosed in the present invention.

[0153] The electronic device 700 further includes a receiver 703 and a transmitter 704. The receiver 703 is used to receive instructions and data sent by other devices, and the transmitter 704 is used to send instructions and data to external devices.

[0154] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0155] According to an embodiment of the present disclosure, the present disclosure also provides a computer program product, which includes: a computer program, the computer program is stored in a readable storage medium, at least one processor of an electronic device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the electronic device executes the solution provided by any of the above embodiments.

[0156] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0157] like Figure 8As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0158] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0159] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as an animation data processing method based on a virtual skeleton. For example, in some embodiments, the animation data processing method based on a virtual skeleton may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the animation data processing method based on a virtual skeleton described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to execute the virtual skeleton-based animation data processing method in any other appropriate manner (for example, by means of firmware).

[0160] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0161] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0162] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0163] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0164] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0165] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.

[0166] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0167] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A method for processing animation data based on virtual skeleton, include: Acquire initial animation data and current animation data of the virtual skeleton from a preset Unreal Engine; wherein the preset Unreal Engine is used to drive the movement of the virtual skeleton, the initial animation data represents the initialization posture of the virtual skeleton, and the current animation data represents the current posture of the virtual skeleton; Determine the animation data to be processed of the virtual skeleton according to the initial animation data and the current animation data; wherein the animation data to be processed represents the position of the virtual skeleton relative to the parent skeleton of the virtual skeleton; According to the animation data to be processed, target animation data in a preset format is determined; wherein the target animation data represents the current posture of the virtual skeleton.

2. The method according to claim 1, in, The initial animation data and the current animation data are both located in a preset initial coordinate system; The step of determining the animation data to be processed of the virtual skeleton according to the initial animation data and the current animation data comprises: According to the initial animation data and the current animation data, the preset initial coordinate system is changed to obtain a target coordinate system; Determine the animation data to be processed of the virtual skeleton in the target coordinate system.

3. The method according to claim 2, in, The step of changing the preset initial coordinate system according to the initial animation data and the current animation data to obtain a target coordinate system includes: Determine the parent bone of the virtual bone; Changing the origin of the preset initial coordinate system to the parent bone of the virtual bone to obtain the origin of the target coordinate system; Determining the orientation angle of the origin of the target coordinate system according to the initial animation data and the current animation data; The target coordinate system is constructed according to the orientation angle of the origin of the target coordinate system.

4. The method according to claim 3, in, The step of determining the orientation angle of the origin of the target coordinate system according to the initial animation data and the current animation data includes: Determining a rotation angle of the virtual skeleton in the preset initial coordinate system according to the initial animation data and the current animation data; The rotation angle of the virtual skeleton in the preset initial coordinate system is determined as the orientation angle of the origin of the target coordinate system.

5. The method according to any one of claims 2 to 4, in, The step of determining the animation data to be processed of the virtual skeleton in the target coordinate system includes: Determine the position information of the virtual bone in the target coordinate system; wherein the position information is in the form of a quaternion array, and the position information represents the position of the virtual bone relative to the parent bone of the virtual bone; The position information is converted into a matrix form to obtain the animation data to be processed.

6. The method according to any one of claims 2 to 5, in, The target coordinate system includes an X-axis, a Y-axis, and a Z-axis; and determining target animation data in a preset format according to the animation data to be processed includes: Obtain a preset matrix template; wherein the number of rows and columns of the preset matrix template is the same as the number of rows and columns of the animation data to be processed, and the elements in the preset matrix template represent at least one of a first angle, a second angle, and a third angle, wherein the first angle represents the angle of rotation of the virtual skeleton around the X-axis, the second angle represents the angle of rotation of the virtual skeleton around the Y-axis, and the third angle represents the angle of rotation of the virtual skeleton around the Z-axis, and the first angle, the second angle, and the third angle are unknown; Target animation data in a preset format is determined according to the animation data to be processed and the preset matrix template.

7. The method according to claim 6, in, The obtaining of a preset matrix template includes: Obtaining a preset coordinate axis sequence; wherein the preset coordinate axis represents the sequence in which the preset virtual skeleton rotates around the X-axis, the Y-axis, and the Z-axis; A matrix template corresponding to the preset coordinate axis sequence is determined.

8. The method according to claim 7, further comprising: include: Obtain a preset first matrix, a second matrix, and a third matrix; wherein the first matrix is ​​used to represent the X-axis by a trigonometric function of a first angle, the second matrix is ​​used to represent the Y-axis by a trigonometric function of a second angle, and the third matrix is ​​used to represent the Z-axis by a trigonometric function of a third angle; According to a preset coordinate axis order, matrix multiplication is performed on the first matrix, the second matrix, and the third matrix to obtain a matrix template; The preset coordinate axis sequence is associated with the matrix template and stored.

9. The method according to any one of claims 6 to 8, in, The step of determining target animation data in a preset format according to the animation data to be processed and the preset matrix template includes: Determining the first angle, the second angle, and the third angle according to the animation data to be processed and the matrix template; The first angle, the second angle, and the third angle are added to a file in a preset format to obtain target animation data in the preset format.

10. The method according to claim 9, in, The determining the first angle, the second angle, and the third angle according to the animation data to be processed and the matrix template includes: Substitute the elements in the animation data to be processed into the corresponding elements in the matrix template, and determine the first angle, the second angle, and the third angle based on a preset inverse trigonometric function algorithm.

11. An animation data processing device based on virtual skeleton, include: A data acquisition unit, used to acquire initial animation data and current animation data of a virtual skeleton from a preset Unreal Engine; wherein the preset Unreal Engine is used to drive the movement of the virtual skeleton, the initial animation data represents the initialization posture of the virtual skeleton, and the current animation data represents the current posture of the virtual skeleton; A first determining unit is used to determine the animation data to be processed of the virtual skeleton according to the initial animation data and the current animation data; wherein the animation data to be processed represents the position of the virtual skeleton relative to the parent skeleton of the virtual skeleton; The second determining unit is used to determine target animation data in a preset format according to the animation data to be processed; wherein the target animation data represents the current posture of the virtual skeleton.

12. The device according to claim 11, in, The initial animation data and the current animation data are both located in a preset initial coordinate system; The first determining unit includes: A coordinate system changing module, used for changing the preset initial coordinate system according to the initial animation data and the current animation data to obtain a target coordinate system; The data determination module is used to determine the animation data to be processed of the virtual skeleton in the target coordinate system.

13. The device according to claim 12, in, The coordinate system changing module comprises: A parent bone determination submodule, used for determining the parent bone of the virtual bone; An origin determination submodule, used for changing the origin of the preset initial coordinate system to the parent bone of the virtual bone to obtain the origin of the target coordinate system; A direction determination submodule, used to determine the direction angle of the origin of the target coordinate system according to the initial animation data and the current animation data; The coordinate system construction submodule is used to construct the target coordinate system according to the orientation angle of the origin of the target coordinate system.

14. The device according to claim 13, in, The orientation determination submodule is specifically used for: Determining a rotation angle of the virtual skeleton in the preset initial coordinate system according to the initial animation data and the current animation data; The rotation angle of the virtual skeleton in the preset initial coordinate system is determined as the orientation angle of the origin of the target coordinate system.

15. The device according to any one of claims 12 to 14, in, The data determination module comprises: A position determination submodule, used to determine the position information of the virtual skeleton in the target coordinate system; wherein the position information is in the form of a quaternion array, and the position information represents the position of the virtual skeleton relative to the parent skeleton of the virtual skeleton; The information conversion submodule is used to convert the position information into a matrix form to obtain the animation data to be processed.

16. The device according to any one of claims 12 to 15, in, The target coordinate system includes an X-axis, a Y-axis, and a Z-axis; the second determining unit includes: A template acquisition module, used for acquiring a preset matrix template; wherein the number of rows and columns of the preset matrix template is the same as the number of rows and columns of the animation data to be processed, and the elements in the preset matrix template represent at least one of a first angle, a second angle, and a third angle, wherein the first angle represents the angle of rotation of the virtual skeleton around the X-axis, the second angle represents the angle of rotation of the virtual skeleton around the Y-axis, and the third angle represents the angle of rotation of the virtual skeleton around the Z-axis, and the first angle, the second angle, and the third angle are unknown numbers; The target determination module is used to determine target animation data in a preset format according to the animation data to be processed and the preset matrix template.

17. The device according to claim 16, in, The template acquisition module includes: A sequence acquisition submodule, used to acquire a preset coordinate axis sequence; wherein the preset coordinate axis represents the sequence in which the preset virtual skeleton rotates around the X-axis, the Y-axis, and the Z-axis; The template determination submodule is used to determine the matrix template corresponding to the preset coordinate axis sequence.

18. The device according to claim 17, further comprising: include: A matrix acquisition unit, used to acquire a preset first matrix, a second matrix, and a third matrix; wherein the first matrix is ​​used to represent the X-axis by a trigonometric function of a first angle, the second matrix is ​​used to represent the Y-axis by a trigonometric function of a second angle, and the third matrix is ​​used to represent the Z-axis by a trigonometric function of a third angle; A matrix multiplication unit, used for performing matrix multiplication on the first matrix, the second matrix, and the third matrix according to a preset coordinate axis order to obtain a matrix template; The template storage unit is used to store the preset coordinate axis sequence in association with the matrix template.

19. The device according to any one of claims 16 to 18, in, The target determination module comprises: An angle determination submodule, used for determining the first angle, the second angle, and the third angle according to the animation data to be processed and the matrix template; The data acquisition submodule is used to add the first angle, the second angle, and the third angle to a file in a preset format to obtain target animation data in a preset format.

20. The device according to claim 19, in, The angle determination submodule is specifically used for: Substitute the elements in the animation data to be processed into the corresponding elements in the matrix template, and determine the first angle, the second angle, and the third angle based on a preset inverse trigonometric function algorithm.

21. An electronic device, include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 10.

22. A non-transitory computer-readable storage medium storing computer instructions, in, The computer instructions are used to cause the computer to execute the method according to any one of claims 1-10.

23. A computer program product, in, The invention comprises a computer program, which implements the steps of the method according to any one of claims 1 to 10 when being executed by a processor.

Citation Information

Cited By

  • Motion capture data transmission method, system and device and electronic equipment

    CN119182930A