A motion data redirection method, system, apparatus and storage medium
By acquiring information such as the skeleton coordinates of the target character and the driving quaternions of the original character, and using node identifiers and weight ratios to calculate motion changes, the system achieves simplified calculation of real-time and non-real-time motion data redirection. This solves the problems of computational complexity and high memory consumption in existing technologies, improves data reuse rate, and reduces animation production costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU VIRTUAL POWER NETWORK TECH CO LTD
- Filing Date
- 2022-12-16
- Publication Date
- 2026-07-03
AI Technical Summary
Existing motion data redirection methods are computationally complex and cannot achieve real-time redirection. Neural network-based methods have high memory overhead, while inverse kinematics-based methods are computationally cumbersome and complex.
By acquiring information such as the skeleton coordinates of the target character and the driving quaternions of the original character, the full-body node coordinates of the target character in the current frame are determined. The motion change is calculated using node identifiers and weight ratios, and the full-body node coordinates of the target character in the current frame are adjusted to achieve real-time and non-real-time motion data redirection.
It simplifies the calculation process, reduces memory consumption, and is applicable to both real-time and non-real-time motion data redirection, improving the reuse rate of motion data and reducing animation production costs.
Smart Images

Figure CN116129009B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of inertial motion capture technology, and in particular to a motion data redirection method, system, device and storage medium. Background Technology
[0002] Motion redirection refers to redirecting the motion of an original character to a target character, making the target character's motion as realistic as the original. This technique can significantly improve the reusability of motion data and reduce the cost of animation production. Common data redirection methods include neural network-based motion redirection and inverse kinematics-based motion redirection. Neural network-based methods require encoding and decoding the entire motion process data, resulting in high computational and memory overhead, and real-time data redirection is not possible. Inverse kinematics-based methods require inversely solving for the positions of other joints based on the positions of the end joints on the skeleton and kinematic constraints, and also require kinematic constraint calculations, making the process cumbersome and complex. Therefore, a new motion data redirection method is urgently needed. Summary of the Invention
[0003] The purpose of this application is to at least partially solve one of the technical problems existing in the prior art.
[0004] Therefore, one objective of the embodiments of this application is to provide a motion data redirection method, system, device, and storage medium. This method can be applied to both real-time and non-real-time motion data redirection and has strong practicality and scalability.
[0005] To achieve the above technical objectives, the technical solution adopted in this application includes: a motion data redirection method, comprising acquiring the first skeleton coordinates of a target character, the second skeleton coordinates of the original character, the first driving quaternion of the current frame of the original character, and the first root node coordinate information of the current frame of the original character; acquiring the first full-body node coordinate information of the previous frame of the target character and the fourth full-body node coordinate information of the previous frame of the original character; determining the temporary second full-body node coordinate information of the current frame of the target character based on the first skeleton coordinates, the second skeleton coordinates, the first driving quaternion, and the first root node coordinate information; determining the third full-body node coordinate information of the current frame of the original character based on the second skeleton coordinates, the first driving quaternion, and the first root node coordinate information; and determining the third full-body node coordinate information of the current frame of the original character based on the second skeleton coordinates, the first driving quaternion, and the first root node coordinate information. The first skeleton coordinate and the second skeleton coordinate are used to determine the weight ratio between the target character's skeleton coordinates and the original character's skeleton coordinates; based on the third and fourth full-body node coordinate information, a first set of coordinate changes for all coordinates of the original character across consecutive frames is determined; based on the first set of coordinate changes, the node identifier with the smallest coordinate change is determined; based on the node identifier, the weight ratio, the first, second, third, and fourth full-body node coordinate information, the motion change of the node corresponding to the node identifier in the target character is determined; based on the second full-body node coordinate information and the motion change, the first full-body node coordinate information of the target character in the current frame is adjusted.
[0006] In addition, the motion data redirection method according to the above embodiments of the present invention may also have the following additional technical features:
[0007] Further, in this embodiment, the step of determining the temporary second full-body node coordinate information of the target character in the current frame based on the first skeleton coordinates, the second skeleton coordinates, the first driving quaternion, and the first root node coordinate information specifically includes: extracting the second skeleton node coordinates of any two adjacent nodes in the second skeleton coordinates of the original character and the first skeleton node coordinates of any two adjacent nodes in the first skeleton coordinates of the target character; determining the skeleton matching quaternion based on the first skeleton node coordinates and the second skeleton node coordinates; determining the second driving quaternion of the target character in the current frame based on the first driving quaternion and the skeleton matching quaternion; and determining the temporary second full-body node coordinate information of the target character in the current frame based on the first skeleton coordinates, the second driving quaternion, and the first root node coordinate information.
[0008] Further, in this embodiment, the step of determining the third full-body node coordinate information of the original character in the current frame based on the second skeleton coordinates, the first driving quaternion, and the first root node coordinate information specifically includes: determining the third full-body node coordinate information of the original character in the current frame based on the second skeleton coordinates, the first driving quaternion of the original character in the current frame, the first root node coordinate information of the original character in the current frame, and a coordinate formula; wherein the coordinate formula is:
[0009]
[0010] in, Q represents the rotation matrix corresponding to the quaternion of the parent node. old Q is the first driving quaternion of the original character in the current frame. 1_old Q is the value of the first element in the quaternion; 2_old Q is the value of the second element in the quaternion; 3_old Q is the value of the third element in the quaternion; 4_old This represents the value of the fourth element in the quaternion. _old is the coordinate of the second skeleton. This refers to the coordinates of the first root node of the original character in the current frame. In the original character skeleton The coordinates of the node's adjacent previous node. The initial value is .
[0011] Furthermore, in this embodiment of the application, the step of determining the first set of coordinate changes of all coordinates between consecutive frames of the original character based on the third full-body node coordinate information and the fourth full-body node coordinate information specifically includes: subtracting the third full-body node coordinate information and the fourth full-body node coordinate information to obtain the first set of differences of the original character's full-body coordinates between two consecutive frames; and using the absolute value of the first set of differences as the first set of coordinate changes of all coordinates between the two consecutive frames.
[0012] Further, in this embodiment of the application, the step of determining the motion change of the node corresponding to the node identifier in the target role based on the node identifier, the weight ratio, the first whole-body node coordinate information, the second whole-body node coordinate information, the third whole-body node coordinate information, and the fourth whole-body node coordinate information specifically includes:
[0013] Determine that the current frame's ranking in the animation is greater than or equal to the second frame. Based on the node identifier, the weight ratio, the first full-body node coordinate information, the second full-body node coordinate information, the third full-body node coordinate information, the fourth full-body node coordinate information, and the first formula for change, determine the X-axis and Y-axis motion changes of the node corresponding to the node identifier in the target character. The first formula for change includes:
[0014]
[0015] in P is the change in motion. The X-axis or Y-axis coordinate of a single node in the first full-body node coordinate information corresponding to the node identifier. The X-axis or Y-axis coordinate of a single node in the second full-body node coordinate information corresponding to the node identifier. The X-axis or Y-axis coordinate of a single node in the third full-body node coordinate information corresponding to the node identifier. This refers to the X-axis or Y-axis coordinate of a single node in the fourth whole-body node coordinate information corresponding to the node identifier. The weight ratio of the target character's skeleton coordinates to the original character's skeleton coordinates is used; based on the Z-axis coordinates of the root node coordinates in the third full-body node coordinate information and the Z-axis coordinates of the root node coordinates in the second full-body node coordinate information, and the weight ratio of the target character's skeleton coordinates to the original character's skeleton coordinates, the Z-axis motion change of the node corresponding to the node identifier in the target character is determined.
[0016] Furthermore, in this embodiment of the application, the step of adjusting the first full-body node coordinate information of the target character in the current frame based on the second full-body node coordinate information and the motion change amount specifically includes: determining the sum of the second full-body node coordinate information and the motion change amount as the first full-body node coordinate information of the current frame.
[0017] Furthermore, in this embodiment of the application, the step of determining the skeleton matching quaternion based on the first skeleton node coordinates and the second skeleton coordinates specifically includes: determining a first skeleton vector based on the first skeleton node coordinates; determining a second skeleton vector based on the second skeleton node coordinates; determining the angle between the first skeleton vector and the second skeleton vector and the spatial normal vector based on the first skeleton vector and the second skeleton vector; and determining the skeleton matching quaternion based on the angle and the spatial normal vector.
[0018] On the other hand, this application embodiment also provides a motion data redirection system, including: an acquisition unit, configured to acquire the first skeleton coordinates of a target character, the second skeleton coordinates of the original character, the first driving quaternion of the current frame of the original character, and the first root node coordinate information of the current frame of the original character, and to acquire the first full-body node coordinate information of the previous frame of the target character and the fourth full-body node coordinate information of the previous frame of the original character; a first processing unit, configured to determine the temporary second full-body node coordinate information of the current frame of the target character based on the first skeleton coordinates, the second skeleton coordinates, the first driving quaternion, and the first root node coordinate information; a second processing unit, configured to determine the third full-body node coordinate information of the current frame of the original character based on the second skeleton coordinates, the first driving quaternion, and the first root node coordinate information; and a third processing unit, configured to determine the third full-body node coordinate information of the current frame of the original character based on the first skeleton coordinates, ... second driving quaternion, and the first root node coordinate information; and a third processing unit, configured to determine the third full-body node coordinate information of the current frame of the original character based on the first skeleton coordinates, the second skeleton coordinates, the second driving quaternion, and the first root node coordinate information; and a third processing unit, configured to determine the third full-body node coordinate information of The system comprises: a first processing unit, a second processing unit, and a third processing unit, a fourth processing unit, and an adjustment unit, and an adjustment unit, and an adjustment unit, and an adjustment unit, and an adjustment unit, and an adjustment unit, and an adjustment unit, and an adjustment unit, and an adjustment unit, and an adjustment unit, and an adjustment unit, and an adjustment unit, and an adjustment unit, respectively, based on the second processing unit coordinate information and the second processing unit coordinate information. The first processing unit determines the first set of coordinate changes for all coordinates of the original character across consecutive frames based on the third and fourth full-body node coordinate information.
[0019] On the other hand, this application also provides a motion data redirection device, comprising:
[0020] At least one processor;
[0021] At least one memory for storing at least one program;
[0022] When the at least one program is executed by the at least one processor, the at least one processor implements a motion data redirection method as described in any one of the inventions.
[0023] Furthermore, this application also provides a storage medium storing processor-executable instructions, which, when executed by a processor, are used to perform a motion data redirection method as described in any of the preceding claims.
[0024] The advantages and beneficial effects of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application:
[0025] This application determines the node identifier with the smallest coordinate change based on the coordinate change between two consecutive frames of the original character. By identifying the node identifier, the motion change of the target character is determined. Then, using the motion change of the target character and the temporary full-body node coordinate information of the target character in the current frame, the full-body node coordinate information of the target character in the current frame is determined. This method, by determining the node with the smallest change through node identifiers, not only ensures the realism of the target character's motion but also features simple and fast calculation, low memory consumption, and applicability to both real-time and non-real-time motion data redirection, demonstrating strong practicality and scalability. Attached Figure Description
[0026] Figure 1 This is a schematic diagram illustrating the steps of a motion data redirection method in a specific embodiment of the present invention;
[0027] Figure 2 This is a schematic diagram of the skeleton structure of a character and the layout of virtual nodes on the soles of the feet in a specific embodiment of the present invention;
[0028] Figure 3 This is a schematic diagram of a motion data redirection system in a specific embodiment of the present invention;
[0029] Figure 4 This is a schematic diagram of a motion data redirection device in a specific embodiment of the present invention. Detailed Implementation
[0030] The principles and processes of the motion data redirection method, system, device, and storage medium of the present invention will be described in detail below with reference to the accompanying drawings.
[0031] Reference Figure 1 The present invention provides a motion data redirection method, comprising the following steps:
[0032] S1. Obtain the first skeleton coordinates of the target character, the second skeleton coordinates of the original character, the first driving quaternion of the original character in the current frame, and the first root node coordinate information of the original character in the current frame. Also obtain the first full-body node coordinate information of the target character in the previous frame and the fourth full-body node coordinate information of the original character in the previous frame.
[0033] In this step, the first skeleton information of the target character and the second skeleton information of the original character are fixed values; the driving quaternion and root node coordinate information may be different in each frame, therefore the driving quaternion and root node coordinate information in this step can be the driving quaternion and root node coordinate information of the current frame; the skeleton structure of the character and the layout of the foot virtual nodes in this embodiment can be referred to Figure 2Because the character model may touch the ground with its toes, heels, or sides during movement such as walking or dancing in virtual space, the toe nodes in the original character skeleton cannot accurately represent the contact with the ground. Therefore, the same virtual node distribution layout should be applied to the soles of the feet of both the original and target characters. The first and second skeleton information can be calculated as follows: Nine virtual nodes are arranged on the soles of both feet. Taking the virtual nodes of the right foot of the original character as an example, the node numbers are expanded from 1 to 23 to 1 to 41. The node numbers of the virtual nodes on the right foot are (24 to 32), corresponding to (R1 to R9). The horizontal length of the instep of the right foot is set to , and the coordinates of each virtual node on the sole can be obtained using the following formula:
[0034]
[0035] Similarly, the coordinates of the virtual nodes on the sole of the original character's left foot and the coordinates of the virtual nodes on the target character's skeleton corresponding to the original character can also be obtained. The driving quaternion and the root node coordinates of the original character in the current frame can be obtained directly through data acquisition. The driving quaternion is a four-dimensional data, and its representation can be [w, x, y, z]. The coordinates of the first full-body node of the target character in the previous frame and the coordinates of the fourth full-body node of the original character in the previous frame can also be obtained directly by calling the results of motion data processing of the previous frame.
[0036] S2. Based on the first skeleton coordinates, the second skeleton coordinates, the first driving quaternion, and the first root node coordinate information, determine the temporary second full-body node coordinate information of the target character in the current frame;
[0037] In this step, the second full-body node coordinate information is a temporary set of node coordinates of the target character. Based on the skeleton coordinates of the target character, the skeleton coordinates of the original character, the driving quaternion of the current frame of the original character, and the root node coordinate information of the current frame of the original character, the temporary second full-body node coordinate information of the target character can be determined. The temporary full-body node coordinate information can be used for subsequent data processing.
[0038] S3. Based on the second skeleton coordinates, the first driving quaternion, and the first root node coordinate information, determine the third full-body node coordinate information of the original character in the current frame.
[0039] In this step, since the full-body node information may change in each frame, the third full-body node coordinate information can be the node coordinate information of the original character's current frame, which can include the coordinate information of all 41 virtual nodes, including the left and right foot nodes of the original character in the current frame. The full-body node coordinate information of the original character in the current frame can be determined based on the skeleton coordinates of the original character, the driving quaternion of the original character in the current frame, and the root node coordinate information of the original character.
[0040] S4. Determine the weight ratio of the target character's skeleton coordinates to the original character's skeleton coordinates based on the first skeleton coordinates and the second skeleton coordinates.
[0041] In this step, the weight ratio can be the ratio of the target character's skeleton coordinates to the original character's skeleton coordinates on the Z-axis. Since the nodes of the target character and the original character correspond one-to-one, when determining the weight ratio, the Z-axis coordinates of any node in the target character's skeleton can be extracted and compared with the corresponding node in the original character's skeleton. Specifically, the Z-axis coordinates of the root node can be used for calculation. The specific calculation formula can be:
[0042]
[0043] in The Z-axis parameter is the coordinate of the root node of the target character. The Z-axis parameter is the coordinate of the original character's root node. This represents the weighting ratio.
[0044] S5. Based on the third full-body node coordinate information and the fourth full-body node coordinate information, determine the first coordinate change set of all coordinates between consecutive frames of the original character.
[0045] In this step, the third full-body node coordinate information can be the full-body node coordinate information of the original character in the current frame, and the fourth full-body node coordinate information can be the full-body node coordinate information of the original character in the previous frame. Based on the changes in the full-body node coordinate information of the previous frame and the current frame, the first set of coordinate changes of all full-body node coordinates between consecutive frames of the original character can be determined. The first set of coordinate changes includes the changes in the coordinates of 41 nodes of the whole body.
[0046] S6. Based on the first set of coordinate changes, determine the node identifier with the smallest coordinate change.
[0047] In this step, the coordinate changes of the 41 nodes in the first set of coordinate changes can be numerically sorted to obtain the coordinates of the bone node with the smallest coordinate change. This bone node is then identified as the node identifier. Specifically, when the coordinate change of the 19th node in consecutive frames is determined to be the smallest, the node identifier is 19.
[0048] S7. Based on the node identifier, the weight ratio, the first whole-body node coordinate information, the second whole-body node coordinate information, the third whole-body node coordinate information, and the fourth whole-body node coordinate information, determine the amount of motion change of the node corresponding to the node identifier in the target role;
[0049] In this step, the motion change of the node corresponding to the node in the target character can be determined based on the determined node identifier, weight ratio, first full-body node coordinate information of the previous frame, temporary second full-body node coordinate information, third full-body node coordinate information of the original character in the current frame, and fourth full-body node coordinate information of the original character in the previous frame.
[0050] S8. Adjust the first full-body node coordinate information of the target character in the current frame according to the second full-body node coordinate information and the motion change amount;
[0051] In this step, the second full-body node coordinate information and the motion change amount can be summed to obtain a new first full-body node coordinate. This first full-body node coordinate is used as the new first full-body node coordinate of the current frame. The new first full-body node coordinate of the current frame can be used as the first full-body node coordinate information of the target character in the previous frame in the next frame's calculation process.
[0052] The step of determining the temporary second full-body node coordinate information of the target character in the current frame based on the first skeleton coordinates, the second skeleton coordinates, the first driving quaternion, and the first root node coordinate information may specifically include:
[0053] S21. Extract the coordinates of the second skeleton nodes of any two adjacent nodes in the second skeleton coordinates of the original character and the coordinates of the first skeleton nodes of any two adjacent nodes in the first skeleton coordinates of the target character.
[0054] S22. Determine the skeleton matching quaternion based on the coordinates of the first skeleton node and the coordinates of the second skeleton node;
[0055] S23. Determine the second driving quaternion of the target character in the current frame based on the first driving quaternion and the skeleton matching quaternion;
[0056] S24. Based on the first skeleton coordinates, the second driving quaternion, and the first root node coordinate information, determine the temporary second full-body node coordinate information of the target character in the current frame;
[0057] In this embodiment, the second skeleton node coordinates of any two adjacent nodes in the skeleton coordinates of the original character and the first skeleton node coordinates of any two adjacent nodes in the skeleton coordinates of the target character can be extracted first. The skeleton matching quaternion is then determined based on the first and second skeleton node coordinates. Finally, the second driving quaternion of the target character in the current frame is determined using the first driving quaternion and the skeleton matching quaternion, which can be based on a specific formula:
[0058]
[0059] Where is the second driving quaternion of the target character in the current frame, is the first driving quaternion, and is the skeleton matching quaternion; after determining the second driving quaternion, the temporary second full-body node coordinate information of the target character in the current frame can be determined based on the first skeleton coordinates, the second driving quaternion, and the first root node coordinate information. The specific formula is:
[0060]
[0061] in The coordinates of the root node for the temporary target role are equal to the coordinates of the first root node. Let be the value of the first element in the driving quaternion of the target character's temporary skeleton. The value of the second element in the driving quaternion within the temporary skeleton of the target character. The value of the third element in the driving quaternion within the temporary skeleton of the target character. The values of the four elements in the driving quaternion within the temporary skeleton of the target character. Let be the coordinates of any node in the temporary skeleton. For temporary skeleton The coordinates of the node's adjacent previous node. The initial value is ; for The corresponding node coordinates of the original character; for The node coordinates of the original character corresponding to the node.
[0062] Furthermore, in some embodiments of this application, the step of determining the third full-body node coordinate information of the original character in the current frame based on the second skeleton coordinates, the first driving quaternion, and the first root node coordinate information specifically includes:
[0063] Based on the second skeleton coordinates of the original character, the first driving quaternion of the original character in the current frame, the first root node coordinate information of the original character in the current frame, and the coordinate formula, the third full-body node coordinate information of the original character in the current frame is determined; wherein the coordinate formula is:
[0064]
[0065] Where, Q represents the rotation matrix corresponding to the quaternion of the parent node. old Q is the first driving quaternion of the original character in the current frame. 1_old Q is the value of the first element in the quaternion; 2_old Q is the value of the second element in the quaternion; 3_old Q is the value of the third element in the quaternion; 4_old This represents the value of the fourth element in the quaternion. _old is the coordinate of the second skeleton. This refers to the coordinates of the first root node of the original character in the current frame. In the original character skeleton The coordinates of the node's adjacent previous node. The initial value is .
[0066] In this step, the calculation of the full-body node coordinates of the original character in the current frame is done in the same way as the calculation of the temporary skeleton, also based on the formula:
[0067]
[0068] Where, Q represents the rotation matrix corresponding to the quaternion of the parent node. old Q is the first driving quaternion of the original character in the current frame. 1_old Q is the value of the first element in the quaternion; 2_old Q is the value of the second element in the quaternion; Q3_old is the value of the third element in the quaternion; Q 4_old This represents the value of the fourth element in the quaternion. _old is the coordinate of the second skeleton. This refers to the coordinates of the first root node of the original character in the current frame. In the original character skeleton The coordinates of the node's adjacent previous node. The initial value is .
[0069] Furthermore, in some embodiments of this application, the step of determining the first set of coordinate changes for all coordinates between consecutive frames of the original character based on the third full-body node coordinate information and the fourth full-body node coordinate information may specifically include:
[0070] S41. Subtract the coordinate information of the third full-body node from the coordinate information of the fourth full-body node to obtain the first set of differences in the full-body coordinates of the original character in two consecutive frames.
[0071] S42. The absolute value of the first difference set is used as the first coordinate change set of all coordinates between the two consecutive frames.
[0072] In this embodiment, by subtracting the full-body node coordinates of the original character in the previous frame from the full-body node coordinates of the original character in the current frame, a first set of differences in the full-body coordinates of the original character in two consecutive frames can be obtained. The elements in this set can be positive or negative. At this time, it is necessary to perform an absolute value operation on each element of the first set of differences to adjust all elements to positive values. All positive elements are used as the first set of coordinate changes between the two consecutive frames.
[0073] Furthermore, in some embodiments of this application, the step of determining the motion change of the node corresponding to the node identifier in the target role based on the node identifier, the weight ratio, the first whole-body node coordinate information, the second whole-body node coordinate information, the third whole-body node coordinate information, and the fourth whole-body node coordinate information may specifically include:
[0074] S51. Based on the node identifier, the weight ratio, the first full-body node coordinate information, the second full-body node coordinate information, the third full-body node coordinate information, the fourth full-body node coordinate information, and the first formula for change, determine the X-axis motion change and Y-axis motion change of the node corresponding to the node identifier in the target role, wherein the first formula for change includes:
[0075]
[0076] in P is the change in motion. The X-axis or Y-axis coordinate of a single node in the first full-body node coordinate information corresponding to the node identifier. The X-axis or Y-axis coordinate of a single node in the second full-body node coordinate information corresponding to the node identifier. The X-axis or Y-axis coordinate of a single node in the third full-body node coordinate information corresponding to the node identifier. This refers to the X-axis or Y-axis coordinate of a single node in the fourth whole-body node coordinate information corresponding to the node identifier. The weighted ratio of the target character's skeleton coordinates to the original character's skeleton coordinates;
[0077] S52. Based on the Z-axis coordinate of the root node in the third full-body node coordinate information, the Z-axis coordinate of the root node in the second full-body node coordinate information, and the weight ratio of the target character skeleton coordinates to the original character skeleton coordinates, determine the Z-axis motion change of the node corresponding to the node identifier in the target character.
[0078] In this embodiment, the coordinates of the child nodes corresponding to the full-body node coordinate information of the node identifier can be determined first by using the first, second, third, and fourth full-body node coordinate information. For example, if the node identifier is 19, then the original character node coordinates of the current frame of the 19th node, the target character node coordinates of the current frame of the 19th node, the original character node coordinates of the previous frame of the 19th node, and the target character node coordinates of the previous frame of the 19th node need to be determined using the first, second, third, and fourth full-body node coordinate information. Based on the coordinates of the child nodes corresponding to the full-body node coordinate information of the four node identifiers, the weight ratio, and the first formula for the change amount, the X-axis motion change amount and Y-axis motion change amount of the node corresponding to the node identifier in the target character are determined. The first formula for the change amount includes:
[0079]
[0080] in P is the change in motion. The X-axis or Y-axis coordinate of a single node in the first full-body node coordinate information corresponding to the node identifier. The X-axis or Y-axis coordinate of a single node in the second full-body node coordinate information corresponding to the node identifier. The X-axis or Y-axis coordinate of a single node in the third full-body node coordinate information corresponding to the node identifier. The X-axis or Y-axis coordinate of a single node in the fourth full-body node coordinate information corresponding to the node identifier is the weight ratio of the target character skeleton coordinates to the original character skeleton coordinates. After determining the X-axis motion change and Y-axis motion change, the Z-axis motion change of the node corresponding to the node identifier in the target character can be determined based on the Z-axis coordinate of the root node in the third full-body node coordinate information, the Z-axis coordinate of the root node in the second full-body node coordinate information, and the weight ratio of the target character skeleton coordinates to the original character skeleton coordinates.
[0081] Furthermore, in some embodiments of this application, the step of adjusting the first full-body node coordinate information of the target character in the current frame based on the second full-body node coordinate information and the motion change amount may specifically include:
[0082] The sum of the second whole-body node coordinate information and the motion change amount is determined as the first whole-body node coordinate information of the current frame.
[0083] In this step, the temporary whole-body node coordinate information and the motion change amount can be summed to obtain a sum value, and then this sum value can be used as the first whole-body node coordinate information of the current frame.
[0084] In some embodiments of this application, the step of determining the skeleton matching quaternion based on the first skeleton node coordinates and the second skeleton coordinates may specifically include:
[0085] S71. Determine the first skeleton vector based on the coordinates of the first skeleton node;
[0086] S72. Determine the second skeleton vector based on the coordinates of the second skeleton nodes;
[0087] S73. Based on the first skeleton vector and the second skeleton vector, determine the angle between the first skeleton vector and the second skeleton vector and the spatial normal vector.
[0088] S74. Determine the skeleton matching quaternion based on the included angle and the spatial normal vector.
[0089] In this step, the skeleton matching quaternion can be determined according to the following formula:
[0090]
[0091] in, The coordinates of node 19 in the second skeleton node coordinates of the original character, and the coordinates of node 18 in the second skeleton node coordinates of the original character. The coordinates of node 19 in the first skeleton node coordinates of the target character. The coordinates of node 18 in the first skeleton node coordinates of the target character, target symbol The dot product of vectors is represented by the symbol ^, which represents the cross product of vectors. This is the vector of the forearm of the original character skeleton. For the target character's skeleton forearm vector, Indicates the modulus; This represents the angle between the original character's forearm vector and the target character's forearm vector. This represents the spatial normal vector from which the original character's forearm vector is rotated to the target character's forearm vector; it should be noted that... , It can also be adjusted to , Two adjacent skeleton coordinates.
[0092] The motion data redirection method of this application will be described in detail below with reference to the accompanying drawings.
[0093] Step 1: Initialize the skeleton information. Define the front of the humanoid virtual model as the y-axis, the right hand pointing as the x-axis, and the top of the head as the z-axis. The original character skeleton used in this solution is in a T-pose pose (arms outstretched horizontally, legs perpendicular to the ground, feet parallel), while the target character skeleton is in a non-standard T-pose state. First, obtain a weight ratio, as follows:
[0094]
[0095] in, Indicates the coordinates of the target character's skeleton. Indicates the coordinates of the original character skeleton, parentheses The value of represents the skeleton node number, ranging from 1 to 23, enclosed in square brackets. This represents the coordinates of the skeleton node in three-dimensional space, with values ranging from 1 to 3 (representing the x-axis, y-axis, and z-axis, respectively).
[0096] Because the character model may touch the ground with its toes, heels, or sides during movements such as walking or dancing in virtual space, the toe nodes in the original character skeleton cannot accurately represent the contact with the ground. Therefore, the same virtual node distribution layout should be applied to the soles of the feet of both the original and target characters. The virtual node layout of the soles in this solution is as follows: there are 9 virtual nodes on the soles of both the left and right feet. Taking the virtual node of the right foot of the original character as an example, the node numbers are expanded from 1 to 23 to 1 to 41. The node numbers of the virtual nodes on the right foot are (24 to 32), corresponding to (R1 to R9). The horizontal length of the instep of the right foot is set to... Then the coordinates of each virtual node on the sole of the foot can be obtained, as shown in the following formula:
[0097]
[0098] Similarly, the virtual node coordinates of the sole of the original character's left foot and the virtual nodes of the target character's skeleton corresponding to the original character can be obtained, which are omitted here. Furthermore, due to significant differences in the initial poses between different humanoid virtual model skeletons—for example, the initial poses of the target character's upper and lower arms differ greatly from those of the original character's upper and lower arms—the poses become distorted after retargeting. Therefore, skeleton matching of the virtual model is necessary to obtain the skeleton matching quaternion. Specifically, taking the right forearm as an example, the skeleton is matched with quaternions. It is obtained by rotating the vectors of each bone segment in space, such as matching the quaternion of the right forearm skeleton. It is obtained by rotating the right forearm vector of the original character to the right forearm vector of the target character, as shown in the following formula:
[0099]
[0100] Among them, symbols The dot product of vectors is represented by the symbol ^, which represents the cross product of vectors. This is the vector of the forearm of the original character skeleton. For the target character's skeleton forearm vector, Indicates the modulus; This represents the angle between the original character's forearm vector and the target character's forearm vector. Represents the spatial normal vector of the original character's forearm vector rotated to the target character's forearm vector; skeleton matching quaternion It is a 23x4 matrix, corresponding to 23 regular skeleton nodes. The virtual nodes on the sole of the foot, the toe, and the ankle joints belong to a rigid body and share the same quaternion, which is obtained by the vector rotation of each bone segment in space. For example, the quaternion matching the skeleton of the right forearm. It is obtained by rotating the right forearm vector of the original character to the right forearm vector of the target character;
[0101] Step 2: Match quaternions based on the skeleton obtained in Step 1. The skeleton is matched to the quaternion driving the original character in the current frame, so that the corresponding bones of the target character and the original character maintain the same posture; the formula is as follows:
[0102]
[0103] Among them, symbols To represent quaternion multiplication, This represents the driving quaternion of the original character frame. The driving quaternion representing the target role is... composition;
[0104] The third step is to obtain the known original character root node coordinates. Assign the root node coordinates to the target role, and then use the target role-driven quaternion obtained in the second step. Target character skeleton information in the first step It then applies forward kinematics (FK) to the target character to obtain temporary full-body node coordinate information. The formula is as follows:
[0105] in, This represents the rotation matrix corresponding to the quaternion of the parent node. Knowing the coordinates of the parent node allows us to deduce the coordinates of the child nodes, such as if the coordinates of the root node are known. The coordinates of its three child nodes can be calculated. , By analogy, the coordinates of all nodes in the body can be obtained. Note that the virtual nodes on the soles of the feet and the nodes on the toes are child nodes of the ankle joint nodes, which are derived from the coordinates of the ankle joint nodes and their quaternions.
[0106] Step 4: Drive the quaternion based on the known original character. The original character skeleton information in the first step and the root node coordinates of the original character Perform FK driving on the original character to obtain the full-body node coordinate information of the original character in the current frame. The calculation method is the same as in step three;
[0107] Step 5: Based on the full-body node coordinate information of the original character in the current frame from Step 4. Calculate the coordinate changes of each node in the whole body in the preceding and following frames. The formula is as follows:
[0108]
[0109] In the formula, This represents the node coordinates of the original character in the current frame. This represents the node coordinates of the original character in the previous frame. The function represents taking the modulo value, which is then obtained through an algorithm. Find the minimum value and obtain the node number where the minimum value is located. This point is defined as a quasi-stationary point.
[0110] Step 6: Identify the quasi-stationary point number obtained in Step 5. and the first step The third step Calculate the changes in motion of the quasi-stationary point along the X and Y axes of the target character. ( ), and the Z-axis This updates the coordinate information of all nodes on the target character. Then, the full-body node coordinate information of the current frame is... Assign the coordinates of all nodes in the previous frame Similarly, the coordinate information of all nodes of the original character is... Assign the coordinate information of all nodes in the previous frame The formula is as follows:
[0111] The assigned coordinates of all nodes in the previous frame The whole-body node coordinates information processed in the current frame can be used as the whole-body node coordinates information of the previous frame for processing in the next frame. Similarly, the assigned values can be used to... It can be used as the whole-body node coordinate information of the previous frame when redirecting motion data for the next frame. .
[0112] In addition, refer to Figure 3 ,and Figure 1 Corresponding to the method, embodiments of this application also provide a motion data redirection system, including: an acquisition unit 101, configured to acquire the first skeleton coordinates of the target character, the second skeleton coordinates of the original character, the first driving quaternion of the current frame of the original character, and the first root node coordinate information of the current frame of the original character, and to acquire the first full-body node coordinate information of the previous frame of the target character and the fourth full-body node coordinate information of the previous frame of the original character; a first processing unit 102, configured to determine the temporary second full-body node coordinate information of the current frame of the target character based on the first skeleton coordinates, the second skeleton coordinates, the first driving quaternion, and the first root node coordinate information; a second processing unit 103, configured to determine the third full-body node coordinate information of the current frame of the original character based on the second skeleton coordinates, the first driving quaternion, and the first root node coordinate information; and a third processing unit 104, configured to determine the third full-body node coordinate information of the current frame of the original character based on the first skeleton coordinates, ... driving The system uses the first full-body node coordinate information and the second full-body node coordinate information to determine the weight ratio between the target character's skeleton coordinates and the original character's skeleton coordinates; the fourth processing unit 105 is used to determine the first set of coordinate changes for all coordinates between consecutive frames of the original character based on the third and fourth full-body node coordinate information; the fifth processing unit 106 is used to determine the node identifier with the smallest coordinate change based on the first set of coordinate changes; the sixth processing unit 107 is used to determine the motion change of the node corresponding to the node identifier in the target character based on the node identifier, the weight ratio, the first full-body node coordinate information, the second full-body node coordinate information, the third full-body node coordinate information, and the fourth full-body node coordinate information; and the adjustment unit 108 is used to adjust the first full-body node coordinate information of the target character in the current frame based on the second full-body node coordinate information and the motion change.
[0113] It should be noted that the content of the above-described motion data redirection method embodiments is applicable to this motion data redirection system embodiment. The specific functions implemented by this motion data redirection system embodiment are the same as those of the above-described motion data redirection method embodiments, and the beneficial effects achieved are also the same as those achieved by the above-described motion data redirection method embodiments.
[0114] and Figure 1 Corresponding to the method described herein, embodiments of this application also provide a motion data redirection device, the specific structure of which can be referred to... Figure 4 ,include:
[0115] At least one processor;
[0116] At least one memory for storing at least one program;
[0117] When the at least one program is executed by the at least one processor, the at least one processor implements the motion data redirection method.
[0118] It should be noted that the content of the above-described motion data redirection method embodiments is applicable to this motion data redirection device embodiment. The specific functions implemented by this motion data redirection device embodiment are the same as those of the above-described motion data redirection method embodiments, and the beneficial effects achieved are also the same as those achieved by the above-described motion data redirection method embodiments.
[0119] and Figure 1 Corresponding to the method described above, this application also provides a storage medium storing processor-executable instructions, which, when executed by a processor, are used to perform the motion data redirection method.
[0120] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order shown in the operation diagrams. For example, depending on the functions / operations involved, two consecutively shown blocks may actually be executed substantially simultaneously, or the blocks may sometimes be executed in reverse order. Furthermore, the embodiments presented and described in the flowcharts of this application are provided by way of example to provide a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and sub-operations described as part of a larger operation are executed independently.
[0121] Furthermore, although this application is described in the context of functional modules, it should be understood that, unless otherwise stated to the contrary, one or more of the functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding this application. Rather, given the properties, functions, and internal relationships of the various functional modules in the apparatus disclosed herein, the actual implementation of the module will be understood within the scope of conventional technology for an engineer. Therefore, those skilled in the art can implement the application set forth in the claims using ordinary techniques without excessive experimentation. It is also understood that the specific concepts disclosed are merely illustrative and not intended to limit the scope of this application, which is determined by the full scope of the appended claims and their equivalents.
[0122] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several programs to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0123] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequential list of executable programs for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, a program execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can retrieve and execute a program from or in conjunction with such a program execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can mean any means that can contain, store, communicate, propagate, or transmit a program for use by or in conjunction with a program execution system, apparatus, or device.
[0124] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0125] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable program execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0126] In the foregoing description of this specification, the references to terms such as "one embodiment," "another embodiment," or "some embodiments," etc., indicate that a specific feature, structure, material, or characteristic described in connection with an embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0127] Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.
[0128] The above is a detailed description of the preferred embodiments of this application, but this application is not limited to the embodiments described. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this application, and these equivalent modifications or substitutions are all included within the scope defined by the claims of this application.
Claims
1. A motion data redirection method, characterized in that, Includes the following steps: Get the first skeleton coordinates of the target character, the second skeleton coordinates of the original character, the first driving quaternion of the original character in the current frame, and the first root node coordinate information of the original character in the current frame. Also get the first full-body node coordinate information of the target character in the previous frame and the fourth full-body node coordinate information of the original character in the previous frame. Based on the first skeleton coordinates, the second skeleton coordinates, the first driving quaternion, and the first root node coordinate information, determine the temporary second full-body node coordinate information of the target character in the current frame; Based on the second skeleton coordinates, the first driving quaternion, and the first root node coordinate information, determine the third full-body node coordinate information of the original character in the current frame; Based on the first skeleton coordinates and the second skeleton coordinates, determine the weight ratio between the target character skeleton coordinates and the original character skeleton coordinates; Based on the third and fourth full-body node coordinate information, determine the first set of coordinate changes for all coordinates between consecutive frames of the original character. Based on the first set of coordinate changes, determine the node identifier with the smallest coordinate change. Based on the node identifier, the weight ratio, the first whole-body node coordinate information, the second whole-body node coordinate information, the third whole-body node coordinate information, and the fourth whole-body node coordinate information, determine the amount of motion change of the node corresponding to the node identifier in the target role; Based on the second full-body node coordinate information and the amount of motion change, adjust the first full-body node coordinate information of the target character in the current frame; The step of determining the temporary second full-body node coordinate information of the target character in the current frame based on the first skeleton coordinates, the second skeleton coordinates, the first driving quaternion, and the first root node coordinate information specifically includes: Extract the second skeleton node coordinates of any two adjacent nodes in the second skeleton coordinates of the original character and the first skeleton node coordinates of any two adjacent nodes in the first skeleton coordinates of the target character. Determine the skeleton matching quaternion based on the coordinates of the first skeleton node and the coordinates of the second skeleton node; Based on the first driving quaternion and the skeleton matching quaternion, determine the second driving quaternion of the target character in the current frame; Based on the first skeleton coordinates, the second driving quaternion, and the first root node coordinate information, determine the temporary second full-body node coordinate information of the target character in the current frame; The step of determining the skeleton matching quaternion based on the coordinates of the first skeleton node and the second skeleton coordinates specifically includes: The first skeleton vector is determined based on the coordinates of the first skeleton node; The second skeleton vector is determined based on the coordinates of the second skeleton nodes; Based on the first skeleton vector and the second skeleton vector, determine the angle between the first skeleton vector and the second skeleton vector, as well as the spatial normal vector. Determine the skeleton matching quaternion based on the included angle and the spatial normal vector; The step of determining the first set of coordinate changes for all coordinates between consecutive frames of the original character based on the third and fourth full-body node coordinate information specifically includes: The difference between the third full-body node coordinate information and the fourth full-body node coordinate information is used to obtain the first difference set of the original character's full-body coordinates for two consecutive frames. The absolute value of the first set of differences is used as the first set of coordinate changes for all coordinates between the two consecutive frames.
2. The motion data redirection method of claim 1, wherein, The step of determining the third full-body node coordinate information of the original character in the current frame based on the second skeleton coordinates, the first driving quaternion, and the first root node coordinate information specifically includes: Based on the second skeleton coordinates of the original character, the first driving quaternion of the original character in the current frame, the first root node coordinate information of the original character in the current frame, and the coordinate formula, the third full-body node coordinate information of the original character in the current frame is determined; wherein the coordinate formula is: in, Q represents the rotation matrix corresponding to the quaternion of the parent node. old Q is the first driving quaternion of the original character in the current frame. 1_old Q is the value of the first element in the quaternion; 2_old Q is the value of the second element in the quaternion; 3_old Q is the value of the third element in the quaternion; 4_old This represents the value of the fourth element in the quaternion. _old is the coordinate of the second skeleton. This refers to the coordinates of the first root node of the original character in the current frame. In the original character skeleton The coordinates of the node's previous adjacent node. The initial value is .
3. The motion data redirection method according to claim 1, characterized in that, The step of determining the motion change of the node corresponding to the node identifier in the target character based on the node identifier, the weight ratio, the first full-body node coordinate information, the second full-body node coordinate information, the third full-body node coordinate information, and the fourth full-body node coordinate information specifically includes: Determine that the current frame's ranking in the animation is greater than or equal to the second frame. Based on the node identifier, the weight ratio, the first full-body node coordinate information, the second full-body node coordinate information, the third full-body node coordinate information, the fourth full-body node coordinate information, and the first formula for change, determine the X-axis and Y-axis motion changes of the node corresponding to the node identifier in the target character. The first formula for change includes: in P is the change in motion. The X-axis or Y-axis coordinate of a single node in the first full-body node coordinate information corresponding to the node identifier. The X-axis or Y-axis coordinate of a single node in the second full-body node coordinate information corresponding to the node identifier. The X-axis or Y-axis coordinate of a single node in the third full-body node coordinate information corresponding to the node identifier. for , The weighted ratio of the target character's skeleton coordinates to the original character's skeleton coordinates; Based on the Z-axis coordinates of the root node in the third full-body node coordinate information, the Z-axis coordinates of the root node in the second full-body node coordinate information, and the weight ratio of the target character skeleton coordinates to the original character skeleton coordinates, the Z-axis motion change of the node corresponding to the node identifier in the target character is determined.
4. The motion data redirection method according to claim 1, characterized in that, The step of adjusting the first full-body node coordinate information of the target character in the current frame based on the second full-body node coordinate information and the motion change amount specifically includes: The sum of the second whole-body node coordinate information and the motion change amount is determined as the first whole-body node coordinate information of the current frame.
5. A system for implementing the motion data redirection method as described in any one of claims 1-4, characterized in that, include: The acquisition unit is used to acquire the first skeleton coordinates of the target character, the second skeleton coordinates of the original character, the first driving quaternion of the original character in the current frame, and the first root node coordinate information of the original character in the current frame, as well as to acquire the first full-body node coordinate information of the target character in the previous frame and the fourth full-body node coordinate information of the original character in the previous frame. The first processing unit is used to determine the temporary second full-body node coordinate information of the target character in the current frame based on the first skeleton coordinates, the second skeleton coordinates, the first driving quaternion, and the first root node coordinate information. The second processing unit is used to determine the third full-body node coordinate information of the original character in the current frame based on the second skeleton coordinates, the first driving quaternion and the first root node coordinate information. The third processing unit is used to determine the weight ratio of the target character skeleton coordinates to the original character skeleton coordinates based on the first skeleton coordinates and the second skeleton coordinates. The fourth processing unit is used to determine the first set of coordinate changes of all coordinates between consecutive frames of the original character based on the third full-body node coordinate information and the fourth full-body node coordinate information. The fifth processing unit is used to determine the node identifier with the smallest coordinate change based on the first set of coordinate changes. The sixth processing unit is used to determine the amount of motion change of the node corresponding to the node identifier in the target role based on the node identifier, the weight ratio, the first whole-body node coordinate information, the second whole-body node coordinate information, the third whole-body node coordinate information, and the fourth whole-body node coordinate information. The adjustment unit is used to adjust the first full-body node coordinate information of the target character in the current frame based on the second full-body node coordinate information and the amount of motion change.
6. A motion data redirection device, characterized in that... include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements a motion data redirection method as described in any one of claims 1-4.
7. A storage medium storing processor-executable instructions, characterized in that, The processor-executable instructions, when executed by the processor, are used to perform a motion data redirection method as described in any one of claims 1-4.