Animation generation method and device of virtual model, computer device and storage medium
By adjusting the skeletal data of the virtual model and utilizing the target controller parameters and the movement parameters of the source animation, the problem of animation applicability between different skeletal structure models was solved, achieving both the universality of animation effects and improved production efficiency.
Patent Information
- Application Number
- CN202211257262.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-14
- Publication Date
- 2026-07-28
- Estimated Expiration
- 2042-10-14
AI Technical Summary
Existing animation retargeting technology cannot be effectively applied between virtual models with different skeletal structures, resulting in unreasonable animation effects, increasing the workload of game developers and reducing production efficiency.
By acquiring the controller parameters of the target virtual model, adjusting the skeletal data of the virtual model, and utilizing the controller movement parameters and initial body model pose from the source animation, the animation of the target virtual model is generated, thus achieving the applicability of the animation effect in different virtual models.
It improves the applicability of the same animation effect across different virtual models, reduces the workload for game developers in creating separate animations for different skeletal models, and increases production efficiency.
Smart Images

Figure CN115526967B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a method, apparatus, computer device, and storage medium for generating animations of virtual models. Background Technology
[0002] With the continuous development of computer communication technology and the widespread use of terminals such as smartphones, tablets, and laptops, terminals are developing towards diversification and personalization, increasingly becoming indispensable terminals in people's lives and work. In order to meet people's pursuit of spiritual life, entertainment games that can be operated on terminals have emerged. For example, multiplayer online battle arena (MOBA) and massively multiplayer online (MMO) games developed based on client or server architecture are very popular among users due to their high smoothness, good operation feel, and real-time combat. In order to meet the players' sense of realism in the game, game developers often build virtual characters or virtual objects based on virtual skeleton models so that players can control virtual characters or virtual objects to play the game.
[0003] Currently, game developers typically provide animations for virtual characters. For example, the basic principle of skeletal skinning animation is to calculate the vertices of the skinning network under the control of the skeleton using a vertex blending dynamics algorithm. Sub-bones move relative to the root bone, driven by animation keyframe data. To reduce the workload for game developers, retargeting techniques are often used to allow different virtual models with the same skeletal structure to use the same animation effects. However, existing retargeting techniques can only be used on virtual models with the same skeletal structure. When virtual models with different skeletal structures use the same animation, some virtual models exhibit unreasonable animation effects. Game developers need to create different animation effects for virtual models with different skeletal structures, resulting in low production efficiency. Summary of the Invention
[0004] This application provides a method, apparatus, computer device, and storage medium for generating animations of virtual models. By adjusting the skeletal data corresponding to the virtual model through controller parameters corresponding to the target animation, the applicability of the same animation effect in different virtual models can be improved, thereby increasing production efficiency.
[0005] This application provides a method for generating animations of virtual models, the method comprising:
[0006] A target controller for obtaining a target virtual model is provided, wherein the target controller is used to control each body part of the target virtual model to obtain an initial body model pose and a specified body model pose;
[0007] Obtain the source virtual model corresponding to the source animation, wherein the body parts controlled by the controller of the source virtual model include the body parts controlled by the target controller of the target virtual model;
[0008] Obtain the movement parameters of the controller corresponding to the source virtual model in each frame of the sub-animation of the source animation;
[0009] Based on the movement parameters of the controller corresponding to each frame of sub-animation, the initial body model pose corresponding to each frame of sub-animation of the target virtual model, and the specified body model pose, the target body model pose corresponding to each frame of sub-animation of the target virtual model is determined.
[0010] The target animation of the target virtual model is generated based on the pose of the target body model corresponding to each frame of the sub-animation of the target virtual model.
[0011] Accordingly, embodiments of this application also provide an animation generation apparatus for a virtual model, the animation generation apparatus for the virtual model comprising:
[0012] The first acquisition unit is used to acquire the target controller of the target virtual model, wherein the target controller is used to control each body part of the target virtual model to obtain an initial body model pose and a specified body model pose;
[0013] The second acquisition unit is used to acquire the source virtual model corresponding to the source animation, wherein the body parts controlled by the controller of the source virtual model include the body parts controlled by the target controller of the target virtual model.
[0014] The third acquisition unit is used to acquire the movement parameters of the controller corresponding to the source virtual model in each frame of the source animation.
[0015] The determining unit is used to determine the target body model pose corresponding to each frame of the target virtual model based on the movement parameters of the controller corresponding to each frame of the sub-animation, the initial body model pose corresponding to each frame of the target virtual model, and the specified body model pose.
[0016] The generation unit is used to generate the target animation of the target virtual model based on the target body model pose corresponding to each frame of the sub-animation of the target virtual model.
[0017] This application also provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the steps in the virtual model animation generation method described in any of the above embodiments by calling the computer program stored in the memory.
[0018] This application also provides a computer-readable storage medium storing a computer program adapted for loading by a processor to perform the steps in the virtual model animation generation method as described in any of the above embodiments.
[0019] This application provides a method, apparatus, computer device, and storage medium for generating animations of virtual models. The method involves: acquiring a target controller for a target virtual model, wherein the target controller controls various body parts of the target virtual model to obtain an initial body model pose and a specified body model pose; then acquiring a source virtual model corresponding to a source animation, wherein the body parts controlled by the controller of the source virtual model include the body parts controlled by the target controller of the target virtual model; next, acquiring the movement parameters of the controller corresponding to the source virtual model in each frame of the source animation; then, determining the target body model pose corresponding to each frame of the target virtual model based on the movement parameters of the controller corresponding to each frame of the target animation, the initial body model pose corresponding to each frame of the target virtual model, and the specified body model pose; finally, generating a target animation for the target virtual model based on the target body model pose corresponding to each frame of the target virtual model. This application adjusts the skeletal data corresponding to the virtual model using the controller parameters corresponding to the target animation, thereby improving the applicability of the same animation effect in different virtual models. Game developers do not need to create different animation effects for virtual models with different skeletal models, thus improving production efficiency. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a scene diagram of the virtual model animation generation system provided in the embodiments of this application.
[0022] Figure 2 This is a flowchart illustrating a method for generating animations of virtual models provided in an embodiment of this application.
[0023] Figure 3 This is a scene illustration of the virtual model animation generation method provided in the embodiments of this application;
[0024] Figure 4 This is another flowchart illustrating the animation generation method for virtual models provided in this application embodiment;
[0025] Figure 5 This is a schematic diagram of the structure of the animation generation device for virtual models provided in the embodiments of this application.
[0026] Figure 6 This is a schematic diagram of the structure of the computer device provided in the embodiments of this application. Detailed Implementation
[0027] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0028] Existing animation retargeting techniques refer to using the animations and states of an existing reference virtual model to create an initial virtual model without animation or state, thus giving the initial virtual model the same animation effects as the reference model. However, existing animation retargeting techniques suffer from inaccurate bone retargeting positions. For example, for a puppy virtual model and an alligator virtual model, the puppy's nose animation is on its face, while the alligator's nose animation is on its upper jaw. Due to different bone layers, the nose animations of the puppy and alligator virtual models are not interchangeable, meaning the puppy's nose animation will not be retargeted onto the alligator's face. Furthermore, the alligator's eye animation rotates left and right when looking left and right, while the puppy's eye animation moves left and right. If animation retargeting is applied in this situation, the alligator's eye animation, which uses the puppy's eye animation, will move left and right, resulting in an animation retargeting error. Therefore, existing animation retargeting techniques require the initial virtual model and the reference virtual model to have a completely consistent hierarchical relationship. When virtual models with different skeletal structures use the same set of animations, there are unreasonable animation effects for some virtual models, resulting in low animation production efficiency.
[0029] To address the aforementioned problems, this application provides a method, apparatus, computer device, and storage medium for generating animations of virtual models. The method involves: acquiring a target controller for a target virtual model, wherein the target controller controls various body parts of the target virtual model to obtain an initial body model pose and a specified body model pose; then acquiring a source virtual model corresponding to a source animation, wherein the body parts controlled by the controller of the source virtual model include the body parts controlled by the target controller of the target virtual model; next, acquiring the movement parameters of the controller corresponding to the source virtual model in each frame of the source animation; then, determining the target body model pose corresponding to each frame of the target virtual model based on the movement parameters of the controller corresponding to each frame of the target animation, the initial body model pose corresponding to each frame of the target virtual model, and the specified body model pose; finally, generating a target animation for the target virtual model based on the target body model pose corresponding to each frame of the target virtual model. This application adjusts the skeletal data corresponding to the virtual model using the controller parameters corresponding to the target animation, thereby improving the applicability of the same animation effect across different virtual models. Game developers do not need to create different animation effects for virtual models with different skeletal models, thus improving production efficiency.
[0030] Specifically, the animation generation method for the virtual model in this application embodiment can be executed by a computer device, which can be a terminal or a server. The terminal can be a smartphone, tablet, laptop, touchscreen, game console, personal computer (PC), personal digital assistant (PDA), or other terminal device. The terminal can also include a client, which can be a game application client, a browser client carrying a game program, or an instant messaging client. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0031] For example, when the animation generation method of the virtual model runs on a terminal, the terminal device stores a game application and uses it to render virtual scenes in the game. The terminal device is used to interact with the user through a graphical user interface (GUI), such as by downloading, installing, and running the game application. The terminal device can provide the GUI to the user in various ways, such as rendering it on the terminal device's display screen or presenting the GUI through holographic projection. For example, the terminal device can include a touch screen and a processor. The touch screen is used to present the GUI and receive user input commands to the GUI, which includes game graphics. The processor is used to run the game, generate the GUI, respond to input commands, and control the display of the GUI on the touch screen.
[0032] For example, when the animation generation method of the virtual model runs on a server, it can be considered cloud gaming. Cloud gaming refers to a gaming method based on cloud computing. In the cloud gaming operating mode, the game application and the game screen presentation are separate. The storage and execution of the virtual model's animation generation method are completed on the cloud gaming server. The game screen presentation is completed on the cloud gaming client, which is mainly used for receiving and sending game data and presenting the game screen. For example, the cloud gaming client can be a display device with data transmission capabilities located close to the user, such as a mobile terminal, television, computer, PDA, or personal digital assistant. However, the terminal device for processing game data is the cloud gaming server in the cloud. When playing the game, the user operates the cloud gaming client to send operation commands to the cloud gaming server. The cloud gaming server runs the game according to the operation commands, encodes and compresses the game screen and other data, returns it to the cloud gaming client via the network, and finally, the cloud gaming client decodes and outputs the game screen.
[0033] Please see Figure 1 , Figure 1This is a schematic diagram of a virtual model animation generation system provided in an embodiment of this application. The system may include at least one terminal, at least one server, at least one database, and a network. The user's terminal can connect to different game servers via the network. The terminal is any device with computing hardware capable of supporting and executing software products corresponding to the game. Furthermore, when the system includes multiple terminals, multiple servers, and multiple networks, different terminals can connect to each other through different networks and servers. The network can be a wireless network or a wired network, such as a wireless local area network (WLAN), local area network (LAN), cellular network, 2G network, 3G network, 4G network, 5G network, etc. Additionally, different terminals can also connect to other terminals or servers using their own Bluetooth networks or hotspot networks. For example, multiple users can connect online through different terminals via appropriate networks and synchronize with each other to support multiplayer games. Furthermore, the system may include multiple databases coupled to different servers, and can continuously store information related to the game environment in the databases while different users are playing multiplayer games online.
[0034] It should be noted that, Figure 1 The scene diagram of the virtual model animation generation system shown is merely an example. The virtual model animation generation system and scene described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0035] To address the aforementioned problems, this application provides a method, apparatus, computer device, and storage medium for generating animations of virtual models. By adding a corresponding controller to the face of each virtual model, each controller represents a facial expression (e.g., frowning or pouting) of that virtual model. These individual facial expressions are saved as an Additive Animation. Then, artists can create corresponding model poses in DCC software and import them into the engine. The engine reads the current correction variables of each controller and blends the previous Additive Animation into the current virtual model's movement to obtain the correct redirection effect. This application improves the applicability of the same animation effect across different virtual models, thereby increasing animation production efficiency. Detailed descriptions follow. It should be noted that the order of description in the following embodiments is not intended to limit the preferred order of embodiments.
[0036] Please see Figure 2 , Figure 2 This is a flowchart illustrating a method for generating animation of a virtual model according to an embodiment of this application. The specific process of this method can be shown in steps 101 to 105 as follows:
[0037] 101. Obtain the target controller of the target virtual model, wherein the target controller is used to control each body part of the target virtual model to obtain an initial body model pose and a specified body model pose.
[0038] Specifically, the computer device can obtain a target controller from all controllers of the target virtual model. The controller is used to control various body parts of the target virtual model, including the head and / or torso. The target controller can be used to control the head of the target virtual model to obtain an initial head model pose and a specified head model pose, or the target controller can be used to control the torso of the target virtual model to obtain an initial torso model pose and a specified torso model pose, thereby performing subsequent operation steps.
[0039] Optionally, a virtual model can have one or more controllers corresponding to its head. The number of controllers corresponding to the head can be determined based on the precision required to control the head or face of the virtual model. The number of facial features and the number of controllers are not directly related; controllers can control complex expressions, such as laughing, which requires control of facial features like the eyes, eyebrows, and mouth, or simply the eye turning to the left.
[0040] Alternatively, a virtual model can have one or more controllers corresponding to its torso. The number of controllers corresponding to the torso can be determined based on the precision required to control the limbs or tail of the virtual model. These controllers can control the tail's movement or its fixed posture; for example, a cat's or dog's tail can be controlled to be raised, while a cow's or sheep's tail can be controlled to be lowered.
[0041] In games, Digital Content Creation (DCC) software is typically used to create virtual models, such as 3ds Max and Maya. DCC software allows the creation of controller effects corresponding to the virtual models, and the poses of the virtual models can be set with parameters according to the actual content controlled by the controllers. For example, please refer to... Figure 3Moving controller A downwards by 10 units represents eye movement. The image shows the virtual model moving its eyes. This effect is achieved by moving the controller downwards, allowing for the creation of an effect based on the initial and specified model poses. For example, raising controller A by 10 units represents pouting. Once the virtual model is bound to the corresponding controller, this content can be exported as an Additive animation for overlay within the engine.
[0042] It should be noted that a controller for the head can be used to refer to a facial feature of the virtual character in the virtual model, such as frowning, pouting, or closing the eyes. These individual facial features are stored in an Additive Animation. A controller for the torso can be used to refer to a torso feature of the virtual character in the virtual model, such as the tail being raised or lowered, limbs being extended, arms being bent, or hands being open or closed. These individual torso features are stored in an Additive Animation.
[0043] Additive Animation is a type of overlay animation composition. Its composition method can be as follows: an Additive Animation can be composed of a root animation A, an overlay animation B, and a target animation C. Specifically, the composition of the root animation A and the overlay animation B is called Additive Animation. This is achieved by calculating the transformations (such as bone displacement, rotation, and scaling) of each bone in the root animation A and the overlay animation B, recording the transformation values relative to the root animation A in each frame of the overlay animation B, and finally overlaying these transformation values onto the target animation C to obtain the overlay target animation C.
[0044] It should be noted that virtual models are models that simulate real-world objects and run within software. Virtual models are designed by designers and include virtual scene models, virtual building models, virtual game character models, and virtual game object models. Virtual game character models typically consist of skeletal data, skinning data, and physical colliders within the software.
[0045] The skeletal data resides within the virtual model of the game character and can be used to execute the physical motion information of the virtual model. The skeletal data can be the body skeleton of the virtual model, which can be a human character, an animal character, or even the skeleton describing the movement of parts other than the body. The skeletal data can be used to construct and compose the skeletal model.
[0046] Skinning data can include multiple vertex data points. Each vertex data point has corresponding weights, vertex position information, normals, triangle sequences, texture coordinates, and vertex color attributes. Based on the triangle sequence of each vertex, triangular faces can be formed using the triangle sequence and corresponding vertex data. Multiple triangular faces can form a graphical mesh, i.e., a triangular mesh. Each vertex can be bound to one or more bone data points. The weight represents the proportion of influence that vertex receives from the joint it is bound to. For example, if the weight value is 1, the vertex is completely affected by the joint it is bound to; if the weight value is 0, the vertex is not affected by the joint it is bound to; if the weight value is between 0 and 1, it means that the vertex is affected by other joints in addition to the joint it is bound to.
[0047] The combined action of physical colliders and rigid bodies imbues virtual game character models with physical effects. Rigid bodies allow the virtual game character models to be controlled and influenced by physical effects, while colliders enable collisions between virtual game character models. Physical colliders can be spherical colliders, capsule colliders, mesh colliders, etc. In this embodiment, a capsule collider is used. Since a capsule collider consists of a cylinder with two hemispheres connected to its ends, it is suitable for use in conjunction with other irregularly shaped colliders, especially for game character models.
[0048] 102. Obtain the source virtual model corresponding to the source animation, wherein the body parts controlled by the controller of the source virtual model include the body parts controlled by the target controller of the target virtual model.
[0049] The body parts controlled by the controller of the source virtual model corresponding to the source animation provided in this application embodiment need to include the body parts controlled by the target controller of the target virtual model, or they can be the same as the body parts controlled by the target controller of the target virtual model.
[0050] 103. Obtain the movement parameters of the controller corresponding to the source virtual model in each frame of the source animation.
[0051] In this embodiment of the application, the method for the step "obtaining the movement parameters of the controller corresponding to the source virtual model in each frame of the source animation" may include:
[0052] Obtain the skeletal transformation matrix of the source virtual model in each frame of the sub-animation;
[0053] Based on the bone transformation matrix, determine the movement parameters of the controller corresponding to the source virtual model in the sub-animation.
[0054] Specifically, in digital content creation software, the skeletal transformation matrix is often represented by a 4x4 matrix. For example, vectors in 3D space are transformed by multiplying this transformation matrix, such as translation, rotation, shearing, scaling, reflection, orthogonal projection, or perspective projection, etc. For instance, for all bones in a virtual model, attributes (such as x-coordinate, y-coordinate, and rotation angle) are interpolated based on the current time and animation keyframes. Then, the transformation matrix (local transformation) of all bones is calculated. Finally, starting from the root bone, the transformation matrix (world transformation) of all bones in the bone root node space is calculated from top to bottom. For example, the following 4x4 matrix can be used to store the transformation information of the bones, as shown below:
[0055]
[0056] Where a is scale x×cos(shear x+A), b is scale x×sin(shear x+A), c is -scaley×sin(shear y+A), and d is scale y×cos(shear y+A), x and y are the offsets obtained by translating the pivot point relative to the bone node, A is the rotation angle, shearX and shearY are the shear angles (shearX, shearY), and scaleX and scaleY are the scaling vectors. It should be noted that other 4x4 matrices can also be used to store the transformation information of the bone transformation, which will not be elaborated here.
[0057] Specifically, the method for the step "determining the movement parameters of the controller corresponding to the source virtual model in the sub-animation based on the skeleton transformation matrix" may include:
[0058] The initial body model pose and the final body model pose corresponding to the source virtual model in the sub-animation are determined based on the bone transformation matrix.
[0059] The difference between the initial skeletal data of the initial body model pose and the final skeletal data of the final body model pose is obtained, and the difference is used as the movement parameter of the controller.
[0060] For example, by obtaining the additional animation corresponding to the source virtual model, we can obtain the root pose A and the offset pose B corresponding to the source virtual model. Root pose A is the initial body model pose, and offset pose B is the final body model pose. The controller in the software can modify the associated bone transformations through offset. Therefore, by providing the engine with root pose A and offset pose B, the path length can be calculated based on the difference between offset pose B and root pose A. Then, the corresponding actual offset can be calculated using the length units in the engine and DCC software. This actual offset is the controller's movement parameter. Specifically, the bones in the additional animation contain xyz displacement, xyz scaling, and xyzw rotation. Displacement and scaling represent movement along the xyz axes. However, rotation requires a 4x4 rotation matrix (due to underlying code limitations). Therefore, an additional axis w is needed; that is, although the rotation parameter appears to be a rotation around the xyz axes, it is actually a multiplication of four tuples.
[0061] In one specific embodiment, the transformation matrix of the bones in the source virtual model in each frame of the source animation can be obtained. Using this transformation matrix as input, the movement amount of the controller of the source virtual model in the DCC software can be calculated in reverse. Due to the special nature of Additive animation, after the source animation completes the motion file, there will be a root motion A and an offset motion B. The controller in the software can modify the transformation of the associated bones by offsetting. Therefore, the inverse calculation method is to provide the root motion A and the offset motion B to the engine. The engine can then calculate the path length according to the difference between the offset motion B and the corresponding root motion A, and then convert the length units in the engine and DCC software to calculate the corresponding actual offset amount (for example, one unit is one centimeter in Unreal Engine, and one unit is one inch by default in DCC).
[0062] 104. Based on the movement parameters of the controller corresponding to each frame of sub-animation, the initial body model pose corresponding to each frame of sub-animation of the target virtual model, and the specified body model pose, determine the target body model pose corresponding to each frame of sub-animation of the target virtual model.
[0063] In one specific embodiment, before the step of "determining the target body model pose corresponding to each frame of the target virtual model based on the movement parameters of the controller corresponding to each frame of the sub-animation, the initial body model pose corresponding to each frame of the target virtual model, and the specified body model pose", the method may include:
[0064] Obtain the initial skeletal data corresponding to the initial body model pose, and the specified skeletal data corresponding to the specified body model pose;
[0065] Bone offset data is determined based on the initial bone data and the specified bone data.
[0066] The initial bone data corresponding to the initial body model pose is the position data of each polygon mesh vertex of the initial body model in the initial pose. The specified bone data corresponding to the specified body model pose is the position data of each polygon mesh vertex of the initial body model in the specified pose. The bone offset data is the difference between the position data of each polygon mesh vertex of the initial body model in the initial pose and the position data of each polygon mesh vertex in the specified pose, which is the path length between the initial bone data and the specified body model pose.
[0067] Furthermore, the method for the step "determining bone offset data based on the initial bone data and the specified bone data" may include:
[0068] Obtain the difference between the initial bone data and the specified bone data, and use the difference as bone offset data.
[0069] Specifically, the step "determining the target body model pose corresponding to each frame of the target virtual model based on the movement parameters of the controller corresponding to each frame of the sub-animation, the initial body model pose corresponding to each frame of the target virtual model, and the specified body model pose" can include:
[0070] Based on the movement parameters of the controller corresponding to each frame of sub-animation, the skeletal data of the initial body model pose corresponding to each frame of sub-animation of the target virtual model, and the skeletal offset data, the target body model pose corresponding to each frame of sub-animation of the target virtual model is determined.
[0071] Furthermore, the method for "determining the target body model pose corresponding to each frame of the target virtual model based on the movement parameters of the controller corresponding to each frame of the sub-animation, the skeletal data of the initial body model pose corresponding to each frame of the target virtual model, and the skeletal offset data" may include:
[0072] Obtain the target product of the movement parameters of the controller corresponding to each frame of sub-animation and the bone offset data;
[0073] Obtain the target sum value of the target product and the skeletal data of the initial body model pose corresponding to each frame of the sub-animation of the target virtual model, and use the target sum value as the target skeletal data corresponding to that frame of the sub-animation of the target virtual model.
[0074] It should be noted that the movement parameter is a percentage value obtained by the artists after calculating the movement length based on a preset ratio when adjusting the controller.
[0075] Optionally, after the step of "using the target and value as the target skeleton data corresponding to the sub-animation of the target virtual model in this frame", the method may include:
[0076] The pose of the target body model corresponding to the sub-frame animation of the target virtual model is determined based on the target skeleton data.
[0077] Specifically, the target body model pose can be determined according to the model pose formula, which is shown below:
[0078] Model pose = root motion + bone offset data * offset coefficient
[0079] Among them, the model pose is the target model pose of the target virtual model, the root motion is the bone data corresponding to the initial model pose of the target virtual model, the bone offset data is the difference between the initial model pose and the specified model pose of the target virtual model, and the offset coefficient is the movement parameter of the controller of the source virtual model corresponding to a certain frame of the source animation.
[0080] It should be noted that, in this embodiment, not only can the posture of the body model in the target virtual model be redirected, but other parts of the target virtual model can also be redirected, such as the hands, feet and tail of the target virtual model. This is only an example and will not be elaborated here.
[0081] 105. Generate the target animation of the target virtual model based on the pose of the target body model corresponding to each frame of the sub-animation of the target virtual model.
[0082] In this embodiment, the target animation of the target virtual model can be formed by sequentially playing each frame of the target virtual model's sub-animation.
[0083] In summary, the embodiments of this application provide a method for generating animations for virtual models. By adjusting the skeletal data of the virtual model through the controller parameters corresponding to the target animation, the applicability of the same animation effect in different virtual models can be improved. Game developers do not need to create different animation effects for virtual models with different skeletal models, thereby improving production efficiency.
[0084] To further illustrate the animation generation method for virtual models provided in this application, the following description will use the application of the virtual model animation generation method in a specific implementation scenario as an example. For instance, please refer to... Figure 4 The specific application scenarios of the controller corresponding to the head part are as follows:
[0085] (1) Game developers can identify a target virtual model without any model animations. The computer device can obtain the target controller corresponding to the target virtual model. This target controller can be used to refer to a facial feature of the virtual character's head, such as frowning, pouting, or closing the eyes. Specifically, the target controller is used to control each head part of the target virtual model to obtain an initial head model pose and a specified head model pose.
[0086] (2) The computer device can obtain the initial bone data corresponding to the initial head model pose and the specified bone data corresponding to the specified head model pose based on the initial head model pose and the specified head model pose. Then, it can obtain the difference between the initial bone data and the specified bone data and use the difference as bone offset data.
[0087] (3) The computer device can obtain the source animation that needs to be redirected and the source virtual model corresponding to the source animation. The head part controlled by the controller of the source virtual model corresponding to the source animation needs to include the head part controlled by the target controller of the target virtual model, or it can be the same as the head part controlled by the target controller of the target virtual model. Then, the bone transformation matrix of the source virtual model in each frame of the sub-animation is obtained; the movement parameters of the controller corresponding to the source virtual model in the sub-animation are determined based on the bone transformation matrix. That is, the additional animation corresponding to the source virtual model can be obtained, that is, the root pose A and the offset pose B corresponding to the source virtual model can be obtained. The controller can modify the associated bone transformation in the software by offset. Therefore, by providing the root pose A and the offset pose B to the engine, the path length can be calculated according to the difference between the offset pose B and the root pose A, and then the corresponding actual offset is calculated according to the length unit in the engine and DCC software as the movement parameter of the controller.
[0088] (4) The computer device can determine the target head model pose corresponding to each frame of the target virtual model based on the movement parameters of the controller corresponding to each frame of the sub-animation, the skeletal data of the initial head model pose corresponding to each frame of the target virtual model, and the skeletal offset data. Specifically, the computer device can calculate the target skeletal data based on the model pose formula (model pose = root motion + skeletal offset data * offset coefficient), that is, obtain the target product of the movement parameters of the controller corresponding to each frame of the sub-animation and the skeletal offset data; obtain the target sum of the target product and the skeletal data of the initial head model pose corresponding to each frame of the target virtual model, and use the target sum as the target skeletal data corresponding to that frame of the target virtual model.
[0089] (5) The computer device can generate the target animation of the target virtual model based on the target head model pose corresponding to each frame of the target virtual model's sub-animation. In this embodiment, the target animation of the target virtual model can be formed by sequentially playing each frame of the target virtual model's sub-animation.
[0090] In summary, this application provides a method for generating animations for virtual models. The method involves obtaining a target controller for a target virtual model, where the target controller controls various body parts of the target virtual model to obtain an initial body model pose and a specified body model pose. Then, a source virtual model corresponding to the source animation is obtained, where the body parts controlled by the controller of the source virtual model include the body parts controlled by the target controller of the target virtual model. Next, the movement parameters of the controller corresponding to the source virtual model in each frame of the source animation are obtained. Then, based on the movement parameters of the controller corresponding to each frame of the sub-animation, the initial body model pose corresponding to each frame of the target virtual model, and the specified body model pose, the target body model pose corresponding to each frame of the target virtual model is determined. Finally, a target animation for the target virtual model is generated based on the target body model pose corresponding to each frame of the target virtual model. This application adjusts the skeletal data corresponding to the virtual model using the controller parameters corresponding to the target animation, thereby improving the applicability of the same animation effect across different virtual models. Game developers do not need to create different animation effects for virtual models with different skeletal models, thus improving production efficiency.
[0091] To facilitate better implementation of the animation generation method for virtual models provided in this application, this application also provides an animation device based on the aforementioned virtual model. The meanings of the terms used are the same as in the animation generation method for virtual models described above, and specific implementation details can be found in the descriptions within the method embodiments.
[0092] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a virtual model animation generation device provided in an embodiment of this application. The device includes:
[0093] The first acquisition unit 201 is used to acquire the target controller of the target virtual model, wherein the target controller is used to control each body part of the target virtual model to obtain an initial body model pose and a specified body model pose;
[0094] The second acquisition unit 202 is used to acquire the source virtual model corresponding to the source animation, wherein the body parts controlled by the controller of the source virtual model include the body parts controlled by the target controller of the target virtual model.
[0095] The third acquisition unit 203 is used to acquire the movement parameters of the controller corresponding to the source virtual model in each frame of the source animation.
[0096] The determining unit 204 is used to determine the target body model pose corresponding to each frame of the target virtual model based on the movement parameters of the controller corresponding to each frame of the sub-animation, the initial body model pose corresponding to each frame of the target virtual model, and the specified body model pose.
[0097] The generation unit 205 is used to generate the target animation of the target virtual model based on the target body model pose corresponding to each frame of the sub-animation of the target virtual model.
[0098] In some embodiments, the animation generation apparatus for the virtual model includes:
[0099] The first acquisition subunit is used to acquire the initial skeletal data corresponding to the initial body model pose and the specified skeletal data corresponding to the specified body model pose.
[0100] The first determining subunit is used to determine bone offset data based on the initial bone data and the specified bone data.
[0101] In some embodiments, the animation generation apparatus for the virtual model includes:
[0102] The second acquisition subunit is used to acquire the difference between the initial bone data and the specified bone data, and use the difference as bone offset data.
[0103] In some embodiments, the animation generation apparatus for the virtual model includes:
[0104] The second determining subunit is used to determine the target body model posture corresponding to each frame of the target virtual model based on the movement parameters of the controller corresponding to each frame of the sub-animation, the skeletal data of the initial body model posture corresponding to each frame of the target virtual model, and the skeletal offset data.
[0105] In some embodiments, the animation generation apparatus for the virtual model includes:
[0106] The third acquisition subunit is used to acquire the target product of the movement parameters of the controller corresponding to each frame of sub-animation and the bone offset data;
[0107] The third acquisition subunit is further configured to acquire the target sum value of the target product and the skeletal data of the initial body model posture corresponding to each frame of the target virtual model, and use the target sum value as the target skeletal data corresponding to that frame of the target virtual model.
[0108] In some embodiments, the animation generation apparatus for the virtual model includes:
[0109] The third determining subunit is used to determine the pose of the target body model corresponding to the sub-animation frame of the target virtual model based on the target skeleton data.
[0110] In some embodiments, the animation generation apparatus for the virtual model includes:
[0111] The fourth acquisition subunit is used to acquire the skeletal transformation matrix of the source virtual model in each frame of the sub-animation;
[0112] The fourth determining sub-unit is used to determine the movement parameters of the controller corresponding to the source virtual model in the sub-animation based on the skeleton transformation matrix.
[0113] In some embodiments, the animation generation apparatus for the virtual model includes:
[0114] The fifth determining subunit is used to determine the initial body model pose and the final body model pose corresponding to the source virtual model in the sub-animation based on the skeletal transformation matrix;
[0115] The fifth acquisition subunit is used to acquire the difference between the initial skeletal data of the initial body model posture and the final skeletal data of the final body model posture, and use the difference as the movement parameter of the controller.
[0116] This application provides an animation generation device for a virtual model. A first acquisition unit acquires a target controller for a target virtual model, wherein the target controller controls various body parts of the target virtual model to obtain an initial body model pose and a specified body model pose. A second acquisition unit 202 acquires a source virtual model corresponding to a source animation, wherein the body parts controlled by the controller of the source virtual model include the body parts controlled by the target controller of the target virtual model. A third acquisition unit 203 acquires the movement parameters of the controller corresponding to the source virtual model in each frame of the source animation. A determining unit 204 determines the target body model pose corresponding to each frame of the target virtual model based on the movement parameters of the controller corresponding to each frame of the sub-animation, the initial body model pose corresponding to each frame of the target virtual model, and the specified body model pose. A generation unit 205 generates a target animation for the target virtual model based on the target body model pose corresponding to each frame of the target virtual model. This application adjusts the skeletal data corresponding to the virtual model by adjusting the controller parameters corresponding to the target animation, thereby improving the applicability of the same animation effect in different virtual models and thus improving production efficiency.
[0117] Accordingly, this application also provides a computer device, which can be a terminal or a server. The terminal can be a smartphone, tablet computer, laptop computer, touch screen, game console, personal computer (PC), personal digital assistant (PDA), or other terminal device. Figure 6 As shown, Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. The computer device 300 includes a processor 301 with one or more processing cores, a memory 302 with one or more computer-readable storage media, and a computer program stored in the memory 302 and executable on the processor. The processor 301 and the memory 302 are electrically connected. Those skilled in the art will understand that the computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0118] The processor 301 is the control center of the computer device 300. It connects various parts of the computer device 300 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 302, and calling data stored in the memory 302, it performs various functions of the computer device 300 and processes data, thereby monitoring the computer device 300 as a whole.
[0119] In this embodiment, the processor 301 in the computer device 300 loads the instructions corresponding to the processes of one or more applications into the memory 302 according to the following steps, and the processor 301 runs the applications stored in the memory 302 to achieve various functions:
[0120] A target controller for obtaining a target virtual model is provided, wherein the target controller is used to control each body part of the target virtual model to obtain an initial body model pose and a specified body model pose;
[0121] Obtain the source virtual model corresponding to the source animation, wherein the body parts controlled by the controller of the source virtual model include the body parts controlled by the target controller of the target virtual model;
[0122] Obtain the movement parameters of the controller corresponding to the source virtual model in each frame of the sub-animation of the source animation;
[0123] Based on the movement parameters of the controller corresponding to each frame of sub-animation, the initial body model pose corresponding to each frame of sub-animation of the target virtual model, and the specified body model pose, the target body model pose corresponding to each frame of sub-animation of the target virtual model is determined.
[0124] The target animation of the target virtual model is generated based on the pose of the target body model corresponding to each frame of the sub-animation of the target virtual model.
[0125] In one embodiment, before determining the target body model pose corresponding to each frame of the target virtual model animation based on the movement parameters of the controller corresponding to each frame of the sub-animation, the initial body model pose corresponding to each frame of the target virtual model animation, and the specified body model pose, the method further includes:
[0126] Obtain the initial skeletal data corresponding to the initial body model pose, and the specified skeletal data corresponding to the specified body model pose;
[0127] Bone offset data is determined based on the initial bone data and the specified bone data.
[0128] In one embodiment, determining bone offset data based on the initial bone data and the specified bone data includes:
[0129] Obtain the difference between the initial bone data and the specified bone data, and use the difference as bone offset data.
[0130] In one embodiment, determining the target body model pose corresponding to each frame of the target virtual model animation based on the movement parameters of the controller corresponding to each frame of the sub-animation, the initial body model pose corresponding to each frame of the target virtual model animation, and the specified body model pose includes:
[0131] Based on the movement parameters of the controller corresponding to each frame of sub-animation, the skeletal data of the initial body model pose corresponding to each frame of sub-animation of the target virtual model, and the skeletal offset data, the target body model pose corresponding to each frame of sub-animation of the target virtual model is determined.
[0132] In one embodiment, determining the target body model pose corresponding to each frame of the target virtual model animation based on the movement parameters of the controller corresponding to each frame of the sub-animation, the skeletal data of the initial body model pose corresponding to each frame of the target virtual model animation, and the skeletal offset data includes:
[0133] Obtain the target product of the movement parameters of the controller corresponding to each frame of sub-animation and the bone offset data;
[0134] Obtain the target sum value of the target product and the skeletal data of the initial body model pose corresponding to each frame of the sub-animation of the target virtual model, and use the target sum value as the target skeletal data corresponding to that frame of the sub-animation of the target virtual model.
[0135] In one embodiment, after using the target and value as the target skeleton data corresponding to the sub-animation of the target virtual model in that frame, the method further includes:
[0136] The pose of the target body model corresponding to the sub-frame animation of the target virtual model is determined based on the target skeleton data.
[0137] In one embodiment, obtaining the movement parameters of the controller corresponding to the source virtual model in each frame of the source animation includes:
[0138] Obtain the skeletal transformation matrix of the source virtual model in each frame of the sub-animation;
[0139] Based on the bone transformation matrix, determine the movement parameters of the controller corresponding to the source virtual model in the sub-animation.
[0140] In one embodiment, determining the movement parameters of the controller corresponding to the source virtual model in the sub-animation based on the skeletal transformation matrix includes:
[0141] The initial body model pose and the final body model pose corresponding to the source virtual model in the sub-animation are determined based on the bone transformation matrix.
[0142] The difference between the initial skeletal data of the initial body model pose and the final skeletal data of the final body model pose is obtained, and the difference is used as the movement parameter of the controller.
[0143] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0144] Optional, such as Figure 6 As shown, the computer device 300 also includes: a touch screen display 303, a radio frequency circuit 304, an audio circuit 305, an input unit 306, and a power supply 307. The processor 301 is electrically connected to the touch screen display 303, the radio frequency circuit 304, the audio circuit 305, the input unit 306, and the power supply 307. Those skilled in the art will understand that... Figure 6 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0145] The touch display screen 303 can be used to display a graphical user interface (GUI) and receive operation commands generated by the user interacting with the GUI. The touch display screen 303 may include a display panel and a touch panel. The display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the computer device. These graphical user interfaces can be composed of graphics, text, icons, video, and any combination thereof. Optionally, the display panel can be configured using a liquid crystal display (LCD), organic light-emitting diode (OLED), or other similar technologies. The touch panel can be used to collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel), generate corresponding operation commands, and execute the corresponding program according to the operation commands. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch location and the signal generated by the touch operation, transmitting the signal to the touch controller. The touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 301. It can also receive and execute commands from the processor 301. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it transmits the information to the processor 301 to determine the type of touch event. Subsequently, the processor 301 provides corresponding visual output on the display panel based on the type of touch event. In this embodiment, the touch panel and the display panel can be integrated into the touch display screen 303 to achieve input and output functions. However, in some embodiments, the touch panel and the touch display screen 303 can be implemented as two independent components to achieve input and output functions. That is, the touch display screen 303 can also be used as part of the input unit 306 to achieve input functions.
[0146] In this embodiment, a game application is executed by processor 301 to generate a graphical user interface (GUI) on touch display screen 303. The touch display screen 303 is used to present the GUI and receive user commands generated by the GUI.
[0147] The radio frequency circuit 304 can be used to transmit and receive radio frequency signals to establish wireless communication with network devices or other computer devices, and to transmit and receive signals with network devices or other computer devices.
[0148] Audio circuitry 305 can be used to provide an audio interface between a user and a computer device via a speaker and a microphone. Audio circuitry 305 converts received audio data into electrical signals, transmits them to the speaker, and the speaker converts them into sound signals for output. Conversely, the microphone converts collected sound signals into electrical signals, which are then received by audio circuitry 305, converted back into audio data, and output to processor 301 for processing. The audio data is then transmitted via radio frequency circuitry 304 to, for example, another computer device, or output to memory 302 for further processing. Audio circuitry 305 may also include an earphone jack to facilitate communication between peripheral headphones and the computer device.
[0149] The input unit 306 can be used to receive input numbers, characters, or user characteristic information (such as fingerprints, iris, facial information, etc.), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
[0150] Power supply 307 is used to supply power to various components of computer device 300. Optionally, power supply 307 can be logically connected to processor 301 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. Power supply 307 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0151] although Figure 6 As not shown in the diagram, computer equipment 300 may also include a camera, sensor, wireless fidelity module, Bluetooth module, etc., which will not be described in detail here.
[0152] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0153] As can be seen from the above, the computer device provided in this embodiment obtains a target controller for a target virtual model, wherein the target controller is used to control various body parts of the target virtual model to obtain an initial body model pose and a specified body model pose; then, it obtains a source virtual model corresponding to the source animation, wherein the body parts controlled by the controller of the source virtual model include the body parts controlled by the target controller of the target virtual model; next, it obtains the movement parameters of the controller corresponding to the source virtual model in each frame of the source animation; then, based on the movement parameters of the controller corresponding to each frame of the sub-animation, the initial body model pose and the specified body model pose corresponding to each frame of the target virtual model, it determines the target body model pose corresponding to each frame of the target virtual model; finally, it generates the target animation of the target virtual model based on the target body model pose corresponding to each frame of the target virtual model. This embodiment adjusts the skeletal data corresponding to the virtual model through the controller parameters corresponding to the target animation, thereby improving the applicability of the same animation effect in different virtual models. Game developers do not need to create different animation effects separately for virtual models with different skeletal models, thus improving production efficiency.
[0154] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0155] Therefore, embodiments of this application provide a computer-readable storage medium storing a plurality of computer programs that can be loaded by a processor to execute steps in any of the virtual model animation generation methods provided in embodiments of this application. For example, the computer program can execute the following steps:
[0156] A target controller for obtaining a target virtual model is provided, wherein the target controller is used to control each body part of the target virtual model to obtain an initial body model pose and a specified body model pose;
[0157] Obtain the source virtual model corresponding to the source animation, wherein the body parts controlled by the controller of the source virtual model include the body parts controlled by the target controller of the target virtual model;
[0158] Obtain the movement parameters of the controller corresponding to the source virtual model in each frame of the sub-animation of the source animation;
[0159] Based on the movement parameters of the controller corresponding to each frame of sub-animation, the initial body model pose corresponding to each frame of sub-animation of the target virtual model, and the specified body model pose, the target body model pose corresponding to each frame of sub-animation of the target virtual model is determined.
[0160] The target animation of the target virtual model is generated based on the pose of the target body model corresponding to each frame of the sub-animation of the target virtual model.
[0161] In one embodiment, before determining the target body model pose corresponding to each frame of the target virtual model animation based on the movement parameters of the controller corresponding to each frame of the sub-animation, the initial body model pose corresponding to each frame of the target virtual model animation, and the specified body model pose, the method further includes:
[0162] Obtain the initial skeletal data corresponding to the initial body model pose, and the specified skeletal data corresponding to the specified body model pose;
[0163] Bone offset data is determined based on the initial bone data and the specified bone data.
[0164] In one embodiment, determining bone offset data based on the initial bone data and the specified bone data includes:
[0165] Obtain the difference between the initial bone data and the specified bone data, and use the difference as bone offset data.
[0166] In one embodiment, determining the target body model pose corresponding to each frame of the target virtual model animation based on the movement parameters of the controller corresponding to each frame of the sub-animation, the initial body model pose corresponding to each frame of the target virtual model animation, and the specified body model pose includes:
[0167] Based on the movement parameters of the controller corresponding to each frame of sub-animation, the skeletal data of the initial body model pose corresponding to each frame of sub-animation of the target virtual model, and the skeletal offset data, the target body model pose corresponding to each frame of sub-animation of the target virtual model is determined.
[0168] In one embodiment, determining the target body model pose corresponding to each frame of the target virtual model animation based on the movement parameters of the controller corresponding to each frame of the sub-animation, the skeletal data of the initial body model pose corresponding to each frame of the target virtual model animation, and the skeletal offset data includes:
[0169] Obtain the target product of the movement parameters of the controller corresponding to each frame of sub-animation and the bone offset data;
[0170] Obtain the target sum value of the target product and the skeletal data of the initial body model pose corresponding to each frame of the sub-animation of the target virtual model, and use the target sum value as the target skeletal data corresponding to that frame of the sub-animation of the target virtual model.
[0171] In one embodiment, after using the target and value as the target skeleton data corresponding to the sub-animation of the target virtual model in that frame, the method further includes:
[0172] The pose of the target body model corresponding to the sub-frame animation of the target virtual model is determined based on the target skeleton data.
[0173] In one embodiment, obtaining the movement parameters of the controller corresponding to the source virtual model in each frame of the source animation includes:
[0174] Obtain the skeletal transformation matrix of the source virtual model in each frame of the sub-animation;
[0175] Based on the bone transformation matrix, determine the movement parameters of the controller corresponding to the source virtual model in the sub-animation.
[0176] In one embodiment, determining the movement parameters of the controller corresponding to the source virtual model in the sub-animation based on the skeletal transformation matrix includes:
[0177] The initial body model pose and the final body model pose corresponding to the source virtual model in the sub-animation are determined based on the bone transformation matrix.
[0178] The difference between the initial skeletal data of the initial body model pose and the final skeletal data of the final body model pose is obtained, and the difference is used as the movement parameter of the controller.
[0179] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0180] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0181] The computer program stored in the storage medium obtains the target controller of the target virtual model, wherein the target controller is used to control each body part of the target virtual model to obtain an initial body model pose and a specified body model pose; then, it obtains the source virtual model corresponding to the source animation, wherein the body part controlled by the controller of the source virtual model includes the body part controlled by the target controller of the target virtual model; next, it obtains the movement parameters of the controller corresponding to the source virtual model in each frame of the source animation; then, based on the movement parameters of the controller corresponding to each frame of the sub-animation, the initial body model pose and the specified body model pose corresponding to each frame of the target virtual model, it determines the target body model pose corresponding to each frame of the target virtual model; finally, it generates the target animation of the target virtual model based on the target body model pose corresponding to each frame of the target virtual model. This embodiment of the application adjusts the skeletal data corresponding to the virtual model through the controller parameters corresponding to the target animation, thereby improving the applicability of the same animation effect in different virtual models. Game developers do not need to create different animation effects separately for virtual models with different skeletal models, thus improving production efficiency.
[0182] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0183] The above provides a detailed description of a virtual model animation generation method, apparatus, computer device, and storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the technical solutions and core ideas of this application. Those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A method for generating animations of a virtual model, characterized in that, include: Obtain the target controller of the target virtual model, wherein the target virtual model corresponds to at least one controller, a controller is used to control a body part corresponding to the controller, and the target controller is used to control the body part in the target virtual model corresponding to the target controller to obtain an initial body model pose and a specified body model pose; Obtain the source virtual model corresponding to the source animation, wherein the body part controlled by the controller of the source virtual model is the same as the body part controlled by the target controller of the target virtual model; Obtain the movement parameters of the controller corresponding to the source virtual model in each frame of the sub-animation of the source animation; Based on the movement parameters of the controller corresponding to each frame of sub-animation, the initial body model pose corresponding to each frame of sub-animation of the target virtual model, and the specified body model pose, the target body model pose corresponding to each frame of sub-animation of the target virtual model is determined. The target animation of the target virtual model is generated based on the pose of the target body model corresponding to each frame of the sub-animation of the target virtual model.
2. The animation generation method for virtual models according to claim 1, characterized in that, Before determining the target body model pose corresponding to each frame of the target virtual model animation based on the movement parameters of the controller corresponding to each frame of the sub-animation, the initial body model pose corresponding to each frame of the target virtual model animation, and the specified body model pose, the method further includes: Obtain the initial skeletal data corresponding to the initial body model pose, and the specified skeletal data corresponding to the specified body model pose; Bone offset data is determined based on the initial bone data and the specified bone data.
3. The animation generation method for virtual models according to claim 2, characterized in that, The process of determining bone offset data based on the initial bone data and the specified bone data includes: Obtain the difference between the initial bone data and the specified bone data, and use the difference as bone offset data.
4. The animation generation method for virtual models according to claim 2, characterized in that, The step of determining the target body model pose corresponding to each frame of the target virtual model animation based on the movement parameters of the controller corresponding to each frame of the sub-animation, the initial body model pose corresponding to each frame of the target virtual model animation, and the specified body model pose includes: Based on the movement parameters of the controller corresponding to each frame of sub-animation, the skeletal data of the initial body model pose corresponding to each frame of sub-animation of the target virtual model, and the skeletal offset data, the target body model pose corresponding to each frame of sub-animation of the target virtual model is determined.
5. The animation generation method for virtual models according to claim 4, characterized in that, The step of determining the target body model pose corresponding to each frame of the target virtual model based on the movement parameters of the controller corresponding to each frame of the sub-animation, the skeletal data of the initial body model pose corresponding to each frame of the target virtual model, and the skeletal offset data includes: Obtain the target product of the movement parameters of the controller corresponding to each frame of sub-animation and the bone offset data; Obtain the target sum value of the target product and the skeletal data of the initial body model pose corresponding to each frame of the sub-animation of the target virtual model, and use the target sum value as the target skeletal data corresponding to that frame of the sub-animation of the target virtual model.
6. The animation generation method for virtual models according to claim 5, characterized in that, After using the target and value as the target bone data corresponding to the sub-animation of the target virtual model for that frame, the method further includes: The pose of the target body model corresponding to the sub-frame animation of the target virtual model is determined based on the target skeleton data.
7. The animation generation method for virtual models according to claim 1, characterized in that, The step of obtaining the movement parameters of the controller corresponding to the source virtual model in each frame of the source animation includes: Obtain the skeletal transformation matrix of the source virtual model in each frame of the sub-animation; Based on the bone transformation matrix, determine the movement parameters of the controller corresponding to the source virtual model in the sub-animation.
8. The animation generation method for virtual models according to claim 7, characterized in that, The determination of the movement parameters of the controller corresponding to the source virtual model in the sub-animation based on the skeleton transformation matrix includes: The initial body model pose and the final body model pose corresponding to the source virtual model in the sub-animation are determined based on the bone transformation matrix. The difference between the initial skeletal data of the initial body model pose and the final skeletal data of the final body model pose is obtained, and the difference is used as the movement parameter of the controller.
9. An animation generation device for a virtual model, characterized in that, include: The first acquisition unit is used to acquire the target controller of the target virtual model, wherein the target virtual model corresponds to at least one controller, a controller is used to control a body part corresponding to the controller, and the target controller is used to control the body part in the target virtual model corresponding to the target controller to obtain an initial body model pose and a specified body model pose; The second acquisition unit is used to acquire the source virtual model corresponding to the source animation, wherein the body part controlled by the controller of the source virtual model is the same as the body part controlled by the target controller of the target virtual model; The third acquisition unit is used to acquire the movement parameters of the controller corresponding to the source virtual model in each frame of the source animation. The determining unit is used to determine the target body model pose corresponding to each frame of the target virtual model based on the movement parameters of the controller corresponding to each frame of the sub-animation, the initial body model pose corresponding to each frame of the target virtual model, and the specified body model pose. The generation unit is used to generate the target animation of the target virtual model based on the target body model pose corresponding to each frame of the sub-animation of the target virtual model.
10. A computer device, characterized in that, The method includes a processor and a memory, the memory storing multiple instructions; the processor loads instructions from the memory to perform the steps in the method for generating animation of a virtual model as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a plurality of instructions adapted for loading by a processor to perform the steps in the method for generating animation of a virtual model as described in any one of claims 1 to 8.