Skin weight generation method and related device
By generating and optimizing skin weights, the animation deformation problem caused by inappropriate skin weight allocation in three-dimensional character animation is solved, and the naturalness and accuracy of the animation are improved.
Patent Information
- Application Number
- CN202510948907.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-10
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2045-07-10
AI Technical Summary
In three-dimensional character animation, when the skin weight allocation is not appropriate, it may cause abnormal animation deformation, affecting visual effects and functional implementation.
The first skin weight is generated based on the distance from the vertex to the bone and attenuation parameters of the model mesh, and the second skin weight is generated after region division, and the optimized skin weight is obtained by optimizing the first skin weight.
Reduces the probability of abnormal animation deformation, improves the accuracy of vertex weights, and ensures that the animation deformation is natural.
Smart Images

Figure CN120451353A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a skin weight generation method and related devices. Background Art
[0002] In 3D character animation, skin weights determine how the vertices of a 3D model mesh follow the motion of its bones, directly impacting the naturalness of the animation. Each vertex of a model mesh can be associated with multiple bones and assigned a corresponding skin weight. These weights determine the degree to which each bone influences the vertex. However, improper skin weight assignment can lead to problems such as unusual animation deformations, impacting visual quality and functionality. Summary of the Invention
[0003] In view of the above problems, this application provides a skin weight generation method and related devices to reduce the probability of abnormal animation deformation. The specific solution is as follows:
[0004] A first aspect of the present application provides a method for generating skin weights, comprising:
[0005] generating first skin weights based on distances from vertices of a model mesh to a bone and a falloff parameter of the bone; wherein the first skin weights include weights of the vertices of the model mesh, and the falloff parameter of the bone affects a first speed, the first speed being a speed at which the weights of the vertices of the model mesh decrease as the distances from the vertices of the model mesh to the bone increase;
[0006] Dividing the vertices of the model mesh into regions to obtain vertices in each region;
[0007] generating a second skinning weight based on an average distance from vertices in the region to a target bone and an attenuation parameter of the region; wherein the second skinning weight includes weights of vertices in the region, the target bone is a bone that affects vertices in the region, and the attenuation parameter of the region affects a second speed, the second speed being a speed at which the weights of vertices in the region decrease as the average distance from vertices in 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 an optimized skin weight.
[0009] In a possible implementation, generating the first skin weight based on the distance from the vertex of the model mesh to the bone and the attenuation parameter of the bone includes:
[0010] Determining bones of vertices affecting a joint region, and obtaining bones of the joint region; wherein the vertices of the joint region are vertices of the model mesh body whose curvature is greater than a preset curvature, and the preset curvature is less than a maximum curvature among the curvatures of the vertices;
[0011] generating weights of the vertices of the joint region based on distances from the vertices of the joint region to the bones of the joint region and attenuation parameters of the bones of the joint region;
[0012] Generating weights of the vertices in the non-joint area based on the distances from the vertices in the non-joint area to all bones and the attenuation parameters of all bones; wherein the vertices in the non-joint area are all vertices of the model mesh except the vertices in the joint area;
[0013] The weights of the vertices in the joint area and the weights of the vertices in the non-joint area are used as the first skin weights.
[0014] In a possible implementation, dividing the vertices of the model mesh into regions to obtain vertices within each region includes:
[0015] Determining the curvature of each vertex of the model mesh body, and taking a vertex with a curvature greater than a preset curvature as a vertex of the joint region; wherein the preset curvature is less than the maximum curvature among the curvatures of each of the vertices;
[0016] Acquire multiple non-joint regions; wherein each non-joint region is obtained by dividing the remaining region of the model mesh body except the joint region;
[0017] The skeleton of each non-joint area is determined, and the vertices of the model mesh remaining after removing the vertices of the joint area are divided into regions in a manner of dividing the vertices into the non-joint area to which the bones with the closest distance belong, to obtain the vertices in each non-joint area.
[0018] In a possible implementation, generating the second skin weight based on the average distance from the vertices in the region to the target bone and the attenuation parameter of the region includes:
[0019] Arrange the bones that affect the vertices in each of the regions in ascending order of distance from the vertex to the bone, and obtain the preset root bone with the highest ranking as the target bone;
[0020] Obtaining a range of each of the regions based on size information of each of the regions, and determining an attenuation parameter of each of the regions based on the range of each of the regions;
[0021] The second skin weight is generated based on a ratio of the square of the average distance from the vertices in each of the regions to the corresponding target bone to the square of the attenuation parameter of each of the regions.
[0022] In a 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 with the goal of minimizing the sum of the difference between the first skin weight and the second skin weight, the difference between the weights of two adjacent vertices, and the weights of the vertices in the joint area to obtain an optimized skin weight; wherein, the vertices in the joint area are vertices of the model mesh body whose curvature is greater than a preset curvature, and the preset curvature is less than the maximum curvature among the curvatures of each of the vertices.
[0024] In a possible implementation, after obtaining the optimized skin weights, the method further includes:
[0025] Obtaining a correspondence between key points of a target model and a source model; wherein the mesh of the source model is the model mesh, and the key points include vertex curvature extreme points and / or intersection points of two bones;
[0026] Determining corresponding points of mesh vertices of the target model in the source model based on the key point correspondence relationship;
[0027] Based on the optimized skin weights and the corresponding points, skin weights of the mesh vertices of the target model are obtained.
[0028] A second aspect of the present application provides a skin weight generation system, comprising:
[0029] A first skin weight generation module, configured to generate first skin weights based on distances from vertices of a model mesh to a bone and a decay parameter of the bone; wherein the first skin weights include weights of the vertices of the model mesh, and the decay parameter of the bone affects a first speed, wherein the first speed is a speed at which the weights of the vertices of the model mesh decrease as the distances from the vertices of the model mesh to the bone increase;
[0030] A vertex partitioning module, configured to partition the vertices of the model mesh into regions to obtain vertices within each region;
[0031] A second skin weight generation module is configured to generate a second skin weight based on an average distance from vertices in the region to a target bone and an attenuation parameter of the region; wherein the second skin weight includes weights of vertices in the region, the target bone is a bone that affects vertices in the region, and the attenuation parameter of the region affects a second speed, wherein the second speed is a speed at which the weights of vertices in the region decrease as the average distance from 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 an optimized skin weight.
[0033] A third aspect of the present application provides a computer program product comprising computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the skin weight generation method of the first aspect or any implementation of the first aspect.
[0034] A fourth aspect of the present 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 above-mentioned first aspect or any implementation manner of the first aspect.
[0037] In a fifth aspect, the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can use the skin weight generation method of the above-mentioned first aspect or any implementation of the first aspect.
[0038] With the help of the above technical solution, the skin weight generation method and related devices provided by the present application divide the vertices of the model mesh into regions, and generate the second skin weight based on the average distance from the vertices in the region to the target bones and the attenuation parameters of the region. Compared with 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 some bones that affect the vertices are considered when calculating the second skin weight. Compared with considering all bones, the accuracy of the vertex weight can be improved. The first skin weight is optimized by the difference between the first skin weight and the second skin weight to obtain the optimized skin weight. By optimizing the skin weight, the probability of animation deformation abnormalities can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.
[0040] Figure 1 A flow chart 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 DESCRIPTION
[0043] The following describes the embodiments of the present application in conjunction with the accompanying drawings. The terms used in the implementation methods of the present application are only used to explain the specific embodiments of the present application and are not intended to limit the present application.
[0044] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0045] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, and this is merely a way of distinguishing the objects of the same attributes when describing them in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0046] Reference Figure 1 , Figure 1 A schematic diagram of a skin weight generation method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, a skin weight generation method provided by an embodiment of the present application may include steps 101 to 104, and these steps are described in detail below.
[0047] Step 101: Generate a first skin weight based on the distance from the vertices of the model mesh to the bones and the attenuation parameter of the bones; wherein the first skin weight includes the weight of the vertices of the model mesh, and the attenuation parameter of the bones affects a first speed, and the first speed is the speed 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.
[0048] The first speed decreases as the attenuation parameter of the bone increases, and the attenuation parameter of the bone increases as the bone length ratio increases. The bone length ratio is the ratio of the bone length to the target length.
[0049] The model mesh is a polygonal mesh structure that forms the surface of a 3D (Three Dimensions) model. It is composed of vertices, edges, and faces. Get the vertex, edge, and face set data M (V, E, F) of the model mesh M, where V represents vertices, E represents edges, and F represents faces. The bone topology structure can obtain the coordinate position data of the bones and the hierarchical relationship of the bones. The bone topology structure is B={ , , ,..., },in, is the nth bone, and the total number of bones is n. The bones in the distance from the vertices of the model mesh to the bones can be bones in the skeleton topology structure.
[0050] The distribution of vertex weights on a model mesh describes the relationship between the mesh and its bones, with bones driving the mesh's deformation. Vertex weight refers to the degree to which a mesh vertex is influenced by a bone. A vertex can be influenced by multiple bones. The greater the vertex weight, the greater the influence of that bone, while the smaller the vertex weight, the less influence it has.
[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 attenuation parameter of the bone may include the attenuation rate of the bone. The attenuation parameter of the bone can be obtained based on the bone length ratio, and the attenuation parameter of the bone is proportional to the bone length ratio, that is, the attenuation parameter of the bone increases as the bone length ratio increases, and the attenuation parameter of the bone decreases as the bone length ratio decreases. The bone length ratio is the ratio of the length of the bone to the target length. The target length can be the model mesh length. Of course, the target length can also be 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. The bone length ratio can be expressed as:
[0052] = ,
[0053] Where, is the bone length ratio, is the bone length, is the model mesh length.
[0054] When generating the first skin weight based on the distance from the vertex to the bone of the model mesh and the attenuation parameter of the bone, the theory that the vertex weight decays exponentially with the distance from the vertex to the bone and the bone length can be used to calculate the weight distribution of each vertex of the model mesh. That is, the vertex weight decreases as the distance from the vertex to the bone increases. Assume that there are 5 vertices affected by a bone b1, namely v1, v2, v3, v4, and v5. The distances of these five vertices to the bone b1 increase in sequence. Then, the vertex weight w(v1)>w(v2)>w(v3)>w(v4)>w(v5). In addition, the attenuation parameter of the bone affects the first speed, which is the speed at which the weight of the model mesh's vertices decreases as the distance from the model mesh's vertices to the bone increases. That is, the vertex weight is affected by the relative length of the bone. The longer the bone length is, that is, the larger the bone length ratio is, the larger the bone's attenuation parameter is, the larger the range of vertices affected by the bone is, and the slower the vertex weight decreases as the distance from the vertex to the bone increases; the shorter the bone length is, that is, the smaller the bone length ratio is, the smaller the bone's attenuation parameter is, the smaller the range of vertices affected by the bone is, and the faster the vertex weight decreases as the distance from the vertex to the bone increases.
[0055] Optional method for calculating the distance from the model mesh's vertices to the bones, including:
[0056] Based on the vertex coordinates of the model mesh and the bone endpoint coordinates, 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 perpendicular distance from the vertex to the bone axis;
[0058] Calculates the distance from a model mesh's vertices to a bone based on the perpendicular and radial distances from the vertex to the bone's axis.
[0059] In practical applications, the calculation formula for the vertical distance from the vertex to the bone axis is as follows:
[0060] =|| - +t ||,
[0061] in,
[0062] t= ,
[0063] Where, is the vertical distance from the vertex to the bone axis, that is, the bone axial projection distance, is the vertex v coordinate, x is the x-axis coordinate, y is the y-axis coordinate, z is the z-axis coordinate, is the coordinate of the starting point of the bone, The coordinates of the bone end point can be used to determine the bone axis. , where the axis is the line segment from the start point to the end point of the bone, t is the projection position ratio of the vertex on the axis of the bone, t , that is, the value range of t can be If t < 0, it means the projection point is outside the starting point of the bone. If t > 0, it means the projection point is outside the end point of the bone.
[0064] The radial distance from the vertex to the bone axis is calculated as follows:
[0065] = - ,
[0066] Where, is the radial distance from the vertex to the bone axis, are the projected point coordinates.
[0067] The distance from the model mesh's vertices to the bones is calculated as follows:
[0068] ,
[0069] Where, Vertices of the model mesh to the bones distance, is the radial distance weight coefficient, ,Right now The value range of , It can be adjusted according to actual conditions and is not specifically limited in this application.
[0070] When calculating the distance from the vertex of the model mesh to the bone, the projection distance along the bone axis can be given priority, which can simulate the influence of the real anatomical structure.
[0071] Optionally, based on the distance from the model mesh's vertices to the bones and the bones' attenuation parameters, generate the first skin weights, including:
[0072] Calculate the ratio of the square of the distance from the model mesh's vertex to the bone to the square of the bone's attenuation parameter;
[0073] Perform exponential calculation on the negative of the comparison value to get the weight of the vertex of the model mesh;
[0074] Uses the weights of all vertices of the model mesh as the first skin weight.
[0075] Of course, in order to ensure that the sum of the weights of the vertices for all bones is 1, after obtaining the weights of the vertices of the model mesh, normalization processing can be performed, that is, the weights of the vertices of the model mesh are summed, and the ratio of the weight of the vertex of the model mesh to the sum of the weights of the vertices of the model mesh is updated as the weight of the vertex of the model mesh, and then the weights of all the vertices of the updated model mesh are used as the first skinning weight.
[0076] The formula for calculating the weight of the vertices of the model mesh is as follows:
[0077] ,
[0078] Where, For the model mesh's vertex v pairs of bones The weight of Vertices of the model mesh to the bones distance, For bones The attenuation parameter, The smaller it is, the faster it decays and the more concentrated the weight distribution is; The larger it is, the slower the decay and the more dispersed the weight distribution is. In practical applications, = , For bones The dynamic influence radius of the model mesh can be based on the bones The length ratio is calculated, n is the total number of bones, is the jth bone, For bones In practical applications, = , For bones The dynamic influence radius of the model mesh can be based on the bones The length ratio is calculated. Vertices of the model mesh to the bones distance.
[0079] The dynamic influence radius of the bone on the model mesh is calculated as follows:
[0080] ,
[0081] Where, For bones The radius of dynamic influence on the model mesh, is the scaling factor, The range of can be [1.5,3.0], It can be determined according to the ratio of bone length, and its influence range can be dynamically adjusted according to the bone length to ensure that the weight distribution is reasonable. Used to dynamically adjust the range of bone influence, and can adapt to different body models. is the bone length ratio, The length of the model mesh reflects the length of the model's body. The influence range of the bones is dynamically adjusted based on the ratio of bone length to body length. Long bones (such as thigh bones) have a larger influence range, while short bones (such as finger bones) have a smaller influence range.
[0082] By calculating the distance from the vertex to the bone and dynamically adjusting the radius, we can use exponential decay to calculate the weight distribution of mesh vertices and bones. The closer the vertex is to the bone, the greater the weight; the farther away, the smaller the weight. In practical applications, the influence radius can be adjusted to adjust the bone decay rate, thereby dynamically adjusting the bone's influence range to adapt to different body models. At the same time, it can ensure that the sum of the vertex weights for all bones is 1, avoiding abnormal stretching or compression during deformation.
[0083] In a possible implementation, the first skin weight is generated based on the distance from the vertex of the model mesh to the bone and the attenuation parameter of the bone, including:
[0084] Determine the bones of the vertices that affect the joint region, and obtain the bones of the joint region; wherein the vertices of the joint region are vertices of the model mesh body whose curvature is greater than a preset curvature, and the preset curvature is less than the maximum curvature among the curvatures of the vertices;
[0085] Generate weights of the vertices in the joint area based on the distances from the vertices in the joint area to the bones in the joint area and the attenuation parameters of the bones in the joint area;
[0086] Based on the distances from the vertices in the non-joint area to all bones and the attenuation parameters of all bones, the weights of the vertices in the non-joint area are generated. The vertices in the non-joint area are the vertices of the model mesh minus the vertices in the joint area.
[0087] The weights of the vertices in the joint area and the weights of the vertices in the non-joint area are used as the first skin weight.
[0088] In order to avoid deformation distortion in the joint area caused by unreasonable weight distribution, the joint area can be sparsely populated to constrain the vertices in the joint area to be affected only by the joints in the local area, so that the initialization weight of the model, that is, the generated first skin weight, is more consistent with the real action rules.
[0089] Based on this, for the joint area, since the model has many vertices and is usually only affected by one or two bone joints, restrictions can be added to the joint area to make the joint area sparse, so that the weight influence of the bones on the model mesh vertices is controlled within a limited number. In practical applications, for the vertices in the joint area, 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 that affect the vertices in the joint region and obtaining the bones in the joint region, the distance from the vertex to the bone can be calculated based on the number of bones affecting the vertices in the joint region and the distance between the vertex and the bone. This value can be used to determine whether the vertex of the model mesh should be affected by the bone. If the number of bones affecting the vertex is set to 2, the top two bones are obtained in ascending order of vertex-to-bone distance as the bones of the joint region.
[0091] The determination of the joint area can be obtained through the curvature of the vertex. By obtaining the vertex features of the mesh, that is, the vertex curvature, the joint area can be detected. The higher the curvature of the vertex means the greater the possibility of deformation, and the deformation at the joint of the object is generally large, so the curvature between the model and the skeleton can be used to determine the joint influence range of the model, that is, the joint area. Specifically, the vertices of the joint area determined 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 of the curvatures of each vertex. Since the joint area is the area with a larger deformation curvature on the model mesh, a limited range can be set (the ratio of the maximum curvature in the mesh), that is, the preset curvature can be the product of the maximum curvature and the target coefficient. When the curvature of the vertex area on the model mesh is higher than the limited range, this area can be set as the joint area. The target coefficient is a number greater than 0 and less than 1. The vertices of the joint area can be expressed as:
[0092] | > ,
[0093] Where, is the vertex of the joint area, satisfying > , Represents a vertex Vertices belonging to the model mesh , is the vertex curvature, is the target coefficient, [0.6,0.8], the target coefficient The range is [0.6,0.8], It can be adjusted according to actual conditions, and this application does not make any specific restrictions here. is the maximum vertex curvature.
[0094] Vertex curvature The calculation formula is as follows:
[0095] = ,
[0096] Where, is the curvature value of the neighborhood of vertex v at the i-th vertex, and Q is the number of all vertices in the model mesh.
[0097] Optionally, based on the distance from the vertex in the joint area to the bone in the joint area and the attenuation parameter of the bone in the joint area, the weight of the vertex in the joint area is generated, including:
[0098] Calculate the ratio of the square of the distance from the vertex of the model mesh to the bone in the joint area to the square of the attenuation parameter of the bone in the joint area;
[0099] The negative of the comparison value is exponentially calculated to obtain the weight of the vertex in the joint area.
[0100] Of course, in order to ensure that the sum of the weights of the vertices to all bones in the joint area is 1, normalization processing can be performed after obtaining all the weights of the vertices in the joint area, that is, the weights of the vertices in the joint area are summed up, and the ratio of the weight of the vertex in the joint area to the sum of all the weights of the vertex is updated to the weight of the vertex in the joint area.
[0101] The weights of the vertices in the joint area are calculated as follows:
[0102] = ,
[0103] Where, The vertices of the joint area The weight of The vertices of the joint area Bones to the joint area distance, For bones The attenuation parameter, The vertices of the joint area Bones to the joint area distance, is the distance from the vertex of the joint area The nearest k bones, where k can be 2, and the vertices in the joint area Not subject to elimination The influence of other bones is calculated In the formula means Not , that is, if Not ,but is 0.
[0104] By adding restrictions in the joint area to achieve sparse joint area, the weighted influence of the bones on the model mesh vertices is limited to two, which can avoid deformation distortion caused by excessive blending. The weights are still distributed according to distance to ensure natural deformation.
[0105] For the vertices in the non-joint area, that is, for all the vertices of the model mesh except the vertices in the joint area, when generating the weights of the vertices in the non-joint area based on the distances from the vertices in the non-joint area to all the bones and the attenuation parameters of all the bones, the ratio of the square of the distances from the vertices in the non-joint area to all the bones to the square of the attenuation parameters of the bones in the non-joint area can be calculated; the negative of the ratio is exponentially calculated to obtain the weights of the vertices in the non-joint area. Of course, after obtaining all the weights of the vertices in the non-joint area, a normalization process can be performed, that is, the weights of the vertices in the non-joint area are summed, and the ratio of the weights of the vertices in the non-joint area to the sum of the weights of all the vertices in the non-joint area is updated as the weights of the vertices in the non-joint area. Finally, the weights of the vertices in the joint area and the weights of the vertices in the non-joint area are used as the first skinning weights.
[0106] Step 102: Divide the vertices of the model mesh into regions to obtain the vertices in each region.
[0107] Since the number of bones affected by vertices in different areas of the model mesh may vary, for example, vertices in the arm and leg areas are only affected by two bones (such as the upper arm bone and forearm bone); the torso area may be affected by multiple bones; and the joint area is only affected by two bones. Therefore, 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 vertices within each region, including:
[0109] Determine the curvature of each vertex of the model mesh, and use the vertex with a curvature greater than a preset curvature as the vertex of the joint region; wherein the preset curvature is less than the maximum curvature among the curvatures of the vertices;
[0110] Acquire multiple non-joint regions; wherein each non-joint region is obtained by dividing the remaining region of the model mesh body except the joint region;
[0111] Determine the bones of each non-joint area, and divide the vertices of the model mesh remaining after removing the vertices in the joint area into areas by dividing the vertices into the non-joint area to which the nearest bones belong, to obtain the vertices in each non-joint area.
[0112] The method of determining the vertices of the joint area according to 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 non-joint regions are obtained by dividing the remaining regions of the model mesh except for the joint regions. These non-joint regions can include arm regions, leg regions, torso regions, and head regions. When determining the bones of each non-joint region, it is necessary to determine the number of bones in the non-joint region that the vertices within the non-joint region are affected by. Vertices in the arm region, leg region, and head region can be affected by two bones, so each vertex in the arm region, leg region, and head region has two bones that affect it. The torso region is allowed to be affected by multiple bones, and the weights decay smoothly with distance.
[0114] After determining the bones in each non-joint area, the vertices can be automatically segmented based on the bone hierarchy and geometric features, associated with the nearest bones, and merged to form regions (for example, all vertices affected by the "upper arm bone" are classified as the "arm"). That is, the vertices of the remaining model mesh after removing the vertices in the joint area are divided into regions in the same way as the vertices are divided into the non-joint area to which the nearest bones belong, and the vertices in each non-joint area are obtained.
[0115] Step 103: Generate a second skin weight based on the average distance from the vertices in the area to the target bone and the attenuation parameter of the area; wherein the second skin weight includes the weights of the vertices in the area, the target bone is the bone that affects the vertices in the area, and the attenuation parameter of the area affects the second speed, which is the speed at which the weights of the vertices in the area decrease as the average distance from the vertices in the area to the target bone increases.
[0116] The second speed 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 a region, i.e., the weights of vertices within each region after the vertices of the model mesh are divided into regions in step 102. Specifically, they may 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 may include the weights of vertices within arm regions, leg regions, torso regions, and head regions. The region's attenuation parameter may include the region's attenuation rate. The region's attenuation parameter can be determined based on the region's extent, and the attenuation parameter increases as the region's extent increases and decreases as the region's extent decreases. The region's attenuation parameter influences the second speed, which is the rate at which the weights of vertices within the region decrease as the average distance from the vertices within the region to the target bone increases. Specifically, the weights of vertices within a region are affected by the extent of the region. A larger region has a larger attenuation parameter, allowing a wider range of bones to be affected, and the weights of vertices within the region decrease more slowly as the average distance from the vertices within the region to the target bone increases. A smaller region has a smaller attenuation parameter, and the weights of vertices within the region decrease more quickly as the average distance from the vertices within the region to the target bone increases.
[0118] Target bones are the bones that affect the vertices within the region. The number of target bones corresponding to different regions may be the same or different. The same region has the same number of target bones. If the region is an arm region, leg region, head region, or joint region, the number of target bones can be 2. If the region is a torso region, the number of target bones can be greater than 2, and the number of target bones can be multiple.
[0119] In a possible implementation, the second skin weight is generated based on the average distance from the vertices in the region to the target bone and the attenuation parameter of the region, including:
[0120] Arrange the bones that affect the vertices in each area in ascending order of distance from the vertex to the bone, and obtain the preset root bone with the highest ranking as the target bone;
[0121] Obtaining a range of each region based on size information of each region, and determining an attenuation parameter of each region based on the range of each region;
[0122] The second skin weight is generated based on the ratio of the square of the average distance between the vertices in each region and the corresponding target bone to the square of the attenuation parameter of each region.
[0123] The target bones are determined by arranging the bones that affect the vertices in each area in ascending order of the distance from the vertex to the bone, obtaining the preset root bones with the top ranking, and calculating the distance formula from the vertex to the bone in step 101. The distances are arranged from small to large, and the top P bones are selected to obtain the corresponding bones as the target bones, where P is the number of target bones, that is, the target bones have preset roots. For example, the preset number of target bones corresponding to the vertices in the arm area, leg area, head area, and joint area is 2, and the preset number of target bones corresponding to the vertices in the torso area is greater than 2.
[0124] The range of each region can be obtained based on the region's size parameters, which include the region's width, height, and depth. Optionally, the range of the region can be calculated using the following formula:
[0125] = ,
[0126] Where, is the range of region R, is the width of region R, is the height of region R, is the depth of region R.
[0127] Optionally, the calculation formula for determining the attenuation parameter of each area based on the range of each area is as follows:
[0128] ,
[0129] Where, is the attenuation parameter of region R, is the attenuation amplitude, [0.1,0.3], that is The range of can be [0.1,0.3], It can be adjusted according to actual conditions and is not specifically limited in this application.
[0130] Optionally, based on the ratio of the square of the average distance from the vertices in each region to the corresponding target bone to the square of the attenuation parameter of each region, the vertex weights in the region are generated, including:
[0131] Calculate the ratio of the square of the average distance from the vertices in each region to the corresponding target bone to the square of the attenuation parameter of each region;
[0132] Perform exponential calculation on the negative of the comparison value to get the weight of the vertices in the area.
[0133] Of course, in order to ensure that the sum of the weights of the vertices to the bones in the area is 1, normalization processing can be performed after obtaining all the weights of the vertices in the area, that is, the weights of the vertices in the area are summed up, and the ratio of the weight of the vertex in the area to the sum of all the weights of the vertex is updated as the weight of the vertex in the area.
[0134] The calculation formula for the vertex weight within the region is as follows:
[0135] = ,
[0136] Where, is the vertex weight in region R, From the vertex to the bone in region R The square of the average distance between the bones Target Bone Set The bones in From the vertex to the bone in region R The square of the average distance of the bone Target Bone Set The vertices in region R are not affected by the target bone set. The influence of other bones is calculated In the formula means Not , that is, if Not ,but is 0.
[0137] By dynamically calculating the bone influence strength and joint area sparsification constraints, the weight distribution is forced to conform to anatomical rules, reducing the need for manual correction.
[0138] Step 104: Based on the difference between the first skin weight and the second skin weight, the first skin weight is optimized to obtain an optimized skin weight.
[0139] The first skin weight can be modified using the second skin weight. Specifically, the first skin weight can be optimized based on the difference between the first skin weight and the second skin weight to obtain an optimized skin weight. In practical applications, methods for optimizing the first skin weight can include, but are not limited to, gradient descent, stochastic coordinate descent, and the like.
[0140] In a possible implementation, optimizing the first skin weight based on a difference between the first skin weight and the second skin weight to obtain an optimized skin weight includes:
[0141] The first skin weight is optimized with the goal of minimizing 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 area to obtain the optimized skin weight; wherein, the vertices in the joint area are vertices of the model mesh body whose curvature is greater than a preset curvature, and the preset curvature is less than the maximum curvature among the curvatures of all vertices.
[0142] With the goal of minimizing the sum of the difference between the first and second skin weights, and the difference between the weights of vertices in the joint region and the weights of two adjacent vertices, the optimal weights are iteratively solved by integrating template matching energy, sparsity constraints, and smoothness constraints through the objective function. Template matching energy is used to enforce weight conformity to anatomical rules. Sparsity constraints are based on the constraints imposed on vertices in the joint region by bone weights, retaining only a few significant bone weights and allowing the remaining weights to approach zero. Smoothness constraints ensure a smooth transition in weight distribution, avoiding surface discontinuities caused by sudden weight changes during deformation (such as a "break" at the connection between the arm and the torso).
[0143] The objective function formula is as follows:
[0144] ,
[0145] in,
[0146] = ,
[0147] = ,
[0148] Where, is the objective function, i.e. the optimized skin weight, Represents the template matching energy. If the current weight distribution of the vertex Deviation , the energy term increases, and the weights are adjusted during optimization to reduce the difference. Represents the constraint on weight sparsity, represents the smoothness constraint, Vertex of the joint area The weight of , J is the joint area, is the current weight distribution of the vertex, is the weight of vertex u, is the weight of vertex v, u and v are two adjacent vertices, E represents the set of all adjacent edges, reflecting the set of all adjacent vertex relationships, is the vertex weight in region R, is the weight value of vertex u to bone bi, n is the total number of bones, is the weight value of vertex v to bone bi, and are weight coefficients, To control the weight coefficient of sparsity strength (the default value can be 0.5), The larger it is, the sparser the weights in the joint area are. is a weight factor to control the strength of smoothness (the default value can be 1.0), The larger it is, the closer the weights of adjacent vertices are.
[0149] Optional methods for skin weight optimization include:
[0150] When a vertex is selected, the weights of the unselected vertices remain unchanged;
[0151] Calculate the gradient of the objective function with respect to the weight of the selected vertex;
[0152] Subtract the product of the gradient and the learning rate from the weight of the selected vertex to obtain the updated weight of the selected vertex;
[0153] Determine whether to end the optimization iteration process. If so, get the optimized skin weight. Otherwise, reselect a vertex, keep the weight of the unselected vertex unchanged, and then calculate the gradient of the objective function with respect to the weight of the selected vertex. Subtract the product of the gradient and the learning rate from the weight of the selected vertex to get the updated weight of the selected vertex until convergence.
[0154] Optionally, the determination of whether to end the optimization iteration process may be made when the number of iterations reaches a preset number, such as 10-15 times, or when the difference between the weights of the previous and next two times 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 weight, further includes:
[0156] Obtaining a correspondence between key points of the target model and the source model; wherein the mesh of the source model is the model mesh, and the key points include vertex curvature extreme points and / or intersection points of two bones;
[0157] Based on the key point correspondence, determine the corresponding points of the target model's mesh vertices 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] In order to transfer the optimized weight distribution to other similar models and reduce duplication of work, a weight transfer operation can be performed. In practical applications, key points can be matched and a correspondence can be established by detecting the key points of the source model and the target model (such as joint centers and curvature extreme points). Then, the deformation field is constructed. Based on the key point matching, a thin plate spline (TPS) deformation field is constructed to map the vertices of the source model to the target model. That is, based on the key point correspondence, the corresponding points of the target model's mesh vertices in the source model are determined. The calculation formula of the TPS deformation field is as follows:
[0160] ,
[0161] ,
[0162] Where, Source model vertex The coordinate matrix reflects the coordinates of the corresponding points of the mesh vertices of the target model in the source model. is the coordinate of the vertex of the target model, a is the total number of key points, is the deformation field weight, are the key point coordinates of 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 migration, the weight distribution of the source model needs to be Migrate to the target model, the calculation formula is as follows:
[0164] ( ,
[0165] Where, is the skin weight of the mesh vertices of the target model, for The inverse of.
[0166] After obtaining the skin weights of the target model's mesh vertices, you can also correct the weights of the deformation difference areas through geometric similarity interpolation.
[0167] In one possible implementation, the skin weight generation method provided in this application, after obtaining the optimized skin weight, further includes:
[0168] Perform edit operations on the optimized skin weights.
[0169] In actual applications, weight values can be mapped to color codes and displayed in real time on the model surface to help users quickly locate problem areas. Red represents high weight values (largely affected by bones), blue represents low weight values (smaller affected by bones), and green represents medium weight values. By setting up a brush tool, users can directly paint the model surface with the brush tool to increase or decrease the weight value of a specific bone. The specific operations are: increase weight: increase the weight value of vertices in the painted area; reduce weight: decrease the weight value of vertices in the painted area; smooth transition: automatically smooth the weight difference between the painted area and the surrounding vertices. Batch operation tools can also be used to provide batch operation functions. Among them, the mirror symmetry method is relatively common. The weight distribution on one side is mirrored and copied to the other side to ensure the symmetry of the model.
[0170] This application ensures biomechanically consistent weight distribution and avoids deformation distortion by constraining joint regions to sparsity (affected by only 2-3 bones). Leveraging anatomical principles, this approach targets bones and skin, combining geometric and anatomical constraints to achieve more realistic and accurate results. By setting regional weighting rules (e.g., limbs are affected only by adjacent bones) and dynamically adapting parameters based on model geometry (bone length, region size), reliance on manual experience or external model libraries is significantly reduced. Tools such as heatmap brushes and mirror symmetry enable users to quickly adjust weights, and cross-model weight transfer is achieved using a thin plate spline (TPS) deformation field. Geometric similarity interpolation corrects for deformation differences, improving reuse efficiency, and local interpolation correction ensures accurate weight transfer. The method provided in this application is suitable for character animation production in games, film, and television, addressing the high labor costs and inconsistent deformation quality of traditional methods. Automating weight distribution throughout the entire process reduces animation production costs and cycle time, improves the speed and accuracy of weight matching, and reduces deformation modification costs caused by inappropriate weight distribution in the gaming and film industries. Its efficient reuse features can quickly adapt to large-scale character animation needs. At the same time, it can be expanded to fields such as medical simulation and virtual human interaction, enabling the construction of digital twins and metaverse ecosystems.
[0171] The above describes a skin weight generation method provided by an embodiment of the present application. The following describes a system for executing the above skin weight generation method.
[0172] See also Figure 2 , Figure 2 This is a schematic diagram of the structure of a skin weight generation system provided in an embodiment of the present application. Figure 2 As shown, the skin weight generation system includes:
[0173] The first skin weight generation module 201 is used to generate a first skin weight based on the distance from the vertices of the model mesh to the bones and the attenuation parameter of the bones; wherein the first skin weight includes the weight of the vertices of the model mesh, and the attenuation parameter of the bones affects the first speed, and the first speed is the speed 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.
[0174] The vertex division module 202 is used to divide the vertices of the model mesh into regions to obtain vertices in each region.
[0175] The second skin weight generation module 203 is used to generate a second skin weight based on the average distance from the vertices in the area to the target bone and the attenuation parameter of the area; wherein the second skin weight includes the weight of the vertices in the area, the target bone is the bone that affects the vertices in the area, and the attenuation parameter of the area affects the second speed, and the second speed is the speed at which the weight of the vertices in the area decreases as the average distance from the vertices in the area to the target bone increases.
[0176] The weight optimization module 204 is configured to optimize the first skin weight based on the difference between the first skin weight and the second skin weight to obtain an optimized skin weight.
[0177] In a possible implementation, the first skin weight generating module 201 is specifically configured to:
[0178] Determine the bones of the vertices that affect the joint region, and obtain the bones of the joint region; wherein the vertices of the joint region are vertices of the model mesh body whose curvature is greater than a preset curvature, and the preset curvature is less than the maximum curvature among the curvatures of the vertices;
[0179] Generate weights of the vertices in the joint area based on the distances from the vertices in the joint area to the bones in the joint area and the attenuation parameters of the bones in the joint area;
[0180] Based on the distances from the vertices in the non-joint area to all bones and the attenuation parameters of all bones, the weights of the vertices in the non-joint area are generated. The vertices in the non-joint area are the vertices of the model mesh minus the vertices in the joint area.
[0181] The weights of the vertices in the joint area and the weights of the vertices in the non-joint area are used as the first skin weight.
[0182] In a possible implementation, the vertex partitioning module 202 includes:
[0183] Determine the curvature of each vertex of the model mesh, and use the vertex with a curvature greater than a preset curvature as the vertex of the joint region; wherein the preset curvature is less than the maximum curvature among the curvatures of the vertices;
[0184] Acquire multiple non-joint regions; wherein each non-joint region is obtained by dividing the remaining region of the model mesh body except the joint region;
[0185] Determine the bones of each non-joint area, and divide the vertices of the model mesh remaining after removing the vertices in the joint area into areas by dividing the vertices into the non-joint area to which the nearest bones belong, to obtain the vertices in each non-joint area.
[0186] In a possible implementation, the second skin weight generating module 203 is specifically configured to:
[0187] Arrange the bones that affect the vertices in each area in ascending order of distance from the vertex to the bone, and obtain the preset root bone with the highest ranking as the target bone;
[0188] Obtaining a range of each region based on size information of each region, and determining an attenuation parameter of each region based on the range of each region;
[0189] The second skin weight is generated based on the ratio of the square of the average distance between the vertices in each region and the corresponding target bone to the square of the attenuation parameter of each region.
[0190] In one possible implementation, the weight optimization module 204 is specifically configured to:
[0191] The first skin weight is optimized with the goal of minimizing 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 area to obtain the optimized skin weight; wherein, the vertices in the joint area are vertices of the model mesh body whose curvature is greater than a preset curvature, and the preset curvature is less than the maximum curvature among the curvatures of all vertices.
[0192] In a possible implementation, the skin weight generation system further includes:
[0193] The weight transfer module is used to obtain the key point correspondence between the target model and the source model; wherein, 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; based on the key point correspondence, the corresponding points of the mesh vertices of the target model in the source model are determined; based on the optimized skin weights and corresponding points, the skin weights of the mesh vertices of the target model are obtained.
[0194] An electronic device is also provided in an embodiment of the present application. Figure 3 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. The electronic device in the embodiments of the present 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 limit the functions and scope of use of the embodiments of the present application.
[0195] like Figure 3 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) 302 or programs 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 device 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 may be connected to the I / O interface 305: an input device 306 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 308 including, for example, a memory card, a hard disk, etc.; and a communication device 309. The communication device 309 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Figure 3 The electronic device is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0197] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any one of the skin weight generation methods provided in the embodiments of the present application.
[0198] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any skin weight generation method provided in the embodiment of the present application.
[0199] It should also be noted that the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed across multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. In addition, in the drawings of the device embodiments provided in this application, the connection relationship between the modules indicates that there is a communication connection between them, which can be specifically implemented as one or more communication buses or signal lines.
[0200] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course can also be implemented by special hardware including application-specific integrated circuits, special CPUs, special memories, special components, etc. In general, all functions performed by computer programs can be easily implemented with corresponding hardware, and the specific hardware structures used to implement the same function can also be diverse, such as analog circuits, digital circuits or special circuits, etc. However, for the present application, software program implementation is a better implementation method in most cases. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer's floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk or optical disk, etc., and includes a number of instructions to enable a computer device (which can be a personal computer, training equipment, or network equipment, etc.) to execute the methods described in each embodiment of the present application.
[0201] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of 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, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, a computer, a training device or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website, a computer, a training device or a data center. The computer-readable storage medium can be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
Claims
1. A method for generating skin weights, characterized in that: include: generating first skin weights based on distances from vertices of a model mesh to a bone and a falloff parameter of the bone; wherein the first skin weights include weights of the vertices of the model mesh, and the falloff parameter of the bone affects a first speed, the first speed being a speed at which the weights of the vertices of the model mesh decrease as the distances from the vertices of the model mesh to the bone increase; Dividing the vertices of the model mesh into regions to obtain vertices in each region; generating a second skinning weight based on an average distance from vertices in the region to a target bone and an attenuation parameter of the region; wherein the second skinning weight includes weights of vertices in the region, the target bone is a bone that affects vertices in the region, and the attenuation parameter of the region affects a second speed, the second speed being a speed at which the weights of vertices in the region decrease as the average distance from vertices in 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 an optimized skin weight.
2. The skin weight generation method according to claim 1, characterized in that: The step of generating a first skin weight based on the distance from the vertex of the model mesh to the bone and the attenuation parameter of the bone comprises: Determining bones of vertices affecting a joint region, and obtaining bones of the joint region; wherein the vertices of the joint region are vertices of the model mesh body whose curvature is greater than a preset curvature, and the preset curvature is less than a maximum curvature among the curvatures of the vertices; generating weights of the vertices of the joint region based on distances from the vertices of the joint region to the bones of the joint region and attenuation parameters of the bones of the joint region; Generating weights of the vertices in the non-joint area based on the distances from the vertices in the non-joint area to all bones and the attenuation parameters of all bones; wherein the vertices in the non-joint area are all vertices of the model mesh except the vertices in the joint area; The weights of the vertices in the joint area and the weights of the vertices in the non-joint area are used as the first skin weights.
3. The skin weight generation method according to claim 1, characterized in that: The step of dividing the vertices of the model mesh into regions to obtain vertices within each region includes: Determining the curvature of each vertex of the model mesh body, and taking a vertex with a curvature greater than a preset curvature as a vertex of the joint region; wherein the preset curvature is less than the maximum curvature among the curvatures of each of the vertices; Acquire multiple non-joint regions; wherein each non-joint region is obtained by dividing the remaining region of the model mesh body except the joint region; The skeleton of each non-joint area is determined, and the vertices of the model mesh remaining after removing the vertices of the joint area are divided into regions in a manner of dividing the vertices into the non-joint area to which the bones with the closest distance belong, to obtain the vertices in each non-joint area.
4. The skin weight generation method according to any one of claims 1 to 3, characterized in that: Generating a second skin weight based on an average distance from vertices in the region to a target bone and an attenuation parameter of the region includes: Arrange the bones that affect the vertices in each of the regions in ascending order of distance from the vertex to the bone, and obtain the preset root bone with the highest ranking as the target bone; Obtaining a range of each of the regions based on size information of each of the regions, and determining an attenuation parameter of each of the regions based on the range of each of the regions; The second skin weight is generated based on a ratio of the square of the average distance from the vertices in each of the regions to the corresponding target bone to the square of the attenuation parameter of each of the regions.
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 with the goal of minimizing the sum of the difference between the first skin weight and the second skin weight, the difference between the weights of two adjacent vertices, and the weights of the vertices in the joint area to obtain an optimized skin weight; wherein, the vertices in the joint area are vertices of the model mesh body whose curvature is greater than a preset curvature, and the preset curvature is less than the maximum curvature among the curvatures of each of the vertices.
6. The skin weight generation method according to claim 1, characterized in that: After obtaining the optimized skin weights, the following steps are further included: Obtaining a correspondence between key points of a target model and a source model; wherein the mesh of the source model is the model mesh, and the key points include vertex curvature extreme points and / or intersection points of two bones; Determining corresponding points of mesh vertices of the target model in the source model based on the key point correspondence relationship; Based on the optimized skin weights and the corresponding points, skin weights of the mesh vertices of the target model are obtained.
7. A skin weight generation system, characterized in that: include: A first skin weight generation module, configured to generate first skin weights based on distances from vertices of a model mesh to a bone and a decay parameter of the bone; wherein the first skin weights include weights of the vertices of the model mesh, and the decay parameter of the bone affects a first speed, wherein the first speed is a speed at which the weights of the vertices of the model mesh decrease as the distances from the vertices of the model mesh to the bone increase; A vertex partitioning module is used to divide the vertices of the model mesh into regions to obtain vertices in each region; A second skin weight generation module is configured to generate a second skin weight based on an average distance from vertices in the region to a target bone and an attenuation parameter of the region; wherein the second skin weight includes weights of vertices in the region, the target bone is a bone that affects vertices in the region, and the attenuation parameter of the region affects a second speed, wherein the second speed is a speed at which the weights of vertices in the region decrease as the average distance from 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 an optimized skin weight.
8. A computer program product, characterized in that The method comprises computer-readable instructions, which, when executed on an electronic device, enable the electronic device to implement the skin weight generation method according to any one of claims 1 to 6.
9. An electronic device, characterized in that: comprising at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is configured to execute the computer program so that the electronic device can implement the skin weight generation method according to any one of claims 1 to 6.
10. A computer storage medium, characterized in that The storage medium carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the skin weight generation method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method for manufacturing computer skin animation based on high-precision three-dimensional scanning model
CN111369649A
Three-dimensional reconstruction method and device, equipment and storage medium
CN113658309A
Bone skin method and device, computer equipment and storage medium
CN113902876A
Skin weight generation method and device, electronic equipment and storage medium
CN117333589A
Animation generation method, animation generation system and computer readable medium
CN117788653A