Method and system for generating motion of a movie animation character in combination with a physics engine
By combining a physics engine to physically simulate and dynamically adjust the movements of characters in film and animation, the problems of low efficiency and lack of realism in existing technologies have been solved, generating more physical and coherent action sequences, thereby improving the quality of film and animation and enhancing the audience's immersion.
Patent Information
- Application Number
- CN202510634055.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2045-05-16
AI Technical Summary
Existing methods for generating character motion in film and animation are inefficient and lack realism and physical plausibility, making it difficult to meet the demands of high-quality, high-efficiency animation production.
The initial action sequence is physically simulated using a physics engine, dynamically adjusted based on motion constraints, and the action continuity is verified and the physical compliance is scored to generate the final action sequence.
The generated motion sequences are more in line with the rules of real physics, improving the fluidity and realism of the animated characters' movements, and enhancing the visual effects and immersion of film and animation works.
Smart Images

Figure CN120580327B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of film and television production, in particular to a film and television animation character motion generation method and system combined with a physical engine. BACKGROUND
[0002] In the field of film and television animation production, character motion generation is a crucial link, and its quality directly affects the visual effect of the work and the audience's sense of immersion. Traditional film and television animation character motion generation methods mainly rely on animators manually drawing each frame or creating character motion through keyframe interpolation. Although manual frame-by-frame drawing can achieve high personalization and precise control, this method is extremely time-consuming and labor-intensive, and for complex motions and large-scale animation production projects, it is extremely inefficient, severely limiting the production progress and output of animation.
[0003] The keyframe interpolation method generates intermediate frames automatically through computer algorithms based on defined keyframes to achieve motion transition. However, the motion generated by this method often lacks realism and physical plausibility. Since it does not take into account the physical laws in the real world, the motion of the character may appear unreasonable, such as sudden changes in motion state without reasonable force, unrealistic collisions and interactions of objects during the motion process, etc. This makes the motion of the animation character appear stiff and mechanical, making it difficult for the audience to feel immersed.
[0004] In addition, some existing motion generation techniques attempt to introduce some simple rules to simulate physical effects, but these rules are often too simple and fixed, and cannot be flexibly adjusted according to different scenes and character characteristics. Moreover, they do not perform coherence verification and physical compliance assessment on the generated motion, resulting in local incoherence or non-compliance with physical laws in the generated motion, affecting the overall quality of the animation.
[0005] Under such circumstances, the existing film and television animation character motion generation methods have been unable to meet the needs of today's film and television industry for high-quality and efficient animation production, and an innovative motion generation method is urgently needed to solve the above problems. SUMMARY
[0006] In view of the above-mentioned problems, in combination with the first aspect of the present application, the present application provides a film and television animation character motion generation method combined with a physical engine, the method comprising:
[0007] obtaining an initial motion sequence of a target character, the initial motion sequence comprising a plurality of consecutive motion frames;
[0008] calling a physical engine to perform physical simulation processing on the initial motion sequence to obtain initial physical data corresponding to the initial motion sequence;
[0009] performing dynamic adjustment processing on the initial physical data based on a preset motion constraint condition, to generate an optimized motion sequence of the target character;
[0010] performing motion coherence verification processing on the optimized motion sequence, to determine a physical compliance score of the optimized motion sequence;
[0011] generating a motion fusion instruction according to the physical compliance score, and performing fusion processing on the optimized motion sequence and the initial motion sequence based on the motion fusion instruction, to generate a final motion sequence of the target character and output to an animation rendering system.
[0012] In a possible implementation of the first aspect, the calling of the physics engine to perform physical simulation processing on the initial motion sequence to obtain initial physical data corresponding to the initial motion sequence comprises:
[0013] extracting bone node position data and joint rotation angle data corresponding to each motion frame from the initial motion sequence, wherein a length unit in the bone node position data is a physics engine standard unit;
[0014] converting the bone node position data into a rigid body motion parameter set recognizable by the physics engine, the rigid body motion parameter set comprising mass distribution parameters, inertia tensor parameters, and collision volume parameters;
[0015] constructing a physical simulation scene based on the rigid body motion parameter set and the joint rotation angle data;
[0016] performing a multi-level motion simulation operation in the physical simulation scene, to calculate motion trajectory data and collision response data of the target character in the physical simulation scene;
[0017] generating the initial physical data corresponding to the initial motion sequence according to the motion trajectory data and the collision response data.
[0018] In a possible implementation of the first aspect, the converting of the bone node position data into a rigid body motion parameter set recognizable by the physics engine comprises:
[0019] determining a hierarchical connection relationship of each bone node based on a bone topology structure of the target character;
[0020] calculating mass distribution parameters of each bone node according to the hierarchical connection relationship, the mass distribution parameters comprising a mass transfer proportion of adjacent bone nodes and a joint support force distribution weight;
[0021] construct a mass distribution optimization equation under a condition of constraining total mass conservation of the target character based on the mass transfer ratio and the joint support force distribution weight;
[0022] obtain an inertia tensor parameter of each skeletal node by solving the mass distribution optimization equation, and determine a collision volume parameter of each skeletal node in a three-dimensional space based on the inertia tensor parameter.
[0023] In a possible implementation of the first aspect, the dynamic adjustment processing of the initial physical data based on the preset motion constraint condition to generate the optimized motion sequence of the target character includes:
[0024] obtain a biomechanics constraint condition of the target character, the biomechanics constraint condition including a joint activity angle threshold, a muscle contraction intensity threshold, and a center of gravity offset tolerance;
[0025] perform frame-by-frame filtering on the motion trajectory data according to the biomechanics constraint condition, and mark any motion frame in which a parameter of a joint activity angle, a muscle contraction intensity, or a center of gravity offset exceeds a threshold as a first abnormal frame set;
[0026] perform inverse dynamics calculation on collision response data in the first abnormal frame set to generate a joint torque correction parameter;
[0027] perform iterative adjustment on joint driving torque in the first abnormal frame set based on the joint torque correction parameter, and perform physical simulation again until updated motion trajectory data meet the biomechanics constraint condition, and then perform remapping processing on the updated motion trajectory data and skeletal node positions and joint rotation angles output by the physical engine to generate the optimized motion sequence.
[0028] In a possible implementation of the first aspect, the inverse dynamics calculation on the collision response data in the first abnormal frame set to generate the joint torque correction parameter includes:
[0029] extract contact point position data and contact force direction data of the target character and virtual environment objects from the collision response data;
[0030] determine a kinematic chain of affected skeletal nodes according to the contact point position data, and calculate a torque compensation value of each joint in the kinematic chain based on the contact force direction data;
[0031] construct an inverse dynamics optimization function with the torque compensation value as a constraint condition, solve the inverse dynamics optimization function by minimizing joint torque deviation, and obtain the joint torque correction parameter;
[0032] The joint torque correction parameter is applied as an external torque to a kinematic chain of the physics engine, and a joint driving parameter in the physics simulation scene is updated.
[0033] In a possible implementation of the first aspect, the action sequence is subjected to an action continuity verification process, and a physical compliance score of the optimized action sequence is determined, including:
[0034] The time interval of adjacent action frames in the optimized action sequence is extracted, and a ratio of the bone displacement difference data to the time interval is calculated as an average motion speed;
[0035] A motion smoothness score is generated based on a change rate of the average motion speed, and a time derivative of the joint rotation speed data is extracted to calculate a joint acceleration mutation index;
[0036] The motion smoothness score is compared with a preset smoothness threshold, and a second abnormal frame set in the optimized action sequence that is lower than the smoothness threshold is marked;
[0037] The joint acceleration mutation index corresponding to the second abnormal frame set is subjected to statistical analysis, and a physical compliance score of the second abnormal frame set is determined in combination with a preset mutation tolerance threshold;
[0038] If the physical compliance score is lower than a preset compliance threshold, a secondary adjustment process is performed on a rigid body motion parameter set in the second abnormal frame set, and a physical compliance score of the optimized action sequence is updated.
[0039] In a possible implementation of the first aspect, the secondary adjustment process performed on the rigid body motion parameter set in the second abnormal frame set includes:
[0040] A time derivative of the bone displacement difference data of adjacent action frames in the second abnormal frame set is obtained;
[0041] A mutation direction and a mutation amplitude of the bone displacement difference data are determined according to the time derivative;
[0042] Based on the mutation direction, an external force parameter applied to a target role in the physics simulation scene is adjusted, so that the direction of the adjusted force is opposite to the mutation direction;
[0043] Based on the mutation amplitude, the collision volume parameter is adjusted, so that the adjusted collision volume parameter reduces the joint acceleration mutation index;
[0044] The adjusted mass distribution parameter and the collision volume parameter are re-input into the physics engine for local physics simulation, and updated motion trajectory data are generated.
[0045] In a possible implementation of the first aspect, the generating the action fusion instruction according to the physical compliance score comprises:
[0046] comparing the physical compliance score of the optimized action sequence with the original fluency score of the initial action sequence to determine an action optimization gain coefficient;
[0047] if the action optimization gain coefficient is greater than a preset gain threshold, generating a first fusion instruction, the first fusion instruction indicating that action frames with a physical compliance score higher than the compliance threshold in the optimized action sequence are replaced by corresponding original action frames in the initial action sequence;
[0048] if the action optimization gain coefficient is less than or equal to the gain threshold, generating a second fusion instruction, the second fusion instruction indicating that action frames with a physical compliance score higher than the compliance threshold in the optimized action sequence are subjected to weighted superposition processing with corresponding original action frames in the initial action sequence;
[0049] performing the fusion processing according to the first fusion instruction or the second fusion instruction to generate the final action sequence.
[0050] In a possible implementation of the first aspect, the weighted superposition processing of the action frames with a physical compliance score higher than the compliance threshold in the optimized action sequence and the corresponding original action frames in the initial action sequence comprises:
[0051] determining a first weight coefficient of the action frames in the optimized action sequence according to a ratio of the physical compliance score to the original fluency score;
[0052] determining a second weight coefficient of the original action frames in the initial action sequence based on a difference between the action optimization gain coefficient and the gain threshold;
[0053] multiplying motion trajectory data of the action frames in the optimized action sequence by the first weight coefficient to obtain weighted optimized trajectory data;
[0054] multiplying motion trajectory data of the original action frames in the initial action sequence by the second weight coefficient to obtain weighted original trajectory data;
[0055] superimposing the weighted optimized trajectory data and the weighted original trajectory data frame by frame to generate fusion trajectory data of the final action sequence.
[0056] For example, in a possible implementation of the first aspect, after the final action sequence of the target character is generated and output to the animation rendering system, the method further comprises:
[0057] monitoring rendering feedback data of the final motion sequence in the animation rendering system in real time;
[0058] if the rendering feedback data contains a joint penetration warning or a motion distortion prompt, re-extracting an abnormal motion frame in the final motion sequence that triggers the warning;
[0059] re-inputting the bone node position data of the abnormal motion frame into the physics engine for constraint optimization processing to generate a replacement motion frame;
[0060] inserting the replacement motion frame into the final motion sequence, and performing physical compliance score verification and rendering simulation pre-checking on the updated final motion sequence, and if there is a residual abnormal frame, re-adjusting according to a preset maximum iteration number or a compliance score difference threshold of the residual abnormal frame until a termination condition is met.
[0061] In still another aspect, the present application also provides a film and television animation character motion generation system combined with a physics engine, comprising a processor, a machine readable storage medium, the machine readable storage medium and the processor are connected, the machine readable storage medium is used for storing programs, instructions or codes, and the processor is used for executing the programs, instructions or codes in the machine readable storage medium to realize the above-mentioned method.
[0062] Based on the above aspects, the present application obtains the initial motion sequence of the target character, calls the physics engine for physical simulation, dynamically adjusts based on the motion constraint condition, performs motion coherence verification and determines the physical compliance score, and performs motion fusion according to the physical compliance score, and a series of coherent and interrelated operations, comprehensively uses the physical engine simulation and the motion constraint adjustment, avoids the problems of lack of real physical feedback and difficulty in meeting the actual motion law in the traditional animation character motion generation, and generates an optimized motion sequence that is more consistent with the real physical rules. The motion coherence verification and the physical compliance score mechanism effectively guarantee the coherence and physical authenticity of the optimized motion sequence. Finally, the optimized motion sequence and the initial motion sequence are combined through motion fusion to generate a final motion sequence that not only retains the characteristics of the initial motion but also integrates the realism and rationality after the physical simulation and optimization adjustment, greatly improves the quality and realism of the film and television animation character motion, provides high-quality motion data for the animation rendering system, and enhances the visual effect and immersion of the film and television animation work. BRIEF DESCRIPTION OF DRAWINGS
[0063] Figure 1 is an execution flow schematic diagram of the film and television animation character motion generation method combined with the physics engine provided by the embodiment of the present application.
[0064] Figure 2is a schematic diagram of exemplary hardware and software components of a system for generating a motion of a character in a movie or TV animation combined with a physical engine according to an embodiment of the present application. DETAILED DESCRIPTION
[0065] The present application will be described in detail below with reference to the accompanying drawings, Figure 1 is a flowchart of a method for generating a motion of a character in a movie or TV animation combined with a physical engine according to an embodiment of the present application. The method for generating a motion of a character in a movie or TV animation combined with a physical engine will be described in detail below.
[0066] Step S110: obtaining an initial motion sequence of a target character, the initial motion sequence comprising a plurality of consecutive motion frames.
[0067] In the context of movie or TV animation production, in order to generate a reasonable motion of a target character, an initial motion sequence of the target character is first obtained. The initial motion sequence is composed of a series of consecutive motion frames, each of which records the pose and position information of the target character at a specific time. There are various ways to obtain the initial motion sequence, and the common ones are through motion capture technology and manual keyframe setting.
[0068] In detail, if the motion capture technology is used, a special motion capture device such as an optical motion capture system or an inertial motion capture system can be used. The optical motion capture system uses a plurality of high-speed cameras to capture the motion trajectories of marker points attached to the key parts of the actor's body. Assuming that the position data of the marker points are represented by the letter A, at a certain time t, each marker point will have corresponding three-dimensional space coordinate data (Ax, Ay, Az). With the passage of time, the position data of these marker points will change constantly, forming a time sequence. By processing and converting the position data of these marker points, the motion information of the target character can be obtained. For humanoid characters, the marker points are usually placed on the head, shoulders, elbows, wrists, hips, knees, and ankles, etc. By recording the positions of these marker points at different times, the actor's motion can be reconstructed and mapped to the target character.
[0069] If it is a manual keyframe setting, an animator will adjust the pose of the target character frame by frame in animation software according to design requirements. In the software, the body parts of the character can usually be changed in position and angle by rotation, translation and other operations. Assuming that the rotation angle of a joint of the character is represented by the letter B, the animator will set different B values on different keyframes according to the plot and action design. For example, in a sword swinging action, the rotation angle B1 of the joint at the beginning corresponds to the pose of the character holding the sword, and during the sword swinging process, the rotation angle B2 of the joint at the intermediate frame gradually increases, and at the end of the sword swinging, the rotation angle B3 of the joint returns to a suitable value. By setting these parameters on the keyframes, the software will automatically interpolate the intermediate frames to generate continuous action frames, thus forming an initial action sequence.
[0070] Regardless of the way to obtain the initial action sequence, it is necessary to ensure that the information contained in each action frame can accurately describe the pose and position of the target character. The above information can include the position of the bone node, the rotation angle of the joint, etc. For example, for a quadruped character, each action frame can contain the position information of the head, neck, shoulder, elbow, wrist, hip, knee, ankle and other bone nodes, as well as the rotation angle information of each joint. These information constitutes a multi-dimensional data set, and the data sets of each action frame are related to each other, forming a continuous action sequence.
[0071] Step S120: calling a physics engine to perform physical simulation processing on the initial action sequence to obtain initial physical data corresponding to the initial action sequence.
[0072] After obtaining the initial action sequence of the target character, the next step is to call a physics engine to perform physical simulation processing on the initial action sequence to obtain the corresponding initial physical data. The physics engine can simulate the motion and interaction of objects in a real physical environment, adding realism to the action of the animation character.
[0073] Step S121: extracting bone node position data and joint rotation angle data corresponding to each action frame from the initial action sequence, wherein the length unit of the bone node position data is a standard unit of the physics engine.
[0074] In order to perform physical simulation, key information needs to be extracted from the initial action sequence, i.e. bone node position data and joint rotation angle data corresponding to each action frame. Bone node position data describes the position of each node in the three-dimensional space of the character's skeletal system, while joint rotation angle data represents the rotation state of the joint.
[0075] When extracting the bone node position data, ensure that its length unit is in the standard unit of the physics engine. Different physics engines may have different standard units, such as meters, centimeters, etc. Assuming that the standard unit of the physics engine is meters, when extracting the bone node position data, the length unit of the original data needs to be converted to meters. If the length unit of the original data is centimeters, it needs to be divided by 100 for unit conversion. Taking a humanoid character as an example, its skeletal system contains multiple bone nodes, such as head node, shoulder node, elbow node, etc. Each bone node has corresponding three-dimensional coordinates (x, y, z) in each action frame, and these coordinate values are the bone node position data.
[0076] Joint rotation angle data reflects the rotation of the joint. For a joint, its rotation angle can be represented by Euler angles (rotation angles around X, Y, Z axes) or quaternions. Assuming that the joint rotation angle is represented by Euler angles, each joint will have three angle values (α, β, γ) in each action frame, representing the rotation angles around the X, Y, Z axes. By extracting the rotation angle data of all joints in each action frame, complete joint rotation angle information can be obtained.
[0077] Step S122: Convert the bone node position data into a set of rigid body motion parameters recognizable by the physics engine, including mass distribution parameters, inertia tensor parameters, and collision volume parameters.
[0078] After obtaining the bone node position data, it needs to be converted into a set of rigid body motion parameters recognizable by the physics engine, which includes mass distribution parameters, inertia tensor parameters, and collision volume parameters.
[0079] Step S1221: Determine the hierarchical connection relationship of each bone node based on the skeletal topology structure of the target character.
[0080] The skeletal topology structure of the target character describes the connection method and hierarchical relationship between bone nodes. Taking a humanoid character as an example, its skeletal topology structure is usually a tree structure, with the head node connected to the neck node, the neck node connected to the shoulder node, and the shoulder node connected to the elbow node and wrist node, etc. By analyzing the skeletal topology structure, the hierarchical connection relationship of each bone node can be determined. Assuming that the bone node is represented by the letter C, C1 represents the head node, C2 represents the neck node, C3 represents the shoulder node, etc., the hierarchical relationship can be determined by recording the connection relationship between these nodes, such as C1 connected to C2, C2 connected to C3, etc. This hierarchical relationship is very important for subsequent calculation of mass distribution parameters, etc., because bone nodes at different levels will affect each other when moving.
[0081] Step S1222: calculating quality distribution parameters of each skeleton node according to the hierarchical connection relationship, the quality distribution parameters including mass transfer proportions of adjacent skeleton nodes and joint support force distribution weights.
[0082] After determining the hierarchical connection relationship of the skeleton nodes, the quality distribution parameters of each skeleton node can be calculated according to the hierarchical connection relationship. The quality distribution parameters mainly include the mass transfer proportions of adjacent skeleton nodes and the joint support force distribution weights.
[0083] The mass transfer proportion of adjacent skeleton nodes represents the distribution of the mass of a skeleton node among adjacent nodes. Assuming that the mass of the skeleton node Ci is Mi, and it is connected to the adjacent skeleton nodes Cj and Ck, the mass of Ci will be distributed to Cj and Ck according to a certain proportion. This proportion can be determined according to the physical properties and motion relationship of the skeleton. For example, in the arm of a humanoid character, the mass of the shoulder node may be distributed to the elbow node and the wrist node according to a certain proportion, which may be related to the muscle distribution and joint range of motion of the arm.
[0084] The joint support force distribution weight reflects the proportion of the force borne by the joint when supporting the skeleton nodes. For two skeleton nodes connected by a joint, the joint needs to bear the interaction force between them. Different joints have different support force distribution weights in different motion states. For example, when the character is standing, the support force distribution weight of the hip joint may be larger because it needs to support the weight of the upper body; when the character swings the arm, the support force distribution weight of the shoulder joint changes according to the motion of the arm. By analyzing the hierarchical connection relationship and motion state of the skeleton nodes, the support force distribution weight of each joint can be calculated.
[0085] Step S1223: constructing a quality distribution optimization equation based on the mass transfer proportions and the joint support force distribution weights, under the condition of constraining the total mass conservation of the target character.
[0086] After obtaining the mass transfer proportions of adjacent skeleton nodes and the joint support force distribution weights, a quality distribution optimization equation needs to be constructed under the condition of constraining the total mass conservation of the target character. The total mass of the target character is a fixed value, denoted as M. The mass distribution of each skeleton node needs to satisfy the condition of total mass conservation, i.e., the sum of the masses of all skeleton nodes is equal to M.
[0087] According to the mass transfer proportion and the joint support force distribution weight, an equation set about the mass of each skeletal node can be established. Assuming that there are n skeletal nodes, and their masses are M1, M2, …, Mn respectively. The mass distribution of each skeletal node is affected by the mass transfer proportion of adjacent nodes and the joint support force distribution weight. For example, for skeletal node Ci, its mass Mi can be expressed as a function related to the mass of adjacent nodes and the mass transfer proportion, and also considering the influence of the joint support force distribution weight on its mass distribution. By establishing the mass relationship of all skeletal nodes and combining the total mass conservation condition, a mass distribution optimization equation can be obtained. The purpose of the mass distribution optimization equation is to find an optimal mass distribution scheme under the premise of satisfying the total mass conservation, so that the motion of the character is more consistent with the physical law.
[0088] Step S1224: obtaining the inertia tensor parameters of each skeletal node by solving the mass distribution optimization equation, and determining the collision volume parameters of each skeletal node in three-dimensional space based on the inertia tensor parameters.
[0089] Solving the mass distribution optimization equation can obtain the mass distribution of each skeletal node, and further obtain the inertia tensor parameters of each skeletal node. Inertia tensor is a physical quantity that describes the inertia of a rigid body when rotating around different axes. For a rigid body, its inertia tensor can be represented by a 3x3 matrix. After obtaining the mass and position information of each skeletal node, the inertia tensor parameters of each skeletal node can be calculated according to the calculation formula of inertia tensor.
[0090] Based on the inertia tensor parameters, the collision volume parameters of each skeletal node in three-dimensional space can be determined. Collision volume parameters describe the volume and shape occupied by skeletal nodes in three-dimensional space, which are used to detect collisions in physical simulation. For example, for a spherical skeletal node, its collision volume parameters can be represented by a radius; for a cuboid-shaped skeletal node, its collision volume parameters can be represented by length, width and height. By analyzing the shape and motion range of the skeletal node, combined with the inertia tensor parameters, appropriate collision volume parameters can be determined, so that the collision between skeletal nodes can be accurately detected in physical simulation.
[0091] Step S123: constructing a physical simulation scene based on the set of rigid body motion parameters and the joint rotation angle data.
[0092] After obtaining the set of rigid body motion parameters and the joint rotation angle data, a physical simulation scene can be constructed based on these data. The physical simulation scene is the environment for simulation by the physical engine, which contains the rigid body information and motion information of the target character.
[0093] The mass distribution parameter, the inertia tensor parameter, and the collision volume parameter in the rigid body motion parameter set are applied to each bone node of the target character to determine the physical properties of each bone node. At the same time, the joint rotation angle data is applied to the joints to determine the initial state of the joints. For example, in a physical simulation scene, each bone node of a humanoid character has corresponding mass, inertia tensor, and collision volume, and each joint has corresponding rotation angle. Through these information, the physical engine can simulate the motion of the character in the physical environment.
[0094] In addition, other parameters of the physical simulation scene need to be set, such as gravity and friction. The gravity parameter determines the direction and size of the gravity acting on the character in the scene, and the friction parameter affects the friction between the character and the ground or other objects. By reasonably setting these parameters, the physical simulation scene can be made more realistic.
[0095] Step S124: performing a multi-level motion simulation operation in the physical simulation scene to calculate the motion trajectory data and collision response data of the target character in the physical simulation scene.
[0096] After the physical simulation scene is constructed, a multi-level motion simulation operation can be performed in the scene to calculate the motion trajectory data and collision response data of the target character in the physical simulation scene.
[0097] The multi-level motion simulation operation takes into account the hierarchical structure of the character's skeletal system and the motion relationship of the joints. Starting from the bottommost bone node, its motion state is calculated according to its physical properties and the forces acting on it. Then, according to the hierarchical connection relationship, the motion of the bottom bone node is transmitted to the upper bone node, and the motion state of each bone node is calculated in turn. For example, in the motion simulation of the arm of a humanoid character, the motion of the wrist node is calculated first, then the motion of the wrist node is transmitted to the elbow node, and then to the shoulder node, and finally the motion state of the whole arm is obtained.
[0098] During the simulation process, the physical engine will continuously detect the collision between the bone nodes and between the bone nodes and other objects in the scene. When a collision occurs, the collision response data will be calculated according to the type and physical properties of the collision. The collision response data includes information such as the time and position of the collision, the size and direction of the collision force. For example, when the foot of the character collides with the ground, the physical engine will calculate the time and position of the collision, as well as the size and direction of the reaction force exerted by the ground on the foot.
[0099] Through continuous iteration calculation, the motion trajectory data of the target character in the physical simulation scene can be obtained. The motion trajectory data records the position and posture information of each bone node at different time, which is an important basis for subsequent analysis and optimization.
[0100] Step S125: generating initial physical data corresponding to the initial action sequence according to the motion trajectory data and the collision response data.
[0101] After obtaining the motion trajectory data and the collision response data, the initial physical data corresponding to the initial action sequence can be generated according to these data. The initial physical data is a comprehensive description of the motion of the target character in the physical simulation scene, which contains the motion trajectory data and the collision response data.
[0102] Integrate the motion trajectory data and the collision response data to form a complete data set. The data set can be represented as a multi-dimensional array, where each element contains the motion trajectory information and the collision response information at a certain time. For example, at a certain time t, the initial physical data may contain the position coordinates, velocity, acceleration of each bone node, and collision-related information such as the colliding object, the size and direction of the collision force, etc.
[0103] By generating the initial physical data, a basis can be provided for subsequent action optimization. The initial physical data reflects the real motion of the target character in the physical environment, and through analysis and processing of these data, places in the initial action sequence that do not conform to the physical laws can be found and adjusted accordingly.
[0104] Step S130: dynamically adjusting the initial physical data based on preset motion constraints to generate the optimized action sequence of the target character.
[0105] After obtaining the initial physical data, it needs to be dynamically adjusted based on the preset motion constraints to generate the optimized action sequence of the target character. The preset motion constraints are set according to the biomechanical characteristics of the target character and the requirements of animation production, which can ensure that the action of the character conforms to the physical laws and the requirements of animation design.
[0106] Step S131: obtaining the biomechanical constraints of the target character, including joint activity angle threshold, muscle contraction intensity threshold, and center of gravity offset tolerance.
[0107] In order to reasonably adjust the initial physical data, the biomechanical constraints of the target character need to be obtained first. The biomechanical constraints are set based on the biomechanical characteristics of the human body or animals, which include joint activity angle threshold, muscle contraction intensity threshold, and center of gravity offset tolerance.
[0108] The joint movement angle threshold defines the range of angles within which the joint can move normally. Different joints have different movement angle limits, for example, the elbow joint of a human can usually only bend and stretch within a certain angle range. Assuming the movement angle of a joint is represented by the letter D, for a certain joint, its movement angle threshold can be represented as an angle interval [Dmin, Dmax], within which the movement of the joint is normal, and beyond which it may cause damage to the body or unnatural movement.
[0109] The muscle contraction strength threshold reflects the maximum contraction strength that the muscle can withstand. When the muscle contracts, it generates strength, but if the contraction strength is too large, it may cause muscle fatigue or injury. Let the muscle contraction strength be represented by the letter E, and its threshold can be represented as Emax, when the muscle contraction strength exceeds Emax, adjustment is needed.
[0110] The center of gravity offset tolerance refers to the maximum offset range of the center of gravity of the character during movement. The stability of the center of gravity is very important for the balance and normal movement of the character. Assuming the position of the center of gravity of the character is represented by the letter F, the center of gravity offset tolerance can be represented as a distance value G, when the offset distance of the center of gravity exceeds G, the character may lose balance.
[0111] Step S132: According to the biomechanical constraint conditions, the motion trajectory data is screened frame by frame, and any parameter exceeding the joint movement angle, muscle contraction strength and center of gravity offset in the motion frame is marked as the first abnormal frame set.
[0112] After obtaining the biomechanical constraint conditions, the motion trajectory data needs to be screened frame by frame according to these conditions. The motion trajectory data records the posture and movement information of the character in each motion frame, and by analyzing these information, it can be judged whether each motion frame meets the biomechanical constraint conditions.
[0113] For each motion frame, the parameters such as joint movement angle, muscle contraction strength and center of gravity offset are extracted. These parameters are compared with the corresponding biomechanical constraint conditions. If the joint movement angle exceeds the joint movement angle threshold, or the muscle contraction strength exceeds the muscle contraction strength threshold, or the center of gravity offset exceeds the center of gravity offset tolerance, then the motion frame is marked as an abnormal frame.
[0114] All motion frames marked as abnormal frames are collected to form the first abnormal frame set. The motion frames in the first abnormal frame set need to be further processed to meet the biomechanical constraint conditions.
[0115] Step S133: The collision response data in the first abnormal frame set is subjected to inverse dynamics calculation to generate joint torque correction parameters.
[0116] For the action frames in the first set of abnormal frames, inverse dynamics calculations need to be performed on their collision response data to generate joint torque correction parameters. Inverse dynamics calculations work by calculating the torque required by the joints to achieve the motion based on the object's motion state and the external forces acting on it.
[0117] Step S1331: Extract the contact point location data and contact force direction data between the target character and the virtual environment object from the collision response data.
[0118] Before performing inverse dynamics calculations, key information needs to be extracted from the collision response data, namely the contact point location data and contact force direction data between the target character and the virtual environment object. The contact point location data describes the specific location where the character collides with the virtual environment object, while the contact force direction data indicates the direction of the external force experienced during the collision.
[0119] Assuming the contact point location is represented by the letter H, which is a three-dimensional coordinate (Hx, Hy, Hz), indicating the contact point's position in three-dimensional space, and the contact force direction is represented by the letter I, which can be represented by a unit vector indicating the direction of the contact force, detailed collision information can be obtained by extracting the contact point location data and contact force direction data for each collision event.
[0120] Step S1332: Determine the kinematic chain of the affected bone node based on the contact point location data, and calculate the torque compensation value of each joint in the kinematic chain based on the contact force direction data.
[0121] Based on the contact point location data, the kinematic chain of the affected skeletal nodes can be determined. A kinematic chain refers to a series of skeletal nodes and joints that start from the skeletal node at the contact point and trace upwards along the hierarchical connections of the skeletal system back to the root node. For example, when a character's foot collides with the ground, the kinematic chain of the affected skeletal nodes might include the foot node, ankle node, knee node, hip node, etc.
[0122] Based on contact force direction data, the torque compensation value for each joint in the kinematic chain can be calculated. The torque compensation value is the additional torque required to balance the effect of contact forces on the joint. For each joint in the kinematic chain, the required torque compensation value can be calculated based on the magnitude and direction of the contact force and the distance from the contact point to the joint. Let the torque compensation value of a joint be represented by the letter J, which is related to the magnitude and direction of the contact force and the distance from the contact point to the joint. The magnitude of the contact force can be denoted as K, and the distance from the contact point to the joint as L. The calculation of the torque compensation value J for each joint in the kinematic chain must consider the vector characteristics of the force. First, the contact force direction I is cross-multiplied by the position vector from the contact point to the joint (this vector is obtained by subtracting the joint position from the contact point position H). The cross-multiplication yields a new vector whose direction follows the right-hand rule, and whose magnitude depends on the contact force magnitude K and the perpendicular distance from the contact point to the joint. This perpendicular distance is the projection of the distance L from the contact point to the joint onto the direction perpendicular to the contact force. Through this calculation, the torque generated by the contact force at each joint can be obtained. However, since joint movement is also affected by other factors, the calculated torque needs to be corrected based on factors such as the type of joint, the position of the joint in the kinematic chain, and the muscle and bone structure around the joint, so as to finally obtain the torque compensation value J of the joint.
[0123] Step S1333: Construct a reverse dynamics optimization function with the torque compensation value as a constraint, and solve the reverse dynamics optimization function by minimizing the joint torque deviation to obtain the joint torque correction parameters.
[0124] After obtaining the torque compensation values for each joint in the kinematic chain, an inverse dynamics optimization function is constructed using these torque compensation values as constraints. The purpose of the inverse dynamics optimization function is to find a set of joint torques such that, while satisfying the torque compensation value constraints, the joint motion can better conform to the laws of physics and biomechanical constraints.
[0125] Let M represent the joint torque. The joint torque deviation can be defined as the difference between the actual joint torque and the ideal joint torque. The ideal joint torque refers to the torque that a joint should possess under the conditions of satisfying torque compensation constraints and biomechanical constraints. The inverse dynamics optimization function can be expressed as a function of the joint torque M, and its objective is to minimize the joint torque deviation.
[0126] To solve the inverse dynamics optimization function, optimization algorithms such as gradient descent and Newton's method can be used. These algorithms iterate continuously, adjusting the value of the joint torque M to gradually reduce the joint torque deviation until a minimum value that meets the requirements is reached. During the iteration process, it is necessary to continuously check whether the joint torque meets the torque compensation value constraint and biomechanical constraint conditions. If not, the joint torque needs to be adjusted to meet the constraint conditions.
[0127] By solving the inverse dynamics optimization function, the joint torque correction parameters can be obtained. These parameters represent the amount of correction needed to the joint torque in order to make the character's movements conform to physical laws and biomechanical constraints.
[0128] Step S1334: Apply the joint torque correction parameters as external torques to the kinematics chain of the physics engine to update the joint drive parameters in the physical simulation scene.
[0129] After obtaining the joint torque correction parameters, they are applied as external torques to the kinematics chain of the physics engine. The kinematics chain of the physics engine describes the connections and motion relationships between the joints in the character's skeletal system. By applying the joint torque correction parameters to the corresponding joints in the kinematics chain, the force conditions on the joints can be changed, thereby affecting the joint's motion.
[0130] In a physics simulation scenario, joint actuation parameters determine the motion state of a joint. These parameters include joint angles, angular velocities, and angular accelerations. After applying joint torque correction parameters as external torques to the joint, the physics engine recalculates the joint's motion state and updates the joint actuation parameters based on Newton's second law and rigid body dynamics principles.
[0131] For example, when a joint is subjected to an additional torque, its angular acceleration changes, which in turn alters its angular velocity and angle. The physics engine iterates through these calculations until a stable motion state is reached. By updating the joint drive parameters, the character's movements can be made more consistent with physical laws and biomechanical constraints.
[0132] Step S134: Iteratively adjust the joint drive torque in the first abnormal frame set based on the joint torque correction parameters, and re-execute the physical simulation until the updated motion trajectory data meets the biomechanical constraints. Then, remap the updated motion trajectory data with the bone node positions and joint rotation angles output by the physics engine to generate the optimized motion sequence.
[0133] Based on the joint torque correction parameters, the joint drive torque in the first set of abnormal frames is iteratively adjusted. Joint drive torque is a key parameter for controlling joint motion; by adjusting the joint drive torque, the motion state of the joint can be changed.
[0134] In each iteration, joint torque correction parameters are applied to the joint drive torque to obtain the adjusted joint drive torque. Then, the physics simulation is re-executed using the adjusted joint drive torque. The physics simulation calculates the character's motion trajectory data based on the adjusted joint drive torque.
[0135] After re-running the physics simulation, check whether the updated motion trajectory data meets the biomechanical constraints. If not, adjust the joint drive torque again and repeat the physics simulation process until the updated motion trajectory data meets the biomechanical constraints.
[0136] Once the updated motion trajectory data meets the biomechanical constraints, it is remapped to the skeletal node positions and joint rotation angles output by the physics engine. This remapping process accurately converts the information in the motion trajectory data into skeletal node positions and joint rotation angles to ensure the character's movements are correctly rendered in the animation.
[0137] Through remapping, an optimized motion sequence for the target character is generated. The motion frames in the optimized motion sequence are more in line with physical laws and biomechanical constraints, making the character's movements more natural and realistic.
[0138] Step S140: Perform action coherence verification processing on the optimized action sequence to determine the physical compliance score of the optimized action sequence.
[0139] After generating the optimized action sequence, it needs to undergo motion coherence verification to determine its physical compliance score. Motion coherence verification checks the smoothness and physical plausibility of the actions in the optimized action sequence, ensuring that the character's movements are both visually and physically reasonable.
[0140] Step S141: Extract the time interval between adjacent action frames in the optimized action sequence, and calculate the ratio of the bone displacement difference data to the time interval as the average motion speed.
[0141] To evaluate the coherence of the action, the time interval between adjacent action frames in the optimized action sequence is first extracted. The time interval reflects the time span between adjacent action frames, and is denoted by the letter N.
[0142] Simultaneously, the bone displacement difference data between adjacent action frames is calculated. The bone displacement difference data describes the changes in the position of bone nodes in adjacent action frames, and the bone displacement difference is denoted by the letter P.
[0143] Dividing the bone displacement difference data P by the time interval N yields the average motion velocity. The average motion velocity reflects the average speed of bone nodes movement between adjacent action frames. By calculating the average motion velocity between each adjacent action frame, the motion velocity information of bone nodes throughout the entire optimized action sequence can be obtained.
[0144] Step S142: Generate a motion smoothness score based on the rate of change of the average motion velocity, and extract the time derivative of the joint rotation velocity data to calculate the joint acceleration mutation index.
[0145] A motion smoothness score is generated based on the rate of change of average motion velocity. The rate of change of average motion velocity reflects the changes in the motion velocity of skeletal nodes. If the rate of change is too large, it indicates that the motion velocity changes too drastically, and the movement is not smooth enough.
[0146] Let the average motion velocity be represented by the letter Q. Its rate of change can be obtained by calculating the ratio of the difference in average motion velocity at adjacent time points to the time interval. Based on the rate of change of the average motion velocity, a scoring function can be designed to map the rate of change to a score value, resulting in a motion smoothness score. The higher the motion smoothness score, the smoother the motion.
[0147] Simultaneously, the time derivative of the joint rotational velocity data is extracted to calculate the joint acceleration abrupt change index. Joint rotational velocity data describes the speed of joint rotation during movement; let's denote joint rotational velocity as R. The time derivative of joint rotational velocity reflects the rate of change of joint rotational velocity, i.e., joint acceleration. If joint acceleration changes significantly within a short period, it indicates an abrupt change in joint movement, resulting in less smooth motion.
[0148] By calculating the time derivative of joint rotational velocity data and performing statistical analysis, the joint acceleration mutation index can be obtained. The joint acceleration mutation index can measure the stability and smoothness of joint movement.
[0149] Step S143: Compare the motion smoothness score with a preset smoothness threshold, and mark the second abnormal frame set in the optimized motion sequence that is lower than the smoothness threshold.
[0150] The motion smoothness score is compared with a preset smoothness threshold. The preset smoothness threshold is a standard value set according to the requirements of animation production and physical laws, denoted by the letter S.
[0151] If the motion smoothness score is lower than the smoothness threshold S, it indicates that the motion of the action frame is not smooth enough and requires further processing. All action frames with motion smoothness scores lower than the smoothness threshold are marked to form a second set of abnormal frames. Action frames in this second set of abnormal frames may have problems such as disjointed motion or excessively abrupt speed changes.
[0152] Step S144: Perform statistical analysis on the joint acceleration mutation index corresponding to the second abnormal frame set, and determine the physical compliance score of the second abnormal frame set in combination with the preset mutation tolerance threshold.
[0153] Statistical analysis is performed on the joint acceleration mutation index corresponding to the second set of abnormal frames. Statistical analysis may include calculating the mean, standard deviation, and other statistical measures of the joint acceleration mutation index to understand the overall situation of joint acceleration mutations.
[0154] Based on a preset mutation tolerance threshold, the physical compliance score of the second set of abnormal frames is determined. The preset mutation tolerance threshold is a maximum value allowed for sudden changes in joint acceleration, set according to physical laws and animation production requirements, and is denoted by the letter T.
[0155] If the joint acceleration mutation index exceeds the mutation tolerance threshold T, it indicates that the joint motion of the animation frame has a large abrupt change, resulting in poor physical compliance. Based on the relationship between the joint acceleration mutation index and the mutation tolerance threshold, a scoring function can be designed to map the joint acceleration mutation index to a score value, thus obtaining the physical compliance score of the second set of abnormal frames. The higher the physical compliance score, the more the animation frame conforms to physical laws and animation production requirements.
[0156] Step S145: If the physical compliance score is lower than the preset compliance threshold, then the rigid body motion parameter set in the second abnormal frame set is adjusted a second time to update the physical compliance score of the optimized action sequence.
[0157] If the physical compliance score of the second abnormal frame set is lower than the preset compliance threshold, it means that there are still parts of the motion frames in the set that do not conform to physical laws and animation production requirements, and they need to be adjusted and processed again.
[0158] The preset compliance threshold is a standard value set according to the quality requirements of animation production, denoted by the letter U. When the physical compliance score is lower than the compliance threshold U, the rigid body motion parameter set in the second abnormal frame set needs to be adjusted.
[0159] Step S1451: Obtain the time derivative of the bone displacement difference data of adjacent action frames in the second abnormal frame set.
[0160] To perform secondary adjustment, the temporal derivative of the skeletal displacement difference data between adjacent action frames in the second abnormal frame set is first obtained. The temporal derivative of the skeletal displacement difference data reflects the rate of change of skeletal displacement, denoted by the letter V.
[0161] By calculating the ratio of the difference in skeletal displacement data between adjacent action frames to the time interval, the temporal derivative of the skeletal displacement difference data can be obtained. This temporal derivative can help understand the changing trend of skeletal movement and provide a basis for subsequent adjustments.
[0162] Step S1452: Determine the direction and magnitude of the abrupt change in the bone displacement difference data based on the time derivative.
[0163] Based on the time derivative V of the bone displacement difference data, the direction and magnitude of the abrupt change in the bone displacement difference data can be determined. The direction of the abrupt change indicates the direction of the bone displacement change, and the magnitude of the abrupt change indicates the magnitude of the bone displacement change.
[0164] If the time derivative V is positive, it indicates that the bone displacement is increasing, and the direction of the mutation is positive; if the time derivative V is negative, it indicates that the bone displacement is decreasing, and the direction of the mutation is negative. The magnitude of the mutation can be represented by the absolute value of the time derivative V; the larger the absolute value, the greater the magnitude of the mutation.
[0165] Step S1453: Adjust the external force parameters applied to the target character in the physical simulation scene based on the mutation direction, so that the adjusted force direction is opposite to the mutation direction.
[0166] Based on the abrupt change direction of the skeletal displacement difference data, the external force parameters applied to the target character in the physical simulation scene are adjusted. These external force parameters include gravity, friction, and thrust, and are denoted by the letter W.
[0167] To reduce abrupt changes in bone displacement, the adjusted force needs to be directed in the opposite direction to the abrupt change. For example, if the abrupt change is in the positive direction, meaning bone displacement is increasing, a counterforce needs to be applied to slow down the bone's movement; if the abrupt change is in the negative direction, meaning bone displacement is decreasing, a positive force needs to be applied to accelerate the bone's movement.
[0168] By adjusting the parameters of external forces, the motion state of the target character can be changed, abrupt changes in bone displacement can be reduced, and the continuity of the action can be improved.
[0169] Step S1454: Adjust the collision volume parameter based on the abrupt change amplitude, so that the adjusted collision volume parameter reduces the joint acceleration abrupt change index.
[0170] The collision volume parameter is adjusted based on the abrupt change amplitude of the bone displacement difference data. The collision volume parameter describes the volume and shape occupied by the bone node in three-dimensional space, and is denoted by the letter X.
[0171] When bone displacement changes abruptly, it can lead to an increase in the abrupt change index of joint acceleration, resulting in less smooth movement. By adjusting the collision volume parameters, the collision situation between bone nodes can be altered, thereby reducing the abrupt change index of joint acceleration.
[0172] For example, if the magnitude of the abrupt change is large, the collision volume parameter can be increased appropriately to make the collision between bone nodes smoother and reduce abrupt changes in joint acceleration; if the magnitude of the abrupt change is small, the collision volume parameter can be decreased appropriately to improve the flexibility of movement.
[0173] Step S1455: Re-input the adjusted mass distribution parameters and collision volume parameters into the physics engine to perform local physics simulation and generate updated motion trajectory data.
[0174] The adjusted mass distribution parameters and collision volume parameters are then re-input into the physics engine for local physics simulation. This local physics simulation only performs simulations on action frames within the second set of anomalous frames to improve simulation efficiency.
[0175] The physics engine recalculates the target character's trajectory data based on the adjusted mass distribution and collision volume parameters. This updated trajectory data, reflecting the adjusted motion, is obtained through local physics simulation.
[0176] The updated motion trajectory data is remapped to the skeletal node positions and joint rotation angles output by the physics engine to update and optimize the motion sequence. Then, the updated optimized motion sequence is subjected to motion coherence verification again to determine the updated physics compliance score. If the physics compliance score is still lower than the preset compliance threshold, the above secondary adjustment process is repeated until the physics compliance score meets the requirements.
[0177] Step S150: Generate motion fusion instructions based on the physical compliance score, and fuse the optimized motion sequence with the initial motion sequence based on the motion fusion instructions to generate the final motion sequence of the target character and output it to the animation rendering system.
[0178] After determining the physical compliance score of the optimized motion sequence, motion fusion instructions are generated based on the score. Then, the optimized motion sequence is fused with the initial motion sequence based on the motion fusion instructions to generate the final motion sequence of the target character, and then output to the animation rendering system.
[0179] Step S151: Compare and analyze the physical compliance score of the optimized action sequence with the original fluency score of the initial action sequence to determine the action optimization gain coefficient.
[0180] The physical compliance score of the optimized motion sequence is compared and analyzed with the original fluency score of the initial motion sequence. The original fluency score of the initial motion sequence is a score value, denoted by the letter Y, obtained when acquiring the initial motion sequence, based on factors such as the fluency and coherence of the motion.
[0181] The motion optimization gain coefficient can be determined by comparing the physical compliance score and the original fluency score. The motion optimization gain coefficient reflects the improvement in physical compliance of the optimized motion sequence relative to the initial motion sequence, and is denoted by the letter Z.
[0182] The motion optimization gain coefficient Z can be obtained by calculating the difference between the physical compliance score and the original fluency score, and then dividing the difference by the original fluency score. The larger the motion optimization gain coefficient, the more significant the improvement in physical compliance of the optimized motion sequence.
[0183] Step S152: If the action optimization gain coefficient is greater than a preset gain threshold, a first fusion instruction is generated. The first fusion instruction instructs the action frames in the optimized action sequence with physical compliance scores higher than the compliance threshold to replace the corresponding original action frames in the initial action sequence.
[0184] The motion optimization gain coefficient Z is compared with the preset gain threshold. The preset gain threshold is a standard value set based on animation production requirements and experience, denoted as A1.
[0185] If the motion optimization gain coefficient Z is greater than the preset gain threshold A1, it indicates that the optimized motion sequence has a significant improvement in physical compliance. At this point, a first fusion instruction is generated. The first fusion instruction instructs that motion frames in the optimized motion sequence with physical compliance scores higher than the compliance threshold U replace the corresponding original motion frames in the initial motion sequence.
[0186] By replacing frames, which conform to physical laws and animation requirements in the optimized motion sequence, the quality of the final motion sequence can be improved.
[0187] Step S153: If the action optimization gain coefficient is less than or equal to the gain threshold, a second fusion instruction is generated. The second fusion instruction instructs the action frames in the optimized action sequence with physical compliance scores higher than the compliance threshold to be weighted and superimposed with the corresponding original action frames in the initial action sequence.
[0188] If the motion optimization gain coefficient Z is less than or equal to the preset gain threshold A1, it indicates that the improvement in physical compliance of the optimized motion sequence is not significant enough. In this case, a second fusion instruction is generated. The second fusion instruction instructs that motion frames in the optimized motion sequence with physical compliance scores higher than the compliance threshold U be weighted and superimposed with the corresponding original motion frames in the initial motion sequence.
[0189] Step S1531: Determine the first weight coefficient of the action frame in the optimized action sequence based on the ratio of the physical compliance score to the original fluency score.
[0190] The first weight coefficient of the action frame in the optimized action sequence is determined based on the ratio of the physical compliance score to the original fluency score. Let the physical compliance score be letter B1 and the original fluency score be letter Y. The first weight coefficient can be obtained by calculating the ratio of B1 to Y, and is denoted as letter C1.
[0191] The first weighting coefficient reflects the importance of the action frame in the fusion process in the optimized action sequence. The larger the weighting coefficient, the greater the proportion of the action frame in the fusion.
[0192] Step S1532: Determine the second weight coefficient of the original action frame in the initial action sequence based on the difference between the action optimization gain coefficient and the gain threshold.
[0193] The second weighting coefficient of the original motion frame in the initial motion sequence is determined based on the difference between the motion optimization gain coefficient Z and the gain threshold A1. Let the second weighting coefficient be denoted by the letter D1, which can be correlated with the difference between the motion optimization gain coefficient Z and the gain threshold A1 through a functional relationship.
[0194] Generally speaking, the closer the motion optimization gain coefficient Z is to the gain threshold A1, the larger the second weight coefficient of the original motion frame in the initial motion sequence; the smaller the motion optimization gain coefficient Z is to the gain threshold A1, the smaller the second weight coefficient.
[0195] Step S1533: Multiply the motion trajectory data of the action frames in the optimized action sequence by the first weighting coefficient to obtain weighted optimized trajectory data.
[0196] Multiply the motion trajectory data of the action frames in the optimized action sequence by the first weighting coefficient C1 to obtain the weighted optimized trajectory data. The motion trajectory data describes the motion trajectory of the skeletal nodes in the action frame, denoted as E1.
[0197] The weighted optimized trajectory data reflects the contribution of action frames in the optimized action sequence to the fusion process. By multiplying by the first weight coefficient, the influence of action frames in the optimized action sequence can be adjusted.
[0198] Step S1534: Multiply the motion trajectory data of the original action frames in the initial action sequence by the second weighting coefficient to obtain weighted original trajectory data.
[0199] The motion trajectory data of the original motion frames in the initial motion sequence is multiplied by the second weighting coefficient D1 to obtain the weighted original trajectory data. The motion trajectory data of the original motion frames in the initial motion sequence is denoted by the letter F1.
[0200] The weighted raw trajectory data reflects the contribution of the original motion frames in the initial motion sequence during the fusion process. By multiplying by a second weighting coefficient, the influence of the original motion frames in the initial motion sequence can be adjusted. After obtaining the weighted optimized trajectory data and the weighted raw trajectory data, it is necessary to ensure the consistency of these two data in terms of dimensions and feature dimensions. Because motion trajectory data usually contains the positional information of bone nodes in three-dimensional space and is a collection of vector data with the same dimension, the weighting operation will not change its dimension, but it is necessary to ensure that the dimensions are consistent, for example, both should use the length dimension under the standard unit of the physics engine.
[0201] Step S1535: The weighted optimized trajectory data and the weighted original trajectory data are superimposed frame by frame to generate the fused trajectory data of the final action sequence.
[0202] The weighted optimized trajectory data and the weighted original trajectory data are superimposed frame by frame. Since both sets of data correspond to the same action frame sequence and are consistent in dimension and scale, element-level superposition can be performed frame by frame. For each action frame, the bone node position information corresponding to that frame in the weighted optimized trajectory data is added to the corresponding bone node position information in the weighted original trajectory data to obtain the fused bone node position information. For example, for the i-th action frame, the position coordinates of the j-th bone node in the weighted optimized trajectory data are (E1i_j_x, E1i_j_y, E1i_j_z), and the position coordinates of the j-th bone node in the weighted original trajectory data are (F1i_j_x, F1i_j_y, F1i_j_z). Then, the position coordinates of the j-th bone node in the fused frame are (E1i_j_x + F1i_j_x, E1i_j_y + F1i_j_y, E1i_j_z + F1i_j_z). By performing this frame-by-frame overlay operation on all action frames, the fused trajectory data of the final action sequence is generated.
[0203] Step S154: Execute the fusion process according to the first fusion instruction or the second fusion instruction to generate the final action sequence.
[0204] The fusion process is executed based on either the first or second fusion instruction generated. If it's the first fusion instruction, action frames with physical compliance scores higher than the compliance threshold in the optimized action sequence directly replace the corresponding original action frames in the initial action sequence. The resulting action sequence is the final action sequence. During the replacement process, it's crucial to ensure that the replaced action frames match the initial action sequence in terms of temporal order and skeletal structure to guarantee the coherence of the final action sequence. If it's the second fusion instruction, the previously obtained fusion trajectory data is used to update the initial action sequence. The fusion trajectory data is remapped to bone node positions and joint rotation angles to obtain updated action frames, thus generating the final action sequence.
[0205] Step S155: Generate the final action sequence of the target character and output it to the animation rendering system.
[0206] After the fusion process is complete, the final motion sequence of the target character is generated. This final motion sequence contains a series of physically accurate and fluid motion frames that precisely describe the character's movement. The final motion sequence is then output to the animation rendering system, which renders the target character based on these motion frames to generate the final animation. The output final motion sequence must be transmitted in a format recognizable by the animation rendering system, such as common animation file formats, and must include complete information such as skeletal node positions and joint rotation angles to ensure the system can accurately reproduce the character's movements.
[0207] Step S210: Monitor the rendering feedback data of the final action sequence in the animation rendering system in real time.
[0208] After outputting the final motion sequence to the animation rendering system, it is necessary to monitor the rendering feedback data of the final motion sequence in the animation rendering system in real time. The rendering feedback data contains various information that occurs during the animation rendering process, such as whether there are joint clipping warnings, motion distortion prompts, etc. By monitoring this feedback data in real time, potential problems in the final motion sequence can be identified in a timely manner and dealt with accordingly.
[0209] Step S220: If the rendering feedback data contains a joint clipping warning or motion distortion prompt, then re-extract the abnormal motion frames that triggered the warning from the final motion sequence.
[0210] If the rendering feedback data contains joint clipping warnings or motion distortion alerts, it indicates that there are non-compliant motion frames in the final motion sequence. In this case, it is necessary to re-extract the abnormal motion frames that triggered the warnings from the final motion sequence. Joint clipping warnings indicate that during animation rendering, the character's joints are penetrating each other, usually due to unreasonable motion design or inaccurate physical simulation. Motion distortion alerts indicate that the character's movement looks unnatural, possibly due to improper settings of parameters such as motion speed and acceleration. Based on the specific information in the rendering feedback data, locate the abnormal motion frames that triggered the warnings and extract them from the final motion sequence.
[0211] Step S230: Re-input the skeletal node position data of the abnormal action frame into the physics engine for constraint optimization processing to generate a replacement action frame.
[0212] The extracted skeletal node position data of the abnormal motion frames are re-input into the physics engine for constraint optimization. During constraint optimization, the previously set biomechanical and motion constraints must still be followed. The physics engine adjusts the skeletal node position data of the abnormal motion frames based on these constraints, recalculating motion trajectories and collision responses. Through continuous iterative optimization, the adjusted motion frames satisfy the biomechanical and motion constraints, ultimately generating replacement motion frames that improve both physical plausibility and motion consistency.
[0213] Step S240: After inserting the replacement action frame into the final action sequence, perform physical compliance score verification and rendering simulation pre-verification on the updated final action sequence. If there are residual abnormal frames, readjust the sequence according to the preset maximum number of iterations or the compliance score difference threshold of the residual abnormal frames until the termination condition is met.
[0214] The generated replacement motion frames are inserted into the corresponding positions in the final motion sequence to obtain the updated final motion sequence. The updated final motion sequence is then subjected to a physics compliance score verification. Following the previously determined method, the physics compliance score of the updated final motion sequence is recalculated. Simultaneously, a rendering simulation pre-verification is performed. The updated final motion sequence is simulated and rendered in the animation rendering system to check for any remaining issues such as joint clipping warnings or motion distortion prompts.
[0215] If residual anomalous frames are still found during the verification and pre-verification process, it is necessary to decide whether to continue adjustments based on either the preset maximum number of iterations or the compliance score difference threshold of the residual anomalous frames. The preset maximum number of iterations is a pre-defined integer representing the maximum number of adjustments allowed. The compliance score difference threshold of the residual anomalous frames is a pre-defined numerical value representing the maximum allowed difference between the physical compliance score of the residual anomalous frames and the compliance threshold.
[0216] If the maximum number of iterations has not been reached, and the compliance score difference of the remaining abnormal frames is greater than the compliance score difference threshold, then the remaining abnormal frames are extracted again, and steps S230 and S240 are repeated to perform constraint optimization processing on the remaining abnormal frames, followed by verification and pre-verification. This continues until the maximum number of iterations is reached or the compliance score difference of the remaining abnormal frames is less than or equal to the compliance score difference threshold, thus satisfying the termination condition. Finally, a physically compliant, coherent, and animation-compliant final motion sequence is obtained.
[0217] Figure 2 The diagram illustrates exemplary hardware and software components of a film and animation character motion generation system 100 incorporating a physics engine, which can implement the inventive ideas of the present invention, according to some embodiments of the present invention. For example, a processor 120 can be used in the film and animation character motion generation system 100 incorporating a physics engine and to perform the functions in the present invention.
[0218] The film and animation character motion generation system 100, which incorporates a physics engine, can be a general-purpose server or a special-purpose server; both can be used to implement the film and animation character motion generation method incorporating a physics engine according to this invention. Although only one server is shown in this invention, for convenience, the functions described in this invention can be implemented in a distributed manner on multiple similar platforms to balance the load.
[0219] For example, a film and television animation character motion generation system 100 incorporating a physics engine may include a network port 110 connected to a network, one or more processors 120 for executing program instructions, a communication bus 130, and various forms of storage media 140, such as a disk, ROM, or RAM, or any combination thereof. Exemplarily, the film and television animation character motion generation system 100 incorporating a physics engine may also include program instructions stored in ROM, RAM, or other types of non-transitory storage media, or any combination thereof. The method of the present invention can be implemented according to these program instructions. The film and television animation character motion generation system 100 incorporating a physics engine also includes an I / O interface 150 between the computer and other input / output devices.
[0220] For ease of explanation, only one processor is described in the physics-engine-integrated film and animation character motion generation system 100. However, it should be noted that the physics-engine-integrated film and animation character motion generation system 100 of this invention may also include multiple processors. Therefore, the steps executed by one processor described in this invention may also be executed jointly or individually by multiple processors. For example, if the processor of the physics-engine-integrated film and animation character motion generation system 100 executes steps A and B, it should be understood that steps A and B may also be executed jointly by two different processors or individually by one processor. For example, the first processor executes step A, the second processor executes step B, or the first processor and the second processor jointly execute steps A and B.
[0221] Furthermore, this embodiment of the invention also provides a readable storage medium, wherein computer-executable instructions are preset in the readable storage medium, and when the processor executes the computer-executable instructions, the above-mentioned method for generating animation character actions in conjunction with a physics engine is implemented.
[0222] It should be noted that, in order to simplify the description of the present invention and thus help to understand one or more embodiments of the invention, multiple features may sometimes be grouped into one embodiment, drawing or description thereof in the foregoing description of the embodiments of the present invention.
Claims
1. A method for generating character motion in film and television animation using a physics engine, characterized in that, The method includes: Obtain the initial action sequence of the target character, wherein the initial action sequence contains multiple consecutive action frames; The physics engine is invoked to perform physical simulation processing on the initial action sequence to obtain the initial physical data corresponding to the initial action sequence. The initial physical data is dynamically adjusted based on preset motion constraints to generate an optimized action sequence for the target character. The optimized action sequence is subjected to action coherence verification processing to determine the physical compliance score of the optimized action sequence; Based on the physical compliance score, an action fusion instruction is generated. Based on the action fusion instruction, the optimized action sequence and the initial action sequence are fused together to generate the final action sequence of the target character and output to the animation rendering system. The process of calling the physics engine to perform physical simulation on the initial action sequence to obtain the initial physical data corresponding to the initial action sequence includes: Extract the bone node position data and joint rotation angle data corresponding to each action frame from the initial action sequence, wherein the length unit in the bone node position data is the standard unit of the physics engine; The skeletal node position data is converted into a set of rigid body motion parameters that the physics engine can recognize. The set of rigid body motion parameters includes mass distribution parameters, inertia tensor parameters, and collision volume parameters. A physical simulation scenario is constructed based on the set of rigid body motion parameters and the joint rotation angle data. Perform multi-level motion simulation operations in the physical simulation scene to calculate the motion trajectory data and collision response data of the target character in the physical simulation scene; Initial physical data corresponding to the initial action sequence is generated based on the motion trajectory data and the collision response data; The process of dynamically adjusting the initial physical data based on preset motion constraints to generate an optimized action sequence for the target character includes: Obtain the biomechanical constraints of the target character, including joint range of motion threshold, muscle contraction strength threshold, and center of gravity shift tolerance. Based on the biomechanical constraints, the motion trajectory data is filtered frame by frame, and the motion frames that exceed the standard in any of the parameters of joint angle, muscle contraction intensity and center of gravity offset are marked as the first abnormal frame set. Perform inverse dynamics calculations on the collision response data in the first abnormal frame set to generate joint torque correction parameters; Based on the joint torque correction parameters, the joint drive torque in the first abnormal frame set is iteratively adjusted, and the physical simulation is re-executed until the updated motion trajectory data meets the biomechanical constraints. Then, the updated motion trajectory data is re-mapped with the bone node positions and joint rotation angles output by the physics engine to generate the optimized motion sequence. The step of generating an action fusion instruction based on the physical compliance score, and fusing the optimized action sequence with the initial action sequence based on the action fusion instruction, includes: The physical compliance score of the optimized action sequence is compared and analyzed with the original smoothness score of the initial action sequence to determine the action optimization gain coefficient. If the action optimization gain coefficient is greater than a preset gain threshold, a first fusion instruction is generated, which instructs the action frames in the optimized action sequence with physical compliance scores higher than the compliance threshold to replace the corresponding original action frames in the initial action sequence. If the action optimization gain coefficient is less than or equal to the gain threshold, a second fusion instruction is generated, which instructs the action frames in the optimized action sequence with physical compliance scores higher than the compliance threshold to be weighted and superimposed with the corresponding original action frames in the initial action sequence. The fusion process is executed according to the first fusion instruction or the second fusion instruction to generate the final action sequence.
2. The method for generating character motion in film and television animation combined with a physics engine according to claim 1, characterized in that, The process of converting the bone node position data into a set of rigid body motion parameters recognizable by the physics engine includes: The hierarchical connection relationship of each bone node is determined based on the skeletal topology of the target character. The mass distribution parameters of each bone node are calculated based on the hierarchical connection relationship. The mass distribution parameters include the mass transfer ratio between adjacent bone nodes and the weight of joint support force distribution. Based on the mass transfer ratio and the joint support force distribution weight, a mass distribution optimization equation is constructed under the condition of constraining the total mass conservation of the target role. The inertial tensor parameters of each bone node are obtained by solving the mass distribution optimization equation, and the collision volume parameters of each bone node in three-dimensional space are determined based on the inertial tensor parameters.
3. The method for generating character motion in film and television animation combined with a physics engine according to claim 1, characterized in that, The step of performing inverse dynamics calculations on the collision response data in the first abnormal frame set to generate joint moment correction parameters includes: Extract the contact point location data and contact force direction data between the target character and the virtual environment object from the collision response data; The kinematic chain of the affected skeletal node is determined based on the contact point location data, and the torque compensation value of each joint in the kinematic chain is calculated based on the contact force direction data. A reverse dynamics optimization function is constructed with the torque compensation value as a constraint. The joint torque correction parameters are obtained by solving the reverse dynamics optimization function by minimizing the joint torque deviation. The joint torque correction parameters are applied as external torques to the kinematics chain of the physics engine to update the joint drive parameters in the physics simulation scene.
4. The method for generating character motion in film and television animation combined with a physics engine according to claim 1, characterized in that, The step of performing action coherence verification on the optimized action sequence to determine the physical compliance score of the optimized action sequence includes: Extract the time interval between adjacent action frames in the optimized action sequence, and calculate the ratio of the bone displacement difference data to the time interval as the average motion velocity; A motion smoothness score is generated based on the rate of change of average motion velocity, and the joint acceleration mutation index is calculated by extracting the time derivative of the joint rotation velocity data. The motion smoothness score is compared with a preset smoothness threshold, and a second set of abnormal frames in the optimized motion sequence that are below the smoothness threshold is marked. Statistical analysis is performed on the joint acceleration mutation index corresponding to the second abnormal frame set, and combined with the preset mutation tolerance threshold, the physical compliance score of the second abnormal frame set is determined. If the physical compliance score is lower than the preset compliance threshold, the rigid body motion parameter set in the second abnormal frame set is adjusted a second time to update the physical compliance score of the optimized action sequence.
5. The method for generating character motion in film and television animation combined with a physics engine according to claim 4, characterized in that, The secondary adjustment process for the rigid body motion parameter set in the second abnormal frame set includes: Obtain the temporal derivative of the skeletal displacement difference data of adjacent action frames in the second abnormal frame set; The direction and magnitude of the abrupt change in the bone displacement difference data are determined based on the time derivative. The external force parameters applied to the target character in the physical simulation scene are adjusted based on the direction of the mutation, so that the direction of the adjusted force is opposite to the direction of the mutation. The collision volume parameters are adjusted based on the magnitude of the abrupt change, so that the adjusted collision volume parameters reduce the abrupt change index of the joint acceleration. The adjusted mass distribution parameters and collision volume parameters are re-input into the physics engine for local physics simulation, generating updated motion trajectory data.
6. The method for generating character motion in film and television animation combined with a physics engine according to claim 4, characterized in that, The generation of action fusion instructions based on the physical compliance score includes: The physical compliance score of the optimized action sequence is compared and analyzed with the original fluency score of the initial action sequence to determine the action optimization gain coefficient. If the action optimization gain coefficient is greater than the preset gain threshold, a first fusion instruction is generated. The first fusion instruction instructs to replace the corresponding original action frame in the initial action sequence with the action frame in the optimized action sequence whose physical compliance score is higher than the compliance threshold. If the action optimization gain coefficient is less than or equal to the gain threshold, a second fusion instruction is generated. The second fusion instruction instructs to perform weighted superposition processing on the action frames in the optimized action sequence whose physical compliance scores are higher than the compliance threshold and the corresponding original action frames in the initial action sequence. The fusion process is executed according to the first fusion instruction or the second fusion instruction to generate the final action sequence.
7. The method for generating character motion in film and television animation combined with a physics engine according to claim 6, characterized in that, The step of weighted superposition of action frames in the optimized action sequence with physical compliance scores higher than the compliance threshold and the corresponding original action frames in the initial action sequence includes: The first weight coefficient of the action frame in the optimized action sequence is determined based on the ratio of the physical compliance score to the original fluency score. The second weighting coefficient of the original action frame in the initial action sequence is determined based on the difference between the action optimization gain coefficient and the gain threshold. Multiply the motion trajectory data of the action frames in the optimized action sequence by the first weighting coefficient to obtain weighted optimized trajectory data; Multiply the motion trajectory data of the original action frames in the initial action sequence by the second weighting coefficient to obtain weighted original trajectory data; The weighted optimized trajectory data is superimposed frame by frame with the weighted original trajectory data to generate the fused trajectory data of the final action sequence.
8. A film and animation character motion generation system combined with a physics engine, characterized in that, The device includes a processor and a memory, the memory being connected to the processor. The memory is used to store programs, instructions, or code, and the processor is used to execute the programs, instructions, or code in the memory to implement the method for generating film and television animation character motion combined with a physics engine as described in any one of claims 1-7.
Citation Information
Patent Citations
Role model action matching method, analysis engine and related equipment
CN116363273A
Intelligent animation modeling method and system based on three-dimensional technology
CN119941934A