Methods, devices, electronic devices and storage media for generating animations of virtual characters

By constructing an interactive grid and optimizing its relative positional relationships, the problem of low efficiency in virtual character animation generation was solved, achieving efficient migration and consistent generation of actions after environmental changes.

CN115496841BActive Publication Date: 2026-11-10TSINGHUA UNIVERSITY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211136402.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-19
Publication Date
2026-11-10
Estimated Expiration
2042-09-19

AI Technical Summary

Technical Problem

Current technologies for generating virtual character animations are inefficient, have limited motion libraries, and cannot adapt to different environments, resulting in high production costs.

Method used

By acquiring the motion trajectory of a virtual character performing preset actions, sampling the target point cloud and environmental constraint point cloud, constructing an interactive mesh, and adjusting the motion information when the virtual object's shape changes, a target animation is generated. The relative positional relationship of the interactive mesh is optimized using Laplace deformation and least squares method.

Benefits of technology

It achieves semantic consistency in motion transfer after virtual object shape changes, improves the efficiency of virtual object animation generation, and reduces the production cost of environmental interaction actions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115496841B_ABST
    Figure CN115496841B_ABST
Patent Text Reader

Abstract

This disclosure relates to a method, apparatus, electronic device, and storage medium for generating animations of virtual characters. The method includes: acquiring the motion trajectory of a virtual character performing a preset action; sampling a target point cloud corresponding to a target part in the motion trajectory, and sampling an environmental constraint point cloud in a virtual space formed by the target point cloud; using the environmental constraint point cloud as constraint information, tetrahedronizing the contact points between the virtual character and a virtual object, as well as the reference points of the virtual character, to form an interaction mesh; the interaction mesh is used to describe the data structure of the interaction between the virtual character and the virtual object; adjusting the motion information of the preset action when the virtual object changes, and constraining the relative positional relationship of the interaction mesh to satisfy a first preset condition, until the adjusted motion information is obtained; and generating a target animation of the virtual character performing the target action based on the adjusted motion information. This disclosure improves the efficiency of virtual character animation generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a method, apparatus, electronic device, and storage medium for generating animations of virtual characters. Background Technology

[0002] A significant portion of a virtual character's actions involves interaction with the external environment. As the external environment changes, the virtual character's environmental interaction actions also need to be adjusted accordingly to maintain the rationality of the actions. Among these, environmental interaction actions refer to the interaction actions between the virtual character and static virtual objects in the virtual scene (such as the ground, tables, chairs, etc.) (e.g., the action of the virtual character picking up a virtual object with its hand).

[0003] To address the demand for UGC (User Generated Content) narrative video production, related technologies generally suffer from problems such as limited motion libraries and inability to adapt motions to different environments. These technologies often require a large number of keyframe operations to make motions adapt to different environments, which greatly increases the production cost of motion libraries and is not conducive to improving the animation generation efficiency of virtual objects. Summary of the Invention

[0004] This disclosure provides a method, apparatus, electronic device, and storage medium for generating animations of virtual characters, to at least solve the problem of low efficiency in generating animations of virtual objects in related technologies. The technical solution of this disclosure is as follows:

[0005] According to a first aspect of the present disclosure, a method for generating animations of virtual characters is provided, comprising:

[0006] Acquire the motion trajectory of a virtual character performing a preset action; the motion trajectory includes the point cloud trajectory generated by the interaction between the target part of the virtual character and a virtual object;

[0007] The target point cloud corresponding to the target part is sampled from the motion trajectory, and the environmental constraint point cloud is sampled from the virtual space formed by the target point cloud.

[0008] Using the environmental constraint point cloud as constraint information, the contact points between the virtual character and the virtual object, as well as the reference points of the virtual character, are tetrahedredged to form an interaction mesh; the interaction mesh is used to describe the data structure of the interaction between the virtual character and the virtual object.

[0009] When the virtual object changes, the motion information of the preset action is adjusted, and the relative positional relationship between the interactive grids is constrained to meet the first preset condition until the adjusted motion information is obtained.

[0010] Based on the adjusted motion information, a target animation is generated for the virtual character to perform the target action; the target action is the action generated by the interaction between the target part of the virtual character and the virtual object after the shape has changed.

[0011] In one possible implementation, sampling the target point cloud corresponding to the target part in the motion trajectory includes: extracting candidate point clouds corresponding to the target part from the point cloud trajectory of the motion trajectory; and sampling point clouds within a preset time window from the candidate point clouds as the target point cloud corresponding to the target part.

[0012] In one possible implementation, sampling the environmental constraint point cloud in the virtual space formed by the target point cloud includes: constructing a virtual bounding box to accommodate the target point cloud; sampling the surface points of the virtual bounding box to obtain the surface sampled point cloud of the virtual bounding box; and using the surface sampled point cloud of the virtual bounding box as the environmental constraint point cloud.

[0013] In one possible implementation, the interactive mesh includes a first interactive mesh before the virtual object's shape changes and a second interactive mesh after the virtual object's shape changes. The constraint on the relative positional relationship between the interactive meshes satisfies a first preset condition until adjusted action information is obtained. This includes: constructing an energy function based on Laplace deformation according to the first and second interactive meshes; the function value of the energy function is used to characterize the degree of change in the relative positional relationship; during the adjustment of the action information of the preset action, the least squares method is used to optimize the energy function until the function value of the energy function is less than or equal to a preset threshold, thus obtaining the adjusted action information.

[0014] In one possible implementation, the method further includes: during the process of adjusting the action information of the preset action, determining a first virtual model and a second virtual model corresponding to the virtual character; the first virtual model is the model corresponding to the virtual character before the virtual object changes; the second virtual model is the model corresponding to the virtual character after the virtual object changes; constraining the relative positional relationship of the key point set in the first virtual model and the second virtual model to satisfy a second preset condition; wherein, the key point set is a set composed of at least one of the grid points or joint points corresponding to the target part of the virtual character.

[0015] In one possible implementation, the method further includes: constraining the difference between the target angle in the first virtual model and the second virtual model to satisfy a third preset condition; wherein, the target angle is the angle between the offset vector and the normal vector of the target reference point of the virtual character and the target joint point of the virtual character; the distance between the target reference point and the target joint point is less than or equal to a preset distance threshold.

[0016] In one possible implementation, the method further includes: obtaining distance information between the set of reference points of the target part and the set of reference points of the virtual object; the distance information is used to characterize the degree of contact between the virtual character and the virtual object; determining inverse kinematic weights based on the distance information; the inverse kinematic weights are negatively correlated with the distance information; and using the position of the target part to deduce the motion angles of each joint in the virtual character according to the inverse kinematic weights.

[0017] In one possible implementation, obtaining the motion trajectory of a virtual character performing a preset action includes: obtaining a source skeleton model and performing character-based rendering on the source skeleton model to obtain the virtual character; importing motion information that controls the virtual character to perform the preset action to obtain the motion trajectory of the virtual character performing the preset action.

[0018] In one possible implementation, the step of importing the action information that controls the virtual character to perform the preset action includes: determining the action constraint type that matches the preset action and the target part; querying the target action file that matches the preset action and the target part in at least one candidate action file that matches the action constraint type; and performing the operation of importing the target action file to import the action information that controls the virtual character to perform the preset action.

[0019] According to a second aspect of the present disclosure, an animation generation apparatus for a virtual character is provided, comprising:

[0020] The acquisition unit is configured to acquire the motion trajectory of a virtual character performing a preset action; the motion trajectory includes the point cloud trajectory generated by the interaction between the target part of the virtual character and a virtual object.

[0021] The sampling unit is configured to sample the target point cloud corresponding to the target part in the motion trajectory, and to sample the environmental constraint point cloud in the virtual space formed by the target point cloud;

[0022] The construction unit is configured to use the environmental constraint point cloud as constraint information to tetrahedronize the contact points between the virtual character and the virtual object, as well as the reference points of the virtual character, to form an interaction mesh; the interaction mesh is used to describe the data structure of the interaction between the virtual character and the virtual object.

[0023] The adjustment unit is configured to adjust the motion information of the preset action when the shape of the virtual object changes, and constrain the relative positional relationship of the interactive mesh to meet the first preset condition until the adjusted motion information is obtained.

[0024] The generation unit is configured to generate a target animation of the virtual character performing a target action based on the adjusted action information; the target action is the action generated by the interaction between the target part of the virtual character and the virtual object after the shape has changed.

[0025] In one possible implementation, the sampling unit is specifically configured to extract candidate point clouds corresponding to the target part from the point cloud trajectory of the action trajectory; and to sample point clouds within a preset time window from the candidate point clouds as the target point cloud corresponding to the target part.

[0026] In one possible implementation, the sampling unit is specifically configured to perform the following actions: constructing a virtual bounding box to accommodate the target point cloud; sampling the surface points of the virtual bounding box to obtain a surface sampled point cloud of the virtual bounding box; and using the surface sampled point cloud of the virtual bounding box as the environmental constraint point cloud.

[0027] In one possible implementation, the interactive mesh includes a first interactive mesh before the virtual object's shape changes and a second interactive mesh after the virtual object's shape changes. The adjustment unit is specifically configured to construct an energy function based on Laplace deformation according to the first and second interactive meshes. The function value of the energy function is used to characterize the degree of change in the relative positional relationship. During the process of adjusting the motion information of the preset action, the least squares method is used to optimize the energy function until the function value of the energy function is less than or equal to a preset threshold, thereby obtaining the adjusted motion information.

[0028] In one possible implementation, the device is further configured to, during the process of adjusting the action information of the preset action, determine a first virtual model and a second virtual model corresponding to the virtual character; the first virtual model is the model corresponding to the virtual character before the virtual object changes; the second virtual model is the model corresponding to the virtual character after the virtual object changes; constrain the relative positional relationship of the key point set in the first virtual model and the second virtual model to satisfy a second preset condition; wherein, the key point set is a set composed of at least one of the grid points or joint points corresponding to the target part of the virtual character.

[0029] In one possible implementation, the device is further configured to enforce a constraint that the difference between the target angle in the first virtual model and the second virtual model satisfies a third preset condition; wherein the target angle is the angle between the offset vector and the normal vector of the target reference point of the virtual character and the target joint point of the virtual character; and the distance between the target reference point and the target joint point is less than or equal to a preset distance threshold.

[0030] In one possible implementation, the device is further configured to perform the following: acquiring distance information between a set of reference points for the target part and a set of reference points for the virtual object; the distance information being used to characterize the degree of contact between the virtual character and the virtual object; determining inverse kinematic weights based on the distance information; the inverse kinematic weights being negatively correlated with the distance information; and using the position of the target part to deduce the motion angles of each joint in the virtual character according to the inverse kinematic weights.

[0031] In one possible implementation, the acquisition unit is specifically configured to acquire a source skeleton model and perform character-based rendering on the source skeleton model to obtain the virtual character; import action information that controls the virtual character to perform the preset action to obtain the action trajectory of the virtual character performing the preset action.

[0032] In one possible implementation, the acquisition unit is specifically configured to: determine the action constraint type that matches the preset action and the target part; query the target action file corresponding to the preset action and the target part in at least one candidate action file that matches the action constraint type; and perform the operation of importing the target action file to import the action information that controls the virtual character to perform the preset action.

[0033] According to a third aspect of the present disclosure, an electronic device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement an animation generation method for virtual characters as described in the first aspect or any possible implementation thereof.

[0034] According to a fourth aspect of the present disclosure, a storage medium is provided that stores a computer program thereon, which, when executed by a processor, implements the method for generating animations of virtual characters as described in the first aspect or any possible implementation thereof.

[0035] According to a fifth aspect of the present disclosure, a computer program product is provided, the program product comprising a computer program stored in a readable storage medium, wherein at least one processor of a device reads from the readable storage medium and executes the computer program, causing the device to perform the animation generation method for a virtual character as described in the first aspect or any possible implementation thereof.

[0036] The technical solution provided by the embodiments of this disclosure brings at least the following beneficial effects: It acquires the motion trajectory of a virtual character performing a preset action; the motion trajectory includes the point cloud trajectory generated by the interaction between the target part of the virtual character and a virtual object; it samples the target point cloud corresponding to the target part in the motion trajectory, and samples the environmental constraint point cloud in the virtual space formed by the target point cloud; it uses the environmental constraint point cloud as constraint information to tetrahedronize the contact points between the virtual character and the virtual object, as well as the reference points of the virtual character, to form an interaction grid for describing the data structure of the interaction between the virtual character and the virtual object; when the shape of the virtual object changes, it adjusts the motion information of the preset action and constrains the relative positional relationship between the interaction grids to meet preset conditions until the adjusted motion information is obtained; based on the adjusted motion information, it generates a target animation of the virtual character performing the target action; the target action is the action generated by the interaction between the target part of the virtual character and the virtual object after its shape has changed; thus, by constructing a virtual space and sampling its surface points as environmental reference points, it achieves the completion of environmental information for discontinuous environmental constraint actions, increasing the constraint time. It extends the brief moment of the interaction action into a time window, facilitating the construction of more interpolation keyframes. Furthermore, when redirecting motion information, an interactive mesh is constructed by combining affine transformation with human reference points. During motion redirection, the relative spatial relationship between the interactive mesh before and after the change in environmental information is constrained to meet preset conditions, thereby achieving efficient and accurate redirection of environmental interactive actions. This enables low-cost migration and generation of environmental interactive actions, ensuring that the semantics of the target action remain consistent after motion migration following changes in the form of the virtual object (after environmental changes). This effectively achieves the redirection of environmental interactive actions and improves the generation efficiency of motion animations for virtual objects.

[0037] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0038] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.

[0039] Figure 1 This is an application environment diagram illustrating an animation generation method for virtual objects according to an exemplary embodiment.

[0040] Figure 2 This is a flowchart illustrating a method for generating animations of virtual objects according to an exemplary embodiment.

[0041] Figure 3This is a flowchart illustrating a method for generating animations of virtual objects according to an exemplary embodiment.

[0042] Figure 4 This is a schematic diagram illustrating a motion trajectory according to an exemplary embodiment.

[0043] Figure 5 This is a schematic diagram of a candidate point cloud according to an exemplary embodiment.

[0044] Figure 6 This is a schematic diagram of a virtual bounding box according to an exemplary embodiment.

[0045] Figure 7 This is a flowchart illustrating another method for generating animations of virtual objects according to an exemplary embodiment.

[0046] Figure 8 This is a block diagram illustrating an animation generation apparatus for a virtual object according to an exemplary embodiment.

[0047] Figure 9 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation

[0048] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0049] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0050] It should also be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.

[0051] The virtual object animation generation method provided in this disclosure can be applied to, for example... Figure 1In the application environment shown, electronic device 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. Electronic device 102 acquires the motion trajectory of a virtual character performing a preset action; the motion trajectory includes the point cloud trajectory generated by the interaction between the target part of the virtual character and a virtual object; electronic device 102 samples the target point cloud corresponding to the target part from the motion trajectory, and samples the environmental constraint point cloud in the virtual space formed by the target point cloud; electronic device 102 uses the environmental constraint point cloud as constraint information to tetrahedronize the contact points between the virtual character and the virtual object, as well as the reference point of the virtual character, to form an interaction mesh; the interaction mesh is used to describe the data structure of the interaction between the virtual character and the virtual object; when the virtual object changes, electronic device 102 adjusts the motion information of the preset action and constrains the relative positional relationship between the interaction meshes to meet preset conditions until the adjusted motion information is obtained; electronic device 102 generates a target animation of the virtual character performing the target action based on the adjusted motion information; the target action is the action generated by the interaction between the target part of the virtual character and the changed virtual object. Electronic device 102 can upload the target animation to server 104. Electronic device 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle systems, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0052] Figure 2 This is a flowchart illustrating an animation generation method for a virtual object according to an exemplary embodiment, such as... Figure 2 As shown, this method is used Figure 1 The electronic device includes the following steps.

[0053] In step S210, the motion trajectory of the virtual character performing a preset action is obtained.

[0054] Among them, "action" refers to the interactive actions between virtual characters and static virtual objects (such as the ground, tables, chairs, etc.) in virtual scenes (such as the action of a virtual character picking up a virtual object with their hand).

[0055] The preset action can refer to the initial action that has not been redirected.

[0056] Among them, the motion trajectory includes the point cloud trajectory generated by the interaction between the target part of the virtual character and the virtual object.

[0057] The target part can refer to the part of the virtual character or virtual object being detected. For example, if the preset action is for the virtual character to pick up a virtual object with its right hand, the target part can refer to the virtual character's right hand.

[0058] In practice, the electronic device can acquire a source skeleton model and perform character-based rendering on it to obtain a virtual character. Then, the electronic device can import motion information to control the virtual character to perform preset actions, thereby controlling the virtual character to perform preset actions and recording the network points of the virtual character during the execution of preset actions, thus obtaining the motion trajectory of the virtual character performing preset actions.

[0059] In step S220, the target point cloud corresponding to the target part is sampled from the motion trajectory, and the environmental constraint point cloud is sampled from the virtual space formed by the target point cloud.

[0060] In practice, the electronic device can extract candidate point clouds corresponding to the target part from the point cloud trajectory of the motion trajectory; then, the electronic device samples the point cloud within a preset time window from the candidate point cloud as the target point cloud corresponding to the target part.

[0061] The electronic device can construct a virtual space to accommodate the target point cloud; then, the electronic device can sample the surface points of the virtual space to obtain the surface sampled point cloud of the virtual space; finally, the electronic device uses the surface sampled point cloud of the virtual space as the environmental constraint point cloud.

[0062] In step S230, the environmental constraint point cloud is used as constraint information to form an interactive mesh by tetrahedronizing the contact points between the virtual character and the virtual object, as well as the reference points of the virtual character.

[0063] The interactive grid is a data structure used to describe the interaction between virtual characters and virtual objects.

[0064] In its implementation, the electronic device uses the environmental constraint point cloud as constraint information and searches for interaction / contact points between environmental objects and the human body using KNN (K-Nearest Neighbor) algorithm. These points are then tetrahedged with the virtual character's human body reference points to form an interaction mesh. Specifically, the electronic device can construct a point cloud from the virtual character's joints and mesh vertices, and then use Delaunay tetrahedronization to compute the interaction mesh.

[0065] In step S240, when the shape of the virtual object changes, the motion information of the preset action is adjusted, and the relative positional relationship between the interactive meshes is constrained to meet the first preset condition until the adjusted motion information is obtained.

[0066] In practical implementation, when the form of a virtual object changes, the electronic device adjusts the action information of a preset action—that is, redirects the action—and constrains the relative positional relationships between the interaction meshes to meet preset conditions until the adjusted action information is obtained. Specifically, the optimization goal of the electronic device is to preserve the relative spatial structure relationship of the interaction mesh. During redirection, the electronic device can construct an "interaction mesh" by combining affine transformations with human reference points. By constraining the relative spatial relationship of the "interaction mesh" before and after the change in environmental information using Laplace energy terms, the redirection of environmental interaction-related actions is achieved.

[0067] In step S250, a target animation is generated based on the adjusted motion information to show the virtual character performing the target action.

[0068] Among them, the target action is the action generated by the interaction between the target part of the virtual character and the virtual object after the shape has changed.

[0069] In practice, after the electronic device completes motion redirection and obtains the adjusted motion information, it uses this information to control the interaction between the target part of the virtual character and the virtual object whose shape has changed, thereby generating a target animation. For ease of understanding by those skilled in the art, Figure 3 A flowchart is provided for a method to generate animations for virtual objects.

[0070] In the above-mentioned method for generating animations of virtual objects, the motion trajectory of a virtual character performing a preset action is obtained. This motion trajectory includes the point cloud trajectory generated by the interaction between the target part of the virtual character and the virtual object. The target point cloud corresponding to the target part is sampled from the motion trajectory, and the environmental constraint point cloud is sampled from the virtual space formed by the target point cloud. Using the environmental constraint point cloud as constraint information, the contact points between the virtual character and the virtual object, as well as the reference points of the virtual character, are tetrahedredged to form an interaction grid, which is used to describe the data structure of the interaction between the virtual character and the virtual object. When the shape of the virtual object changes, the motion information of the preset action is adjusted, and the relative positional relationship between the interaction grids is constrained to meet preset conditions until the adjusted motion information is obtained. Based on the adjusted motion information, a target animation of the virtual character performing the target action is generated. The target action is the action generated by the interaction between the target part of the virtual character and the virtual object after its shape has changed. Thus, by constructing a virtual space and sampling its surface points as environmental reference points, the environmental information of discontinuous environmental constraint actions is supplemented, increasing the constraint time. This extends the brief moment of the interaction action into a time window, facilitating the construction of more interpolation keyframes. Furthermore, when redirecting motion information, an interactive mesh is constructed by combining affine transformation with human reference points. During motion redirection, the relative spatial relationship between the interactive mesh before and after the change in environmental information is constrained to meet preset conditions, thereby achieving efficient and accurate redirection of environmental interactive actions. This enables low-cost migration and generation of environmental interactive actions, ensuring that the semantics of the target action remain consistent after motion migration following changes in the form of the virtual object (after environmental changes). This effectively achieves the redirection of environmental interactive actions and improves the generation efficiency of motion animations for virtual objects.

[0071] In an exemplary embodiment, sampling the target point cloud corresponding to the target part in the motion trajectory includes: extracting candidate point clouds corresponding to the target part from the point cloud trajectory of the motion trajectory; and sampling point clouds within a preset time window from the candidate point clouds as the target point cloud corresponding to the target part.

[0072] In the specific implementation, during the process of the electronic device sampling the target point cloud corresponding to the target part in the motion trajectory, the electronic device can extract the candidate point cloud corresponding to the target part from the point cloud trajectory of the motion trajectory; then, the electronic device samples the point cloud in the preset time window from the candidate point cloud as the target point cloud corresponding to the target part.

[0073] For the convenience of those skilled in the art, Figure 4 An exemplary schematic diagram of a motion trajectory is provided; taking the action of a virtual character picking up a virtual object with their right hand as an example, the electronic device moves from... Figure 4The candidate point cloud is obtained by extracting the trajectory point cloud of the virtual character's right hand from the shown motion trajectory (see [link]). Figure 5 Then, the electronic device samples the point cloud within a preset time window from the candidate point cloud, which serves as the target point cloud corresponding to the target region (see [link]). Figure 6 (610 in the middle).

[0074] The technical solution of this embodiment can effectively create a virtual environment as an action constraint, maintain the continuity of the action while effectively adjusting the action, and supplement the environmental information of the non-continuous environment to constrain the action, thereby increasing the constraint time.

[0075] In an exemplary embodiment, sampling an environmental constraint point cloud in a virtual space constituted by a target point cloud includes: constructing a virtual bounding box to accommodate the target point cloud; sampling the surface points of the virtual bounding box to obtain a surface sampled point cloud of the virtual bounding box; and using the surface sampled point cloud of the virtual bounding box as the environmental constraint point cloud.

[0076] In specific implementation, the process of the electronic device sampling the environmental constraint point cloud in the virtual space formed by the target point cloud includes: the electronic device constructing a virtual bounding box to accommodate the target point cloud; then, the electronic device performing Poisson disk sampling on the surface points of the virtual bounding box to obtain the surface sampled point cloud of the virtual bounding box; finally, the electronic device using the surface sampled point cloud of the virtual bounding box as the environmental constraint point cloud. For ease of understanding by those skilled in the art, Figure 6 An exemplary schematic diagram of a virtual bounding box is provided; 610 represents the target point cloud, and 620 represents the virtual bounding box.

[0077] The technical solution of this embodiment constructs a virtual bounding box to accommodate the target point cloud; samples the surface points of the virtual bounding box to obtain the surface sampled point cloud of the virtual bounding box; and uses the surface sampled point cloud of the virtual bounding box as the environmental constraint point cloud. This enables the effective creation of a virtual environment as an action constraint, effectively adjusting the action while maintaining the continuity of the action, and supplementing the environmental information of the non-continuous environmental constraint action to increase the constraint time.

[0078] In an exemplary embodiment, the interactive mesh includes a first interactive mesh before the virtual object's shape changes and a second interactive mesh after the virtual object's shape changes. The relative positional relationship between the interactive meshes is constrained to meet a first preset condition until adjusted action information is obtained. This includes: constructing an energy function based on Laplace deformation according to the first and second interactive meshes; the function value of the energy function is used to characterize the degree of change in the relative positional relationship; during the process of adjusting the action information of the preset action, the least squares method is used to optimize the energy function until the function value of the energy function is less than or equal to a preset threshold, thereby obtaining the adjusted action information.

[0079] In its implementation, the electronic device uses an interactive mesh as the data structure to describe human-environment interaction, and the optimization goal is to preserve the relative spatial structure relationships of the interactive mesh. Specifically, the electronic device can construct a point cloud from all the joints of the virtual character and the mesh vertices, and use Delaunay tetrahedronization to compute the interactive mesh.

[0080] The electronic device acquires the character model of the virtual character before the virtual object's form changes (i.e., the source model), and the character model of the virtual character after the virtual object's form changes (i.e., the target model). Then, the electronic device uses the interactive mesh corresponding to the source model as the first interactive mesh and the interactive mesh corresponding to the target model as the second interactive mesh. It should be noted that the methods for acquiring the interactive mesh corresponding to the source model and the interactive mesh corresponding to the target model are described above and will not be repeated here.

[0081] During the optimization process, the optimization objective of the electronic device is to maintain the relative positional relationship between corresponding points in the source and target models with respect to surrounding points (e.g., first-order neighbors). Therefore, this scheme uses Laplace deformation energy optimization, directly constraining each edge of the tetrahedralized graph. The energy function can be expressed as:

[0082]

[0083] Wherein, N j For point p j The set of first-order neighbors, These are standardized weights.

[0084] After constructing an energy function that represents the degree of change in the relative positional relationship between interactive grids, the electronic device can use the least squares method to optimize the energy function during the process of adjusting the motion information of the preset action until the function value of the energy function is less than or equal to the preset threshold, thus obtaining the adjusted motion information.

[0085] The technical solution of this embodiment constructs an energy function based on Laplace deformation according to the first and second interactive meshes. The function value of the energy function is used to characterize the degree of change in the relative positional relationship. In the process of adjusting the motion information of the preset action, the least squares method is used to optimize the energy function until the function value of the energy function meets the preset conditions, and the adjusted motion information is obtained. Thus, the relative spatial structure relationship of the interactive mesh can be quickly constrained to remain unchanged by using the energy function of Laplace deformation. This ensures that the semantics of the target action can remain consistent after the shape of the virtual object changes (after the environment changes) and the motion is transferred. This effectively realizes the redirection of environmental interaction actions and improves the generation efficiency of the motion animation of virtual objects.

[0086] In an exemplary embodiment, the method further includes: during the process of adjusting the motion information of the preset action, determining a first virtual model and a second virtual model corresponding to the virtual character; constraining the relative positional relationship of the key point set in the first virtual model and the second virtual model to satisfy a second preset condition; wherein, the key point set is a set composed of at least one of the grid points or joint points corresponding to the target part of the virtual character.

[0087] The first virtual model is the character model corresponding to the virtual character before the virtual object's form changes. In practical applications, the first virtual model can also be named the source model.

[0088] The second virtual model is the character model corresponding to the virtual character after the virtual object's form has changed. In practical applications, the first virtual model can also be named the target model.

[0089] In specific implementation, during the process of adjusting the motion information of the preset action, the electronic device can constrain the degree of change in the relative positional relationship between the key point set in the first virtual model and the key point set in the second virtual model to be less than a preset threshold (e.g., the relative positional relationship remains unchanged). Specifically, the electronic device can add an L1 constraint on the key point set, which includes mesh points and joints. For ease of understanding by those skilled in the art, this constraint objective can be expressed as:

[0090] E V =∑|V t -V s |

[0091] Among them, V s V represents the set of key points of the source model (i.e., the first virtual model). t This represents the set of key points of the target model (i.e., the second virtual model).

[0092] The technical solution of this embodiment satisfies the preset conditions by constraining the relative positional relationship of the key point set in the first virtual model and the second virtual model. The key point set is a set composed of at least one of the grid points or joint points of the virtual character. This can produce a good constraint effect on the limbs of the virtual character while fully preserving the detailed movements of the virtual character's hands.

[0093] In an exemplary embodiment, during the process of adjusting the motion information of the preset action, the method further includes: constraining the difference between the target angle in the first virtual model and the second virtual model to satisfy a third preset condition.

[0094] The target angle is the angle between the offset vector and the normal vector of the virtual character's reference point and the joint point of the virtual character; the distance between the virtual character's reference point and the joint point of the target part is less than or equal to a preset distance threshold.

[0095] In practical implementation, while adjusting the motion information of the preset action, the electronic device can also constrain the difference between the target angle in the first virtual model and the second virtual model to meet preset conditions. For example, when the target part is the hand of a virtual object, the electronic device can further constrain the normal vector of the reference point, that is, select the reference point closest to each hand joint point, and calculate the angle between the offset vector from the reference point to the joint point and the normal vector as the constraint target. This constraint target can be expressed as:

[0096] E R =∑|r t -r s |

[0097] Where, r s The target angle, r, represents the angle between the source model (i.e., the first virtual model). t This represents the target angle of the target model (i.e., the second virtual model).

[0098] The technical solution of this embodiment constrains the difference between the target angle in the first virtual model and the second virtual model to meet a preset condition. The target angle is the angle between the offset vector and the normal vector of the reference point of the virtual character and the joint point of the virtual character. The distance between the reference point of the virtual character and the joint point of the target part meets the preset condition, thereby avoiding the phenomenon of clipping caused by random reference point optimization.

[0099] In an exemplary embodiment, during the process of adjusting the motion information of the preset action, the method further includes: obtaining distance information between the reference point set of the target part and the reference point set of the virtual object; determining inverse kinematic weights based on the distance information; the inverse kinematic weights are negatively correlated with the distance information; and using the position of the target part to deduce the motion angles of each joint in the virtual character according to the inverse kinematic weights.

[0100] Among them, distance information is used to characterize the degree of contact between virtual characters and virtual objects.

[0101] In practice, while adjusting the motion information of the preset action, the electronic device can also obtain the distance information between the reference point set of the target part and the reference point set of the virtual object (e.g., Hausdorff distance). Then, the electronic device can determine the inverse kinematic weights that are negatively correlated with the distance information. The electronic device uses the inverse kinematic weights to deduce the motion angles of each joint in the virtual character based on the position of the target part.

[0102] For example, when the target part is the virtual character's hand, taking the action of picking up an item as an example of contact between the hand and the environment (virtual object), all reference points of the hand and the reference points of the environment can be considered as two point sets. The degree of contact is represented by the Hausdorff distance between these two point sets. After adjusting the position for picking up the item, to ensure a smooth transition between environmental constraints, a larger distance between the point sets indicates a greater distance between the hand and the corresponding part. In this case, the inverse kinematics (IK) weights should be reduced to decrease the environmental constraints and complete the retraction action. Conversely, a smaller distance indicates a more significant interaction between parts, and the IK weights should be increased. The Hausdorff distance is defined as:

[0103]

[0104] Here, X and Y represent the local point set of the human body and the environmental point set involved in the interaction, respectively. By incorporating annotation information and IK weight constraints, the generated actions become smoother and more natural compared to direct global optimization.

[0105] The technical solution of this embodiment obtains the distance information between the reference point set of the target part and the reference point set of the virtual object, and determines the inverse kinematic weights that are negatively correlated with the distance information. This is used to deduce the motion angles of each joint in the virtual character by using the position of the target part. This enables the implementation of a weighted exponential decay method based on the distance between the environmental point and the end part, ensuring the continuity between action transitions, avoiding jump phenomena, and better connecting the transition actions before and after the action and environmental constraints.

[0106] In one exemplary embodiment, obtaining the motion trajectory of a virtual character performing a preset action includes: obtaining a source skeleton model and performing character-based rendering on the source skeleton model to obtain a virtual character; importing motion information that controls the virtual character to perform the preset action to obtain the motion trajectory of the virtual character performing the preset action.

[0107] In the specific implementation, during the process of obtaining the motion trajectory of the virtual character performing the preset action, the electronic device can execute the initialization step of MotionBuilder (a 3D character animation software): Specifically, the electronic device can obtain the source skeleton model and perform character rendering on the source skeleton model to obtain the virtual character; then, the electronic device can import the motion information for controlling the virtual character to perform the preset action, so as to control the virtual character to perform the preset action and thus obtain the motion trajectory of the virtual character performing the preset action.

[0108] The technical solution of this embodiment obtains a virtual character by acquiring a source skeleton model and performing character-based rendering on the source skeleton model; it then imports action information to control the virtual character to perform preset actions, thereby initializing the virtual character and controlling the virtual character to perform preset actions, thus effectively obtaining the action trajectory of the virtual character performing preset actions.

[0109] In one exemplary embodiment, importing action information for controlling a virtual character to perform a preset action includes: determining an action constraint type that matches the preset action and the target part; querying a target action file corresponding to the preset action and the target part from at least one candidate action file that matches the action constraint type; and performing an operation to import the target action file to import the action information for controlling the virtual character to perform the preset action.

[0110] The action constraint type refers to the type of constraint method used in the interactive action. In practical applications, the action constraint type can be divided into spatial position constraints and spatial direction constraints based on the target part of the action and the environment (e.g., virtual objects). Spatial position constraints can be further divided into continuous constraints, transient constraints, and multi-condition constraints. To facilitate understanding by those skilled in the art, Tables 1 and 2 provide exemplary examples of the mapping relationship between each target part (constraint part) and the file name of the action file when the action constraint type is spatial position constraint and spatial direction constraint, respectively.

[0111]

[0112]

[0113] Table 1 Spatial Location Constraints

[0114]

[0115] Table 2 Spatial Angle Constraints

[0116] In the specific implementation, during the process of importing action information to control the virtual character to perform preset actions, the electronic device can determine the action constraint type that matches the preset action and the target part; then, in at least one candidate action file that matches the action constraint type, the electronic device queries the target action file that corresponds to the preset action and the target part; then, the electronic device performs the operation of importing the target action file to import the action information to control the virtual character to perform preset actions. For example, when the preset action is to pick up an item from the ground with both hands, the electronic device determines that the target part is "both hands" and the action is "picking up from the ground". The electronic device can determine that the action constraint type matching the action and target part is a transient constraint in the spatial position constraint. Then, the electronic device can use at least one candidate action file corresponding to the transient constraint shown in Table 1 to query the target action file corresponding to the target part being "both hands" and the action being "picking up from the ground" (i.e., the action file named "1002000978, picking up from the ground"). Finally, the electronic device performs the operation of importing the action file named "1002000978, picking up from the ground" to import the action information for controlling the virtual character to perform the action of "picking up an item from the ground with both hands".

[0117] The technical solution of this embodiment determines the action constraint type that matches the preset action and target part; queries the target action file corresponding to the preset action and target part in at least one candidate action file that matches the action constraint type; and performs the operation of importing the target action file, thereby enabling the rapid and accurate import of action information that controls the virtual character to perform preset actions.

[0118] Figure 7 This is a flowchart illustrating another method for generating animations of virtual characters according to an exemplary embodiment, such as... Figure 7 As shown, this method is used Figure 1 The electronic device in the process includes the following steps.

[0119] In step S710, the source skeleton model is obtained and the source skeleton model is rendered into a character to obtain a virtual character.

[0120] In step S720, motion information for controlling the virtual character to perform preset actions is imported to obtain the motion trajectory of the virtual character performing the preset actions; the motion trajectory includes the point cloud trajectory generated by the interaction between the target part of the virtual character and the virtual object.

[0121] In step S730, candidate point clouds corresponding to the target part are extracted from the point cloud trajectory of the motion trajectory.

[0122] In step S740, point clouds within a preset time window are sampled from the candidate point clouds and used as the target point cloud corresponding to the target part.

[0123] In step S750, a virtual bounding box is constructed to contain the target point cloud, and the surface points of the virtual bounding box are sampled to obtain the surface sampled point cloud of the virtual bounding box.

[0124] In step S760, the surface sampling point cloud of the virtual bounding box is used as the environmental constraint point cloud.

[0125] In step S770, the environmental constraint point cloud is used as constraint information to form a tetrahedron for the contact points between the virtual character and the virtual object, as well as the reference point of the virtual character, to create an interaction mesh. The interaction mesh is used to describe the data structure for the interaction between the virtual character and the virtual object.

[0126] In step S780, when the virtual object changes, the motion information of the preset action is adjusted, and the relative positional relationship between the interactive meshes is constrained to meet the first preset condition until the adjusted motion information is obtained.

[0127] In step S790, a target animation is generated based on the adjusted motion information to show that the virtual character is performing a target action; the target action is the action generated by the interaction between the target part of the virtual character and the changed virtual object.

[0128] It should be noted that the specific limitations of the above steps can be found in the specific limitations of a method for generating animations of a virtual character mentioned above, and will not be repeated here.

[0129] It should be understood that, although Figure 2 and Figure 7 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 2 and Figure 7 At least some of the steps in the process may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but may be executed at different times. The execution order of these steps or stages is not necessarily sequential, but may be executed in turn or alternately with other steps or at least some of the steps or stages in other steps.

[0130] It is understood that the same / similar parts between the various embodiments of the methods described above in this specification can be referred to each other. Each embodiment focuses on the differences from other embodiments, and relevant parts can be referred to the description of other method embodiments.

[0131] Figure 8 This is a block diagram illustrating an animation generation apparatus for a virtual object according to an exemplary embodiment. (Refer to...) Figure 8 The device includes:

[0132] The acquisition unit 810 is configured to acquire the motion trajectory of a virtual character performing a preset action; the motion trajectory includes the point cloud trajectory generated by the interaction between the target part of the virtual character and a virtual object.

[0133] The sampling unit 820 is configured to sample the target point cloud corresponding to the target part in the motion trajectory, and sample the environmental constraint point cloud in the virtual space formed by the target point cloud;

[0134] The construction unit 830 is configured to use the environmental constraint point cloud as constraint information to tetrahedronize the contact points between the virtual character and the virtual object, as well as the reference points of the virtual character, to form an interaction mesh; the interaction mesh is used to describe the data structure of the interaction between the virtual character and the virtual object.

[0135] The adjustment unit 840 is configured to adjust the motion information of the preset action when the shape of the virtual object changes, and constrain the relative positional relationship of the interactive mesh to meet the first preset condition until the adjusted motion information is obtained.

[0136] The generation unit 850 is configured to generate a target animation of the virtual character performing a target action based on the adjusted action information; the target action is the action generated by the interaction between the target part of the virtual character and the virtual object after the shape has changed.

[0137] In an exemplary embodiment, the sampling unit 820 is specifically configured to extract candidate point clouds corresponding to the target part from the point cloud trajectory of the action trajectory; and to sample point clouds within a preset time window from the candidate point clouds as the target point cloud corresponding to the target part.

[0138] In an exemplary embodiment, the sampling unit 820 is specifically configured to perform the following: construct a virtual bounding box for accommodating the target point cloud; sample the surface points of the virtual bounding box to obtain a surface sampled point cloud of the virtual bounding box; and use the surface sampled point cloud of the virtual bounding box as the environmental constraint point cloud.

[0139] In an exemplary embodiment, the interactive mesh includes a first interactive mesh before the virtual object's shape changes and a second interactive mesh after the virtual object's shape changes. The adjustment unit is specifically configured to construct an energy function based on Laplace deformation according to the first and second interactive meshes. The function value of the energy function is used to characterize the degree of change in the relative positional relationship. During the process of adjusting the motion information of the preset action, the least squares method is used to optimize the energy function until the function value of the energy function is less than or equal to a preset threshold, thereby obtaining the adjusted motion information.

[0140] In an exemplary embodiment, the device is further configured to, during the process of adjusting the action information of the preset action, determine a first virtual model and a second virtual model corresponding to the virtual character; the first virtual model is the model corresponding to the virtual character before the virtual object changes; the second virtual model is the model corresponding to the virtual character after the virtual object changes; constrain the relative positional relationship of the key point set in the first virtual model and the second virtual model to satisfy a second preset condition; wherein, the key point set is a set composed of at least one of the grid points or joint points corresponding to the target part of the virtual character.

[0141] In an exemplary embodiment, the device is further configured to perform a constraint that the difference between the target angle in the first virtual model and the second virtual model satisfies a third preset condition; wherein the target angle is the angle between the offset vector and the normal vector of the target reference point of the virtual character and the target joint point of the virtual character; and the distance between the target reference point and the target joint point is less than or equal to a preset distance threshold.

[0142] In an exemplary embodiment, the device is further configured to perform the following: acquiring distance information between a set of reference points for the target part and a set of reference points for the virtual object; the distance information is used to characterize the degree of contact between the virtual character and the virtual object; determining inverse kinematic weights based on the distance information; the inverse kinematic weights being negatively correlated with the distance information; and using the position of the target part to deduce the motion angles of each joint in the virtual character according to the inverse kinematic weights.

[0143] In an exemplary embodiment, the acquisition unit 810 is specifically configured to acquire a source skeleton model and perform character rendering on the source skeleton model to obtain the virtual character; import action information that controls the virtual character to perform the preset action, and obtain the action trajectory of the virtual character performing the preset action.

[0144] In an exemplary embodiment, the acquisition unit 810 is specifically configured to: determine the action constraint type that matches the preset action and the target part; query the target action file that matches the preset action and the target part in at least one candidate action file that matches the action constraint type; and perform the operation of importing the target action file to import the action information that controls the virtual character to perform the preset action.

[0145] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0146] Figure 9 This is a block diagram illustrating an electronic device 900 for performing an animation generation method for virtual objects, according to an exemplary embodiment. For example, the electronic device 900 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.

[0147] Reference Figure 9 The electronic device 900 may include one or more of the following components: processing component 902, memory 904, power supply component 906, multimedia component 908, audio component 910, input / output (I / O) interface 912, sensor component 914, and communication component 916.

[0148] Processing component 902 typically controls the overall operation of electronic device 900, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 902 may include one or more processors 920 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 902 may include one or more modules to facilitate interaction between processing component 902 and other components. For example, processing component 902 may include a multimedia module to facilitate interaction between multimedia component 908 and processing component 902.

[0149] Memory 904 is configured to store various types of data to support the operation of electronic device 900. Examples of this data include instructions for any application or method operating on electronic device 900, contact data, phonebook data, messages, pictures, videos, etc. Memory 904 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, optical disk, or graphene memory.

[0150] Power supply component 906 provides power to various components of electronic device 900. Power supply component 906 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 900.

[0151] Multimedia component 908 includes a screen that provides an output interface between the electronic device 900 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 908 includes a front-facing camera and / or a rear-facing camera. When the electronic device 900 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0152] Audio component 910 is configured to output and / or input audio signals. For example, audio component 910 includes a microphone (MIC) configured to receive external audio signals when electronic device 900 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 904 or transmitted via communication component 916. In some embodiments, audio component 910 also includes a speaker for outputting audio signals.

[0153] I / O interface 912 provides an interface between processing component 902 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0154] Sensor assembly 914 includes one or more sensors for providing state assessments of various aspects of electronic device 900. For example, sensor assembly 914 can detect the on / off state of electronic device 900, the relative positioning of components such as the display and keypad of electronic device 900, changes in position of electronic device 900 or its components, the presence or absence of user contact with electronic device 900, orientation or acceleration / deceleration of device 900, and temperature changes of electronic device 900. Sensor assembly 914 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 914 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 914 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.

[0155] Communication component 916 is configured to facilitate wired or wireless communication between electronic device 900 and other devices. Electronic device 900 can access wireless networks based on communication standards, such as WiFi, carrier networks (such as 2G, 3G, 4G, or 5G), or combinations thereof. In one exemplary embodiment, communication component 916 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 916 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0156] In an exemplary embodiment, the electronic device 900 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.

[0157] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 904 including instructions, which can be executed by a processor 920 of an electronic device 900 to perform the above-described method. For example, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0158] In an exemplary embodiment, a computer program product is also provided, the computer program product including instructions that can be executed by a processor 920 of an electronic device 900 to perform the above-described method.

[0159] It should be noted that the above-mentioned apparatus, electronic equipment, computer-readable storage medium, computer program product, etc., may also include other implementation methods according to the description of the method embodiments. For specific implementation methods, please refer to the description of the relevant method embodiments, which will not be elaborated here.

[0160] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.

[0161] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A method for generating animations for virtual characters, characterized in that, include: Acquire the motion trajectory of a virtual character performing a preset action; the motion trajectory includes the point cloud trajectory generated by the interaction between the target part of the virtual character and a virtual object; The target point cloud corresponding to the target part is sampled from the motion trajectory, and a virtual bounding box is constructed to contain the target point cloud; Poisson disk sampling is performed on the surface points of the virtual bounding box to obtain the surface sampled point cloud of the virtual bounding box; the surface sampled point cloud of the virtual bounding box is used as the environmental constraint point cloud; Using the environmental constraint point cloud as constraint information, the contact points between the virtual character and the virtual object, as well as the reference points of the virtual character, are tetrahedredged to form an interaction mesh; the interaction mesh is used to describe the data structure of the interaction between the virtual character and the virtual object. When the virtual object changes, the motion information of the preset action is adjusted, and the relative positional relationship between the interactive grids is constrained to meet the first preset condition until the adjusted motion information is obtained. Based on the adjusted motion information, a target animation is generated in which the virtual character performs the target action; The target action is the action generated by the interaction between the target part of the virtual character and the changed virtual object.

2. The method for generating animations of virtual characters according to claim 1, characterized in that, The step of sampling the target point cloud corresponding to the target part in the motion trajectory includes: Candidate point clouds corresponding to the target part are extracted from the point cloud trajectory of the motion trajectory; Points within a preset time window are sampled from the candidate point clouds and used as the target point cloud corresponding to the target region.

3. The method for generating animations of virtual characters according to claim 1, characterized in that, The interactive mesh includes a first interactive mesh before the virtual object changes and a second interactive mesh after the virtual object changes. The constraint on the relative positional relationship between the interactive meshes satisfies a first preset condition until the adjusted action information is obtained, including: Based on the first and second interactive grids, an energy function based on Laplace deformation is constructed; the function value of the energy function is used to characterize the degree of change in the relative positional relationship. During the process of adjusting the motion information of the preset action, the least squares method is used to optimize the energy function until the function value of the energy function is less than or equal to a preset threshold, thereby obtaining the adjusted motion information.

4. The method for generating animations of virtual characters according to claim 1, characterized in that, The method further includes: During the process of adjusting the motion information of the preset action, a first virtual model and a second virtual model corresponding to the virtual character are determined; the first virtual model is the model corresponding to the virtual character before the virtual object changes; the second virtual model is the model corresponding to the virtual character after the virtual object changes. The relative positional relationship of the constraint key point set in the first virtual model and the second virtual model satisfies a second preset condition; wherein, the key point set is a set composed of at least one of the grid points or joint points corresponding to the target part of the virtual character.

5. The method for generating animations of virtual characters according to claim 4, characterized in that, The method further includes: The difference between the constrained target angle in the first virtual model and the second virtual model satisfies a third preset condition; wherein, the target angle is the angle between the offset vector and the normal vector of the target reference point of the virtual character and the target joint point of the virtual character; the distance between the target reference point and the target joint point is less than or equal to a preset distance threshold.

6. The method for generating animations of virtual characters according to claim 4, characterized in that, The method further includes: Obtain distance information between the reference point set of the target part and the reference point set of the virtual object; the distance information is used to characterize the degree of contact between the virtual character and the virtual object; Based on the distance information, inverse kinematics weights are determined; the inverse kinematics weights are negatively correlated with the distance information. Based on the inverse kinematic weights, the motion angles of each joint in the virtual character are deduced from the position of the target part.

7. The method for generating animations of virtual characters according to claim 1, characterized in that, The process of obtaining the motion trajectory of a virtual character performing a preset action includes: Obtain the source skeleton model and perform character-based rendering on the source skeleton model to obtain the virtual character; Import the motion information that controls the virtual character to perform the preset action, and obtain the motion trajectory of the virtual character performing the preset action.

8. The method for generating animations of virtual characters according to claim 7, characterized in that, The imported action information that controls the virtual character to perform the preset action includes: Determine the action constraint type that matches the preset action and the target part; In at least one candidate action file that matches the action constraint type, a target action file corresponding to the preset action and the target part is retrieved; Perform the operation of importing the target action file to import the action information that controls the virtual character to perform the preset action.

9. An animation generation device for a virtual character, characterized in that, include: The acquisition unit is configured to acquire the motion trajectory of a virtual character performing a preset action; the motion trajectory includes the point cloud trajectory generated by the interaction between the target part of the virtual character and a virtual object. The sampling unit is configured to sample the target point cloud corresponding to the target part in the motion trajectory and construct a virtual bounding box to accommodate the target point cloud. Poisson disk sampling is performed on the surface points of the virtual bounding box to obtain the surface sampled point cloud of the virtual bounding box; the surface sampled point cloud of the virtual bounding box is used as the environmental constraint point cloud; The construction unit is configured to use the environmental constraint point cloud as constraint information to tetrahedronize the contact points between the virtual character and the virtual object, as well as the reference points of the virtual character, to form an interaction mesh; the interaction mesh is used to describe the data structure of the interaction between the virtual character and the virtual object. The adjustment unit is configured to adjust the motion information of the preset action when the shape of the virtual object changes, and constrain the relative positional relationship of the interactive mesh to meet the first preset condition until the adjusted motion information is obtained. The generation unit is configured to generate a target animation of the virtual character performing a target action based on the adjusted action information; The target action is the action generated by the interaction between the target part of the virtual character and the virtual object after the virtual character's shape changes.

10. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the animation generation method for virtual characters as described in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is enabled to perform the animation generation method for the virtual character as described in any one of claims 1 to 8.