Animation generation method and device and electronic equipment
By performing collision testing and parameter optimization methods in animation generation, the problem of low parameter adjustment accuracy in the prior art is solved, and a more efficient animation generation effect is achieved.
Patent Information
- Application Number
- CN202411873599.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-04-11
Smart Images

Figure CN119810279A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of metaverse, and more specifically, to an animation generation method, device and electronic device. Background Art
[0002] In the related art, when generating collision animation effects, a collision test is first performed based on the created animation character, and the relevant staff will manually fine-tune the parameters based on the results of the collision test. The above method of manually adjusting parameters is prone to parameter modification errors, inaccurate parameter adjustment, etc., resulting in poor animation generation effects, not close to reality, low adjustment accuracy and poor animation generation effects.
[0003] Currently, no effective solution has been proposed to address the problems of low parameter adjustment accuracy and poor animation generation effect in related technologies. Summary of the invention
[0004] The main purpose of the present application is to provide an animation generation method to solve the problems of low parameter adjustment accuracy and poor animation generation effect in the related art.
[0005] In order to achieve the above-mentioned purpose, according to one aspect of the present application, an animation generation method is provided. The method comprises: obtaining initial motion parameters of a target part point of a target character, wherein the initial motion parameters are used to indicate the initial motion characteristics of the target part point; based on the initial motion parameters and initial dynamic parameters, performing a collision test between the target character and the collision body to obtain a collision test result, wherein the initial dynamic parameters are used to indicate the physical property parameters of the target character and its environment; determining a target adjustment rule matching the target part point from a plurality of adjustment rules; based on the collision test result, optimizing the initial motion parameters and initial dynamic parameters using the target adjustment rule to obtain target motion parameters and target dynamic parameters; generating a target animation based on the target motion parameters and target dynamic parameters.
[0006] Optionally, based on the collision test results, target adjustment rules are used to optimize the initial motion parameters and initial dynamic parameters to obtain target motion parameters and target dynamic parameters, including: based on the collision test results, the initial dynamic parameters are optimized to obtain target dynamic parameters; based on the target dynamic parameters, a simulated animation clip is generated; during the playback of the simulated animation clip, whether the target character in the simulated animation clip meets the preset motion restriction conditions; if the preset motion restriction conditions are not met, the initial motion parameters are optimized using target adjustment rules to obtain target motion parameters; or if the preset motion restriction conditions are met, the initial motion parameters are used as target motion parameters.
[0007] Optionally, when the target part point is a joint and the corresponding initial motion parameter is a joint motion parameter, during the playback of the simulated animation clip, it is detected whether the target character in the simulated animation clip satisfies the preset motion restriction condition, including: during the playback of the simulated animation clip, obtaining the joint motion range of the target character; detecting whether the joint motion range is within the preset motion range; if the joint motion range is within the preset motion range, determining that the preset motion restriction condition is satisfied; if the joint motion range is not within the preset motion range, determining that the preset motion restriction condition is not satisfied.
[0008] Optionally, when the preset motion restriction conditions are not met, the initial motion parameters are optimized using target adjustment rules to obtain target motion parameters, including: when the preset motion restriction conditions are not met, obtaining the deviation information of the joint motion range relative to the preset motion range, wherein the deviation information includes at least: the deviation direction and the degree of deviation; obtaining the target joint type of the target part point; based on the deviation information and the target joint type, the initial motion parameters are optimized using target adjustment rules to obtain the target motion parameters.
[0009] Optionally, a target adjustment rule that matches the target part point is determined from multiple adjustment rules, including: determining a target adjustment rule corresponding to the target joint type from multiple adjustment rules; wherein the target adjustment rule is used to indicate the correspondence between the deviation information and the adjustment method of the initial motion parameters, and multiple adjustment rules correspond to different joint types.
[0010] Optionally, based on the deviation information and the target joint type, the initial motion parameters are optimized using target adjustment rules to obtain target motion parameters, including: based on the deviation information and the target adjustment rules, determining a target adjustment method for adjusting the initial motion parameters, wherein the target adjustment method includes at least: an adjustment direction and an adjustment amplitude for adjusting the initial motion parameters; based on the target adjustment method, adjusting the initial motion parameters to obtain target motion parameters.
[0011] Optionally, based on the collision test results, the initial dynamic parameters are optimized to obtain target dynamic parameters, including: obtaining animation rendering requirements; based on the animation rendering requirements and the collision test results, the initial dynamic parameters are optimized to obtain target dynamic parameters.
[0012] In order to achieve the above-mentioned purpose, according to another aspect of the present application, an animation generation device is provided. The device comprises: an acquisition module, used to acquire the initial motion parameters of the target part point of the target character, wherein the initial motion parameters are used to indicate the initial motion characteristics of the target part point; a test module, used to perform a collision test on the target character and the collision body based on the initial motion parameters and initial dynamic parameters, and obtain a collision test result, wherein the initial dynamic parameters are used to indicate the physical property parameters of the target character and its environment; a determination module, used to determine a target adjustment rule matching the target part point from multiple adjustment rules; an optimization module, used to optimize the initial motion parameters and initial dynamic parameters using the target adjustment rules based on the collision test result, and obtain target motion parameters and target dynamic parameters; and a generation module, used to generate a target animation based on the target motion parameters and target dynamic parameters.
[0013] Optionally, the optimization module includes: a first optimization submodule, used to optimize the initial dynamic parameters based on the collision test results to obtain target dynamic parameters; a first generation submodule, used to generate a simulation animation based on the target dynamic parameters; a first detection submodule, used to detect whether the target character in the simulation animation meets the preset motion restriction conditions during the playback of the simulation animation; a second optimization submodule, used to optimize the initial motion parameters using the target adjustment rules to obtain the target motion parameters when the preset motion restriction conditions are not met; a first initial submodule, used to use the initial motion parameters as the target motion parameters when the preset motion restriction conditions are met.
[0014] Optionally, the first detection submodule includes: a first acquisition submodule, used to acquire the joint motion range of the target character during the simulation animation playback; a second detection submodule, used to detect whether the joint motion range is within a preset motion range; a first determination submodule, used to determine that the preset motion restriction condition is met when the joint motion range is within the preset motion range; and a second determination submodule, used to determine that the preset motion restriction condition is not met when the joint motion range is not within the preset motion range.
[0015] Optionally, the second determination submodule also includes: a second acquisition submodule, used to obtain the deviation information of the joint motion range relative to the preset motion range when the preset motion restriction conditions are not met, wherein the deviation information at least includes: the deviation direction and the deviation degree; obtaining the target joint type of the target part point; a third optimization submodule, used to optimize the initial motion parameters based on the deviation information and the target joint type, using the target adjustment rules to obtain the target motion parameters.
[0016] Optionally, the third optimization submodule includes: a third determination submodule, used to determine the target adjustment rule corresponding to the target joint type from multiple adjustment rules; wherein the target adjustment rule is used to indicate the correspondence between the deviation information and the adjustment method of the initial motion parameters, and multiple adjustment rules correspond to different joint types.
[0017] Optionally, the third optimization submodule also includes: a fourth determination submodule, used to determine a target adjustment method for adjusting the initial motion parameters based on the deviation information and the target adjustment rules, wherein the target adjustment method at least includes: an adjustment direction and an adjustment amplitude for adjusting the initial motion parameters; a first adjustment submodule, used to adjust the initial motion parameters based on the target adjustment method to obtain the target motion parameters.
[0018] Optionally, the generation module includes: a third acquisition submodule, used to obtain animation rendering requirements; and a fourth optimization submodule, used to optimize initial dynamic parameters based on the animation rendering requirements and collision test results to obtain target dynamic parameters.
[0019] In an embodiment of the present application, initial motion parameters of a target part point of a target character are obtained, wherein the initial motion parameters are used to indicate the initial motion characteristics of the target part point; based on the initial motion parameters and the initial dynamic parameters, a collision test is performed on the target character and the collision body to obtain a collision test result, wherein the initial dynamic parameters are used to indicate the physical property parameters of the target character and its environment; a target adjustment rule matching the target part point is determined from multiple adjustment rules; based on the collision test result, the initial motion parameters and the initial dynamic parameters are optimized using the target adjustment rule to obtain target motion parameters and target dynamic parameters; based on the target motion parameters and the target dynamic parameters, a target animation is generated, thereby achieving the purpose of dual optimization of motion parameters and dynamic parameters based on the collision test result using the target adjustment rule to improve the accuracy of determining the motion parameters and dynamic parameters, thereby achieving the technical effect of improving the animation generation effect, and further solving the technical problem of low parameter adjustment accuracy and poor animation generation effect caused by only adjusting the parameters based on the collision test result. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0021] Figure 1 A hardware structure block diagram of a computer terminal for implementing an animation generation method is shown;
[0022] Figure 2is a flowchart of an animation generation method according to an embodiment of the present application;
[0023] Figure 3 is a schematic diagram of an animation generating device provided according to an embodiment of the present application;
[0024] Figure 4 It is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following explanations:
[0028] Acceleration is a physical quantity that describes how fast an object's speed changes. It represents the change in speed per unit time, that is, the rate of change of the velocity vector over time. The unit of acceleration is meters per second squared.
[0029] Animation Generation (AG) refers to the process of creating dynamic visual effects by arranging a series of static images (frames) in a certain order and time interval through computer software or technical means.
[0030] Kinematics refers to a branch of physics that studies the motion of objects without involving the influence of factors such as force and mass.
[0031] A regular grid is a dot structure that is evenly distributed in a two-dimensional or three-dimensional space. In a regular grid, the distance and angle between each point are equal. This structure is very common in computer graphics, numerical analysis, physical simulation and other fields, and is used to represent and process spatial data. Regular grids can be used to create various graphics and models, such as topographic maps, architectural models, etc.
[0032] It should be noted that the collected information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this application are information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data are in compliance with relevant laws, regulations and standards, necessary confidentiality measures are taken, and public order and good customs are not violated, and corresponding operation entrances are provided for users to choose to authorize or refuse. For example, an interface is set up between this system and relevant users or institutions to provide users with corresponding operation entrances for users to choose to agree or refuse the results of automated decision-making; if the user chooses to refuse, the expert decision-making process will be entered.
[0033] Example 1
[0034] According to an embodiment of the present application, an embodiment of a method for generating an animation is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0035] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing an animation generation method. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0036] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0037] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the animation generation method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the above-mentioned animation generation method is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0038] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0039] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0040] In the above operating environment, the present application provides an optional animation generation method. Figure 2is a flowchart of an animation generation method according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:
[0041] Step S202, obtaining initial motion parameters of a target part point of the target character, wherein the initial motion parameters are used to indicate initial motion features of the target part point;
[0042] Optionally, the target part points may be key points of an animation character or object, which may be joints on a skeleton, the center of an object, or other points with special meanings.
[0043] Optionally, the initial motion parameters can provide necessary starting conditions for subsequent dynamic simulation and collision testing, and the initial motion parameters may include, but are not limited to, the initial position, direction, angle, speed, and acceleration of the target character's body part (target part point). Among them, the position represents the position coordinates of the target part point in space; the direction represents the direction of the target part point's movement or the direction the character is facing; the angle represents the rotation angle of the target part point relative to its parent node or reference point; the speed represents the speed at which the target part point moves; and the acceleration is used to indicate the change in the acceleration of the target part point, which is used to affect the smoothness and naturalness of the target part point's movement.
[0044] It should be noted that without these initial motion parameters, the dynamics simulation will not start, so they are the starting point of the entire animation generation process. These initial motion parameters are a combination of the animator's creativity and the principles of biological kinematics, and they guide the movement of the character in the animation. By setting the initial motion parameters, you can ensure that the movement of the animated character meets the animator's expectations while simulating the movement laws of real creatures.
[0045] Step S204, performing a collision test on the target character and the collision body based on the initial motion parameters and the initial dynamic parameters to obtain a collision test result, wherein the initial dynamic parameters are used to indicate physical property parameters of the target character and its environment;
[0046] Optionally, when performing collision tests between the target character and the collision body, the initial motion parameters can be combined with the dynamic parameters to ensure that the behavior of the character in the animation follows the laws of physics. For example, parameters such as velocity and acceleration should match dynamic parameters such as gravity and collision reaction to simulate real-world physical behavior.
[0047] Optionally, collision testing refers to simulating the interaction between the target character and the environment or other objects through the physics engine, which may include but is not limited to collision, friction, gravity and other effects, to check the rationality of the animation at the physical level. By setting initial dynamic parameters, such as gravity parameters, collision parameters, muscle parameters, etc., the physics engine can accurately simulate these interactions to ensure that the physical behavior in the animation conforms to the physical laws of the real world. Based on the initial motion parameters, the collision test can detect whether the movement of the target character in the animation is natural and reasonable. For example, checking the elastic response of the arms or legs during collision, whether the range of motion of the joints exceeds the limits of normal organisms, etc., can help to discover and correct animation behaviors that may look unnatural or not in line with the principles of biokinetics. The results of the collision test can be used as a direct basis for adjusting the animation effect. If the test finds that the animation behavior is not as expected, such as the character is too stiff or bounces too much after the collision, these results can guide the subsequent adjustment of the dynamic parameters and motion parameters to make the animation closer to reality and more immersive. Among them, the initial dynamic parameters may include but are not limited to: gravity parameters, collision parameters, muscle parameters, among which: gravity parameters may include but are not limited to gravity acceleration and gravity direction, among which gravity acceleration determines the acceleration of the falling object. A larger gravity acceleration will cause the object to fall faster; gravity direction determines the direction of gravity. In three-dimensional space, the direction of gravity is always vertically downward. Collision parameters may include but are not limited to collision response and collision detection, among which collision response determines the behavior of an object when it collides with other objects. For example, the elastic coefficient determines the degree of bounce after the object collides; collision detection determines when and how to detect collisions between objects. This involves the shape, size and position of the collision body. Muscle parameters may include but are not limited to muscle tension, the relationship between muscle length and speed, among which muscle tension determines the strength of the muscle when it contracts. Changes in tension will affect the character's actions and movements; the relationship between muscle length and speed determines the contraction speed of the muscle at different lengths. This will affect the smoothness and speed of the character's movements.
[0048] Optionally, you can get the collision body as follows:
[0049] Step S2041, constructing a mesh model: the three-dimensional model of the target character, especially the character model containing its complex geometric shape, can be converted into a regular mesh representation composed of multiple regular shapes, such as cubes, spheres or cylinders, wherein the size and distribution of the regular shapes are optimized to approximate the physical properties of the model while reducing the number of geometric bodies;
[0050] Step S2042, constructing a regular grid: using cells of uniform, predefined size and shape to cover the entire model space, creating a regular grid to form a three-dimensional array structure to achieve fast data access and processing, each cell represents a potential collision detection area in the model space;
[0051] Step S2043, automatic identification and intersection analysis: automatically identifying the intersection between cells in the regular grid and the geometric body of the three-dimensional model through an algorithm, and marking all cells that intersect with the actual geometric body of the model as potential collision body areas;
[0052] Step S2044, collision body generation and optimization: merging or simplifying the marked intersecting cells into one or more optimized collision bodies, which may be complex geometric shapes, such as convex hulls, to reduce the number of collision detections while ensuring that the collision body matches the physical properties and motion state of the model;
[0053] Step S2045, reduction of physical calculation overhead: using the constructed regular grid as a pre-screening mechanism, detailed collision detection is performed only on the grid cells that actually intersect with the model geometry in the physics engine (Physics Engine), thereby significantly reducing the complexity and overhead of physical calculations and improving the real-time rendering performance of animations or games.
[0054] Among them, a physics engine is a computer program that can be used to simulate physical phenomena in the real world, such as gravity, collision, friction, etc. It plays an important role in game development, animation production, simulation and other fields. The main purpose of a physics engine is to create a physical behavior close to reality in a virtual environment so that users can experience a more realistic and natural interaction.
[0055] Step S206, determining a target adjustment rule matching the target part point from a plurality of adjustment rules;
[0056] Optionally, different body parts (target points) have different motion laws and physical characteristics. For example, the range of motion, speed, muscle tension and other parameters of arms and legs are significantly different. By adopting adjustment rules that match specific parts, the most accurate adjustment and optimized animation effect can be achieved. The existence of multiple adjustment rule libraries allows animators or systems to select the most suitable adjustment rules for parameter optimization according to the specific type of target points. Through targeted optimization methods, specific problems found in collision tests, such as excessive bouncing, excessive or insufficient range of motion, etc., can be solved more efficiently. The adjustment rules for each target point are formulated based on the biokinematic principles of the part. For example, the adjustment rules for arms can consider the rotation range and muscle tension of the shoulder joint, and the adjustment rules for legs can consider the flexion and extension angles of the knee and hip joints. By applying these rules, it can be ensured that the movement of the animated character conforms to the real biokinematic laws.
[0057] Step S208, based on the collision test results, the initial motion parameters and the initial dynamic parameters are optimized using target adjustment rules to obtain target motion parameters and target dynamic parameters;
[0058] Optionally, by identifying abnormal points in the test, such as excessive bounce, mold penetration, and joint range of motion, clear guidance can be provided for subsequent parameter optimization. The target adjustment rule is an optimization strategy designed for specific parts. Based on the test results and the biokinematic characteristics of the target parts, it guides the adjustment direction and amplitude of the initial motion parameters and initial dynamic parameters. This makes the adjustment process more scientific and precise, and can avoid blind modifications.
[0059] In an optional embodiment, based on the collision test results, the initial motion parameters and the initial dynamic parameters are optimized using target adjustment rules to obtain target motion parameters and target dynamic parameters, including: based on the collision test results, the initial dynamic parameters are optimized to obtain target dynamic parameters; based on the target dynamic parameters, a simulated animation clip is generated; during the playback of the simulated animation clip, whether the target character in the simulated animation clip meets the preset motion restriction conditions; if the preset motion restriction conditions are not met, the initial motion parameters are optimized using target adjustment rules to obtain target motion parameters; or if the preset motion restriction conditions are met, the initial motion parameters are used as target motion parameters.
[0060] Optionally, based on the results of the collision test, the dynamic parameters are optimized first. Because the accurate simulation of the physical environment is the basis of the realism of the animation, the optimization of the dynamic parameters can directly improve the physical behaviors such as collision reaction and gravity influence, and ensure the rationality of the animation at the physical level. The simulated animation clips generated after optimizing the dynamic parameters are used to intuitively display the optimization effect and serve as a basis for further adjustments. By playing the simulated animation, the visual effects and physical behaviors of the animation after the dynamic parameters are adjusted can be intuitively evaluated. During the playback of the simulated animation, it is detected whether the movement of the target character meets the preset movement restrictions. This is a further check based on the principle of biokinematics to ensure that the movement in the animation conforms to the structural and functional limitations of the organism and avoid unnatural or impossible movements.
[0061] Optionally, the target kinetic parameters may be obtained by, but not limited to, the following methods:
[0062] Step S2081, analyzing the collision test results, specifically includes:
[0063] Identify problem points and check for anomalies or unexpected animation behaviors in collision tests, such as excessive bouncing, clipping, and jerky motion.
[0064] Identify the dynamic parameters and determine which dynamic parameters are most likely to cause the above problems, such as gravity acceleration, spring coefficient, friction, joint restrictions, etc.
[0065] Step S2082, setting the adjustment target, specifically includes:
[0066] Specify rendering requirements, which may include but are not limited to animation style (realistic, exaggerated, etc.), speed, rhythm, naturalness and smoothness of character movements, etc.;
[0067] Define the physical rules that the animation should follow, such as the effects of gravity, interactions between objects, etc.
[0068] Step S2083, fine-tuning the dynamic parameters, specifically includes:
[0069] Make small changes to the identified dynamic parameters, such as increasing or decreasing the elastic coefficient, adjusting the friction, etc.
[0070] If the collision effect is not ideal, such as the object rebounding force is too large, you can reduce the elastic coefficient of the collision body; if the collision detection is inaccurate, adjust the shape and size of the collision body to better match the object;
[0071] The gravity acceleration or direction can be adjusted according to animation requirements to affect the speed and trajectory of the falling object.
[0072] Step S2084, real-time preview and feedback, specifically includes:
[0073] Preview the modified animation in real time in the animation editing software to see if the problem has been improved;
[0074] Animators and testers should watch the animation and provide feedback to assess whether the adjustments are effective and meet the rendering needs.
[0075] Step S2085, repeating the test and adjustment, specifically includes:
[0076] Based on the feedback, it may be necessary to adjust the parameters again, and then re-perform collision testing and animation preview until satisfactory visual effects and physical performance are achieved, that is, the target dynamic parameters are output while meeting the preset motion constraints.
[0077] Optionally, this optional embodiment can form an efficient, accurate and adaptable animation optimization process by prioritizing the optimization of dynamic parameters and fine-tuning motion parameters, combined with feedback verification of simulated animation and detection of motion restriction conditions. This embodiment can ensure the realism and naturalness of animation, improve the efficiency of animation production, reduce manual intervention, and provide strong support for the development of animation technology and industry applications.
[0078] In an optional embodiment, when the target part point is a joint and the corresponding initial motion parameter is a joint motion parameter, during the playback of the simulated animation clip, it is detected whether the target character in the simulated animation clip satisfies the preset motion restriction condition, including: during the playback of the simulated animation clip, obtaining the joint motion range of the target character; detecting whether the joint motion range is within the preset motion range; if the joint motion range is within the preset motion range, determining that the preset motion restriction condition is satisfied; if the joint motion range is not within the preset motion range, determining that the preset motion restriction condition is not satisfied.
[0079] Optionally, by detecting whether the joint motion range is within the preset motion range, it can be ensured that the joint motion of the character in the animation does not exceed the physiological limitations of real creatures, such as the natural bending angle and motion range of the joints, to prevent the movements in the animation from looking unnatural or impossible. During the animation playback of the simulated animation clip, by obtaining and detecting the joint motion range, it can be verified whether the joint motion complies with physical rules such as gravity, collision response, etc. after the dynamic parameters are adjusted, to ensure the realism and physical rationality of the animation effect. If it is detected that the joint motion range is not within the preset motion range, this step can provide a basis for adjusting the joint motion parameters, allowing the animator or system to optimize in a targeted manner until the joint motion in the animation is both natural and reasonable and meets the preset motion restrictions.
[0080] In this embodiment, by detecting joint motion parameters, it can be ensured that the motion of the animated character complies with both physical rules and biokinematic limitations, thereby improving the authenticity and naturalness of the animation, avoiding physical conflicts, optimizing the animation production process, and ensuring animation quality.
[0081] In an optional embodiment, when the preset motion restriction conditions are not met, the initial motion parameters are optimized using target adjustment rules to obtain target motion parameters, including: when the preset motion restriction conditions are not met, obtaining the deviation information of the joint motion range relative to the preset motion range, wherein the deviation information includes at least: the deviation direction and the degree of deviation; obtaining the target joint type of the target part point; based on the deviation information and the target joint type, the initial motion parameters are optimized using target adjustment rules to obtain the target motion parameters.
[0082] Optionally, the degree of deviation is the magnitude of deviation; the direction of deviation and the magnitude of deviation can reflect the difference between the joint movement in the actual animation and the expected setting (preset range of motion). For example, if the actual rotation angle of the joint exceeds the preset maximum rotation angle, this will cause deviation, the direction of deviation can be forward, backward, etc., and the magnitude of deviation is the difference between the actual angle and the preset angle.
[0083] Optionally, the joint type may refer to the type of joint, such as finger joints, knee joints, elbow joints, etc. Different types of joints have their own specific motion restrictions and physical properties, which will affect the setting of the motion parameters of the target part point.
[0084] Optionally, when it is detected that the range of joint motion in the animation clip exceeds the preset biokinematic limits, obtaining the specific deviation direction and degree of deviation helps to accurately identify the problem and provide precise guidance for subsequent parameter optimization. According to the target joint type (such as arm joints, leg joints, hand joints, etc.), the matching adjustment rules are used to optimize the motion parameters, and personalized adjustments can be made according to the characteristics of different joints, making the motion in the animation more natural and realistic.
[0085] In an optional embodiment, a target adjustment rule that matches the target part point is determined from multiple adjustment rules, including: determining the target adjustment rule corresponding to the target joint type from multiple adjustment rules; wherein the target adjustment rule is used to indicate the correspondence between the deviation information and the adjustment method of the initial motion parameters, and multiple adjustment rules correspond to different joint types.
[0086] Optionally, each joint type (such as arm joints, leg joints, hand joints, etc.) has its unique range of motion, speed and mechanical properties. Selecting a rule that matches the target joint type from a plurality of adjustment rules can ensure that parameter adjustment is based on the biokinetics and physical properties of the joint, and achieves more accurate and effective optimization. The present embodiment, by presetting a plurality of adjustment rules, can automatically select the most suitable rule to apply according to the detected deviation information, can reduce the need for manual adjustment, and improve the automation and intelligent level of the animation optimization process.
[0087] For different joint types, the corresponding joint motion parameter adjustment rules are different, for example:
[0088] For arm joints, when the deviation direction is forward, the character's arm exceeds the preset forward range of motion when moving forward; the corresponding joint adjustment method is to reduce the forward rotation angle parameter of the shoulder joint, or increase the muscle tension parameter associated with the arm to limit the excessive forward extension of the arm. When the deviation direction is backward, the character's arm exceeds the preset backward range of motion when moving backward. The corresponding adjustment method is to increase the backward rotation angle parameter of the shoulder joint, or reduce the muscle tension parameter associated with the arm to allow the arm to move backward more freely.
[0089] For leg joints, if the deviation is too large, the height of the character's legs when jumping exceeds the preset range. Reduce the flexion and extension angle parameters of the knee and hip joints, or adjust the relevant muscle strength parameters to reduce the jumping height. If the deviation is too small, the character's head turns too small when turning left and right. The corresponding adjustment method is to increase the left and right rotation angle parameters of the neck joint, or adjust the tension parameters of the relevant head muscles to increase the range of head rotation.
[0090] For the joint type of hand joints, when the target character's hand joints exceed the preset forward and backward movement range and the preset gripping strength when grasping an object, the corresponding adjustment method is: simultaneously adjust the forward and backward rotation angle parameters of the wrist joints and the tension parameters of the gripping-related muscles to meet the gripping requirements.
[0091] The above methods of adjusting joint motion parameters can be tried and adjusted according to specific circumstances to achieve the best animation effect. At the same time, other factors can be further considered, such as the overall rhythm of the animation, the smoothness and naturalness of the movements, etc., to ensure the overall coordination and expressiveness of the animation.
[0092] In an optional embodiment, based on the deviation information and the target joint type, the initial motion parameters are optimized using target adjustment rules to obtain target motion parameters, including: based on the deviation information and the target adjustment rules, determining a target adjustment method for adjusting the initial motion parameters, wherein the target adjustment method includes at least: an adjustment direction and an adjustment amplitude for adjusting the initial motion parameters; based on the target adjustment method, adjusting the initial motion parameters to obtain target motion parameters.
[0093] Optionally, the deviation information can provide a specific problem description, and the target adjustment rules can guide how to accurately adjust the motion parameters based on this information and the target joint type to ensure that the adjustment direction and amplitude are correct. This embodiment automatically analyzes the deviation information and determines the target adjustment method through a preset rule library and algorithm to achieve automated and intelligent optimization of motion parameters, which can reduce the need for manual intervention and improve the efficiency and accuracy of adjustment. During the adjustment process, the dynamic simulation results (collision test) and biokinematic limitations (preset range of motion) are comprehensively considered to ensure that the adjusted motion parameters comply with both physical rules and biokinematic principles, thereby improving the authenticity and naturalness of the animation.
[0094] In an optional embodiment, based on the collision test results, the initial dynamic parameters are optimized to obtain target dynamic parameters, including: obtaining animation rendering requirements; based on the animation rendering requirements and the collision test results, the initial dynamic parameters are optimized to obtain target dynamic parameters.
[0095] Optionally, by obtaining the animation rendering requirements, ensure that the optimization direction and goals match the style, rhythm and visual effect requirements of the final animation to avoid blind optimization. Based on the collision test results, it is possible to identify the deviation or insufficiency of the dynamic parameters in simulating real physical behaviors, provide specific data support for parameter optimization, and ensure that the physical reactions in the animation are more reasonable. This embodiment can achieve the dynamics and flexibility of dynamic parameter optimization by combining animation rendering requirements, and can be adjusted according to the needs of different projects to improve the adaptability and efficiency of animation generation.
[0096] Step S210, generating a target animation based on the target motion parameters and the target dynamic parameters.
[0097] Optionally, the target dynamics parameters can include precise adjustments to the physical properties of the environment (such as gravity, collision, muscle tension, etc.) to ensure the physical authenticity of the animation clip at the dynamic level and make the character movement in the animation closer to reality. The target motion parameters are the result of optimization based on the principles of biokinematics and joint constraints. It guides the precise motion trajectory and characteristics of the target parts (such as joints), making the movements of the characters in the animation smooth and natural, in line with the movement characteristics of the organism. The combined application of the optimized motion parameters and dynamic parameters to the generation of animation clips can ensure the coordination between animation elements and avoid the problems of incoherent or unnatural animation that may be caused by the adjustment of a single parameter.
[0098] Based on the above embodiments and optional embodiments, the present application proposes an optional implementation of an animation generation method, which includes:
[0099] Step S1, determining the motion parameters of the target part point, specifically includes:
[0100] In the animation editor, set the initial motion parameters of the target part points for the target character's body parts, including the motion direction and angle. The target part points should be based on the biological bone structure and kinematics principles to simulate real human body movements, and can include but are not limited to the target character's bones.
[0101] Step S2, applying dynamics simulation and collision detection, specifically includes:
[0102] Enable dynamic simulation and set the collision body to collide with the target character to simulate the movement and deformation of the target character's body parts. This includes muscle contraction and relaxation, collision reaction, and the influence of gravity.
[0103] Step S3, adjusting the kinetic parameters, specifically includes:
[0104] According to the needs of animation rendering, the parameters of dynamic simulation (i.e. initial dynamic parameters) are adjusted in combination with collision tests and results to obtain target dynamic parameters such as friction, elasticity, mass and gravity. These parameters should conform to the physical rules of the real world in order to accurately simulate motion and deformation. The dynamic parameters involved refer to the physical rules followed when simulating the motion of objects in the physics engine. The adjustment of dynamic parameters is to ensure the physical rationality and authenticity of the animation, while the motion parameters of the target parts are to ensure the rationality of the animation in biokinematics and the naturalness of the vision.
[0105] Step S4, fine adjustment of motion parameters, specifically including:
[0106] A simulated animation clip is generated based on the adjusted motion dynamics parameters (i.e., target dynamics parameters); during the playback of the simulated animation clip, it is detected whether the target character in the simulated animation clip meets the preset motion restriction conditions; if so, the simulated animation clip can be directly used as the final target animation clip; if not, the motion parameters need to be adjusted accordingly to obtain the adjusted motion parameters (i.e., target motion parameters).
[0107] Specifically, when the target part point is the joint of the target character, the joint motion range of the target character in the simulated animation is detected to detect whether the joint motion range is within the preset motion range; if it is, no adjustment is required; if not, it is necessary to determine the deviation direction, deviation size (i.e., degree of deviation) and joint type of the joint motion range relative to the preset motion range; based on the deviation direction, deviation size and joint type, fine-tune the joint motion parameters of the target character, where the joint motion parameters may include but are not limited to joint rotation angle, speed, rotation direction, etc.
[0108] Step S5, integrating into a complete animation, specifically includes:
[0109] Integrate the adjusted target character and target animation clip into the complete animation project. Make sure to match with other animation elements to maintain overall consistency and realism.
[0110] Step S6, animation continuous optimization, specifically including:
[0111] Throughout the animation process, we continuously focus on detail adjustment and optimization. As technology advances and our understanding of the principles of biological movement deepens, we continue to improve the animation effects.
[0112] It should be noted that the animation generation method provided by the embodiment of the present application obtains the initial motion parameters of the target part point of the target character, wherein the initial motion parameters are used to indicate the initial motion characteristics of the target part point; based on the initial motion parameters and initial dynamic parameters, a collision test is performed on the target character and the collision body to obtain a collision test result, wherein the initial dynamic parameters are used to indicate the physical property parameters of the target character and its environment; a target adjustment rule matching the target part point is determined from multiple adjustment rules; based on the collision test result, the initial motion parameters and initial dynamic parameters are optimized using the target adjustment rule to obtain the target motion parameters and target dynamic parameters; based on the target motion parameters and target dynamic parameters, a target animation is generated, which solves the problem of low parameter adjustment accuracy and poor animation generation effect in the related art. The purpose of using the target adjustment rule to double optimize the motion parameters and dynamic parameters based on the collision test result to improve the accuracy of the determination of the motion parameters and dynamic parameters is achieved, thereby achieving the technical effect of improving the animation generation effect.
[0113] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0114] Example 2
[0115] The embodiment of the present application also provides an animation generation device. It should be noted that the animation generation device of the embodiment of the present application can be used to execute the animation generation method provided in the embodiment of the present application. The animation generation device provided in the embodiment of the present application is introduced below.
[0116] According to an embodiment of the present application, a device for implementing the above animation generation method is also provided. Figure 3 is a schematic diagram of an animation generating device provided according to an embodiment of the present application, such as Figure 3 As shown, the device includes: an acquisition module 300, which is used to acquire the initial motion parameters of the target part point of the target character, wherein the initial motion parameters are used to indicate the initial motion characteristics of the target part point; a test module 302, which is connected to the acquisition module 300, and is used to perform a collision test on the target character and the collision body based on the initial motion parameters and initial dynamic parameters to obtain a collision test result, wherein the initial dynamic parameters are used to indicate the physical property parameters of the target character and its environment; a determination module 304, which is connected to the test module 302, and is used to determine a target adjustment rule that matches the target part point from multiple adjustment rules; an optimization module 306, which is connected to the determination module 304, and is used to optimize the initial motion parameters and the initial dynamic parameters based on the collision test result using the target adjustment rule to obtain target motion parameters and target dynamic parameters; a generation module 308, which is connected to the optimization module 306, and is used to generate a target animation based on the target motion parameters and the target dynamic parameters.
[0117] The animation generation device provided by the embodiment of the present application is provided with an acquisition module 300 for acquiring the initial motion parameters of the target part point of the target character, wherein the initial motion parameters are used to indicate the initial motion characteristics of the target part point; a test module 302 for performing a collision test on the target character and the collision body based on the initial motion parameters and the initial dynamic parameters to obtain the collision test results, wherein the initial dynamic parameters are used to indicate the physical property parameters of the target character and its environment; a determination module 304 for determining the target adjustment rule matching the target part point from multiple adjustment rules; an optimization module 306 for optimizing the initial motion parameters and the initial dynamic parameters based on the collision test results using the target adjustment rules to obtain the target motion parameters and the target dynamic parameters; a generation module 308 for generating the target animation based on the target motion parameters and the target dynamic parameters. The problem of low parameter adjustment accuracy and poor animation generation effect in the related art is solved. Thus, the purpose of using the target adjustment rules to perform dual optimization on the motion parameters and the dynamic parameters based on the collision test results to improve the accuracy of the determination of the motion parameters and the dynamic parameters is achieved, thereby achieving the effect of improving the animation generation effect.
[0118] Optionally, in the animation generation device provided in the embodiment of the present application, the optimization module includes: a first optimization sub-module, used to optimize the initial dynamic parameters based on the collision test results to obtain target dynamic parameters; a first generation sub-module, used to generate a simulation animation based on the target dynamic parameters; a first detection sub-module, used to detect whether the target character in the simulation animation meets the preset motion restriction conditions during the playback of the simulation animation; the second optimization sub-module, used to optimize the initial motion parameters using the target adjustment rules to obtain the target motion parameters when the preset motion restriction conditions are not met; the first initial sub-module, used to use the initial motion parameters as the target motion parameters when the preset motion restriction conditions are met.
[0119] Optionally, in the animation generation device provided in the embodiment of the present application, the first detection submodule includes: a first acquisition submodule, used to acquire the joint motion range of the target character during the simulation animation playback; a second detection submodule, used to detect whether the joint motion range is within a preset motion range; a first determination submodule, used to determine that the preset motion restriction condition is met when the joint motion range is within the preset motion range; and a second determination submodule, used to determine that the preset motion restriction condition is not met when the joint motion range is not within the preset motion range.
[0120] Optionally, in the animation generation device provided in the embodiment of the present application, the second determination submodule includes: a second acquisition submodule, used to obtain the deviation information of the joint motion range relative to the preset motion range when the preset motion restriction conditions are not met, wherein the deviation information at least includes: the deviation direction and the deviation degree; obtaining the target joint type of the target part point; a third optimization submodule, used to optimize the initial motion parameters based on the deviation information and the target joint type, using the target adjustment rules to obtain the target motion parameters.
[0121] Optionally, in the animation generation device provided in the embodiment of the present application, the third optimization sub-module includes: a third determination sub-module, used to determine the target adjustment rule corresponding to the target joint type from multiple adjustment rules; wherein the target adjustment rule is used to indicate the correspondence between the deviation information and the adjustment method of the initial motion parameters, and multiple adjustment rules correspond to different joint types.
[0122] Optionally, in the animation generation device provided in the embodiment of the present application, the third optimization sub-module also includes: a fourth determination sub-module, used to determine a target adjustment method for adjusting the initial motion parameters based on the deviation information and the target adjustment rules, wherein the target adjustment method includes at least: an adjustment direction and an adjustment amplitude for adjusting the initial motion parameters; a first adjustment sub-module, used to adjust the initial motion parameters based on the target adjustment method to obtain the target motion parameters.
[0123] Optionally, in the animation generation device provided in the embodiment of the present application, the generation module includes: a third acquisition sub-module, used to obtain animation rendering requirements; a fourth optimization sub-module, used to optimize the initial dynamic parameters based on the animation rendering requirements and the collision test results to obtain target dynamic parameters.
[0124] It should be noted that the acquisition module 300, the test module 302, the determination module 304, the optimization module 306, and the generation module 308 correspond to steps S202 to S210 in Example 1, and the two modules and the corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules or units can be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n), and the above-mentioned modules can also be part of the device and can be run in the computer terminal 10 provided in Example 1.
[0125] Example 3
[0126] An embodiment of the present application may provide an electronic device, Figure 4 is a structural block diagram of an electronic device according to an embodiment of the present application. Figure 4 As shown, the electronic device may include: one or more ( Figure 4 (only one is shown) processor 1002, memory 1004, storage controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.
[0127] Among them, the memory can be used to store software programs and modules, such as program instructions / modules corresponding to the methods and devices in the embodiments of the present application, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0128] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: obtain the initial motion parameters of the target part point of the target character, wherein the initial motion parameters are used to indicate the initial motion characteristics of the target part point; based on the initial motion parameters and initial dynamic parameters, perform a collision test on the target character and the collision body to obtain a collision test result, wherein the initial dynamic parameters are used to indicate the physical property parameters of the target character and its environment; determine a target adjustment rule that matches the target part point from multiple adjustment rules; based on the collision test result, use the target adjustment rule to optimize the initial motion parameters and initial dynamic parameters to obtain target motion parameters and target dynamic parameters; based on the target motion parameters and target dynamic parameters, generate a target animation.
[0129] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: based on the collision test results, optimize the initial dynamic parameters to obtain target dynamic parameters; based on the target dynamic parameters, generate a simulation animation; during the playback of the simulation animation, detect whether the target character in the simulation animation meets the preset motion restriction conditions; if the preset motion restriction conditions are not met, use the target adjustment rules to optimize the initial motion parameters to obtain the target motion parameters; or if the preset motion restriction conditions are met, use the initial motion parameters as the target motion parameters.
[0130] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: during the simulation animation playback, obtain the joint motion range of the target character; detect whether the joint motion range is within the preset motion range; if the joint motion range is within the preset motion range, determine that the preset motion restriction condition is met; if the joint motion range is not within the preset motion range, determine that the preset motion restriction condition is not met.
[0131] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: when the preset motion restriction conditions are not met, obtain the deviation information of the joint motion range relative to the preset motion range, wherein the deviation information at least includes: the deviation direction and the deviation degree; obtain the target joint type of the target part point; based on the deviation information and the target joint type, use the target adjustment rules to optimize the initial motion parameters to obtain the target motion parameters.
[0132] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: determine the target adjustment rule corresponding to the target joint type from multiple adjustment rules; wherein the target adjustment rule is used to indicate the correspondence between the deviation information and the adjustment method of the initial motion parameters, and multiple adjustment rules correspond to different joint types.
[0133] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: based on the deviation information and the target adjustment rules, determine the target adjustment method for adjusting the initial motion parameters, wherein the target adjustment method at least includes: the adjustment direction and adjustment amplitude of the initial motion parameters; based on the target adjustment method, adjust the initial motion parameters to obtain the target motion parameters.
[0134] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: obtaining animation rendering requirements; optimizing the initial dynamic parameters based on the animation rendering requirements and the collision test results to obtain the target dynamic parameters.
[0135] By adopting the embodiment of the present application, a scheme for animation generation is provided. By obtaining the initial motion parameters of the target part point of the target character, wherein the initial motion parameters are used to indicate the initial motion characteristics of the target part point; based on the initial motion parameters and the initial dynamic parameters, a collision test is performed on the target character and the collision body to obtain a collision test result, wherein the initial dynamic parameters are used to indicate the physical property parameters of the target character and its environment; a target adjustment rule matching the target part point is determined from multiple adjustment rules; based on the collision test result, the initial motion parameters and the initial dynamic parameters are optimized by the target adjustment rule to obtain the target motion parameters and the target dynamic parameters; based on the target motion parameters and the target dynamic parameters, a target animation is generated, so as to achieve the purpose of using the target adjustment rule to perform dual optimization on the motion parameters and the dynamic parameters based on the collision test result to improve the accuracy of the determination of the motion parameters and the dynamic parameters, thereby achieving the technical effect of improving the animation generation effect, and further solving the technical problem of low parameter adjustment accuracy and poor animation generation effect caused by only adjusting the parameters based on the collision test result and manually.
[0136] It can be understood by those skilled in the art that Figure 4 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Figure 4 The structure of the electronic device is not limited. Figure 4 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 4 Different configurations are shown.
[0137] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0138] Example 4
[0139] The embodiment of the present application further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the animation generation method provided in the first embodiment.
[0140] Optionally, in this embodiment, the above storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
[0141] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing the program steps of the animation generation method.
[0142] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0143] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0144] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0145] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0146] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0147] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0148] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. An animation generation method, characterized in that: include: Acquire initial motion parameters of a target part point of a target character, wherein the initial motion parameters are used to indicate initial motion features of the target part point; Based on the initial motion parameters and initial dynamic parameters, a collision test is performed on the target character and a collision body to obtain a collision test result, wherein the initial dynamic parameters are used to indicate physical property parameters of the target character and its environment; Determine a target adjustment rule matching the target part point from a plurality of adjustment rules; Based on the collision test result, the initial motion parameters and the initial dynamic parameters are optimized by using the target adjustment rule to obtain target motion parameters and target dynamic parameters; A target animation is generated based on the target motion parameters and the target dynamic parameters.
2. The method according to claim 1, characterized in that The method of optimizing the initial motion parameters and the initial dynamic parameters based on the collision test result by using the target adjustment rule to obtain target motion parameters and target dynamic parameters includes: Based on the collision test results, the initial dynamic parameters are optimized to obtain the target dynamic parameters; Based on the target dynamic parameters, generating a simulation animation; During the playback of the simulated animation, detecting whether the target character in the simulated animation meets a preset motion restriction condition; When the preset motion restriction condition is not satisfied, optimizing the initial motion parameter by using the target adjustment rule to obtain the target motion parameter; or When the preset motion restriction condition is met, the initial motion parameter is used as the target motion parameter.
3. The method according to claim 2, characterized in that In the case where the target part point is a joint and the corresponding initial motion parameter is a joint motion parameter, during the playback of the simulated animation, detecting whether the target character in the simulated animation satisfies a preset motion restriction condition includes: During the playback of the simulated animation, obtaining the joint motion range of the target character; Detecting whether the joint motion range is within a preset motion range; When the joint motion range is within the preset motion range, determining that the preset motion restriction condition is satisfied; When the joint motion range is not within the preset motion range, it is determined that the preset motion restriction condition is not satisfied.
4. The method according to claim 3, characterized in that When the preset motion restriction condition is not met, optimizing the initial motion parameter by using the target adjustment rule to obtain the target motion parameter includes: When the preset motion restriction condition is not met, obtaining deviation information of the joint motion range relative to the preset motion range, wherein the deviation information at least includes: a deviation direction and a deviation degree; Obtaining a target joint type of the target part point; Based on the deviation information and the target joint type, the target adjustment rule is used to optimize the initial motion parameters to obtain the target motion parameters.
5. The method according to claim 4, characterized in that The step of determining a target adjustment rule matching the target location point from a plurality of adjustment rules comprises: Determining the target adjustment rule corresponding to the target joint type from a plurality of adjustment rules; The target adjustment rule is used to indicate the corresponding relationship between the deviation information and the adjustment method of the initial motion parameter, and the multiple adjustment rules correspond to different joint types.
6. The method according to claim 4, characterized in that The step of optimizing the initial motion parameters based on the deviation information and the target joint type by using the target adjustment rule to obtain the target motion parameters includes: Based on the deviation information and the target adjustment rule, determining a target adjustment method for adjusting the initial motion parameter, wherein the target adjustment method at least includes: an adjustment direction and an adjustment amplitude for adjusting the initial motion parameter; Based on the target adjustment method, the initial motion parameters are adjusted to obtain the target motion parameters.
7. The method according to any one of claims 2 to 6, characterized in that The optimizing the initial dynamic parameters based on the collision test results to obtain the target dynamic parameters includes: Get animation rendering requirements; Based on the animation rendering requirements and the collision test results, the initial dynamic parameters are optimized to obtain the target dynamic parameters.
8. An animation generating device, characterized in that: include: An acquisition module, used for acquiring initial motion parameters of a target part point of a target character, wherein the initial motion parameters are used for indicating initial motion characteristics of the target part point; A test module, used to perform a collision test on the target character and the collision body based on the initial motion parameters and the initial dynamic parameters to obtain a collision test result, wherein the initial dynamic parameters are used to indicate the physical property parameters of the target character and its environment; A determination module, used to determine a target adjustment rule matching a target part point from a plurality of adjustment rules; An optimization module, for optimizing the initial motion parameters and initial dynamic parameters by using target adjustment rules based on the collision test results to obtain target motion parameters and target dynamic parameters; The generation module is used to generate target animation based on target motion parameters and target dynamic parameters.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is run, the device where the computer-readable storage medium is located is controlled to execute the animation generation method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: include: A memory storing an executable program; A processor, configured to run the program, wherein the program executes the method according to any one of claims 1 to 7 when running.