Clothing and bone binding method, device, equipment and storage medium
Patent Information
- Application Number
- CN202310115344.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-14
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2043-02-14
AI Technical Summary
[0004]本发明的主要目的在于解决现有的服装与不同骨骼之前的绑定操作过于繁琐且效率低的问题
[0009]上述服装与骨骼的绑定方法、装置、设备及存储介质,通过确定目标角色模型和服装模型,并基于服装模型读取对应的姿势绑定记录;基于姿势绑定记录确定服装模型的网格顶点与骨骼之间的对应关系,以及网格顶点与骨骼之间的位置关系;基于对应关系将目标角色模型上的骨骼与所服装模型的网格顶点进行匹配,得到骨骼绑定关系;基于目标角色模型的第一骨骼信息、位置关系和骨骼绑定关系,确定服装模型的蒙皮权重,并基于骨骼绑定关系和蒙皮权重对服装模型进行绑定。本方式中,通过服装模型的历史的姿势绑定记录中确定骨骼的对应关系和蒙皮权重,基于该对应关系和蒙皮权重将服装模型绑定到新的角色模型中,从而实现了服装的自动封套绑定,同时也实现了服装绑定关系的循环使用,解决了现有的服装与不同骨骼之前的绑定操作过于繁琐且效率低的问题。
Smart Images

Figure CN116206021B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer graphics, and more particularly to a method, apparatus, device, and storage medium for binding clothing to a skeleton. Background Technology
[0002] With the development of the gaming industry, the number of game enthusiasts is increasing. To enhance the gaming experience for players, game production is increasingly trending towards realistic scenes. Especially in role-playing games, players enhance their virtual characters by changing their equipment or clothing. However, matching the same equipment or clothing to different virtual characters requires adjustments, which is a complex operation for animation rendering.
[0003] To address the aforementioned issues, current methods primarily utilize automatic clothing tools to match network vertices of equipment or clothing onto the bodies of virtual characters of different body types. However, since the skeletal dimensions of virtual characters vary across body types, adjustments to the dimensions of the network vertices are necessary after matching to ensure a perfect skeletal match. This dimensional adjustment currently involves manually applying influence weights to each bone on the clothing vertices before creating skeletal animations—a very labor-intensive process. Furthermore, the adjusted clothing models cannot be reused, significantly reducing the efficiency of binding clothing to the character. Summary of the Invention
[0004] The main objective of this invention is to solve the problem that the existing binding operations between clothing and different skeletons are too cumbersome and inefficient.
[0005] The first aspect of this invention provides a method for binding clothing to a skeleton, the binding method comprising: Determine the target character model and clothing model, and read the corresponding pose binding record based on the clothing model; Based on the pose binding record, the correspondence between the mesh vertices and bones of the clothing model, as well as the positional relationship between the mesh vertices and bones, are determined; Based on the correspondence, the bones on the target character model are matched with the mesh vertices of the clothing model to obtain the bone binding relationship; Based on the first skeletal information of the target character model, the positional relationship, and the skeletal binding relationship, the skinning weight of the clothing model is determined, and the clothing model is bound based on the skeletal binding relationship and the skinning weight.
[0006] A second aspect of the present invention provides a garment-to-skeleton binding device, the garment-to-skeleton binding device comprising: The reading module is used to determine the target character model and clothing model, and read the corresponding pose binding record based on the clothing model; The determination module is used to determine the correspondence between the mesh vertices and bones of the clothing model, as well as the positional relationship between the mesh vertices and bones, based on the pose binding record; The matching module is used to match the bones on the target character model with the mesh vertices of the clothing model based on the correspondence relationship to obtain the bone binding relationship; The binding module is used to determine the skinning weights of the clothing model based on the first skeletal information of the target character model, the positional relationship, and the skeletal binding relationship, and to bind the clothing model based on the skeletal binding relationship and the skinning weights.
[0007] A third aspect of the present invention provides a garment-to-skeleton binding device, comprising: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a circuit; the at least one processor invokes the instructions in the memory to cause the garment-to-skeleton binding device to perform the various steps of the garment-to-skeleton binding method described above.
[0008] A fourth aspect of the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the steps of the above-described method for binding clothing to bones.
[0009] The aforementioned method, apparatus, device, and storage medium for binding clothing to bones involves: determining a target character model and a clothing model; reading corresponding pose binding records based on the clothing model; determining the correspondence between mesh vertices and bones in the clothing model, as well as the positional relationship between mesh vertices and bones, based on the pose binding records; matching the bones on the target character model with the mesh vertices of the clothing model based on the correspondence to obtain the bone binding relationship; determining the skinning weights of the clothing model based on the first bone information, positional relationship, and bone binding relationship of the target character model; and binding the clothing model based on the bone binding relationship and skinning weights. In this method, the correspondence between bones and skinning weights are determined from the historical pose binding records of the clothing model. Based on this correspondence and skinning weights, the clothing model is bound to a new character model, thereby achieving automatic envelope binding of clothing and enabling the cyclical use of clothing binding relationships. This solves the problem of existing binding operations between clothing and different bones being overly cumbersome and inefficient.
[0010] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.
[0011] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0012] Figure 1 This is a schematic diagram of the first embodiment of the method for binding clothing to bones in this invention; Figure 2 This is a schematic diagram of a second embodiment of the method for binding clothing to bones in this invention; Figure 3 This is a schematic diagram illustrating the application of the clothing model cover to the target character model in an embodiment of the present invention; Figure 4 This is a schematic diagram of one embodiment of the binding device between clothing and bones in this invention; Figure 5 This is a schematic diagram of another embodiment of the binding device between clothing and bones in this invention; Figure 6 This is a schematic diagram of one embodiment of the garment-skeleton binding device in this invention. Detailed Implementation
[0013] This invention provides a method, apparatus, device, and storage medium for binding clothing to a skeleton. Based on the height, waist-to-body ratio, skeletal matrix information, and envelope data of two sets of skeletons, the clothing is bound to a new skeleton. The binding and weighting work can be completed by calculating the new envelope data and vertex weights based on local muscle information.
[0014] The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0015] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 The first embodiment of the method for binding clothing to bones in this invention includes: 101. Determine the target character model and clothing model, and read the corresponding pose binding records based on the clothing model; It is understood that this embodiment is mainly applied to servers or terminal devices, and terminal devices refer to devices such as PCs, mobile phones, and iPads that have rendering programs or game programs installed. Users select the corresponding model on the program interface by operating the rendering program or game program on the terminal device. The model can be a virtual character in the game, or a human body, etc. By operating on the interface, the target character is determined and the type of the target character is determined, thereby determining the corresponding model structure. The method provided in this application will be described below using a humanoid bipedal animal model and a game scene as an example.
[0016] In this embodiment, the clothing to be bound and the target character are obtained, and the corresponding clothing model and target character model, as well as the skeletal information corresponding to the target character, are determined based on the clothing and the target character. Based on the clothing model, the bound second skeleton information, the binding pose matrix, bone weight information, and bone start and end point envelope information of the clothing model relative to the second skeleton information are read from the database. Based on the binding pose matrix, the binding pose inverse matrix of the clothing model is calculated. The bone start and end point envelope information can be understood as the correspondence between the bone start and bone end points in the skeletal structure and the start and end points in the mesh vertices of the clothing model, that is, the correspondence between the parent-child node relationship of each mesh vertex in the clothing model and the parent-child node relationship of each bone point in the skeletal structure.
[0017] In this step, the terminal device collects the user's touch operations on the game interface, determines the virtual character that needs to wear or change clothing, and identifies the type of the virtual character, which can be understood as a bipedal or non-bipedal character. Based on the type of the virtual character, a corresponding model is created to obtain the target character model. Further, based on the touch operations, clothing is determined. This clothing should be understood as clothes, equipment, fabric materials, etc., and a model of the clothing is constructed to obtain the clothing model.
[0018] Furthermore, using the clothing model as an index, the program's backend is queried to see if there are application records for the clothing model, such as binding records for wearing it. If so, the most recent binding record of binding the clothing model to the virtual character is read. Alternatively, the binding configuration between a preset clothing model and a standard character model can be obtained based on the clothing model as an index.
[0019] In practical applications, when acquiring the pose binding record, the specific process involves acquiring the skeleton information of the clothing model relative to the historically bound character model. This includes the bones corresponding to each part of the clothing model, such as the bones corresponding to the arm and leg parts of the clothing model, as well as the correspondence between each joint on the bones. It may even include the positional relationship between the joints and the envelope nodes, the weight ratio of the motion relationship between each joint of the bones, and so on.
[0020] 102. Determine the correspondence between mesh vertices and bones of the clothing model, as well as the positional relationship between mesh vertices and bones, based on pose binding records; In this embodiment, the pose binding record includes the second skeleton information of the character model bound to the clothing model, as well as the binding pose matrix, bone weight information, and bone start and end envelope information of the clothing model relative to the second skeleton information. The names of the bones bound between the clothing model and the character model, as well as the correspondence between bone nodes, are determined by the binding pose matrix. Specifically, the correspondence between each mesh vertex and bone node in the clothing model is extracted.
[0021] Furthermore, after determining the correspondence between each mesh vertex and bone node, the clothing model is divided into sections, and mesh vertices are extracted for each section. From the extracted mesh vertices, the envelope start and end points are determined, and based on these, the corresponding bone start and end points are determined. The positional relationship relative to the bone start and end points is then calculated. In practical applications, the bone start and end points should be understood as the starting and ending points of a linkage among multiple bone points with a linkage relationship in the skeletal structure. For example, in a character's arm, which includes the forearm and upper arm, the upper arm drives the forearm in a linkage relationship. Its bone start point is the upper arm, and its bone end point is the forearm. Similarly, as the forearm moves with the upper arm, the bone points on the forearm also have a sequence of movement, and the start and end points can be determined based on this sequence. The method for determining the envelope start and end points of mesh vertices in the clothing model is the same and will not be repeated here.
[0022] 103. Based on the correspondence, match the bones on the target character model with the mesh vertices of the clothing model to obtain the bone binding relationship; In this embodiment, a skeletal matching algorithm can be used to match the mesh vertices of the skeleton and the clothing model. This algorithm can be understood as a tool for adapting skeletons to clothing. For example, it can pre-learn the skeletal structure of characters with different body types, as well as the mapping and proportional adjustment relationships of different clothing on the skeletal structure, through a neural network. The resulting matching model can also be an animation development software. This algorithm can automatically match clothing mesh vertices in scenarios where the skeleton types of the adapted models are the same. For instance, when different bipedal animal models wear the same clothes, since the skeletal structures of bipedal animal models are the same, differing only in bone size, the algorithm first parses the historical binding relationships of the clothing to obtain the bone names corresponding to each part of the clothing. Then, it removes the original binding relationships in the clothing model and selects matching bones from the target character based on the bone names, associating them with the corresponding parts of the clothing model to obtain the skeletal binding relationship. In other words, it first identifies the skeletal structure of the target character model, matches the bone points on the skeletal structure with each mesh vertex on the clothing model, and then outputs the binding relationship between the skeletal structure and the mesh vertices on the clothing model.
[0023] In practical applications, the skeletal binding relationship can be the binding relationship between all the bones of the entire clothing model and the target character model, or it can be the binding relationship between a portion of the bones and the corresponding part of the clothing model, such as the matching relationship between the upper right arm in the target character model and the upper right arm in the clothing model.
[0024] 104. Based on the first skeleton information, positional relationship and skeleton binding relationship of the target character model, determine the skinning weight of the clothing model, and bind the clothing model based on the skeleton binding relationship and skinning weight.
[0025] In this embodiment, based on the determination of the skinning weight of the clothing, specifically the skeletal binding relationship, the position percentage between the start and end points of the cover of each part of the clothing model and the start and end points of the corresponding bones in the target character model is adjusted. Then, the weight value is adjusted based on the bone length of the corresponding bones in the target character model to obtain the skinning weight. Finally, the clothing model is bound based on the skeletal binding relationship and the skinning weight to achieve the animation rendering of the clothing model.
[0026] In summary, by identifying the target character model and clothing model, and reading the corresponding pose binding records based on the clothing model; determining the correspondence between the mesh vertices and bones of the clothing model, as well as the positional relationship between the mesh vertices and bones based on the pose binding records; matching the bones on the target character model with the mesh vertices of the clothing model based on the correspondence to obtain the bone binding relationship; determining the skinning weights of the clothing model based on the first bone information, positional relationship, and bone binding relationship of the target character model, and binding the clothing model based on the bone binding relationship and skinning weights, this method not only achieves automatic envelope binding of clothing, but also enables the cyclical use of clothing binding relationships, solving the problem that the existing binding operations between clothing and different bones are too cumbersome and inefficient.
[0027] Reference Figure 2 and 3 This is the second embodiment of the clothing-skeleton binding method provided by the present invention. The method is described in detail below using the wearing of clothing on different human bodies as an example. The method specifically includes the following steps: 201. Determine the target character model and clothing model, and read the corresponding pose binding records based on the clothing model; Specifically, the pose binding record includes skeleton information, binding pose matrix, bone weight information, bone start and end point envelope information, and binding pose inverse matrix.
[0028] In this step, the clothing to be bound and the target character are obtained, and the corresponding clothing model and target character model are determined based on the clothing and target character, as well as the skeletal information corresponding to the target character; the bound second skeleton information is read from the database based on the clothing model, as well as the binding posture matrix, bone weight information and bone start and end point envelope information of the clothing model relative to the second skeleton information; the binding posture inverse matrix for unbinding the clothing model is calculated based on the binding posture matrix.
[0029] In practical applications, for example, if the target character model is BodyB and the clothing model is ClothB, the database is queried to see if there is a historical record based on the clothing model, that is, to see if there is a clothing model ClothA with the same clothing model. If it exists, the character model BodyA bound to ClothA is read, and the skeleton SkeletonA of the character model and the corresponding binding pose matrix are extracted.
[0030] For example, BodyA and ClothA correspond to SkeletonA, and the bones on the skeleton correspond to "binding pose matrices" such as MatrixA_1, MatrixA_2, and MatrixA_3. BodyB is not wearing clothes, and its skeleton is SkeletonB. The bones on the skeleton correspond to "binding pose matrices" such as MatrixB_1, MatrixB_2, and MatrixB_3.
[0031] In this embodiment, the pose binding record includes the binding information of all bones in the entire character model. For each bone in the local spatial structure, a Struct is recorded, where Sj represents scaling, Rj represents rotation, and Tj represents translation. These three matrices are merged into one matrix, which is a joint affine transformation matrix. Adding information such as bone length and radius allows the entire skeleton to be represented as a tree structure of matrix information, starting from the pelvis and indexing each bone step by step. Its tree structure is expressed as follows: struct JointPose { Quaternion rot; / / R joint rotation information Vector3 trans; / / T joint displacement information Vector3 scale; / / S joint scaling information }
[0032] Based on the matrix tree structure of the skeleton described above, the deformation P of the sub-bones can be calculated continuously from the position, rotation, and scaling of the root bone through hierarchical relationships. The expression of P is as follows:
[0033] 202. Extract the bones and their corresponding hierarchical structure from the second skeleton information based on the binding pose matrix, and determine the mesh vertices of the clothing model based on the bones; In this step, the binding pose matrix refers to the binding pose matrix between the clothing model and other character models. The other character models can be understood as historical binding characters. The binding pose matrix is calculated in reverse by the algorithm to solve the corresponding bones and the hierarchical structure of the bones. Then, the clothing model is solved based on the solved bones to obtain the mesh vertices of the clothing model.
[0034] In practical applications, solving the mesh vertices of a clothing model is equivalent to solving the skeleton of the second skeleton information. By parsing the bones in the second skeleton information and determining the hierarchical structure of the bones based on their starting positions, for example, for a bipedal model like the human body, we standardize this skeleton method, setting the root bone at the pelvis, then extending the spine upwards from the pelvis, and further extending from the spine to the clavicle, arms, head, etc. As long as all bipedal model creation follows this standardized skeleton as a reference, without changing the hierarchical structure, only changing the length, position, and constraint angle of local bones, then the bones of different models can be directly mapped to each other. For example, a child's left arm and an adult's left arm correspond one-to-one and are on the same layer in the skeleton hierarchy.
[0035] 203. Determine the correspondence between mesh vertices and bones in the clothing model based on the hierarchical structure corresponding to the skeleton; In this step, based on the hierarchical structure of the clothing model and the correspondence between the bones and the corresponding parts of the clothing model, which are parsed from the historical binding pose records of the clothing model, such as the right upper arm bone parsed from the second skeleton information, which corresponds to the right upper arm sleeve in the clothing model, each mesh vertex in the clothing model can be mapped to the corresponding bone or bone node in the target character model.
[0036] 204. Determine the skeletal start point, skeletal end point, envelope start point, and envelope end point of the clothing model based on the skeletal start point, end point, and envelope end point information; 205. Calculate the percentage of the positions of the envelope start and end points relative to the bone start and end points to obtain the positional relationship between the mesh vertices and the bones; 206. Based on the correspondence, match the bones on the target character model with the mesh vertices of the clothing model to obtain the bone binding relationship; In this embodiment, the skeletal hierarchy of each part in the clothing model is determined based on the correspondence; the skeletal binding relationship on the clothing model is removed; the skeletal hierarchy of each part is matched with the bones in the first skeletal information of the target character; and the matched bones are added to the corresponding parts of the clothing model to generate the corresponding skeletal binding relationship.
[0037] In practical applications, the clothing model enveloped onto the target character model is actually a copy of ClothA, denoted as ClothB. A preset skeletal matching algorithm is then used to dress ClothB onto BodyB, and the mesh is adjusted. However, the bones and weights bound to ClothB still correspond to SkeletonA at this point. This is because the bipedal bone hierarchy allows for one-to-one correspondence between all skeletons; that is, the sub-bones of SkeletonA and SkeletonB can be matched. First, the skeleton SkeletonA on ClothB is deleted. Then, based on the correspondence, the bones on SkeletonB are added to ClothB one-to-one, thus obtaining the skeletal binding relationship.
[0038] 207. Determine the new skeletal start point and new skeletal end point of the clothing model relative to the target character model based on the skeletal binding relationship; 208. Based on the new bone start point, new bone end point, positional relationship, and binding pose inverse matrix, calculate the bone transformation matrix of the clothing model enveloped to the target character model; In this step, under the rigged pose, the local joint matrix of each bone and the world matrix of the model are recorded. The matrix transformed from the local joint matrix to the model matrix is called the rigged pose matrix, and the matrix transformed from the model matrix to the local joint matrix is called the rigged pose inverse matrix.
[0039]
[0040] Where j represents the node local space, M represents the model space, and B represents the transformation matrix of the rigging pose.
[0041] Specifically, after binding the skeletons, because the lengths and radii of the old and new skeletons are different, the envelope information of the skeletons will still be incorrect and needs to be recalibrated. Taking the upper right arm as an example, on ClothA, its skeleton start and end points are skeA_bone1_start and skeA_bone1_end, and the envelope start and end points are skeA_env_start and skeA_env_end. These four points are on a straight line, allowing us to calculate the percentage position of the envelope's start and end points relative to the skeleton's start and end points, denoted as ratioA_start and ratioB_end. On the skeleton of another outfit, ClothB, the skeleton start and end points are skeB_bone1_start and skeB_bone1_end. Based on ratioA_start and ratioB_end, the global position of the new envelope is calculated, and the local transformation of the envelope relative to the skeleton is calculated based on the inverse matrix of the skeleton's binding pose.
[0042] 209. Based on the first skeleton information, positional relationship and skeleton binding relationship of the target character model, determine the skinning weight of the clothing model; 210. Bind the clothing model based on the skeleton binding relationship and skin weight.
[0043] In this embodiment, the bone lengths of each bone in the target character model are extracted, as well as the start and end points of the bones of the clothing model relative to the target character model; based on the start and end points of the bones and the positional relationship, the global position of the clothing model relative to the target character is calculated; based on the global position of the cover, the bone transformation matrix, and the corresponding bone length, the skinning weight of the clothing model is calculated; and the clothing model is bound based on the bone binding relationship and the skinning weight.
[0044] Furthermore, the step of calculating the skinning weights of the clothing model based on the global position of the cover, the skeletal transformation matrix, and the corresponding bone length includes: calculating a decay weight based on the global position of the cover, the skeletal transformation matrix, and the corresponding bone length; and adjusting the bone weight information relative to the second skeleton information based on the decay weight to obtain the skinning weights of the clothing model.
[0045] In practical applications, after binding the skeleton and envelope to ClothB, the weight information stored in its mesh vertices is still that of SkeletonA. Moreover, the two skeletons differ in height, body shape, and local bone length, so the original weight information cannot be used directly. Here, we take a vertex (VertexA) at the left wrist as an example. The vertex weight of VertexA is ([skeA_bone_1, 0.4], [skeA_bone_2, 0.6]). Based on the bone mapping relationship, we calculate the bone names skeB_bone_1 and skeB_bone_2 on the new skeleton. At the same time, because the bone length change will affect the weight value, we calculate the attenuated weight based on the distance ([skeB_bone_1, 0.3], [skeB_bone_2, 0.7]). Then, we set the new vertex weights to the vertices.
[0046] In summary, by identifying the target character model and clothing model, and reading the corresponding pose rigging records based on the clothing model; determining the correspondence between the mesh vertices and bones of the clothing model, as well as the positional relationship between the mesh vertices and bones, based on the pose rigging records; matching the bones on the target character model with the mesh vertices of the clothing model based on the correspondence, obtaining the skeletal rigging relationship; and determining the skinning weights of the clothing model based on the first bone information, positional relationship, and skeletal rigging relationship of the target character model, and rigging the clothing model based on the skeletal rigging relationship and skinning weights. This allows for the automatic calculation of skeletal rigging and skinning weights for the matched model, reducing the heavy workload of animation artists that previously took days to complete to within minutes, solving the problem of the existing cumbersome and inefficient rigging operations between clothing and different bones.
[0047] The binding method between clothing and skeleton in the embodiments of the present invention has been described above. The binding device between clothing and skeleton in the embodiments of the present invention will be described below. Please refer to [link / reference]. Figure 4 One embodiment of the clothing-skeleton binding device in this invention includes: The reading module 410 is used to determine the target character model and clothing model, and read the corresponding pose binding record based on the clothing model; The determination module 420 is used to determine the correspondence between the mesh vertices and bones of the clothing model, as well as the positional relationship between the mesh vertices and bones, based on the pose binding record. The matching module 430 is used to match the bones on the target character model with the mesh vertices of the clothing model based on the correspondence relationship to obtain the bone binding relationship; The binding module 440 is used to determine the skinning weight of the clothing model based on the first skeletal information of the target character model, the positional relationship and the skeletal binding relationship, and to bind the clothing model based on the skeletal binding relationship and the skinning weight.
[0048] In summary, this method involves identifying the target character model and clothing model, and then reading the corresponding pose binding records based on the clothing model. Based on these records, the correspondence between the mesh vertices and bones of the clothing model, as well as their positional relationships, are determined. The bones of the target character model are matched with the mesh vertices of the clothing model to obtain the skeletal binding relationship. Based on the first bone information, positional relationships, and skeletal binding relationship of the target character model, the skinning weights of the clothing model are determined, and the clothing model is bound based on these skeletal binding relationships and skinning weights. This approach determines the skeletal correspondence and skinning weights from the clothing model's historical pose binding records, and binds the clothing model to a new character model based on these correspondences and skinning weights. This achieves automatic envelope binding of clothing and also enables the cyclical use of clothing binding relationships, solving the problem of cumbersome and inefficient binding operations between existing clothing and different bones.
[0049] See Figure 5 This is a second embodiment of the clothing-skeleton binding device provided in the embodiments of this application, specifically including: The reading module 410 is used to determine the target character model and clothing model, and read the corresponding pose binding record based on the clothing model; The determination module 420 is used to determine the correspondence between the mesh vertices and bones of the clothing model, as well as the positional relationship between the mesh vertices and bones, based on the pose binding record. The matching module 430 is used to match the bones on the target character model with the mesh vertices of the clothing model based on the correspondence relationship to obtain the bone binding relationship; The binding module 440 is used to determine the skinning weight of the clothing model based on the first skeletal information of the target character model, the positional relationship and the skeletal binding relationship, and to bind the clothing model based on the skeletal binding relationship and the skinning weight.
[0050] The above-mentioned reading module 410 includes: The acquisition unit 411 is used to acquire the clothing to be bound and the target character, and to determine the corresponding clothing model and target character model, as well as the skeletal information corresponding to the target character based on the clothing and the target character; The reading unit 412 is used to read the bound second skeleton information from the database based on the clothing model, as well as the binding posture matrix, bone weight information and bone start and end cap information of the clothing model relative to the second skeleton information; The first calculation unit 413 is used to calculate the inverse matrix of the binding posture of the clothing model based on the binding posture matrix.
[0051] The aforementioned determining module 420 includes: Extraction unit 421 is used to extract the bones and corresponding hierarchical structure in the second skeleton information based on the binding pose matrix, and to determine the mesh vertices of the clothing model based on the bones.
[0052] The first determining unit 422 is used to determine the correspondence between the mesh vertices and the bones of the clothing model based on the hierarchical structure corresponding to the bones; The second determining unit 423 is used to determine the skeletal starting point, skeletal ending point, envelope starting point, and envelope ending point of the clothing model based on the skeletal starting point and ending point envelope information; The second calculation unit 424 is used to calculate the position percentage of the envelope start point and the envelope end point relative to the bone start point and the bone end point, and obtain the positional relationship between the mesh vertex and the bone.
[0053] The matching module 430 mentioned above includes: The third determining unit 431 is used to determine the skeletal hierarchy of each part in the clothing model based on the correspondence; The matching unit 432 is used to remove the skeletal binding relationship on the clothing model, match the bones in the first bone information of the target character based on the bone hierarchy of each part, and add the matched bones to the corresponding parts of the clothing model to generate the corresponding skeletal binding relationship.
[0054] The matching module 430 mentioned above also includes a transformation unit 433, which is specifically used for: Based on the skeletal binding relationship, determine the new skeletal start point and new skeletal end point of the clothing model relative to the target character model; Based on the new bone start point, the new bone end point, the positional relationship, and the binding pose inverse matrix, the bone transformation matrix of the clothing model encapsulated in the target character model is calculated.
[0055] The aforementioned binding module 440 includes: The skeleton extraction unit 441 is used to extract the bone length of each bone of the target character model, as well as the start and end points of the skeleton of the clothing model relative to the target character model. The position calculation unit 442 is used to calculate the global position of the clothing model relative to the target character's cover based on the bone start point, the bone end point, and the positional relationship. The weight calculation unit 443 is used to calculate the skinning weight of the clothing model based on the global position of the cover, the bone transformation matrix and the corresponding bone length. Binding unit 444 is used to bind the clothing model based on the skeleton binding relationship and the skin weight.
[0056] The aforementioned binding unit 444 is specifically used for: Based on the global position of the envelope, the bone transformation matrix, and the corresponding bone length, the attenuation weight is calculated; The bone weight information relative to the second skeleton information is adjusted based on the attenuation weight to obtain the skin weight of the clothing model.
[0057] In this embodiment of the invention, the clothing-to-skeleton binding device operates the aforementioned clothing-to-skeleton binding method. Based on the height, waist-to-body ratio, bone matrix information, and skinning data of the two skeletons, it binds the clothing to a new skeleton. Then, based on local muscle information, it calculates the new skinning data and vertex weights to complete the binding and weight application. This allows for the automatic calculation of skeleton binding and skinning weights for the matched model, solving the problem of cumbersome and inefficient binding operations between existing clothing and different skeletons.
[0058] This embodiment also provides a garment-to-skeleton binding device, including a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor. The processor executes the machine-executable instructions to implement the aforementioned garment-to-skeleton binding method. This garment-to-skeleton binding device can be a server or a terminal device.
[0059] See Figure 6 As shown, the garment-to-skeleton binding device includes a processor 600 and a memory 601. The memory 601 stores machine-executable instructions that can be executed by the processor 600. The processor 600 executes the machine-executable instructions to implement the above-described garment-to-skeleton binding method.
[0060] Furthermore, Figure 6 The garment and skeleton binding device shown also includes a bus 602 and a communication interface 603. The processor 600, the communication interface 603, and the memory 601 are connected via the bus 602.
[0061] The memory 601 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 603 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The bus 602 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 6 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0062] The processor 600 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 600 or by instructions in software form. The processor 600 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory 601. The processor 600 reads the information from memory 601 and, in conjunction with its hardware, completes the following steps: The process involves identifying a target character model and a clothing model, and reading the corresponding pose binding record based on the clothing model. Based on the pose binding record, the process determines the correspondence between the mesh vertices and bones of the clothing model, as well as the positional relationship between the mesh vertices and bones. Based on the correspondence, the process matches the bones on the target character model with the mesh vertices of the clothing model to obtain a bone binding relationship. Based on the first bone information of the target character model, the positional relationship, and the bone binding relationship, the process determines the skinning weights of the clothing model, and binds the clothing model based on the bone binding relationship and the skinning weights.
[0063] The above-described process of determining the target character model and clothing model, and reading the corresponding pose binding record based on the clothing model, includes: Obtain the clothing to be bound and the target character, and determine the corresponding clothing model and target character model, as well as the skeletal information corresponding to the target character based on the clothing and the target character; read the bound second skeleton information from the database for the clothing model, as well as the binding posture matrix, bone weight information and bone start and end point envelope information of the clothing model relative to the second skeleton information; calculate the binding posture inverse matrix of the clothing model to unbind the clothing model based on the binding posture matrix.
[0064] The above-mentioned determination of the correspondence between the mesh vertices and bones of the clothing model based on the pose binding record, as well as the positional relationship between the mesh vertices and bones, includes: extracting the bones and the corresponding hierarchical structure in the second skeleton information based on the binding pose matrix, and determining the mesh vertices of the clothing model based on the bones.
[0065] Based on the hierarchical structure corresponding to the skeleton, the correspondence between the mesh vertices and the skeleton of the clothing model is determined; based on the start and end point envelope information of the skeleton, the start point, end point, envelope start point, and envelope end point of the clothing model are determined; the position percentage of the envelope start point and the envelope end point relative to the start point and the end point of the skeleton is calculated to obtain the positional relationship between the mesh vertices and the skeleton.
[0066] The above-described method of matching the bones on the target character model with the mesh vertices of the clothing model based on the correspondence to obtain the bone binding relationship includes: determining the bone hierarchy of each part in the clothing model based on the correspondence; removing the bone binding relationship on the clothing model; matching the bone hierarchy of each part with the bones in the first bone information of the target character; and adding the matched bones to the corresponding parts of the clothing model to generate the corresponding bone binding relationship.
[0067] The above-mentioned process of removing the skeletal binding relationship on the clothing model, matching the skeletal hierarchy of each part with the bones in the first skeletal information of the target character, and adding the matched bones to the corresponding parts of the clothing model to generate the corresponding skeletal binding relationship, further includes: determining the new skeletal start point and new skeletal end point of the clothing model relative to the target character model based on the skeletal binding relationship; and calculating the skeletal transformation matrix of the clothing model encapsulated in the target character model based on the new skeletal start point, the new skeletal end point, the positional relationship, and the inverse binding pose matrix.
[0068] The above-described determination of the skinning weights of the clothing model based on the first skeletal information of the target character model, the positional relationship, and the skeletal binding relationship, and binding of the clothing model based on the skeletal binding relationship and the skinning weights, includes: extracting the bone lengths of each bone of the target character model, and the bone start point and bone end point of the clothing model relative to the target character model; calculating the global envelope position of the clothing model relative to the target character based on the bone start point, the bone end point, and the positional relationship; calculating the skinning weights of the clothing model based on the global envelope position, the skeletal transformation matrix, and the corresponding bone length; and binding of the clothing model based on the skeletal binding relationship and the skinning weights.
[0069] The above-described calculation of the skinning weights of the clothing model based on the global position of the cover, the skeletal transformation matrix, and the corresponding bone length includes: calculating a decay weight based on the global position of the cover, the skeletal transformation matrix, and the corresponding bone length; and adjusting the bone weight information relative to the second skeleton information based on the decay weight to obtain the skinning weights of the clothing model.
[0070] In summary, this method involves identifying the target character model and clothing model, and then reading the corresponding pose binding records based on the clothing model. Based on these records, the correspondence between the mesh vertices and bones of the clothing model, as well as their positional relationships, are determined. The bones of the target character model are matched with the mesh vertices of the clothing model to obtain the skeletal binding relationship. Based on the first bone information, positional relationships, and skeletal binding relationship of the target character model, the skinning weights of the clothing model are determined, and the clothing model is bound based on these binding relationships and weights. This approach determines the skeletal correspondence and skinning weights from the clothing model's historical pose binding records, and binds the clothing model to a new character model based on these correspondences and weights. This achieves automatic envelope binding of clothing and also enables the cyclical use of clothing binding relationships, solving the problem of cumbersome and inefficient binding operations between existing clothing and different bones.
[0071] This embodiment also provides a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are invoked and executed by a processor, the machine-executable instructions cause the processor to perform the following steps: The process involves identifying a target character model and a clothing model, and reading the corresponding pose binding record based on the clothing model. Based on the pose binding record, the process determines the correspondence between the mesh vertices and bones of the clothing model, as well as the positional relationship between the mesh vertices and bones. Based on the correspondence, the process matches the bones on the target character model with the mesh vertices of the clothing model to obtain a bone binding relationship. Based on the first bone information of the target character model, the positional relationship, and the bone binding relationship, the process determines the skinning weights of the clothing model, and binds the clothing model based on the bone binding relationship and the skinning weights.
[0072] The above-described process of determining the target character model and clothing model, and reading the corresponding pose binding record based on the clothing model, includes: Obtain the clothing to be bound and the target character, and determine the corresponding clothing model and target character model, as well as the skeletal information corresponding to the target character based on the clothing and the target character; read the bound second skeleton information from the database for the clothing model, as well as the binding posture matrix, bone weight information and bone start and end point envelope information of the clothing model relative to the second skeleton information; calculate the binding posture inverse matrix of the clothing model to unbind the clothing model based on the binding posture matrix.
[0073] The above-mentioned determination of the correspondence between the mesh vertices and bones of the clothing model based on the pose binding record, as well as the positional relationship between the mesh vertices and bones, includes: extracting the bones and the corresponding hierarchical structure in the second skeleton information based on the binding pose matrix, and determining the mesh vertices of the clothing model based on the bones.
[0074] Based on the hierarchical structure corresponding to the skeleton, the correspondence between the mesh vertices and the skeleton of the clothing model is determined; based on the start and end point envelope information of the skeleton, the start point, end point, envelope start point, and envelope end point of the clothing model are determined; the position percentage of the envelope start point and the envelope end point relative to the start point and the end point of the skeleton is calculated to obtain the positional relationship between the mesh vertices and the skeleton.
[0075] The above-described method of matching the bones on the target character model with the mesh vertices of the clothing model based on the correspondence to obtain the bone binding relationship includes: determining the bone hierarchy of each part in the clothing model based on the correspondence; removing the bone binding relationship on the clothing model; matching the bone hierarchy of each part with the bones in the first bone information of the target character; and adding the matched bones to the corresponding parts of the clothing model to generate the corresponding bone binding relationship.
[0076] The above-mentioned process of removing the skeletal binding relationship on the clothing model, matching the skeletal hierarchy of each part with the bones in the first skeletal information of the target character, and adding the matched bones to the corresponding parts of the clothing model to generate the corresponding skeletal binding relationship, further includes: determining the new skeletal start point and new skeletal end point of the clothing model relative to the target character model based on the skeletal binding relationship; and calculating the skeletal transformation matrix of the clothing model encapsulated in the target character model based on the new skeletal start point, the new skeletal end point, the positional relationship, and the inverse binding pose matrix.
[0077] The above-described determination of the skinning weights of the clothing model based on the first skeletal information of the target character model, the positional relationship, and the skeletal binding relationship, and binding of the clothing model based on the skeletal binding relationship and the skinning weights, includes: extracting the bone lengths of each bone of the target character model, and the bone start point and bone end point of the clothing model relative to the target character model; calculating the global envelope position of the clothing model relative to the target character based on the bone start point, the bone end point, and the positional relationship; calculating the skinning weights of the clothing model based on the global envelope position, the skeletal transformation matrix, and the corresponding bone length; and binding of the clothing model based on the skeletal binding relationship and the skinning weights.
[0078] The above-described calculation of the skinning weights of the clothing model based on the global position of the cover, the skeletal transformation matrix, and the corresponding bone length includes: calculating a decay weight based on the global position of the cover, the skeletal transformation matrix, and the corresponding bone length; and adjusting the bone weight information relative to the second skeleton information based on the decay weight to obtain the skinning weights of the clothing model.
[0079] In summary, by binding the two skeletons to a new skeleton based on their height, waist-to-body ratio, skeletal matrix information, and skinning data, and by calculating the new skinning data and vertex weights based on local muscle information, the binding and weighting processes can be completed. This allows for the automatic calculation of skeletal binding and skinning weights for the matched model, solving the problem of the current cumbersome and inefficient binding operations between clothing and different skeletons.
[0080] The computer program product of the clothing-to-skeleton binding method and related equipment provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.
[0081] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0082] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.
[0083] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0084] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0085] Finally, it should be noted that the above embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for binding clothing to a skeleton, characterized in that, The binding method includes: Determine the target character model and clothing model, and read the corresponding pose binding record based on the clothing model; Based on the pose binding record, the correspondence between the mesh vertices and bones of the clothing model, as well as the positional relationship between the mesh vertices and bones, are determined; when obtaining the pose binding record, specifically, the skeletal information of the clothing model relative to the historically bound character model is obtained; The skeleton matching algorithm matches the skeletons on the target character model with the mesh vertices of the clothing model based on the correspondence to obtain the skeleton binding relationship. The skeleton matching algorithm is a matching model that has been pre-learned by a neural network to determine the skeleton structure of characters of different body types, as well as the mapping relationship and proportion adjustment relationship of different clothing on the skeleton structure. Based on the first skeletal information of the target character model, the positional relationship, and the skeletal binding relationship, the skinning weight of the clothing model is determined, and the clothing model is bound based on the skeletal binding relationship and the skinning weight.
2. The method for binding clothing to bones according to claim 1, characterized in that, The process of determining the target character model and clothing model, and reading the corresponding pose binding record based on the clothing model, includes: Obtain the clothing to be bound and the target character, and determine the corresponding clothing model and target character model, as well as the skeletal information corresponding to the target character based on the clothing and target character; Based on the clothing model, the bound second skeleton information is read from the database, as well as the binding posture matrix, bone weight information, and bone start and end cap information of the clothing model relative to the second skeleton information; The inverse matrix of the binding postures for unbinding the clothing model is calculated based on the binding posture matrix.
3. The method for binding clothing to bones according to claim 2, characterized in that, The process of determining the correspondence between mesh vertices and bones of the clothing model based on the pose binding record, and the positional relationship between mesh vertices and bones, includes: Based on the binding pose matrix, the bones and the corresponding hierarchical structure in the second skeleton information are extracted, and the mesh vertices of the clothing model are determined based on the bones; The correspondence between the mesh vertices and bones of the clothing model is determined based on the hierarchical structure corresponding to the skeleton; The skeletal start point, skeletal end point, envelope start point, and envelope end point of the clothing model are determined based on the skeletal start point, end point, envelope start point, and envelope end point. Calculate the position percentages of the envelope start point and the envelope end point relative to the bone start point and the bone end point to obtain the positional relationship between the mesh vertices and the bones.
4. The method for binding clothing to bones according to claim 3, characterized in that, The process involves using a skeletal matching algorithm to match the bones of the target character model with the mesh vertices of the clothing model based on the correspondence, thereby obtaining the skeletal binding relationship. This includes: The skeletal hierarchy of each part in the clothing model is determined based on the correspondence. Remove the skeletal binding relationships on the clothing model, match the bones in the first skeletal information of the target character based on the skeletal hierarchy of each part, and add the matched bones to the corresponding parts of the clothing model to generate the corresponding skeletal binding relationships.
5. The method for binding clothing to bones according to claim 2, characterized in that, After removing the skeletal binding relationships on the clothing model, matching the bones in the first skeletal information of the target character with the skeletal hierarchy of each part, and adding the matched bones to the corresponding parts of the clothing model to generate the corresponding skeletal binding relationships, the process further includes: Based on the skeletal binding relationship, determine the new skeletal start point and new skeletal end point of the clothing model relative to the target character model; Based on the new bone start point, the new bone end point, the positional relationship, and the binding pose inverse matrix, the bone transformation matrix of the clothing model encapsulated in the target character model is calculated.
6. The method for binding clothing to bones according to claim 5, characterized in that, The process of determining the skinning weights of the clothing model based on the first skeletal information of the target character model, the positional relationships, and the skeletal binding relationships, and binding the clothing model based on the skeletal binding relationships and the skinning weights, includes: Extract the bone length of each bone in the target character model, as well as the start and end points of the bones of the clothing model relative to the target character model; Based on the bone start point, the bone end point, and the positional relationship, the global position of the clothing model relative to the target character's cover is calculated; Based on the global position of the cover, the bone transformation matrix, and the corresponding bone length, the skinning weight of the clothing model is calculated; The clothing model is bound based on the skeletal binding relationship and the skin weight.
7. The method for binding clothing to bones according to claim 6, characterized in that, The calculation of the skinning weights of the clothing model based on the global position of the envelope, the skeletal transformation matrix, and the corresponding skeletal length includes: Based on the global position of the envelope, the bone transformation matrix, and the corresponding bone length, the attenuation weight is calculated; The bone weight information relative to the second skeleton information is adjusted based on the attenuation weight to obtain the skin weight of the clothing model.
8. A binding device for clothing and skeleton, characterized in that, The garment-skeleton binding device includes: The reading module is used to determine the target character model and clothing model, and read the corresponding pose binding record based on the clothing model; The determination module is used to determine the correspondence between the mesh vertices and bones of the clothing model, as well as the positional relationship between the mesh vertices and bones, based on the pose binding record; specifically, when obtaining the pose binding record, the module obtains the skeleton information of the clothing model relative to the historically bound character model. The matching module is used to match the bones on the target character model with the mesh vertices of the clothing model based on the correspondence using a skeletal matching algorithm to obtain a skeletal binding relationship. The skeletal matching algorithm is a matching model that has been pre-learned by a neural network to determine the skeletal structure of characters of different body types, as well as the mapping relationship and proportional adjustment relationship of different clothing on the skeletal structure. The binding module is used to determine the skinning weights of the clothing model based on the first skeletal information of the target character model, the positional relationship, and the skeletal binding relationship, and to bind the clothing model based on the skeletal binding relationship and the skinning weights.
9. A garment-to-skeleton binding device, characterized in that, The garment-to-skeleton binding device includes: a memory and at least one processor, wherein the memory stores instructions; The at least one processor invokes the instructions in the memory to cause the garment-to-skeleton binding device to perform the steps of the garment-to-skeleton binding method as described in any one of claims 1-7.
10. A computer-readable storage medium storing instructions thereon, characterized in that, When the instructions are executed by the processor, they implement the steps of the clothing-to-skeleton binding method as described in any one of claims 1-7.
Citation Information
Patent Citations
Implementation method of skinned skeletal animation
CN104021584A
Virtual role model creation method and device, electronic equipment and storage medium
CN112712578A
