A method and related apparatus for generating skin weights

By generating and optimizing skin weights, the problem of abnormal animation deformation caused by inappropriate skin weight allocation in 3D character animation was solved, improving the naturalness and visual effect of the animation.

CN120451353BActive Publication Date: 2025-12-02HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510948907.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-10
Publication Date
2025-12-02
Estimated Expiration
2045-07-10

AI Technical Summary

Technical Problem

In 3D character animation, improper skin weight allocation can easily lead to abnormal animation deformation, affecting visual effects and functional implementation.

Method used

The first skin weight is generated based on the distance from the vertex to the bone and the attenuation parameter of the model mesh. The second skin weight is generated after region division. The optimized skin weight is obtained by optimizing the difference between the first skin weight and the second skin weight.

Benefits of technology

It reduces the probability of animation distortion anomalies, improves the accuracy of vertex weights, and ensures the naturalness and visual effect of animation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120451353B_ABST
    Figure CN120451353B_ABST
Patent Text Reader

Abstract

This application discloses a skinning weight generation method and related apparatus, relating to the computer field, comprising: generating a first skinning weight based on the distance from vertices of a model mesh to bones and the attenuation parameter of the bones; dividing the vertices of the model mesh into regions to obtain vertices within each region; generating a second skinning weight based on the average distance from vertices within the region to the target bone and the attenuation parameter of the region; and optimizing the first skinning weight based on the difference between the first skinning weight and the second skinning weight to obtain an optimized skinning weight. This application can reduce the probability of animation distortion anomalies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a skinning weight generation method and related apparatus. Background Technology

[0002] In 3D character animation, skinning weights determine how the vertices of a 3D model mesh follow the movement of the skeleton, directly affecting the naturalness of the animation. Each vertex of the model mesh can be associated with multiple bones and assigned corresponding skinning weights. Skinning weights determine the degree to which a vertex is affected by different bones. However, when skinning weights are not properly assigned, problems such as abnormal animation distortion may occur, affecting visual effects and functional implementation. Summary of the Invention

[0003] In view of the above problems, this application provides a skinning weight generation method and related apparatus to reduce the probability of animation distortion anomalies. The specific solution is as follows:

[0004] The first aspect of this application provides a method for generating skin weights, including:

[0005] A first skinning weight is generated based on the distance from the vertices of the model mesh to the bones and the decay parameters of the bones; wherein, the first skinning weight includes the weight of the vertices of the model mesh, and the decay parameters of the bones affect the first velocity, the first velocity being the rate at which the weight of the vertices of the model mesh decreases as the distance from the vertices of the model mesh to the bones increases;

[0006] The vertices of the model mesh are divided into regions to obtain the vertices within each region;

[0007] A second skinning weight is generated based on the average distance from vertices within the region to the target bone and the attenuation parameter of the region; wherein, the second skinning weight includes the weight of vertices within the region, the target bone is the bone that affects the vertices within the region, the attenuation parameter of the region affects the second velocity, and the second velocity is the rate at which the weight of vertices within the region decreases as the average distance from vertices within the region to the target bone increases;

[0008] Based on the difference between the first skin weight and the second skin weight, the first skin weight is optimized to obtain the optimized skin weight.

[0009] In one possible implementation, generating the first skinning weights based on the distance from the vertices of the model mesh to the bones and the decay parameters of the bones includes:

[0010] Determine the bones that affect the vertices of the joint region to obtain the bones of the joint region; wherein, the vertices of the joint region are the vertices of the model mesh whose curvature is greater than a preset curvature, and the preset curvature is less than the maximum curvature among the curvatures of all the vertices;

[0011] The weights of the vertices of the joint region are generated based on the distance from the vertices of the joint region to the bones of the joint region and the attenuation parameters of the bones of the joint region.

[0012] The weights of the vertices in the non-joint regions are generated based on the distances from the vertices of the non-joint regions to all bones and the attenuation parameters of all bones; wherein, the vertices of the non-joint regions are the vertices of the model mesh after removing the vertices of the joint regions.

[0013] The weights of the vertices in the joint region and the weights of the vertices in the non-joint region are used as the first skinning weights.

[0014] In one possible implementation, the step of dividing the vertices of the model mesh into regions to obtain the vertices within each region includes:

[0015] Determine the curvature of each vertex of the model mesh, and designate vertices with curvature greater than a preset curvature as vertices of the joint region; wherein the preset curvature is less than the maximum curvature among the curvatures of all vertices.

[0016] Multiple non-joint regions are obtained; wherein each non-joint region is obtained by dividing the remaining regions of the model mesh, excluding the joint regions.

[0017] The bones of each non-joint region are determined. The vertices of the model mesh remaining after removing the vertices of the joint regions are divided into regions according to the method of dividing the vertices to the non-joint regions to which the vertices belong, so as to obtain the vertices in each non-joint region.

[0018] In one possible implementation, generating the second skinning weights based on the average distance from vertices within the region to the target bone and the region's attenuation parameter includes:

[0019] The bones that affect the vertices in each region are arranged in ascending order of distance from the vertex to the bone, and the top-ranked preset root bone is obtained as the target bone.

[0020] The range of each region is obtained based on the size information of each region, and the attenuation parameter of each region is determined based on the range of each region.

[0021] The second skinning weight is generated based on the ratio of the square of the average distance from each vertex in each region to the corresponding target bone to the square of the attenuation parameter of each region.

[0022] In one possible implementation, optimizing the first skin weight based on the difference between the first skin weight and the second skin weight to obtain the optimized skin weight includes:

[0023] The first skin weight is optimized to minimize the difference between the first skin weight and the second skin weight, the difference between the weights of two adjacent vertices, and the sum of the weights of the vertices in the joint region. The optimized skin weight is obtained by optimizing the first skin weight. The vertices in the joint region are the vertices of the model mesh whose curvature is greater than a preset curvature, and the preset curvature is less than the maximum curvature among the curvatures of the vertices.

[0024] In one possible implementation, after obtaining the optimized skin weights, the following is also included:

[0025] Obtain the correspondence between key points of the target model and the source model; wherein, the mesh of the source model is the mesh of the model, and the key points include vertex curvature extreme points and / or the intersection points of two bones;

[0026] Based on the key point correspondence, determine the corresponding points of the mesh vertices of the target model in the source model;

[0027] Based on the optimized skin weights and the corresponding points, the skin weights of the mesh vertices of the target model are obtained.

[0028] A second aspect of this application provides a skinning weight generation system, comprising:

[0029] The first skinning weight generation module is used to generate a first skinning weight based on the distance from the vertices of the model mesh to the bones and the decay parameter of the bones; wherein, the first skinning weight includes the weight of the vertices of the model mesh, the decay parameter of the bones affects the first velocity, and the first velocity is the rate at which the weight of the vertices of the model mesh decreases as the distance from the vertices of the model mesh to the bones increases;

[0030] The vertex partitioning module is used to partition the vertices of the model mesh into regions, thereby obtaining the vertices within each region;

[0031] The second skinning weight generation module is used to generate a second skinning weight based on the average distance from the vertices in the region to the target bone and the attenuation parameter of the region; wherein, the second skinning weight includes the weight of the vertices in the region, the target bone is the bone that affects the vertices in the region, the attenuation parameter of the region affects the second velocity, and the second velocity is the rate at which the weight of the vertices in the region decreases as the average distance from the vertices in the region to the target bone increases;

[0032] The weight optimization module is used to optimize the first skin weight based on the difference between the first skin weight and the second skin weight to obtain the optimized skin weight.

[0033] A third aspect of this application provides a computer program product including computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the skinning weight generation method of the first aspect or any implementation thereof.

[0034] A fourth aspect of this application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:

[0035] The memory is used to store computer programs;

[0036] The processor is used to execute the computer program so that the electronic device can implement the skin weight generation method of the first aspect or any implementation thereof.

[0037] The fifth aspect of this application provides a computer storage medium carrying one or more computer programs, which, when executed by an electronic device, enable the electronic device to perform the skin weight generation method described in the first aspect or any implementation thereof.

[0038] Using the above technical solution, the skin weight generation method and related apparatus provided in this application divide the vertices of the model mesh into regions. Based on the average distance from the vertices within the region to the target bone and the region's attenuation parameter, a second skin weight is generated. Compared to directly generating the first skin weight for all vertices of the entire model mesh, by reducing the number of bones corresponding to the vertices, only the bones affecting the vertices are considered when calculating the second skin weight. Compared to considering all bones, this improves the accuracy of the vertex weights. The first skin weight is optimized by the difference between the first and second skin weights to obtain the optimized skin weight. By optimizing the skin weight, the probability of animation distortion anomalies can be reduced. Attached Figure Description

[0039] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.

[0040] Figure 1 A flowchart of a skin weight generation method provided in this application;

[0041] Figure 2 A structural diagram of a skin weight generation system provided in this application;

[0042] Figure 3 This is a schematic diagram of the structure of an electronic device provided in this application. Detailed Implementation

[0043] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.

[0044] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.

[0045] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.

[0046] Reference Figure 1 , Figure 1 A flowchart illustrating a skin weight generation method provided in this application embodiment is shown below. Figure 1 As shown in the embodiment of this application, a skin weight generation method may include steps 101 to 104, which are described in detail below.

[0047] Step 101: Generate the first skinning weight based on the distance from the vertex to the bone of the model mesh and the decay parameter of the bone; wherein, the first skinning weight includes the weight of the vertex of the model mesh, the decay parameter of the bone affects the first velocity, and the first velocity is the speed at which the weight of the vertex of the model mesh decreases as the distance from the vertex to the bone of the model mesh increases.

[0048] Among them, the first velocity decreases as the bone decay parameter increases, and the bone decay parameter increases as the bone length ratio increases. The bone length ratio is the ratio of the bone length to the target length.

[0049] A model mesh is a polygonal mesh structure that constitutes the surface of a 3D (Three Dimensions) model, composed of vertices, edges, and faces. The set of vertices, edges, and faces of the model mesh M is obtained as M(V,E,F), where V represents vertices, E represents edges, and F represents faces. The skeletal topology can obtain the coordinate position data of bones and their hierarchical relationships. This skeletal topology is B={ , , ,..., },in, Let n be the nth bone, and the total number of bones is n. Bones can be identified by the distances from vertices of the model mesh to their corresponding bones within the bone topology.

[0050] The distribution of vertex weights in a model mesh describes the relationship between the model mesh and its skeleton, which drives the mesh to deform. Vertex weight refers to the degree to which a vertex is affected by a skeleton. A vertex can be affected by multiple skeletons. The larger the vertex weight, the deeper the influence of that skeleton; the smaller the vertex weight, the shallower the influence.

[0051] The first skinning weight includes the weights of the vertices of the model mesh, specifically the weights of each vertex of the model mesh. The bone attenuation parameter can include the bone attenuation rate, which can be obtained based on the bone length ratio. Furthermore, the bone attenuation parameter is directly proportional to the bone length ratio; that is, the attenuation parameter increases as the bone length ratio increases and decreases as the bone length ratio decreases. The bone length ratio is the ratio of the bone length to a target length, which can be the model mesh length or a preset length. For the same model mesh, the bone length ratio of each bone is the ratio of the bone length to the same preset length. This bone length ratio can be expressed as:

[0052] = ,

[0053] In the formula, This refers to the proportion of bone length. For bone length, This represents the length of the model mesh.

[0054] When generating the first skinning weights based on the distance from the vertices to the bones and the decay parameters of the bones in the model mesh, the weight distribution of each vertex in the model mesh can be calculated by using the theory that the vertex weight decays exponentially with the distance from the vertex to the bone and the bone length. That is, the vertex weight decreases as the distance from the vertex to the bone increases. Assuming that there are 5 vertices affected by a bone b1, namely v1, v2, v3, v4, and v5, and the distance from these five vertices to the bone b1 increases sequentially, then the weights of the vertices are w(v1) > w(v2) > w(v3) > w(v4) > w(v5). Furthermore, the decay parameter of the bone affects the first velocity, which is the rate at which the weight of the vertices of the model mesh decreases as the distance from the vertex to the bone increases. In other words, the vertex weight is affected by the relative length of the bone. The longer the bone is relatively, i.e., the larger the proportion of bone length, the larger the decay parameter of the bone, the larger the range of vertices affected by the bone, and the slower the vertex weight decreases as the distance from the vertex to the bone increases. Conversely, the shorter the bone is relatively, i.e., the smaller the proportion of bone length, the smaller the decay parameter of the bone, the smaller the range of vertices affected by the bone, and the faster the vertex weight decreases as the distance from the vertex to the bone increases.

[0055] Optional methods for calculating the distance from the vertices of the model mesh to the bones include:

[0056] Based on the vertex coordinates and bone endpoint coordinates of the model mesh, calculate the vertical distance from the vertex to the bone axis.

[0057] Calculate the radial distance from the vertex to the bone axis based on the difference between the vertex coordinates and the vertical distance from the vertex to the bone axis.

[0058] Calculate the distance from the vertex of the model mesh to the bone based on the vertical and radial distances from the vertex to the bone axis.

[0059] In practical applications, the formula for calculating the vertical distance from a vertex to the bone axis is as follows:

[0060] =|| - +t ||,

[0061] in,

[0062] t= ,

[0063] In the formula, This is the perpendicular distance from the vertex to the bone axis, i.e., the axial projection distance of the bone. Let v be the coordinate of the vertex, x be the x-axis coordinate, y be the y-axis coordinate, and z be the z-axis coordinate. The coordinates of the starting point of the skeleton. The coordinates of the bone's starting and ending points are used to determine the bone's axis, i.e., for the i-th bone. Its axis is the line segment from the start point to the end point of the bone, and t is the proportion of the projection position of the vertex on the bone axis. That is, the range of values ​​for t can be If t < 0, it means the projection point is located outside the starting point of the bone; if t > 0, it means the projection point is located outside the ending point of the bone.

[0064] The formula for calculating the radial distance from the vertex to the bone axis is as follows:

[0065] = - ,

[0066] In the formula, The radial distance from the vertex to the bone axis. These are the coordinates of the projection point.

[0067] The formula for calculating the distance from the vertices of the model mesh to the bones is as follows:

[0068] ,

[0069] In the formula, For the vertices of the model mesh To the bones distance, Radial distance weighting coefficient, ,Right now The range of values ​​can be , Adjustments can be made according to the actual situation; this application does not impose specific limitations here.

[0070] When calculating the distance from the vertices of the model mesh to the bones, the projected distance along the bone axis can be given priority, which can simulate the influence of real anatomical structures.

[0071] Optionally, based on the distance from the vertices of the model mesh to the bones and the bone attenuation parameters, a first skinning weight is generated, including:

[0072] Calculate the ratio of the square of the distance from the vertex of the model mesh to the bone to the square of the bone's attenuation parameter;

[0073] The weights of the vertices of the model mesh are obtained by exponentially calculating the negative values ​​of the comparison values.

[0074] The weights of all vertices of the model mesh are used as the first skinning weights.

[0075] Of course, to ensure that the sum of the weights of the vertices to all bones is 1, normalization can be performed after obtaining the weights of the vertices of the model mesh. This involves summing the weights of each vertex of the model mesh, updating the weight of the vertex of the model mesh to the ratio of the weight of the vertex of the model mesh to the sum of the weights of each vertex of the model mesh, and then using the updated weights of all vertices of the model mesh as the first skinning weight.

[0076] The formula for calculating the weights of the vertices of the model mesh is as follows:

[0077] ,

[0078] In the formula, For the vertices v of the model mesh, pair them with the skeleton. The weight, For the vertices of the model mesh To the bones distance, For bones The attenuation parameter, The smaller the value, the faster the decay and the more concentrated the weight distribution. The larger the value, the slower the decay and the more dispersed the weight distribution. In practical applications, = , For bones The dynamic influence radius of the model mesh can be determined based on the skeleton. The length ratio is calculated, where n is the total number of bones. For the j-th bone, For bones The attenuation parameter, in practical applications, = , For bones The dynamic influence radius of the model mesh can be determined based on the skeleton. The length ratio is calculated. For the vertices of the model mesh To the bones The distance.

[0079] The dynamic influence radius of the skeleton on the model mesh is calculated using the following formula:

[0080] ,

[0081] In the formula, For bones The dynamic influence radius of the model mesh. Scaling factor The range can be [1.5, 3.0]. The influence range can be determined based on the proportion of bone length and dynamically adjusted according to bone length, ensuring a reasonable weight distribution. It is used to dynamically adjust the range of influence of bones, and can adapt to different body shape models. This refers to the proportion of bone length. The model mesh length reflects the body length of the model. The influence range of the bones is dynamically adjusted according to the ratio of bone length to body length. Longer bones (such as the femur) have a larger influence range, while shorter bones (such as the finger bones) have a smaller influence range.

[0082] By obtaining the distance from the vertices to the bones and dynamically adjusting the radius, the weight distribution between the mesh vertices and bones can be calculated using an exponential decay method. Vertices closer to the bones have a larger weight, and those farther away have a smaller weight. In practical applications, the influence radius can be adjusted to regulate the bone decay rate, thereby dynamically adjusting the influence range of the bones to adapt to different body models. At the same time, it can ensure that the sum of the weights of the vertices to all bones is 1, avoiding abnormal stretching or compression during deformation.

[0083] In one possible implementation, the first skinning weights are generated based on the distance from the vertices of the model mesh to the bones and the bone attenuation parameters, including:

[0084] Determine the bones that affect the vertices of the joint region to obtain the bones of the joint region; wherein, the vertices of the joint region are the vertices of the model mesh whose curvature is greater than a preset curvature, and the preset curvature is less than the maximum curvature among all vertices.

[0085] The weights of the vertices in the joint region are generated based on the distance from the vertices of the joint region to the bones of the joint region and the attenuation parameters of the bones of the joint region.

[0086] The weights of the vertices in the non-joint regions are generated based on the distances from the vertices in the non-joint regions to all bones and the attenuation parameters of all bones; where the vertices in the non-joint regions are the vertices of the model mesh after removing the vertices in the joint regions.

[0087] The weights of vertices in joint regions and vertices in non-joint regions are used as the first skinning weights.

[0088] To avoid deformation distortion in joint regions due to unreasonable weight distribution, joint region sparsification can be used to constrain the vertices of joint regions to be affected only by local joints, making the model's initial weights, i.e. the generated first skin weights, more consistent with the real motion patterns.

[0089] Based on this, for the joint region, since its model has many vertices and is usually only affected by one or two bone joints, constraints can be added to the joint region to achieve sparsity, so that the weight influence of bones on the model mesh vertices is controlled within a limited number. In practical applications, for the vertices of the joint region, only the weights of the two closest bones can be retained to avoid deformation distortion caused by excessive mixing, and the weights are still distributed according to distance to ensure natural deformation.

[0090] Optionally, when determining the bones affecting the vertices of the joint region, the bones of the joint region can be obtained based on the number of bones affecting the vertices and the distance between the vertices and the bones. The distance from the vertex to the bone can then be calculated. This distance can be used to determine whether a vertex of the model mesh should be affected by that bone. If the number of bones affecting the vertices is set to two, then the two bones with the highest distance from the vertex to the bone are selected as the bones of the joint region, in ascending order.

[0091] Joint regions can be determined by the curvature of vertices. By acquiring the vertex features of the mesh, i.e., vertex curvature, joint regions can be detected. Vertices with higher curvature are more likely to deform, and deformation at joints is generally larger. Therefore, the curvature between the model and the skeleton can be used to determine the joint influence range of the model, i.e., the joint region. Specifically, the vertices of the determined joint region are those whose curvature in the model mesh is greater than a preset curvature, and the preset curvature is less than the maximum curvature among all vertices. Since the joint region is a region with large deformation curvature on the model mesh, a limiting range can be set (the ratio of the maximum curvature in the mesh). This preset curvature can be the product of the maximum curvature and a target coefficient. When the curvature of a vertex region on the model mesh is higher than this limiting range, this region can be designated as a joint region. This target coefficient is a number greater than 0 and less than 1. The vertices of the joint region can be represented as:

[0092] | > ,

[0093] In the formula, For the vertices of the joint region, satisfying > , Represents vertices Vertices belonging to the model mesh , For vertex curvature, For the target coefficient, [0.6, 0.8], which is the target coefficient. The range is [0.6, 0.8]. Adjustments can be made based on the actual situation; this application does not impose specific limitations. The maximum vertex curvature.

[0094] Vertex curvature The calculation formula is as follows:

[0095] = ,

[0096] In the formula, Let be the curvature value of the neighborhood of vertex v at the i-th vertex, and Q be the total number of vertices in the model mesh.

[0097] Optionally, the weights of the vertices of the joint region are generated based on the distance from the vertices of the joint region to the bones of the joint region and the attenuation parameters of the bones of the joint region, including:

[0098] Calculate the ratio of the square of the distance from the vertex of the model mesh to the bone of the joint region to the square of the attenuation parameter of the bone of the joint region;

[0099] The weights of the vertices in the joint region are obtained by exponentially calculating the negative values ​​of the comparison values.

[0100] Of course, to ensure that the sum of the weights of the vertices to the bones of all joint regions is 1, normalization can be performed after obtaining all the weights of the vertices in the joint region. That is, the weights of the vertices in the joint region are summed, and the ratio of the weight of the vertex in the joint region to the sum of all the weights of the vertex is updated as the weight of the vertex in the joint region.

[0101] The formula for calculating the weight of vertices in the joint region is as follows:

[0102] = ,

[0103] In the formula, The apex of the joint region The weight, The apex of the joint region Bones in the joint area distance, For bones The attenuation parameter, The apex of the joint region Bones in the joint area distance, The distance from the apex of the joint region The nearest k bones, where k can be 2, are the vertices of the joint region. Not subject to removal The influence of other bones, calculation In the formula It means Not belonging to If Not belonging to ,but It is 0.

[0104] By adding constraints to the joint region to achieve joint sparsity, the weight influence of the bones on the vertices of the model mesh is controlled to only two, which can avoid deformation distortion caused by excessive mixing, and the weights are still distributed according to distance to ensure natural deformation.

[0105] For vertices in non-joint regions (i.e., all vertices in the model mesh excluding joint vertices), when generating the weights of vertices in non-joint regions based on the distances from these vertices to all bones and the attenuation parameters of all bones, the ratio of the square of the distance from the vertex to all bones to the square of the attenuation parameter of the bones in the non-joint region can be calculated. The negative of this ratio is then used as an exponentiation to obtain the weight of the vertex in the non-joint region. Alternatively, after obtaining all the weights of the vertices in the non-joint region, normalization can be performed. This involves summing the weights of each vertex in the non-joint region and updating the weight of that vertex in the non-joint region to the ratio of its weight to the sum of the weights of all vertices in the non-joint region. Finally, the weights of the vertices in the joint regions and the weights of the vertices in the non-joint regions are used as the first skinning weights.

[0106] Step 102: Divide the vertices of the model mesh into regions to obtain the vertices within each region.

[0107] Since the number of bones affected by vertices in different regions of the model mesh may vary—for example, vertices in the arm and leg regions are only affected by two bones (such as the upper arm bone and the forearm bone); the torso region may be affected by multiple bones; and the joint region is only affected by two bones—the vertices of the model mesh can be divided into regions to obtain the vertices in each region.

[0108] In one possible implementation, the vertices of the model mesh are divided into regions to obtain the vertices within each region, including:

[0109] Determine the curvature of each vertex of the model mesh, and designate vertices with curvature greater than a preset curvature as vertices of the joint region; wherein the preset curvature is less than the maximum curvature among the curvatures of each vertex;

[0110] Multiple non-joint regions are obtained; each non-joint region is obtained by dividing the remaining areas of the model mesh, excluding the joint regions.

[0111] Determine the bones of each non-joint region. Divide the vertices of the model mesh remaining after removing the vertices of the joint regions by dividing the vertices into the non-joint regions of the nearest bone.

[0112] The method for determining the vertices of the joint region based on the vertex curvature is described in step 101 and will not be repeated here.

[0113] When determining vertices within non-joint regions, multiple non-joint regions are first obtained. These regions are obtained by dividing the model mesh into areas other than joint regions. These non-joint regions can include arm regions, leg regions, torso regions, and head regions. When determining the skeletons of each non-joint region, it is necessary to determine the number of bones affecting each vertex within that region. Vertices in the arm, leg, and head regions can be affected by two bones, meaning each vertex in these regions is affected by two bones. The torso region, however, can be affected by multiple bones, with the weights decreasing smoothly with distance.

[0114] After determining the skeletons of each non-joint region, automatic segmentation can be performed based on the skeleton hierarchy and geometric features. Vertices are associated with the nearest bones and merged to form regions (e.g., all vertices affected by the "upper arm bone" are grouped into the "arm"). In other words, the vertices of the model mesh remaining after removing the vertices of the joint regions are divided into regions according to the method of dividing the vertices to the non-joint regions to which the vertices belong, thus obtaining the vertices in each non-joint region.

[0115] Step 103: Generate a second skinning weight based on the average distance from the vertices in the region to the target bone and the region's attenuation parameter; wherein, the second skinning weight includes the weight of the vertices in the region, the target bone is the bone that affects the vertices in the region, the region's attenuation parameter affects the second velocity, and the second velocity is the rate at which the weight of the vertices in the region decreases as the average distance from the vertices in the region to the target bone increases.

[0116] Among them, the second velocity decreases as the attenuation parameter of the region increases, and the attenuation parameter of the region increases as the range of the region increases.

[0117] The second skinning weight includes the weights of vertices within the regions, specifically the weights of vertices within each region after dividing the model mesh into regions in step 102. This can include the weights of vertices within joint regions and the weights of vertices within non-joint regions. The weights of vertices within non-joint regions can include the weights of vertices within arm regions, leg regions, torso regions, and head regions. The attenuation parameter of this region can include the attenuation rate of the region. This attenuation parameter can be obtained based on the region's extent, and it increases as the region's extent increases and decreases as the region's extent decreases. This attenuation parameter affects the second velocity, which is the rate at which the weight of vertices within the region decreases as the average distance from the vertices within the region to the target bone increases. In other words, the weight of vertices within the region is affected by the region's extent. A larger region allows for a larger attenuation parameter, enabling a wider range of bone influence, and the weight of vertices within the region decreases more slowly as the average distance from the vertices within the region to the target bone increases. Conversely, a smaller region allows for a smaller attenuation parameter, and the weight of vertices within the region decreases more quickly as the average distance from the vertices within the region to the target bone increases.

[0118] The target bone is the bone of the vertex within the affected area. The number of target bones may be the same or different for different areas, and the number of target bones in the same area is the same. If the area is an arm area, leg area, head area, or joint area, the number of target bones can be 2. If the area is a torso area, the number of target bones can be more than 2. The number of target bones can be multiple.

[0119] In one possible implementation, a second skinning weight is generated based on the average distance from vertices within the region to the target bone and the region's attenuation parameters, including:

[0120] Arrange the bones that affect the vertices in each region in ascending order of distance from the vertex to the bone, and obtain the top-ranked preset root bone as the target bone.

[0121] The range of each region is obtained based on the size information of each region, and the attenuation parameter of each region is determined based on the range of each region.

[0122] The second skinning weight is generated based on the ratio of the square of the average distance from each vertex in each region to the square of the attenuation parameter of each region.

[0123] The target skeleton is determined by arranging the bones affecting the vertices in each region in ascending order of distance from the vertex to the bone, and obtaining the top-ranked preset root bones. The formula for calculating the distance from the vertex to the bone is shown in step 101. The bones are then arranged in ascending order of distance, and the top P bones are selected as the target skeletons, where P is the number of target skeletons, i.e., the number of preset roots for each target skeleton. For example, the preset number of root bones for the target skeletons corresponding to vertices in the arm, leg, head, and joint regions is 2, while the preset number of root bones for the target skeletons corresponding to vertices in the torso region is greater than 2.

[0124] The extent of each region can be obtained based on its dimensional parameters, including width, height, and depth. Optionally, the formula for calculating the extent of a region is as follows:

[0125] = ,

[0126] In the formula, The range of region R, The width of region R Let R be the height of region R. Let R be the depth of region R.

[0127] Optionally, the calculation formula for the attenuation parameter of each region, based on the range of each region, is as follows:

[0128] ,

[0129] In the formula, Let R be the attenuation parameter for region R. The attenuation magnitude, [0.1, 0.3], that is The range can be [0.1, 0.3]. Adjustments can be made according to the actual situation; this application does not impose specific limitations here.

[0130] Optionally, vertex weights within each region are generated based on the ratio of the square of the average distance from each vertex to the corresponding target bone to the square of the attenuation parameter for each region, including:

[0131] Calculate the ratio of the square of the average distance from each vertex in each region to the square of the attenuation parameter for each region;

[0132] The negative values ​​of the comparison values ​​are used to calculate the exponent to obtain the vertex weights within the region.

[0133] Of course, to ensure that the total weight of the vertices in the region is 1, normalization can be performed after obtaining all the weights of the vertices in the region. This involves summing the weights of the vertices in the region and updating the ratio of the weights of the vertices in the region to the sum of all the weights of the vertices in the region as the weights of the vertices in the region.

[0134] The formula for calculating the vertex weights within a region is as follows:

[0135] = ,

[0136] In the formula, The vertex weights within region R. Vertices within region R to bones The square of the average distance of the bone Target skeleton set The skeleton in Vertices within region R to bones The square of the average distance of the bone Target skeleton set The skeleton in the target bone set. The vertices of region R are not affected by the target bone set. The influence of other bones, calculation In the formula It means Not belonging to If Not belonging to ,but It is 0.

[0137] By dynamically calculating the influence strength of bones and the sparsity constraints of joint regions, the weight distribution is forced to conform to anatomical rules, which can reduce the need for manual correction.

[0138] Step 104: Based on the difference between the first skin weight and the second skin weight, optimize the first skin weight to obtain the optimized skin weight.

[0139] The first skin weight can be corrected using the second skin weight. Specifically, the first skin weight can be optimized based on the difference between the first and second skin weights to obtain the optimized skin weight. In practical applications, methods for optimizing the first skin weight can include, but are not limited to, gradient descent and stochastic descent.

[0140] In one possible implementation, the first skin weight is optimized based on the difference between the first skin weight and the second skin weight to obtain the optimized skin weight, including:

[0141] The first skin weight is optimized to minimize the difference between the first skin weight and the second skin weight, the difference between the weights of two adjacent vertices, and the sum of the weights of the vertices in the joint region. The optimized skin weight is obtained by optimizing the first skin weight. The vertices in the joint region are the vertices of the model mesh whose curvature is greater than the preset curvature, and the preset curvature is less than the maximum curvature among the curvatures of all vertices.

[0142] The objective is to minimize the difference between the first and second skin weights, the sum of the weights of vertices in the joint region and the difference between the weights of adjacent vertices, and to iteratively solve for the optimal weights by fusing template matching energy, sparsity constraints, and smoothness constraints through an objective function. Template matching energy forces the weights to conform to anatomical rules; sparsity constraints are based on the constraint imposed on the vertices of the joint region by bone weights, retaining only significant weight values ​​for a few bones while keeping the rest close to zero; and smoothness constraints ensure a smooth transition in weight distribution, avoiding surface discontinuities caused by abrupt weight changes during deformation (such as the "break" at the connection between the arm and torso).

[0143] The objective function formula is as follows:

[0144] ,

[0145] in,

[0146] = ,

[0147] = ,

[0148] In the formula, The objective function is the optimized skin weights. This represents the template matching energy, if the current weight distribution of the vertices... Deviation If this happens, the energy term increases, and the weights will be adjusted during optimization to reduce the difference. This represents a constraint on the sparsity of weights. Represents smoothness constraint, The apex of the joint region The weights, where J is the joint region. The current weight distribution of the vertices. Let u be the weight of vertex u. Let be the weight of vertex v, u and v be two adjacent vertices, and E represent the set of all adjacent edges, reflecting the relationships between all adjacent vertices. The vertex weights within region R. Let be the weight of vertex u relative to bone bi, and n be the total number of bones. Let be the weight value of vertex v with respect to bone bi. and All are weighting coefficients. The weighting coefficient for controlling the sparsity intensity (the default value can be 0.5). The larger the value, the sparser the weight distribution in the joint region. The weighting coefficient that controls the smoothness intensity (the default value can be 1.0). The larger the value, the closer the weights of adjacent vertices.

[0149] Optional methods for skin weight optimization include:

[0150] Selecting a vertex does not change the weight of the unselected vertices;

[0151] Calculate the gradient of the objective function with respect to the weights of the selected vertices;

[0152] Subtract the product of the gradient and the learning rate from the weights of the selected vertices to obtain the updated weights of the selected vertices.

[0153] Determine whether the optimization iteration process has ended. If it has ended, obtain the optimized skinning weights. Otherwise, select a new vertex, keeping the weights of the unselected vertices unchanged. Then, calculate the gradient of the objective function with respect to the weights of the selected vertex. Subtract the product of the gradient and the learning rate from the weights of the selected vertex to obtain the updated weights of the selected vertex, until convergence.

[0154] Optionally, to determine whether to end the optimization iteration process, it can be ended when the number of iterations reaches a preset number, such as 10-15, or when the difference between the weights of two consecutive iterations is less than a preset difference.

[0155] In one possible implementation, the skin weight generation method provided in this application, after obtaining the optimized skin weights, further includes:

[0156] Obtain the correspondence between key points of the target model and the source model; where the mesh of the source model is the model mesh, and the key points include the vertex curvature extreme points and / or the intersection points of two bones;

[0157] Based on the key point correspondence, determine the corresponding points of the mesh vertices in the target model in the source model;

[0158] Based on the optimized skin weights and corresponding points, the skin weights of the mesh vertices of the target model are obtained.

[0159] To transfer the optimized weight distribution to other similar models and reduce repetitive work, a weight transfer operation can be performed. In practical applications, keypoint matching can be performed by detecting key points (such as joint centers and curvature extrema) in the source and target models to establish a correspondence. Then, a deformation field is constructed. Based on keypoint matching, a Thin-Plate Spline (TPS) deformation field is built, mapping the vertices of the source model to the target model. That is, based on the keypoint correspondence, the corresponding points of the mesh vertices of the target model in the source model are determined. The formula for calculating the TPS deformation field is as follows:

[0160] ,

[0161] ,

[0162] In the formula, For the source model vertex The coordinate matrix reflects the coordinates of the corresponding points of the mesh vertices in the target model within the source model. Here, represents the coordinates of the vertices of the target model, and 'a' represents the total number of keypoints. For deformation field weights, These are the coordinates of the key points in the source model.

[0163] Based on the optimized skin weights and corresponding points, the skin weights of the mesh vertices of the target model are obtained. That is, when performing weight transfer, it is necessary to transfer the weight distribution of the source model. The calculation formula is applied to the target model as follows:

[0164] ( ,

[0165] In the formula, The skinning weights of the vertices of the mesh volume in the target model. for The reverse.

[0166] After obtaining the skin weights of the vertices of the target model's mesh, the weights of the deformed regions can be corrected through geometric similarity interpolation.

[0167] In one possible implementation, the skin weight generation method provided in this application, after obtaining the optimized skin weights, further includes:

[0168] Edit the optimized skin weights.

[0169] In practical applications, weight values ​​can be mapped to color codes and displayed in real-time on the model surface, helping users quickly locate problem areas. Red represents high weight values ​​(highly affected by bones), blue represents low weight values ​​(less affected by bones), and green represents medium weight values. By setting up a brush tool, users can directly paint on the model surface to increase or decrease the weight values ​​of specific bones. Specifically, increasing weight increases the weight values ​​of vertices within the painted area; decreasing weight decreases the weight values ​​of vertices within the painted area; and smoothing transitions automatically smooth the weight differences between the painted area and surrounding vertices. Batch operation tools can also be used to provide batch operation functionality. The mirror symmetry method is widely used, mirroring the weight distribution on one side to the other to ensure model symmetry.

[0170] This application utilizes sparsity constraints in joint regions (affected only by 2-3 bones) to ensure that weight distribution conforms to biomechanical principles, avoiding deformation distortion. Based on anatomical principles, it targets the interaction between bones and skin, combining geometric features and anatomy for constraints to achieve a more realistic and accurate effect. By setting regional weight rules (e.g., limbs are only affected by adjacent bones) and dynamically adapting parameters based on model geometric features (bone length, region size), reliance on human experience or external model libraries can be significantly reduced. Tools such as heatmap brushes and mirror symmetry are provided to support users in quickly adjusting weights. Cross-model weight transfer is achieved based on thin plate spline (TPS) deformation fields, combined with geometric similarity interpolation to correct deformation differences, improving reuse efficiency, and local interpolation correction ensures the accuracy of weight transfer. The method provided in this application is applicable to character animation production in fields such as games and film, solving problems such as high manual costs and unstable deformation quality in traditional methods. Through fully automated weight allocation, animation production costs and cycles can be reduced, and the speed and accuracy of weight matching can be improved, reducing deformation modification costs caused by unreasonable weight allocation in the game and film industries. Its high efficiency and reusability can quickly adapt to the needs of large-scale character animation. At the same time, it can be extended to fields such as medical simulation and virtual human interaction, empowering the construction of digital twins and metaverse ecosystems.

[0171] The above describes a skin weight generation method provided by the embodiments of this application. The following will describe a system for performing the above skin weight generation method.

[0172] Please see Figure 2 , Figure 2 This is a schematic diagram of a skin weight generation system provided in an embodiment of this application. Figure 2 As shown, the skin weight generation system includes:

[0173] The first skinning weight generation module 201 is used to generate a first skinning weight based on the distance from the vertex of the model mesh to the bone and the decay parameter of the bone; wherein, the first skinning weight includes the weight of the vertex of the model mesh, the decay parameter of the bone affects the first velocity, and the first velocity is the speed at which the weight of the vertex of the model mesh decreases as the distance from the vertex of the model mesh to the bone increases.

[0174] The vertex partitioning module 202 is used to partition the vertices of the model mesh into regions, thereby obtaining the vertices within each region.

[0175] The second skinning weight generation module 203 is used to generate a second skinning weight based on the average distance from the vertices in the region to the target bone and the attenuation parameter of the region; wherein, the second skinning weight includes the weight of the vertices in the region, the target bone is the bone that affects the vertices in the region, the attenuation parameter of the region affects the second velocity, and the second velocity is the rate at which the weight of the vertices in the region decreases as the average distance from the vertices in the region to the target bone increases.

[0176] The weight optimization module 204 is used to optimize the first skin weight based on the difference between the first skin weight and the second skin weight to obtain the optimized skin weight.

[0177] In one possible implementation, the first skin weight generation module 201 is specifically used for:

[0178] Determine the bones that affect the vertices of the joint region to obtain the bones of the joint region; wherein, the vertices of the joint region are the vertices of the model mesh whose curvature is greater than a preset curvature, and the preset curvature is less than the maximum curvature among all vertices.

[0179] The weights of the vertices in the joint region are generated based on the distance from the vertices of the joint region to the bones of the joint region and the attenuation parameters of the bones of the joint region.

[0180] The weights of the vertices in the non-joint regions are generated based on the distances from the vertices in the non-joint regions to all bones and the attenuation parameters of all bones; where the vertices in the non-joint regions are the vertices of the model mesh after removing the vertices in the joint regions.

[0181] The weights of vertices in joint regions and vertices in non-joint regions are used as the first skinning weights.

[0182] In one possible implementation, the vertex partitioning module 202 includes:

[0183] Determine the curvature of each vertex of the model mesh, and designate vertices with curvature greater than a preset curvature as vertices of the joint region; wherein the preset curvature is less than the maximum curvature among the curvatures of each vertex;

[0184] Multiple non-joint regions are obtained; each non-joint region is obtained by dividing the remaining areas of the model mesh, excluding the joint regions.

[0185] Determine the bones of each non-joint region. Divide the vertices of the model mesh remaining after removing the vertices of the joint regions by dividing the vertices into the non-joint regions of the nearest bone.

[0186] In one possible implementation, the second skin weight generation module 203 is specifically used for:

[0187] Arrange the bones that affect the vertices in each region in ascending order of distance from the vertex to the bone, and obtain the top-ranked preset root bone as the target bone.

[0188] The range of each region is obtained based on the size information of each region, and the attenuation parameter of each region is determined based on the range of each region.

[0189] The second skinning weight is generated based on the ratio of the square of the average distance from each vertex in each region to the square of the attenuation parameter of each region.

[0190] In one possible implementation, the weight optimization module 204 is specifically used for:

[0191] The first skin weight is optimized to minimize the difference between the first skin weight and the second skin weight, the difference between the weights of two adjacent vertices, and the sum of the weights of the vertices in the joint region. The optimized skin weight is obtained by optimizing the first skin weight. The vertices in the joint region are the vertices of the model mesh whose curvature is greater than the preset curvature, and the preset curvature is less than the maximum curvature among the curvatures of all vertices.

[0192] In one possible implementation, the skin weight generation system also includes:

[0193] The weight transfer module is used to obtain the correspondence between key points of the target model and the source model. The source model's mesh is the model mesh, and the key points include the vertex curvature extrema and / or the intersection of two bones. Based on the key point correspondence, the corresponding points of the target model's mesh vertices in the source model are determined. Based on the optimized skin weights and the corresponding points, the skin weights of the target model's mesh vertices are obtained.

[0194] This application also provides an electronic device in its embodiments. (See reference...) Figure 3 The diagram illustrates a structural schematic suitable for implementing the electronic device in the embodiments of this application. The electronic device in the embodiments of this application may include, but is not limited to, fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 3 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0195] like Figure 3 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 into a random access memory (RAM) 303. When the electronic device is powered on, the RAM 303 also stores various programs and data required for the operation of the electronic device. The processing unit 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0196] Typically, the following devices can be connected to I / O interface 305: input devices 306 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 307 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 308 including, for example, memory cards, hard drives, etc.; and communication devices 309. Communication device 309 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 3 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.

[0197] This application also provides a computer program product including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the skinning weight generation methods provided in this application.

[0198] This application also provides a computer-readable storage medium carrying one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any of the skinning weight generation methods provided in this application.

[0199] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0200] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0201] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0202] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

Claims

1. A method for generating skin weights, characterized in that, include: A first skinning weight is generated based on the distance from the vertices of the model mesh to the bones and the decay parameters of the bones; wherein, the first skinning weight includes the weight of the vertices of the model mesh, and the decay parameters of the bones affect the first velocity, the first velocity being the rate at which the weight of the vertices of the model mesh decreases as the distance from the vertices of the model mesh to the bones increases; The vertices of the model mesh are divided into regions to obtain the vertices within each region; A second skinning weight is generated based on the average distance from vertices within the region to the target bone and the attenuation parameter of the region; wherein, the second skinning weight includes the weight of vertices within the region, the target bone is the bone that affects the vertices within the region, the attenuation parameter of the region affects the second velocity, and the second velocity is the rate at which the weight of vertices within the region decreases as the average distance from vertices within the region to the target bone increases; Based on the difference between the first skin weight and the second skin weight, the first skin weight is optimized to obtain the optimized skin weight.

2. The skin weight generation method according to claim 1, characterized in that, The first skinning weight is generated based on the distance from the vertices of the model mesh to the bones and the attenuation parameters of the bones, including: Determine the bones that affect the vertices of the joint region to obtain the bones of the joint region; wherein, the vertices of the joint region are the vertices of the model mesh whose curvature is greater than a preset curvature, and the preset curvature is less than the maximum curvature among the curvatures of all the vertices; The weights of the vertices of the joint region are generated based on the distance from the vertices of the joint region to the bones of the joint region and the attenuation parameters of the bones of the joint region. The weights of the vertices in the non-joint regions are generated based on the distances from the vertices of the non-joint regions to all bones and the attenuation parameters of all bones; wherein, the vertices of the non-joint regions are the vertices of the model mesh after removing the vertices of the joint regions. The weights of the vertices in the joint region and the weights of the vertices in the non-joint region are used as the first skinning weights.

3. The skin weight generation method according to claim 1, characterized in that, The process of dividing the vertices of the model mesh into regions to obtain the vertices within each region includes: Determine the curvature of each vertex of the model mesh, and designate vertices with curvature greater than a preset curvature as vertices of the joint region; wherein the preset curvature is less than the maximum curvature among the curvatures of all vertices. Multiple non-joint regions are obtained; wherein each non-joint region is obtained by dividing the remaining regions of the model mesh, excluding the joint regions. The bones of each non-joint region are determined. The vertices of the model mesh remaining after removing the vertices of the joint regions are divided into regions according to the method of dividing the vertices to the non-joint regions to which the vertices belong, so as to obtain the vertices in each non-joint region.

4. The skin weight generation method according to any one of claims 1 to 3, characterized in that, The generation of second skinning weights based on the average distance from vertices within the region to the target bone and the attenuation parameters of the region includes: The bones that affect the vertices in each region are arranged in ascending order of distance from the vertex to the bone, and the top-ranked preset root bone is obtained as the target bone. The range of each region is obtained based on the size information of each region, and the attenuation parameter of each region is determined based on the range of each region. The second skinning weight is generated based on the ratio of the square of the average distance from each vertex in each region to the corresponding target bone to the square of the attenuation parameter of each region.

5. The skin weight generation method according to claim 1, characterized in that, The step of optimizing the first skin weight based on the difference between the first skin weight and the second skin weight to obtain the optimized skin weight includes: The first skin weight is optimized to minimize the difference between the first skin weight and the second skin weight, the difference between the weights of two adjacent vertices, and the sum of the weights of the vertices in the joint region. The optimized skin weight is obtained by optimizing the first skin weight. The vertices in the joint region are the vertices of the model mesh whose curvature is greater than a preset curvature, and the preset curvature is less than the maximum curvature among the curvatures of the vertices.

6. The skin weight generation method according to claim 1, characterized in that, After obtaining the optimized skin weights, the following is also included: Obtain the correspondence between key points of the target model and the source model; wherein, the mesh of the source model is the mesh of the model, and the key points include vertex curvature extreme points and / or the intersection points of two bones; Based on the key point correspondence, determine the corresponding points of the mesh vertices of the target model in the source model; Based on the optimized skin weights and the corresponding points, the skin weights of the mesh vertices of the target model are obtained.

7. A skin weight generation system, characterized in that, include: The first skinning weight generation module is used to generate a first skinning weight based on the distance from the vertices of the model mesh to the bones and the decay parameter of the bones; wherein, the first skinning weight includes the weight of the vertices of the model mesh, the decay parameter of the bones affects the first velocity, and the first velocity is the rate at which the weight of the vertices of the model mesh decreases as the distance from the vertices of the model mesh to the bones increases; The vertex partitioning module is used to partition the vertices of the model mesh into regions, thereby obtaining the vertices within each region; The second skinning weight generation module is used to generate a second skinning weight based on the average distance from the vertices in the region to the target bone and the attenuation parameter of the region; wherein, the second skinning weight includes the weight of the vertices in the region, the target bone is the bone that affects the vertices in the region, the attenuation parameter of the region affects the second velocity, and the second velocity is the rate at which the weight of the vertices in the region decreases as the average distance from the vertices in the region to the target bone increases; The weight optimization module is used to optimize the first skin weight based on the difference between the first skin weight and the second skin weight to obtain the optimized skin weight.

8. A computer program product, characterized in that, It includes computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the skinning weight generation method as described in any one of claims 1 to 6.

9. An electronic device, characterized in that, It includes at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program to enable the electronic device to implement the skin weight generation method as described in any one of claims 1 to 6.

10. A computer storage medium, characterized in that, The storage medium carries one or more computer programs that, when executed by an electronic device, enable the electronic device to implement the skinning weight generation method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Bone skin method and device, computer equipment and storage medium

    CN113902876A