Method and system for generating movie and television animation character actions in combination with physical engine
By combining the physics engine to perform physical simulation and biomechanical constraint adjustment of the action of a film and television animation character, the problems of low action generation efficiency and insufficient realism in the existing technology are solved. The generated action sequences show higher coherence and authenticity in film and television animations, improving the quality of the animation.
Patent Information
- Application Number
- CN202510634055.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-05-16
AI Technical Summary
The existing film and television animation character action generation methods are inefficient and the generated actions lack realism and physical rationality, making it difficult to meet the needs of high-quality and efficient animation production.
Combined with the physics engine, the initial action sequence is carried out physically simulated, by extracting the position and joint rotation angle data of bone nodes, building a physical simulation scenario, performing multi-level motion simulation, generating initial physical data, and dynamically adjusting based on biomechanical constraints, performing action coherence verification and physical compliance scoring, and finally generating an optimized action sequence.
The generated action sequence is more in line with the actual physical rules, improving the coherence and reality of the animation characters' actions, and enhancing the visual effect and immersion of film and television animation works.
Smart Images

Figure CN120580327A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of film and television production, and in particular to a method and system for generating motions of film and television animation characters in combination with a physical engine. Background Art
[0002] In the field of film and television animation production, character motion generation has always been a crucial step, with its quality directly impacting the visual quality of the work and the audience's sense of immersion. Traditional methods for generating character motion for film and television animation rely primarily on animators manually drawing each frame or creating character motion through keyframe interpolation. While manual frame-by-frame drawing allows for a high degree of personalization and precise control, it is extremely time-consuming and labor-intensive. For complex action and large-scale animation projects, it is extremely inefficient, severely limiting animation production progress and output.
[0003] Keyframe interpolation, on the other hand, uses a computer algorithm to automatically generate intermediate frames based on defined keyframes to achieve transitions. However, the movements generated by this method often lack realism and physical plausibility. Because it fails to account for real-world physics, the character's movements may appear illogical, such as sudden changes in motion without proper force, or unrealistic collisions and interactions between objects during the action. This makes the animation appear stiff and mechanical, making it difficult for the audience to immerse themselves in the action.
[0004] Additionally, some existing motion generation technologies attempt to introduce simple rules to simulate physical effects. However, these rules are often too simplistic and rigid, unable to be flexibly adjusted to different scenarios and character characteristics. Furthermore, they lack consistency verification and physical compliance assessment for the generated motions, resulting in localized incoherence or non-compliance with physical laws, impacting the overall animation quality.
[0005] In this context, the existing methods for generating motion for film and television animation characters can no longer meet the current film and television industry's demand for high-quality and efficient animation production. An innovative motion generation method is urgently needed to solve the above problems. Summary of the Invention
[0006] In view of the above-mentioned problems, in combination with the first aspect of the present invention, the present invention provides a method for generating motions of film and television animation characters in combination with a physics engine, the method comprising: Obtaining an initial action sequence of a target character, wherein the initial action sequence includes a plurality of continuous action frames; Calling a physical engine to perform physical simulation processing on the initial action sequence to obtain initial physical data corresponding to the initial action sequence; Dynamically adjusting the initial physical data based on preset motion constraints to generate an optimized action sequence for the target character; Performing action consistency verification on the optimized action sequence to determine a physical compliance score of the optimized action sequence; An action fusion instruction is generated according to the physical compliance score, and the optimized action sequence is fused with the initial action sequence based on the action fusion instruction to generate a final action sequence of the target character and output it to an animation rendering system.
[0007] In a possible implementation of the first aspect, 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 includes: Extracting the skeletal node position data and joint rotation angle data corresponding to each action frame from the initial action sequence, wherein the length unit in the skeletal node position data is a standard unit of the physics engine; Converting the skeletal node position data into a set of rigid body motion parameters recognizable by a physics engine, wherein the set of rigid body motion parameters includes mass distribution parameters, inertia tensor parameters, and collision volume parameters; Constructing a physical simulation scene based on the rigid body motion parameter set and the joint rotation angle data; Performing multi-level motion simulation operations in the physical simulation scene to calculate 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 according to the motion trajectory data and the collision response data.
[0008] In a possible implementation of the first aspect, converting the skeletal node position data into a set of rigid body motion parameters recognizable by a physics engine includes: Determining the hierarchical connection relationship of each skeletal node based on the skeletal topology of the target character; Calculate the mass distribution parameters of each skeletal node according to the hierarchical connection relationship, wherein the mass distribution parameters include the mass transfer ratio of adjacent skeletal nodes and the joint support force distribution weight; Based on the mass transfer ratio and the joint support force distribution weight, a mass distribution optimization equation is constructed under the condition that the total mass of the target character is conserved; The inertia tensor parameters of each skeletal node are obtained by solving the mass distribution optimization equation, and the collision volume parameters of each skeletal node in three-dimensional space are determined based on the inertia tensor parameters.
[0009] In a possible implementation of the first aspect, the dynamically adjusting the initial physical data based on preset motion constraints to generate an optimized action sequence for the target character includes: Obtaining biomechanical constraints of the target character, wherein the biomechanical constraints include a joint motion angle threshold, a muscle contraction strength threshold, and a center of gravity shift tolerance; screening the motion trajectory data frame by frame according to the biomechanical constraint conditions, marking the action frames where any parameter of the joint activity angle, muscle contraction intensity and center of gravity offset exceeds the standard as a first abnormal frame set; performing inverse dynamics calculation on the collision response data in the first abnormal frame set to generate joint torque correction parameters; The joint driving torque in the first abnormal frame set is iteratively adjusted based on the joint torque correction parameter, and the physical simulation is re-executed until the updated motion trajectory data meets the biomechanical constraint conditions. The updated motion trajectory data is remapped with the bone node positions and joint rotation angles output by the physical engine to generate the optimized action sequence.
[0010] In a possible implementation of the first aspect, performing inverse dynamics calculation on the collision response data in the first abnormal frame set to generate joint torque correction parameters includes: Extracting contact point position data and contact force direction data between the target character and the virtual environment object from the collision response data; Determining a kinematic chain of affected skeletal nodes according to the contact point position data, and calculating a torque compensation value for each joint in the kinematic chain based on the contact force direction data; constructing an inverse dynamics optimization function with the torque compensation value as a constraint condition, solving the inverse dynamics optimization function by minimizing the joint torque deviation, and obtaining the joint torque correction parameter; The joint torque correction parameter is applied as an external torque to the kinematic chain of the physics engine to update the joint drive parameters in the physics simulation scene.
[0011] In a possible implementation of the first aspect, performing action continuity verification on the optimized action sequence to determine a 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 speed; generating a motion smoothness score based on the rate of change of the average motion velocity, and extracting the time derivative of the joint rotation velocity data to calculate a joint acceleration mutation index; Comparing the motion smoothness score with a preset smoothness threshold, and marking a second abnormal frame set in the optimized motion sequence that is below the smoothness threshold; Performing statistical analysis on the joint acceleration mutation index corresponding to the second abnormal frame set, and determining a physical compliance score for the second abnormal frame set in combination with a preset mutation tolerance threshold; If the physical compliance score is lower than a preset compliance threshold, a secondary adjustment process is performed on the rigid body motion parameter set in the second abnormal frame set to update the physical compliance score of the optimized action sequence.
[0012] In a possible implementation of the first aspect, the performing secondary adjustment processing on the rigid body motion parameter set in the second abnormal frame set includes: Obtaining a time derivative of the skeletal displacement difference data of adjacent action frames in the second abnormal frame set; Determining the mutation direction and mutation amplitude of the bone displacement difference data according to the time derivative; Adjusting a parameter of an external force applied to a target character in the physical simulation scene based on the mutation direction, so that the adjusted force direction is opposite to the mutation direction; adjusting the collision volume parameter based on the mutation amplitude so that the adjusted collision volume parameter reduces the joint acceleration mutation index; The adjusted mass distribution parameters and collision volume parameters are re-input into the physics engine to perform local physics simulation and generate updated motion trajectory data.
[0013] In a possible implementation of the first aspect, generating the action fusion instruction according to the physical compliance score includes: Comparing and analyzing 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; If the action optimization gain coefficient is greater than a preset gain threshold, a first fusion instruction is generated, wherein the first fusion instruction instructs the action frames in the optimized action sequence whose physical compliance scores are 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, wherein the second fusion instruction instructs to perform weighted superposition processing on action frames in the optimized action sequence whose physical compliance scores are higher than the compliance threshold and corresponding original action frames in the initial action sequence; The fusion process is performed according to the first fusion instruction or the second fusion instruction to generate the final action sequence.
[0014] In a possible implementation of the first aspect, performing weighted superposition processing on the action frames in the optimized action sequence having a physical compliance score higher than the compliance threshold and the corresponding original action frames in the initial action sequence includes: determining a first weight coefficient of an action frame in the optimized action sequence according to a ratio of the physical compliance score to the original fluency score; determining a second weight coefficient of an original action frame in the initial action sequence based on a difference between the action optimization gain coefficient and the gain threshold; multiplying the motion trajectory data of the action frame in the optimized action sequence by the first weight coefficient to obtain weighted optimized trajectory data; multiplying the motion trajectory data of the original action frame in the initial action sequence by the second weight coefficient to obtain weighted original trajectory data; The weighted optimized trajectory data and the weighted original trajectory data are superimposed frame by frame to generate fused trajectory data of the final action sequence.
[0015] For example, in a possible implementation of the first aspect, after generating the final action sequence of the target character and outputting it to the animation rendering system, the method further includes: Real-time monitoring of rendering feedback data of the final action sequence in the animation rendering system; If the rendering feedback data includes a joint penetration warning or a motion distortion prompt, re-extracting the abnormal action frame that triggers the warning in the final action sequence; Re-inputting the skeletal node position data of the abnormal action frame into the physics engine for constraint optimization processing to generate a replacement action frame; After inserting the replacement action frame into the final action sequence, the updated final action sequence is subjected to physical compliance score verification and rendering simulation pre-verification. If there are any residual abnormal frames, the sequence is readjusted 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.
[0016] On the other hand, the present invention also provides a film and television animation character action generation system combined with a physical engine, including a processor and a machine-readable storage medium, the machine-readable storage medium is connected to the processor, the machine-readable storage medium is used to store programs, instructions or codes, and the processor is used to execute the programs, instructions or codes in the machine-readable storage medium to implement the above method.
[0017] Based on the above aspects, the present invention obtains the initial action sequence of the target character, calls the physics engine for physical simulation, dynamically adjusts based on motion constraints, performs action continuity verification and determines the physical compliance score, and performs action fusion according to the physical compliance score. A series of coherent and interrelated operations are carried out, and the physical engine simulation and motion constraint adjustment are comprehensively used to avoid the problems of lack of real physical feedback and difficulty in conforming to actual motion laws in traditional animation character action generation. The generated optimized action sequence is more in line with real physical rules. The action continuity verification and physical compliance scoring mechanism effectively ensure the continuity and physical authenticity of the optimized action sequence. Finally, the optimized action sequence is combined with the initial action sequence through action fusion. The final action sequence generated not only retains the characteristics of the initial action, but also incorporates the realism and rationality after physical simulation and optimization adjustment, greatly improving the quality and realism of film and television animation character actions, providing high-quality action data for the animation rendering system, and enhancing the visual effects and immersion of film and television animation works. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a schematic diagram of the execution flow of the method for generating the action of a film and television animation character combined with a physical engine provided by an embodiment of the present invention.
[0019] Figure 2 Schematic diagram of exemplary hardware and software components of a system for generating motions of film and television animation characters in combination with a physics engine, provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0020] The present invention will be described in detail below with reference to the accompanying drawings. Figure 1 This is a flow chart of a method for generating motions of film and television animation characters in combination with a physical engine, provided by an embodiment of the present invention. The method for generating motions of film and television animation characters in combination with a physical engine is introduced in detail below.
[0021] Step S110: obtaining an initial action sequence of the target character, wherein the initial action sequence includes a plurality of continuous action frames.
[0022] In film and television animation production, generating appropriate motion for a target character requires first obtaining the character's initial motion sequence. This initial motion sequence consists of a series of continuous motion frames, each of which records the character's posture and position at a specific moment. There are various ways to obtain this initial motion sequence, the most common of which are motion capture technology and manual keyframe setting.
[0023] Specifically, if motion capture technology is employed, specialized motion capture equipment such as optical or inertial motion capture systems can be used. Optical motion capture systems utilize multiple high-speed cameras to capture the motion trajectories of markers attached to key areas of an actor's body. Assuming the position data of the markers is represented by the letter A, at a given moment t, each marker has corresponding three-dimensional spatial coordinate data (Ax, Ay, Az). Over time, the position data of these markers continuously changes, forming a time series. By processing and converting the position data of these markers, the motion information of the target character can be obtained. For humanoid characters, markers are typically placed at key locations such as the head, shoulders, elbows, wrists, hips, knees, and ankles. By recording the positions of these markers at different times, the actor's movements can be reconstructed and mapped onto the target character.
[0024] If the keyframes are set manually, the animator will adjust the target character's posture frame by frame in the animation software according to the design requirements. In the software, the character's body parts can usually change their position and angle through operations such as rotation and translation. Assuming that the rotation angle of a joint of the character is represented by the letter B, the producer will set different B values on different keyframes according to the plot and action design. For example, in a sword swinging action, the joint rotation angle B1 at the beginning corresponds to the character's sword-holding posture. During the sword swinging process, the joint rotation angle B2 of the intermediate frame will gradually increase. At the end of the sword swing, the joint rotation angle B3 will return to an appropriate value. By setting these parameters on the keyframes, the software will automatically interpolate the intermediate frames to generate continuous action frames, thus forming the initial action sequence.
[0025] Regardless of the method used to obtain the initial motion sequence, it is necessary to ensure that the information contained in each motion frame accurately describes the target character's posture and position. This information can include the positions of skeletal nodes and the rotation angles of joints. For example, for a quadruped character, each motion frame may contain the position information of multiple skeletal nodes such as the head, neck, shoulders, elbows, wrists, hips, knees, and ankles, as well as the rotation angles of each joint. This information constitutes a multidimensional data set, and the data sets of each motion frame are interconnected to form a continuous motion sequence.
[0026] Step S120: calling a physical engine to perform physical simulation processing on the initial action sequence to obtain initial physical data corresponding to the initial action sequence.
[0027] After obtaining the target character's initial motion sequence, the next step is to use the physics engine to perform physical simulation on this initial motion sequence to obtain the corresponding initial physical data. The physics engine can simulate the movement and interaction of objects in a real physical environment, adding realism to the animated character's movements.
[0028] Step S121: extracting the skeletal node position data and joint rotation angle data corresponding to each action frame from the initial action sequence, wherein the length unit in the skeletal node position data is a standard unit of the physics engine.
[0029] To perform physical simulation, key information needs to be extracted from the initial action sequence: the skeletal node position data and joint rotation angle data corresponding to each action frame. The skeletal node position data describes the position of each node in the character's skeletal system in 3D space, while the joint rotation angle data represents the rotational state of the joints.
[0030] When extracting bone node position data, make sure its length unit is 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, then when extracting bone node position data, you need to convert the length unit of the original data to meters. If the length unit of the original data is centimeters, you need to divide it by 100 for unit conversion. Taking a humanoid character as an example, its skeletal system contains multiple bone nodes, such as head nodes, shoulder nodes, elbow nodes, etc. Each bone node has corresponding three-dimensional coordinates (x, y, z) in each action frame. These coordinate values are the bone node position data.
[0031] Joint rotation angle data reflects the rotation of the joints. For a joint, its rotation angle can be expressed using Euler angles (rotation angles around the X, Y, and Z axes) or quaternions. Assuming Euler angles are used to represent joint rotation angles, each joint will have three angle values (α, β, γ) in each action frame, representing the rotation angles around the X, Y, and Z axes, respectively. By extracting the rotation angle data for all joints in each action frame, complete joint rotation angle information can be obtained.
[0032] Step S122: converting the skeletal node position data into a set of rigid body motion parameters recognizable by a physical engine, wherein the set of rigid body motion parameters includes mass distribution parameters, inertia tensor parameters, and collision volume parameters.
[0033] After obtaining the skeletal node position data, it needs to be converted into a set of rigid body motion parameters that can be recognized by the physics engine. The rigid body motion parameter set includes mass distribution parameters, inertia tensor parameters, and collision volume parameters.
[0034] Step S1221: Determine the hierarchical connection relationship of each skeletal node based on the skeletal topology structure of the target character.
[0035] The target character's skeletal topology describes the connection method and hierarchical relationship between skeletal nodes. For a humanoid character, for example, its skeletal topology is typically 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, wrist node, and so on. By analyzing the skeletal topology, the hierarchical connection relationship between each skeletal node can be determined. Assuming the letter C represents a skeletal node, C1 represents the head node, C2 represents the neck node, C3 represents the shoulder node, and so on, then the hierarchical relationship can be determined by recording the connection relationships between these nodes, such as C1 connecting to C2, C2 connecting to C3, and so on. This hierarchical relationship is crucial for subsequent calculations of mass distribution parameters, as skeletal nodes at different levels influence each other during movement.
[0036] Step S1222: Calculate the mass distribution parameters of each skeletal node according to the hierarchical connection relationship, wherein the mass distribution parameters include the mass transfer ratio of adjacent skeletal nodes and the joint support force distribution weight.
[0037] After determining the hierarchical connection relationship of the bone nodes, the mass distribution parameters of each bone node can be calculated based on the hierarchical connection relationship. The mass distribution parameters mainly include the mass transfer ratio of adjacent bone nodes and the joint support force distribution weight.
[0038] The mass transfer ratio between adjacent skeletal nodes represents the distribution of a skeletal node's mass between adjacent nodes. Assuming a skeletal node Ci has a mass of Mi and is connected to adjacent skeletal nodes Cj and Ck, Ci's mass is distributed to Cj and Ck in a specific ratio. This ratio can be determined based on the physical properties and kinematic relationships of the bones. For example, in a humanoid character's arm, the mass of the shoulder node might be transferred to the elbow and wrist nodes in a specific ratio, which may be related to the arm's muscle distribution and range of motion.
[0039] The joint support force distribution weight reflects the proportion of force borne by the joint when supporting the bone node. For two bone 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 his arms, the support force distribution weight of the shoulder joint will change according to the movement of the arm. By analyzing the hierarchical connection relationship and motion state of the bone nodes, the support force distribution weight of each joint can be calculated.
[0040] Step S1223: Based on the mass transfer ratio and the joint support force distribution weight, a mass distribution optimization equation is constructed under the condition that the total mass of the target character is constrained to be conserved.
[0041] After determining the mass transfer ratios between adjacent skeletal nodes and the joint support force distribution weights, we need to construct a mass distribution optimization equation while maintaining the target character's total mass. The target character's total mass is a fixed value, M. The mass distribution of each skeletal node must satisfy the total mass conservation condition, meaning the sum of the masses of all skeletal nodes equals M.
[0042] According to the mass transfer ratio and the joint support force distribution weight, a set of equations about the mass of each bone node can be established. Assume that there are n bone nodes, and their masses are M1, M2, ..., Mn respectively. The mass distribution of each bone node will be affected by the mass transfer ratio of the adjacent nodes and the joint support force distribution weight. For example, for the bone node Ci, its mass Mi can be expressed as a function related to the mass and mass transfer ratio of the adjacent nodes, and the influence of the joint support force distribution weight on its mass distribution must also be considered. By establishing the mass relationship of all bone nodes and combining it with the condition of conservation of total mass, a mass distribution optimization equation can be obtained. The purpose of this mass distribution optimization equation is to find an optimal mass distribution scheme under the premise of satisfying the conservation of total mass, so that the character's movement is more in line with physical laws.
[0043] Step S1224: Obtain the inertia tensor parameters of each skeletal node by solving the mass distribution optimization equation, and determine the collision volume parameters of each skeletal node in three-dimensional space based on the inertia tensor parameters.
[0044] Solving the mass distribution optimization equation reveals the mass distribution of each skeletal node, and thus the inertia tensor parameters for each skeletal node. The inertia tensor is a physical quantity that describes the magnitude of inertia of a rigid body when rotating about 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 for each skeletal node can be calculated using the inertia tensor calculation formula.
[0045] Based on the inertia tensor parameters, the collision volume parameters of each bone node in three-dimensional space can be determined. The collision volume parameters describe the volume and shape of the bone node in three-dimensional space and are used to detect collisions in physical simulations. For example, for a spherical bone node, its collision volume parameters can be expressed as radius; for a rectangular bone node, its collision volume parameters can be expressed as length, width, and height. By analyzing the shape and range of motion of the bone node and combining it with the inertia tensor parameters, appropriate collision volume parameters can be determined, allowing collisions between bone nodes to be accurately detected in physical simulations.
[0046] Step S123: constructing a physical simulation scene based on the rigid body motion parameter set and the joint rotation angle data.
[0047] After obtaining the rigid body motion parameter set and joint rotation angle data, we can build a physical simulation scene based on this data. The physical simulation scene is the environment simulated by the physics engine, which contains the rigid body information and motion information of the target character.
[0048] The mass distribution parameters, inertia tensor parameters, and collision volume parameters from the rigid body motion parameter set are applied to each skeletal node of the target character to determine the physical properties of each skeletal node. Simultaneously, the joint rotation angle data is applied to the joints to determine their initial states. For example, in a physics simulation scene, each skeletal node of a humanoid character has a corresponding mass, inertia tensor, and collision volume, and each joint has a corresponding rotation angle. Using this information, the physics engine can simulate the character's movement in the physical environment.
[0049] In addition, you need to set other parameters for the physics simulation scene, such as gravity and friction. Gravity determines the direction and magnitude of the gravitational force acting on the character in the scene, while friction affects the friction between the character and the ground or other objects. By properly setting these parameters, you can make the physics simulation scene more realistic.
[0050] Step S124: performing multi-level motion simulation operations in the physical simulation scene, and calculating motion trajectory data and collision response data of the target character in the physical simulation scene.
[0051] After building the physical simulation scene, you can perform multi-level motion simulation operations in the scene and calculate the motion trajectory data and collision response data of the target character in the physical simulation scene.
[0052] Multi-level motion simulation takes into account the hierarchical structure of a character's skeletal system and the kinematic relationships between its joints. Starting with the lowest-level skeletal nodes, their motion is calculated based on their physical properties and the forces acting on them. Then, based on the hierarchical connections, the motion of these lower-level skeletal nodes is transferred to the upper-level nodes, and the motion of each skeletal node is calculated in turn. For example, in simulating the motion of a humanoid character's arm, the motion of the wrist node is calculated first, then transferred to the elbow node, and then to the shoulder node, ultimately determining the motion of the entire arm.
[0053] During simulation, the physics engine continuously detects collisions between skeletal nodes and between skeletal nodes and other objects in the scene. When a collision occurs, it calculates collision response data based on the collision type and physical properties. This collision response data includes information such as the time, location, magnitude, and direction of the collision force. For example, when a character's foot collides with the ground, the physics engine calculates the time and location of the collision, as well as the magnitude and direction of the reaction force exerted by the ground on the foot.
[0054] Through continuous iterative calculations, the target character's motion trajectory data in the physical simulation scene can be obtained. The motion trajectory data records the position and posture information of each skeletal node at different times, which is an important basis for subsequent analysis and optimization.
[0055] Step S125: generating initial physical data corresponding to the initial action sequence according to the motion trajectory data and the collision response data.
[0056] After obtaining the motion trajectory data and collision response data, the initial physical data corresponding to the initial action sequence can be generated based on these data. The initial physical data is a comprehensive description of the target character's movement in the physical simulation scene, which includes the motion trajectory data and collision response data.
[0057] The motion trajectory data and collision response data are combined to form a complete data set. This data set can be represented as a multidimensional array, where each element contains the motion trajectory information and collision response information at a specific moment. For example, at a specific time t, the initial physics data may include the position coordinates, velocity, acceleration of each skeletal node, as well as collision-related information such as the colliding object, the magnitude and direction of the collision force, etc.
[0058] Generating initial physics data provides a foundation for subsequent motion optimization. This data reflects the target character's actual motion in the physical environment. By analyzing and processing this data, we can identify areas in the initial motion sequence that don't conform to physical laws and make corresponding adjustments.
[0059] Step S130: Dynamically adjust the initial physical data based on preset motion constraints to generate an optimized action sequence for the target character.
[0060] After obtaining the initial physical data, it needs to be dynamically adjusted based on the preset motion constraints to generate the target character's optimized motion sequence. The preset motion constraints are set based on the target character's biomechanical characteristics and the requirements of animation production, ensuring that the character's movements conform to the laws of physics and the requirements of animation design.
[0061] Step S131: obtaining biomechanical constraints of the target character, wherein the biomechanical constraints include a joint motion angle threshold, a muscle contraction strength threshold, and a center of gravity shift tolerance.
[0062] To properly adjust the initial physical data, we first need to obtain the target character's biomechanical constraints. Biomechanical constraints are set based on the biomechanical properties of the human body or animal, and include joint motion angle thresholds, muscle contraction strength thresholds, and center of gravity offset tolerance.
[0063] The joint motion angle threshold specifies the range of angles within which a joint can normally move. Different joints have different motion angle limits. For example, the human elbow can typically only flex and extend within a certain range of angles. Assuming the joint motion angle is represented by the letter D, the motion angle threshold for a particular joint can be expressed as an angle range [Dmin, Dmax]. Within this range, joint motion is normal; outside this range, damage to the body or unnatural movements may occur.
[0064] The muscle contraction strength threshold reflects the maximum contraction strength a muscle can withstand. Muscles generate force when they contract, but excessive contraction can lead to fatigue or damage. Let's represent muscle contraction strength as the letter E, and its threshold as Emax. When muscle contraction strength exceeds Emax, adjustments are necessary.
[0065] Center of Gravity Shift Tolerance (CGT) is the maximum allowable deviation of a character's center of gravity during movement. A stable CG is crucial for a character's balance and proper movement. For example, if the character's CG is represented by the letter F, CGT can be expressed as a distance G. If the CGT exceeds G, the character may lose balance.
[0066] Step S132: screening the motion trajectory data frame by frame according to the biomechanical constraint condition, marking the action frames in which any parameter of the joint activity angle, muscle contraction intensity and center of gravity offset exceeds the standard as the first abnormal frame set.
[0067] After obtaining the biomechanical constraints, the motion trajectory data needs to be screened frame by frame based on these conditions. The motion trajectory data records the character's posture and movement information in each action frame. By analyzing this information, it can be determined whether each action frame meets the biomechanical constraints.
[0068] For each action frame, parameters such as joint motion angle, muscle contraction strength, and center of gravity offset are extracted. These parameters are compared with the corresponding biomechanical constraints. If the joint motion angle exceeds the joint motion angle threshold, the muscle contraction strength exceeds the muscle contraction strength threshold, or the center of gravity offset exceeds the center of gravity offset tolerance, the action frame is marked as an abnormal frame.
[0069] All action frames marked as abnormal frames are collected to form a first abnormal frame set. The action frames in the first abnormal frame set need to be further processed to make them meet the biomechanical constraint conditions.
[0070] Step S133: performing inverse dynamics calculation on the collision response data in the first abnormal frame set to generate joint torque correction parameters.
[0071] For the action frames in the first abnormal frame set, inverse dynamics calculation is required to calculate the collision response data to generate joint torque correction parameters. Inverse dynamics calculation is to infer the torque required for the joint to achieve the movement based on the object's motion state and the external forces it is subjected to.
[0072] Step S1331: extracting contact point position data and contact force direction data between the target character and the virtual environment object from the collision response data.
[0073] Before performing inverse dynamics calculations, key information must be extracted from the collision response data: 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 and the virtual environment object collided, while the contact force direction data indicates the direction of the external force applied during the collision.
[0074] The contact point position is represented by the letter H, which is a three-dimensional coordinate (Hx, Hy, Hz) representing the contact point's position in three-dimensional space. 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. By extracting the contact point position data and contact force direction data for each collision event, detailed collision information can be obtained.
[0075] Step S1332: determining the kinematic chain of the affected skeletal nodes according to the contact point position data, and calculating the torque compensation value of each joint in the kinematic chain based on the contact force direction data.
[0076] Based on the contact point position data, the kinematic chain of affected skeletal nodes can be determined. A kinematic chain is a series of skeletal nodes and joints that are formed by tracing back from the skeletal node where the contact point is located, along the hierarchical connections of the skeletal system, to the root node. For example, when a character's foot collides with the ground, the kinematic chain of affected skeletal nodes may include the foot node, ankle node, knee node, hip node, and so on.
[0077] Based on the 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 effects of the contact force on the joint. For each joint in the kinematic chain, the required torque compensation value can be calculated based on the contact force magnitude and direction, as well as the distance from the contact point to the joint. The torque compensation value for the joint is represented by the letter J. It is related to the contact force magnitude, contact force direction, and distance from the contact point to the joint. The contact force magnitude can be represented by K, and the distance from the contact point to the joint is represented by the letter L. The calculation of the torque compensation value J for each joint in the kinematic chain takes into account the force vector characteristics. First, the contact force direction I is cross-producted with the position vector from the contact point to the joint (the vector obtained by subtracting the contact point position H from the joint position). This cross-product yields a new vector whose direction follows the right-hand rule and whose magnitude is related to 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 perpendicular to the contact force direction. Through this calculation, the torque generated by the contact force at each joint can be calculated. However, since the movement of the joint 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, and finally the torque compensation value J of the joint is obtained.
[0078] Step S1333: constructing an inverse dynamics optimization function with the torque compensation value as a constraint condition, solving the inverse dynamics optimization function by minimizing the joint torque deviation, and obtaining the joint torque correction parameter.
[0079] 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 goal of the inverse dynamics optimization function is to find a set of joint torques such that, while satisfying the torque compensation constraints, the joint motion more closely conforms to physical laws and biomechanical constraints.
[0080] 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 is the torque that the joint should have while satisfying the torque compensation value and biomechanical constraints. The inverse dynamics optimization function can be expressed as a function of the joint torque M, with the goal of minimizing the joint torque deviation.
[0081] To solve the inverse dynamics optimization function, optimization algorithms such as gradient descent and Newton's method can be used. These algorithms iteratively adjust the joint torque M, gradually reducing the joint torque deviation until it reaches a satisfactory minimum. During this iterative process, it is necessary to continuously check whether the joint torque meets the torque compensation value constraint and biomechanical constraints. If not, the joint torque needs to be adjusted to meet the constraints.
[0082] By solving the inverse dynamics optimization function, we can ultimately obtain the joint torque correction parameters. These parameters represent the correction amount required to make the character's movements conform to physical laws and biomechanical constraints.
[0083] Step S1334: applying the joint torque correction parameter as an external torque to the kinematic chain of the physics engine to update the joint drive parameters in the physics simulation scene.
[0084] After obtaining the joint torque correction parameters, they are applied as external torques to the physics engine's kinematic chain. The physics engine's kinematic chain 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 kinematic chain, the forces acting on the joints can be altered, thereby affecting their motion.
[0085] In a physics simulation scenario, joint drive parameters determine the joint's motion state. These parameters include the joint's angle, angular velocity, and angular acceleration. When the joint torque correction parameter is applied to the joint as an external torque, the physics engine recalculates the joint's motion state and updates the joint drive parameters based on Newton's second law and rigid body dynamics.
[0086] For example, when a joint is subjected to an additional torque, its angular acceleration changes, causing the angular velocity and angle to change accordingly. The physics engine iterates and calculates these changes until a stable state of motion is achieved. By updating the joint drive parameters, the character's movements can be made more consistent with the laws of physics and biomechanical constraints.
[0087] Step S134: Iteratively adjust the joint driving torque in the first abnormal frame set based on the joint torque correction parameter, and re-execute the physical simulation until the updated motion trajectory data meets the biomechanical constraint conditions, and then remap the updated motion trajectory data with the bone node position and joint rotation angle output by the physical engine to generate the optimized action sequence.
[0088] Based on the joint torque correction parameter, the joint driving torque in the first abnormal frame set is iteratively adjusted. The joint driving torque is a key parameter for controlling joint motion. By adjusting the joint driving torque, the motion state of the joint can be changed.
[0089] In each iteration, the joint torque correction parameter is 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.
[0090] After re-running the physics simulation, the updated motion trajectory data is checked to see if it satisfies the biomechanical constraints. If not, the joint drive torque is adjusted again and the physics simulation process is repeated until the updated motion trajectory data satisfies the biomechanical constraints.
[0091] Once the updated motion trajectory data meets the biomechanical constraints, it is remapped to the bone node positions and joint rotation angles output by the physics engine. Remapping accurately converts the information in the motion trajectory data into bone node positions and joint rotation angles to ensure the character's movements are correctly rendered in the animation.
[0092] Through the remapping process, an optimized action sequence of the target character is generated. The action frames in the optimized action sequence are more consistent with the laws of physics and biomechanical constraints, making the character's movements more natural and realistic.
[0093] Step S140: performing action continuity verification on the optimized action sequence to determine a physical compliance score of the optimized action sequence.
[0094] After generating an optimized action sequence, it needs to be subjected to motion consistency verification to determine the physical compliance score of the optimized action sequence. Motion consistency verification can check 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.
[0095] Step S141: extracting the time interval between adjacent action frames in the optimized action sequence, and calculating the ratio of the bone displacement difference data to the time interval as the average motion speed.
[0096] To evaluate the coherence of an action, we first extract the time interval between adjacent action frames in the optimized action sequence. The time interval reflects the time span between adjacent action frames, and the time interval between adjacent action frames is denoted by the letter N.
[0097] At the same time, the bone displacement difference data between adjacent action frames is calculated. The bone displacement difference data describes the change in the position of the bone nodes in adjacent action frames. Let the bone displacement difference be represented by the letter P.
[0098] Divide the skeletal displacement difference data P by the time interval N to obtain the average motion speed. The average motion speed reflects the average speed of the skeletal node between adjacent action frames. By calculating the average motion speed between each adjacent action frame, the motion speed information of the skeletal node in the entire optimized action sequence can be obtained.
[0099] Step S142: generating a motion smoothness score based on the rate of change of the average motion velocity, and extracting the time derivative of the joint rotation velocity data to calculate a joint acceleration mutation index.
[0100] The motion smoothness score is generated based on the rate of change of the average motion speed. The rate of change of the average motion speed reflects the change in the motion speed of the skeleton node. If the rate of change is too large, it means that the motion speed changes too drastically and the movement is not smooth enough.
[0101] Let's denote the average speed by the letter Q. Its rate of change can be calculated by calculating the ratio of the difference in average speed at adjacent time points to the time interval. Based on the rate of change of the average speed, a scoring function can be designed to map the rate of change to a score, resulting in a motion smoothness score. A higher smoothness score indicates a smoother motion.
[0102] At the same time, the time derivative of the joint rotation velocity data is extracted to calculate the joint acceleration mutation index. Joint rotation velocity data describes the rotational velocity of a joint during motion, denoted by the letter R. The time derivative of the joint rotation velocity reflects the rate of change of the joint rotation velocity, or joint acceleration. If the joint acceleration changes significantly within a short period of time, it indicates a sudden change in the joint motion, resulting in an unsmooth movement.
[0103] By calculating the time derivative of joint rotation 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.
[0104] Step S143: Compare the motion smoothness score with a preset smoothness threshold, and mark a second abnormal frame set in the optimized motion sequence that is lower than the smoothness threshold.
[0105] 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, and is set to the letter S.
[0106] 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 abnormal frame set. The action frames in this second abnormal frame set may have problems such as incoherent motion and excessive speed changes.
[0107] Step S144: performing statistical analysis on the joint acceleration mutation index corresponding to the second abnormal frame set, and determining the physical compliance score of the second abnormal frame set in combination with a preset mutation tolerance threshold.
[0108] Performing statistical analysis on the joint acceleration mutation index corresponding to the second abnormal frame set. The statistical analysis may include calculating statistical quantities such as the average value and standard deviation of the joint acceleration mutation index to understand the overall situation of the joint acceleration mutation.
[0109] The physical compliance score of the second abnormal frame set is determined by combining a preset mutation tolerance threshold. The preset mutation tolerance threshold is a maximum value of joint acceleration mutation allowed according to physical laws and animation production requirements, and is set to the letter T.
[0110] If the joint acceleration mutation index exceeds the mutation tolerance threshold T, it indicates that the joint motion in that action frame exhibits significant mutations and 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, resulting in a physical compliance score for the second set of abnormal frames. A higher physical compliance score indicates that the action frame more closely conforms to physical laws and animation production requirements.
[0111] Step S145: If the physical compliance score is lower than a preset compliance threshold, a secondary adjustment process is performed on the rigid body motion parameter set in the second abnormal frame set to update the physical compliance score of the optimized action sequence.
[0112] If the physical compliance score of the second abnormal frame set is lower than the preset compliance threshold, it means that there are still some action frames in the set that do not conform to the physical laws and animation production requirements, and they need to be adjusted again.
[0113] The preset compliance threshold is a standard value set according to the quality requirements of animation production, and is set to 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.
[0114] Step S1451: Obtain the time derivative of the skeletal displacement difference data of adjacent action frames in the second abnormal frame set.
[0115] To perform the secondary adjustment process, first obtain the time derivative of the bone displacement difference data of adjacent action frames in the second abnormal frame set. The time derivative of the bone displacement difference data reflects the speed of the bone displacement change and is set as the letter V.
[0116] By calculating the ratio of the difference in skeletal displacement difference data between adjacent action frames to the time interval, we can obtain the time derivative of the skeletal displacement difference data. This time derivative can help us understand the changing trend of skeletal motion and provide a basis for subsequent adjustments.
[0117] Step S1452: Determine the mutation direction and mutation amplitude of the bone displacement difference data according to the time derivative.
[0118] The mutation direction and magnitude of the bone displacement difference data can be determined based on the time derivative V of the bone displacement difference data. The mutation direction indicates the direction of the bone displacement change, and the mutation magnitude indicates the magnitude of the bone displacement change.
[0119] If the time derivative V is positive, it means that the bone displacement is increasing and the mutation direction is positive. If the time derivative V is negative, it means that the bone displacement is decreasing and the mutation direction is negative. The magnitude of the mutation can be represented by the absolute value of the time derivative V. A larger absolute value indicates a larger magnitude of the mutation.
[0120] Step S1453: adjusting 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.
[0121] Based on the mutation direction of the skeletal displacement difference data, adjust the external force parameters applied to the target character in the physical simulation scene. External force parameters include gravity, friction, thrust, etc., and the external force is represented by the letter W.
[0122] To reduce sudden changes in bone displacement, the adjusted force needs to be directed in the opposite direction of the sudden change. For example, if the sudden change is positive, meaning the bone displacement is increasing, a reverse force should be applied to slow down the bone's movement. If the sudden change is negative, meaning the bone displacement is decreasing, a positive force should be applied to accelerate the bone's movement.
[0123] By adjusting the external force parameters, the motion state of the target character can be changed, the sudden change of bone displacement can be reduced, and the continuity of the movement can be improved.
[0124] Step S1454: adjusting the collision volume parameter based on the mutation amplitude, so that the adjusted collision volume parameter reduces the joint acceleration mutation index.
[0125] Based on the mutation amplitude of the bone displacement difference data, adjust the collision volume parameter. The collision volume parameter describes the volume and shape of the bone node in three-dimensional space. Let the collision volume parameter be the letter X.
[0126] When the bone displacement changes significantly, the joint acceleration exponent may increase, making the movement less smooth. By adjusting the collision volume parameters, the collision between bone nodes can be changed, thereby reducing the joint acceleration exponent.
[0127] For example, if the mutation amplitude is large, the collision volume parameter can be appropriately increased to make the collision between bone nodes softer and reduce the mutation of joint acceleration; if the mutation amplitude is small, the collision volume parameter can be appropriately reduced to improve the flexibility of the movement.
[0128] Step S1455: re-inputting the adjusted mass distribution parameters and collision volume parameters into the physics engine to perform local physics simulation and generate updated motion trajectory data.
[0129] The adjusted mass distribution parameters and collision volume parameters are re-input into the physics engine for local physics simulation. The local physics simulation only simulates the action frames in the second abnormal frame set to improve the simulation efficiency.
[0130] The physics engine recalculates the target character's motion trajectory data based on the adjusted mass distribution parameters and collision volume parameters. Through local physics simulation, updated motion trajectory data can be obtained, which reflects the adjusted action.
[0131] The updated motion trajectory data is remapped to the skeletal node positions and joint rotation angles output by the physics engine to update the optimized motion sequence. The updated optimized motion sequence is then verified for motion consistency to determine an updated physics compliance score. If the physics compliance score is still below the preset compliance threshold, the above secondary adjustment process is repeated until the physics compliance score meets the requirements.
[0132] Step S150: generating an action fusion instruction according to the physical compliance score, fusing the optimized action sequence with the initial action sequence based on the action fusion instruction, generating a final action sequence of the target character, and outputting it to an animation rendering system.
[0133] After determining the physical compliance score of the optimized action sequence, an action fusion instruction is generated based on the score. Then, based on the action fusion instruction, the optimized action sequence is fused with the initial action sequence to generate the final action sequence of the target character, which is then output to the animation rendering system.
[0134] Step S151: Comparing and analyzing 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.
[0135] The physical compliance score of the optimized action sequence is compared with the original fluency score of the initial action sequence. The original fluency score of the initial action sequence is a score value (Y) obtained when the initial action sequence is obtained based on factors such as the fluency and coherence of the action.
[0136] By comparing the physical compliance score with the original fluency score, the motion optimization gain factor can be determined. The motion optimization gain factor reflects the degree of improvement in physical compliance of the optimized motion sequence relative to the initial motion sequence and is set to the letter Z.
[0137] The action optimization gain coefficient Z can be calculated by calculating the difference between the physical compliance score and the original fluency score and dividing the difference by the original fluency score. The larger the action optimization gain coefficient, the more significant the improvement in physical compliance of the optimized action sequence.
[0138] Step S152: If the action optimization gain coefficient is greater than a preset gain threshold, a first fusion instruction is generated, wherein the first fusion instruction instructs the action frames in the optimized action sequence whose physical compliance scores are higher than the compliance threshold to replace the corresponding original action frames in the initial action sequence.
[0139] The motion optimization gain coefficient Z is compared with a preset gain threshold value. The preset gain threshold value is a standard value set according to the requirements and experience of animation production and is set as the letter A1.
[0140] If the motion optimization gain coefficient Z is greater than the preset gain threshold A1, it indicates that the optimized motion sequence has significantly improved in terms of physical compliance. At this time, a first fusion instruction is generated. The first fusion instruction instructs the motion frames in the optimized motion sequence whose physical compliance scores are higher than the compliance threshold U to replace the corresponding original motion frames in the initial motion sequence.
[0141] Through the replacement operation, the action frames in the optimized action sequence that conform to the physical laws and animation production requirements can be integrated into the initial action sequence to improve the quality of the final action sequence.
[0142] Step S153: If the action optimization gain coefficient is less than or equal to the gain threshold, a second fusion instruction is generated, which 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.
[0143] If the motion optimization gain coefficient Z is less than or equal to the preset gain threshold A1, it indicates that the physical compliance improvement of the optimized motion sequence is not significant enough. In this case, a second fusion instruction is generated. The second fusion instruction instructs to perform a weighted superposition process on the motion frames in the optimized motion sequence whose physical compliance scores are higher than the compliance threshold U and the corresponding original motion frames in the initial motion sequence.
[0144] Step S1531: determining a first weight coefficient of an action frame in the optimized action sequence according to a ratio of the physical compliance score to the original fluency score.
[0145] The first weight coefficient for 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 B1 and the original fluency score be Y. The first weight coefficient can be calculated by calculating the ratio of B1 to Y and is set to C1.
[0146] The first weight coefficient reflects the importance of the action frame in the optimized action sequence in the fusion process. The larger the weight coefficient, the greater the proportion of the action frame in the fusion.
[0147] Step S1532: determining a 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.
[0148] The second weight coefficient of the original action frame in the initial action sequence is determined based on the difference between the action optimization gain coefficient Z and the gain threshold A1. Let the second weight coefficient be letter D1, which can be associated with the difference between the action optimization gain coefficient Z and the gain threshold A1 through a functional relationship.
[0149] Generally speaking, when the action optimization gain coefficient Z is closer to the gain threshold A1, the second weight coefficient of the original action frame in the initial action sequence is larger; when the action optimization gain coefficient Z is smaller than the gain threshold A1, the second weight coefficient is smaller.
[0150] Step S1533: multiplying the motion trajectory data of the action frame in the optimized action sequence by the first weight coefficient to obtain weighted optimized trajectory data.
[0151] The motion trajectory data of the action frame in the optimized action sequence is multiplied by the first weight coefficient C1 to obtain weighted optimized trajectory data. The motion trajectory data describes the motion trajectory of the skeleton node in the action frame and is set as letter E1.
[0152] The weighted optimization trajectory data reflects the contribution of the action frames in the optimized action sequence in the fusion process. By multiplying it by the first weight coefficient, the influence of the action frames in the optimized action sequence can be adjusted.
[0153] Step S1534: multiplying the motion trajectory data of the original action frame in the initial action sequence by the second weight coefficient to obtain weighted original trajectory data.
[0154] The motion trajectory data of the original motion frame in the initial motion sequence is multiplied by the second weight coefficient D1 to obtain weighted original trajectory data. The motion trajectory data of the original motion frame in the initial motion sequence is set to letter F1.
[0155] The weighted original trajectory data reflects the contribution of the original action frames in the initial action sequence to the fusion process. By multiplying it by the second weight coefficient, the influence of the original action frames in the initial action sequence can be adjusted. After obtaining the weighted optimized trajectory data and the weighted original trajectory data, it is necessary to ensure the consistency of the two data in terms of dimensions and feature dimensions. Because motion trajectory data usually contains the position information of skeletal nodes in three-dimensional space and is a set of vector data with the same dimensions, the weighting operation does not change its dimensions. However, it is necessary to ensure the consistency of dimensions, for example, the length dimension under the standard unit of the physics engine is used.
[0156] Step S1535: superimposing the weighted optimized trajectory data and the weighted original trajectory data frame by frame to generate fused trajectory data of the final action sequence.
[0157] 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 sequence of action frames and are consistent in dimension and scale, element-by-frame superposition can be performed. For each action frame, the corresponding skeletal node position information in the weighted optimized trajectory data is added to the corresponding skeletal node position information in the weighted original trajectory data to obtain the fused skeletal node position information. For example, for the i-th action frame, the position coordinates of the j-th skeletal 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 skeletal node in the weighted original trajectory data are (F1i_j_x, F1i_j_y, F1i_j_z). Therefore, the fused position coordinates of the j-th skeletal node in the 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 superposition operation on all action frames, the fused trajectory data of the final action sequence is generated.
[0158] Step S154: Execute the fusion process according to the first fusion instruction or the second fusion instruction to generate the final action sequence.
[0159] The fusion process is performed according to the generated first fusion instruction or the second fusion instruction. If it is the first fusion instruction, the action frames in the optimized action sequence whose physical compliance scores are higher than the compliance threshold are directly replaced with the corresponding original action frames in the initial action sequence. The action sequence formed after the replacement is completed is the final action sequence. During the replacement process, it is necessary to ensure that the replaced action frames match the initial action sequence in terms of time sequence and bone structure to ensure the continuity of the final action sequence. If it is the second fusion instruction, the fusion trajectory data obtained previously is used to update the initial action sequence. The fusion trajectory data is remapped to the bone node position and joint rotation angle to obtain the updated action frame, thereby generating the final action sequence.
[0160] Step S155: Generate the final action sequence of the target character and output it to the animation rendering system.
[0161] After the fusion process is completed, the final action sequence of the target character is generated. The final action sequence contains a series of action frames that conform to the laws of physics and have coherent movements. These action frames accurately describe the movement posture of the target character. The final action sequence is output to the animation rendering system, which renders the target character based on these action frames to generate the final animation picture. The output final action sequence needs to be transmitted in a format that the animation rendering system can recognize, such as a common animation file format, and must contain complete information such as bone node positions and joint rotation angles to ensure that the animation rendering system can correctly restore the character's movements.
[0162] Step S210: monitoring the rendering feedback data of the final action sequence in the animation rendering system in real time.
[0163] After the final motion sequence is output to the animation rendering system, the rendering feedback data from the final motion sequence needs to be monitored in real time. This rendering feedback data contains various information that appears during the rendering process, such as joint penetration warnings and motion distortion prompts. By monitoring this feedback data in real time, potential problems in the final motion sequence can be promptly identified and addressed accordingly.
[0164] Step S220: If the rendering feedback data includes a joint penetration warning or a motion distortion prompt, then re-extract the abnormal action frame that triggers the warning in the final action sequence.
[0165] If the rendering feedback data contains joint penetration warnings or motion distortion prompts, it means that there are action frames in the final action sequence that do not meet the requirements. At this time, it is necessary to re-extract the abnormal action frames that triggered the warning in the final action sequence. The joint penetration warning means that during the animation rendering process, the character's joints have penetrated each other, which is usually caused by unreasonable action design or inaccurate physical simulation. The motion distortion prompt means that the character's movement looks visually unnatural, which may be caused by improper settings of parameters such as action speed and acceleration. Based on the specific information in the rendering feedback data, locate the abnormal action frame that triggered the warning and extract it from the final action sequence.
[0166] Step S230: re-inputting the skeletal node position data of the abnormal action frame into the physics engine for constraint optimization processing to generate a replacement action frame.
[0167] The extracted skeletal node position data of the abnormal motion frames is re-input into the physics engine for constraint optimization. During this constraint optimization process, the previously established biomechanical and motion constraints must still be adhered to. Based on these constraints, the physics engine adjusts the skeletal node position data of the abnormal motion frames and recalculates data such as motion trajectory and collision response. Through continuous iterative optimization, the adjusted motion frames meet the biomechanical and motion constraints, ultimately generating replacement motion frames that improve both physical plausibility and motion coherence.
[0168] Step S240: After inserting the replacement action frame into the final action sequence, the updated final action sequence is subjected to physical compliance score verification and rendering simulation pre-verification. If there are residual abnormal frames, the sequence is readjusted 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.
[0169] Insert the generated replacement action frames into the corresponding positions in the final action sequence to obtain the updated final action sequence. Verify the physical compliance score of the updated final action sequence by recalculating the score using the previously determined physical compliance score method. Simultaneously, perform a rendering simulation pre-verification, performing a simulated rendering of the updated final action sequence in the animation rendering system to check for any issues such as joint penetration warnings or motion distortion.
[0170] If residual abnormal frames are found during the verification and pre-check process, the system determines whether to continue adjustments based on the preset maximum number of iterations or the compliance score difference threshold for the residual abnormal frames. The preset maximum number of iterations is a pre-set integer representing the maximum number of adjustments allowed. The compliance score difference threshold for the residual abnormal frames is a pre-set value representing the maximum allowable difference between the physical compliance score of the residual abnormal frames and the compliance threshold.
[0171] If the number of iterations has not reached the maximum number of iterations, and the compliance score difference of the remaining abnormal frames is greater than the compliance score difference threshold, the remaining abnormal frames are re-extracted, and steps S230 and S240 are repeated to perform constrained optimization on the remaining abnormal frames, and verification and pre-checking are performed again. This process continues until the number of iterations reaches the maximum number of iterations 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. Ultimately, a final action sequence that is physically compliant, motion-coherent, and meets animation production requirements is obtained.
[0172] Figure 2A schematic diagram illustrates exemplary hardware and software components of a system 100 for generating motion for a film and television animation character incorporating a physics engine, which can implement the concepts of the present invention, according to some embodiments of the present invention. For example, a processor 120 can be used in the system 100 for generating motion for a film and television animation character incorporating a physics engine, and can be used to perform the functions of the present invention.
[0173] The system 100 for generating motion for a film and television animation character using a physics engine can be a general-purpose server or a special-purpose server, both of which can be used to implement the method for generating motion for a film and television animation character using a physics engine. Although only one server is shown in the present invention, for convenience, the functions described in the present invention can be implemented in a distributed manner on multiple similar platforms to balance the processing load.
[0174] For example, the film and television animation character action generation system 100 combined with 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 storage media 140 in different forms, such as a disk, ROM, or RAM, or any combination thereof. Exemplarily, the film and television animation character action generation system 100 combined with 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 action generation system 100 combined with a physics engine also includes an I / O interface 150 between the computer and other input and output devices.
[0175] For ease of explanation, only one processor is described in the film and television animation character action generation system 100 combined with a physics engine. However, it should be noted that the film and television animation character action generation system 100 combined with a physics engine in the present invention can also include multiple processors, so the steps performed by one processor described in the present invention can also be performed jointly or individually by multiple processors. For example, if the processor of the film and television animation character action generation system 100 combined with a physics engine executes step A and step B, it should be understood that step A and step B can also be performed jointly by two different processors or individually in one processor. For example, the first processor executes step A, the second processor executes step B, or the first processor and the second processor execute steps A and B together.
[0176] In addition, an embodiment of the present invention further provides a readable storage medium, in which computer-executable instructions are preset. When a processor executes the computer-executable instructions, the above-mentioned method for generating film and television animation character actions combined with a physical engine is implemented.
[0177] It should be noted that in order to simplify the description of the present invention and thus help understand one or more embodiments of the invention, in the foregoing description of the embodiments of the present invention, multiple features are sometimes combined into one embodiment, figure or description thereof.
Claims
1. A method for generating motions of film and television animation characters in combination with a physical engine, characterized in that: The method comprises: Obtaining an initial action sequence of a target character, wherein the initial action sequence includes a plurality of continuous action frames; Calling a physical engine to perform physical simulation processing on the initial action sequence to obtain initial physical data corresponding to the initial action sequence; Dynamically adjusting the initial physical data based on preset motion constraints to generate an optimized action sequence for the target character; Performing action consistency verification on the optimized action sequence to determine a physical compliance score of the optimized action sequence; An action fusion instruction is generated according to the physical compliance score, and the optimized action sequence is fused with the initial action sequence based on the action fusion instruction to generate a final action sequence of the target character and output it to an animation rendering system.
2. The method for generating motions of film and television animation characters in combination with a physical engine according to claim 1, wherein: The calling of the physical engine to perform physical simulation processing on the initial action sequence to obtain initial physical data corresponding to the initial action sequence includes: Extracting the skeletal node position data and joint rotation angle data corresponding to each action frame from the initial action sequence, wherein the length unit in the skeletal node position data is a standard unit of the physics engine; Converting the skeletal node position data into a set of rigid body motion parameters recognizable by a physics engine, wherein the set of rigid body motion parameters includes mass distribution parameters, inertia tensor parameters, and collision volume parameters; Constructing a physical simulation scene based on the rigid body motion parameter set and the joint rotation angle data; Performing multi-level motion simulation operations in the physical simulation scene to calculate 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 according to the motion trajectory data and the collision response data.
3. The method for generating motions of film and television animation characters in combination with a physical engine according to claim 2, wherein: The step of converting the skeletal node position data into a set of rigid body motion parameters recognizable by a physics engine includes: Determining the hierarchical connection relationship of each skeletal node based on the skeletal topology of the target character; Calculate the mass distribution parameters of each skeletal node according to the hierarchical connection relationship, wherein the mass distribution parameters include the mass transfer ratio of adjacent skeletal nodes and the joint support force distribution weight; Based on the mass transfer ratio and the joint support force distribution weight, a mass distribution optimization equation is constructed under the condition that the total mass of the target character is conserved; The inertia tensor parameters of each skeletal node are obtained by solving the mass distribution optimization equation, and the collision volume parameters of each skeletal node in three-dimensional space are determined based on the inertia tensor parameters.
4. The method for generating motions of film and television animation characters in combination with a physical engine according to claim 2, wherein: The dynamically adjusting the initial physical data based on the preset motion constraint conditions to generate the optimized action sequence of the target character includes: Obtaining biomechanical constraints of the target character, wherein the biomechanical constraints include a joint motion angle threshold, a muscle contraction strength threshold, and a center of gravity shift tolerance; screening the motion trajectory data frame by frame according to the biomechanical constraint conditions, marking the action frames where any parameter of the joint activity angle, muscle contraction intensity and center of gravity offset exceeds the standard as a first abnormal frame set; performing inverse dynamics calculation on the collision response data in the first abnormal frame set to generate joint torque correction parameters; The joint driving torque in the first abnormal frame set is iteratively adjusted based on the joint torque correction parameter, and the physical simulation is re-executed until the updated motion trajectory data meets the biomechanical constraint conditions. The updated motion trajectory data is remapped with the bone node positions and joint rotation angles output by the physical engine to generate the optimized action sequence.
5. The method for generating motions of film and television animation characters in combination with a physical engine according to claim 4, characterized in that: The performing inverse dynamics calculation on the collision response data in the first abnormal frame set to generate joint torque correction parameters includes: Extracting contact point position data and contact force direction data between the target character and the virtual environment object from the collision response data; Determining a kinematic chain of affected skeletal nodes according to the contact point position data, and calculating a torque compensation value for each joint in the kinematic chain based on the contact force direction data; constructing an inverse dynamics optimization function with the torque compensation value as a constraint condition, solving the inverse dynamics optimization function by minimizing the joint torque deviation, and obtaining the joint torque correction parameter; The joint torque correction parameter is applied as an external torque to the kinematic chain of the physics engine to update the joint drive parameters in the physics simulation scene.
6. The method for generating motions of film and television animation characters in combination with a physical engine according to claim 2, wherein: The performing action continuity 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 speed; The motion smoothness score was generated based on the rate of change of the average motion velocity, and the joint acceleration mutation index was calculated by extracting the time derivative of the joint rotation velocity data; Comparing the motion smoothness score with a preset smoothness threshold, and marking a second abnormal frame set in the optimized motion sequence that is below the smoothness threshold; Performing statistical analysis on the joint acceleration mutation index corresponding to the second abnormal frame set, and determining a physical compliance score for the second abnormal frame set in combination with a preset mutation tolerance threshold; If the physical compliance score is lower than a preset compliance threshold, a secondary adjustment process is performed on the rigid body motion parameter set in the second abnormal frame set to update the physical compliance score of the optimized action sequence.
7. The method for generating motions of film and television animation characters in combination with a physical engine according to claim 6, characterized in that: The performing secondary adjustment processing on the rigid body motion parameter set in the second abnormal frame set includes: Obtaining a time derivative of the skeletal displacement difference data of adjacent action frames in the second abnormal frame set; Determining the mutation direction and mutation amplitude of the bone displacement difference data according to the time derivative; Adjusting a parameter of an external force applied to a target character in the physical simulation scene based on the mutation direction, so that the adjusted force direction is opposite to the mutation direction; adjusting a collision volume parameter based on the mutation amplitude so that the adjusted collision volume parameter reduces the joint acceleration mutation index; The adjusted mass distribution parameters and collision volume parameters are re-input into the physics engine to perform local physics simulation and generate updated motion trajectory data.
8. The method for generating motions of film and television animation characters in combination with a physical engine according to claim 6, wherein: Generating an action fusion instruction according to the physical compliance score includes: Comparing and analyzing 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; If the action optimization gain coefficient is greater than a preset gain threshold, a first fusion instruction is generated, wherein the first fusion instruction instructs the action frames in the optimized action sequence whose physical compliance scores are 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, wherein the second fusion instruction instructs to perform weighted superposition processing on action frames in the optimized action sequence whose physical compliance scores are higher than the compliance threshold and corresponding original action frames in the initial action sequence; The fusion process is performed according to the first fusion instruction or the second fusion instruction to generate the final action sequence.
9. The method for generating motions of film and television animation characters in combination with a physical engine according to claim 8, characterized in that: The weighted superposition processing of 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 includes: determining a first weight coefficient of an action frame in the optimized action sequence according to a ratio of the physical compliance score to the original fluency score; determining a second weight coefficient of an original action frame in the initial action sequence based on a difference between the action optimization gain coefficient and the gain threshold; multiplying the motion trajectory data of the action frame in the optimized action sequence by the first weight coefficient to obtain weighted optimized trajectory data; multiplying the motion trajectory data of the original action frame in the initial action sequence by the second weight coefficient to obtain weighted original trajectory data; The weighted optimized trajectory data and the weighted original trajectory data are superimposed frame by frame to generate fused trajectory data of the final action sequence.
10. A film and television animation character action generation system combined with a physical engine, characterized in that: It includes a processor and a memory, the memory is connected to the processor, the memory is used to store programs, instructions or codes, and the processor is used to execute the programs, instructions or codes in the memory to implement the method for generating film and television animation character actions combined with a physical engine as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Role model action matching method, analysis engine and related equipment
CN116363273A
Real-time action method and device for synchronously driving character animation and physical interaction
CN116883560A
Physical animation generation method and device based on Unreal engine
CN116934922A
Motion video generation method, related device and medium
CN119229218A
Virtual character behavior action simulation system and method based on artificial intelligence
CN119850802A