Object skin method and device and figure skin method and device for virtual scene
By calculating the distance and topological relationship between visual points and bones, the target bone chain is generated, and the machine learning network is used to predict the skin weight, the problem of visual points incorrectly binding bones is solved, and the accuracy and sense of reality of skin is improved.
Patent Information
- Application Number
- CN202411439395.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-01-10
AI Technical Summary
In the prior art, due to factors such as alignment error, object model and/or visual model pose changes, the visual point is incorrectly bound to the bone, and the prediction of the skin weight of the visual point relative to the bone is insufficient, and the high accuracy is lacking. Object skin method of degree.
By obtaining the object model and visual model, calculate the distance between visual points and bones, and generate target bone chains based on distance and topological relationships. Pre-trained machine learning networks are used to predict skin weights to ensure the precise binding between visual points and bones. Determine the relationship.
Improves the accuracy of skin weights and the realism of object skins, avoids the situation where visual points are incorrectly bound to bones, and improves the skin effect.
Smart Images

Figure CN119295617A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present specification relate to the field of computer technology, and more particularly to a method and device for skinning an object and a character in a virtual scene. Background Art
[0002] With the development of computer technology, the action driving of visual objects is completed by means of bone constraints, that is, the skin weight of the visual point on the visual model is set relative to the bone on the object model, and the target object is skinned based on the skin weight. In this way, when the bone moves, the visual point of the visual model associated with it will also move accordingly, thereby achieving a smooth and natural animation effect. For example, in a game or animation scene, the skin weight of the clothing point on the virtual character's clothes is set relative to the bone, and the virtual character is skinned, making the virtual character's movements more realistic and coherent.
[0003] At present, skin weights are mainly set manually, which is time-consuming, inefficient and requires high professional quality. Using automatic prediction to predict skin weights can improve the efficiency of object skinning. For example, using AI (Artificial Intelligence) technology to predict skin weights to achieve automatic object skinning has officially become a mature direction for AI to be applied in industry, and has also been widely used in workflows such as game production and animation production.
[0004] However, due to factors such as alignment errors, pose changes of the object model and / or visual model, the distance may be inaccurate, resulting in the visual point being incorrectly bound to the skeleton, and the prediction of the skinning weight of the visual point relative to the skeleton is not accurate enough. Therefore, a highly accurate object skinning method is urgently needed. Summary of the invention
[0005] In view of this, an embodiment of the present specification provides an object skinning method. One or more embodiments of the present specification also relate to a method for skinning a character in a virtual scene, an object skinning device, a character skinning device in a virtual scene, a computing device, a computer-readable storage medium, and a computer program product to solve the technical defects existing in the prior art.
[0006] According to a first aspect of an embodiment of this specification, there is provided an object skinning method, comprising: Acquire an object model and a visual model of the target object, wherein the object model includes the bone position of each bone in the target object and a first topological relationship of each bone, and the visual model includes the visual point position of each visual point and a second topological relationship of each visual point; According to the positions of each bone and each visual point, the distance of each visual point relative to each bone is calculated; Generate a target skeleton chain corresponding to each visual point according to the distance, the first topological relationship and the second topological relationship; According to the target skeleton chain, the skin weight of each visual point is predicted, and the target object is skinned based on the skin weight.
[0007] According to a second aspect of an embodiment of this specification, a method for skinning a character in a virtual scene is provided, comprising: Acquire a character model and a clothing model of a virtual character in a virtual scene, wherein the character model includes the bone position of each bone in the virtual character and the third topological relationship of each bone, and the clothing model includes the clothing point position of each clothing point and the fourth topological relationship of each clothing point; According to the positions of each bone and each clothing point, the distance of each clothing point relative to each bone is calculated; Generate a target skeleton chain corresponding to each clothing point according to the distance, the third topological relationship and the fourth topological relationship; According to the target skeleton chain, the pre-trained machine learning network is used to predict the skin weight of each clothing point, and the virtual character is skinned based on the skin weight.
[0008] According to a third aspect of an embodiment of this specification, there is provided an object skinning device, comprising: A first acquisition module is configured to acquire an object model and a visual model of the target object, wherein the object model includes a bone position of each bone in the target object and a first topological relationship of each bone, and the visual model includes a visual point position of each visual point and a second topological relationship of each visual point; A first calculation module is configured to calculate the distance of each visual point relative to each skeleton according to the position of each skeleton and the position of each visual point; A first generating module is configured to generate a target skeleton chain corresponding to each visual point according to the distance, the first topological relationship, and the second topological relationship; The first skinning module is configured to predict the skin weight of each visual point according to the target skeleton chain, and perform skinning processing on the target object based on the skin weight.
[0009] According to a fourth aspect of the embodiments of this specification, a character skinning device for a virtual scene is provided, comprising: A second acquisition module is configured to acquire a character model and a clothing model of a virtual character in a virtual scene, wherein the character model includes a bone position of each bone in the virtual character and a third topological relationship of each bone, and the clothing model includes a clothing point position of each clothing point and a fourth topological relationship of each clothing point; A second calculation module is configured to calculate the distance of each clothing point relative to each skeleton according to the position of each skeleton and the position of each clothing point; The second generation module is configured to generate a target skeleton chain corresponding to each clothing point according to the distance, the third topological relationship and the fourth topological relationship; The second skinning module is configured to predict the skinning weight of each clothing point according to the target skeleton chain using a pre-trained machine learning network, and skin the virtual character based on the skinning weight.
[0010] According to a fifth aspect of an embodiment of this specification, a computing device is provided, including: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the above method are implemented.
[0011] According to a sixth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores a computer program / instruction, and the steps of the above method are implemented when the computer program / instruction is executed by a processor.
[0012] According to a seventh aspect of the embodiments of this specification, a computer program product is provided, comprising a computer program / instruction, which implements the steps of the above method when executed by a processor.
[0013] In one embodiment of the present specification, an object model and a visual model of a target object are obtained, and the distance of each visual point relative to each bone is calculated based on the bone position of each bone in the object model and the visual point position of each visual point in the visual model, and the spatial relationship between each visual point and each bone is accurately measured. Then, based on the distance, the first topological relationship of each bone and the second topological relationship of each visual point, a target bone chain corresponding to each visual point is generated, and a precise binding relationship between the visual point and the bone is established to avoid the situation where the visual point is incorrectly bound to the bone. According to the target bone chain, the skin weight of each visual point is predicted, and the accuracy of the predicted skin weight is improved. The target object is skinned based on the skin weight, and the skinning effect of the object skinning is improved, and the realism of the object skinning is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 is a flow chart of an object skinning method provided by one embodiment of this specification; Figure 2 is a schematic diagram of an object model and a visual model of a target object in an object skinning method provided by an embodiment of the present specification; Figure 3 is a schematic diagram of a skeleton chain in an object skinning method provided by an embodiment of the present specification; Figure 4is a schematic diagram of a skeleton chain in another object skinning method provided by an embodiment of the present specification; Figure 5 is a schematic diagram of distance in an object skinning method provided by an embodiment of this specification; Figure 6 It is a flow chart of a method for skinning a character in a virtual scene provided by an embodiment of this specification; Figure 7 is a process flow chart of an object skinning method applied to a game development scenario provided by an embodiment of the present specification; Figure 8 is a schematic structural diagram of an object skinning device provided by an embodiment of the present specification; Fig. 9 It is a structural schematic diagram of a character skinning device for a virtual scene provided by an embodiment of the present specification; Fig.10 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION
[0015] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.
[0016] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0017] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0018] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0019] Currently, the main method for automatically predicting skin weights is to align the object model and the visual model, calculate the distance of each visual point relative to each bone, and predict the skin weight of each visual point based on the distance. For example, based on the distance, a pre-trained machine learning network is used to predict the skin weight of each visual point.
[0020] However, due to factors such as alignment errors, pose changes of the object model and / or the visual model, there may be errors in the distance, resulting in the visual point being incorrectly bound to the skeleton and the problem of insufficient accuracy in predicting the skinning weights of the visual point relative to the skeleton.
[0021] In response to the above problems, an object skinning method is provided in the present specification. The present specification also relates to a character skinning method for a virtual scene, an object skinning device, a character skinning device for a virtual scene, a computing device, a computer-readable storage medium and a computer program product, which are described in detail one by one in the following embodiments.
[0022] See also Figure 1 , Figure 1 A flowchart of an object skinning method provided according to an embodiment of the present specification is shown, comprising the following specific steps: Step 102: Acquire an object model and a visual model of the target object, wherein the object model includes the bone position of each bone in the target object and the first topological relationship of each bone, and the visual model includes the visual point position of each visual point and the second topological relationship of each visual point.
[0023] This specification is applied to applications, websites or system platforms with object skinning functions. It can be an animation engine application that generates a target object based on the skeletal motion information of multiple bones of the target object, including but not limited to: Unity, Unreal Engine, Maya, 3DS Max, Blender. It can also be an animation generation application for movies and TV commercials, a game production application for games, an engineering simulation application for engineering design, and an educational and scientific research application for education and scientific research, which are not limited here. It should be noted that the embodiments of this specification are applied to the editor mode stage, not the runtime stage of the animation.
[0024] The target object is a physical object in a virtual scene, such as an animated character, animal, or object in a two-dimensional animation (2D animation) or three-dimensional animation (3D animation). There is at least one target object, for example, three characters and their objects in an animation are all target objects.
[0025] The object model of the target object is the spatial model of the target object in the virtual scene space, which is composed of multiple vertices. The vertices form polygonal faces to describe the shape and appearance characteristics of the target object. The object model of the target object can be moved or deformed in the virtual scene space. The object model includes but is not limited to: a skeleton model. For example, a character model, an animal model, a plant model, an item model, a building model, etc. in a three-dimensional animation (3D animation) scene space. The object model includes multiple bones, and the bones control the movement of model vertices within a certain range. For example, a character in a three-dimensional animation has multiple bones such as a head, a trunk, and limbs. Each bone has a corresponding bone position, and each bone has a first topological relationship. For example, in a Unity application, after aligning the object model and the visual model of the target object, the bone position of a certain bone is: (X, Y, Z), and the first topological relationship between the three bones is: upper arm bone 1-lower arm bone 1.1-hand bone 1.1.3.
[0026] The visual model is a spatial model of the visual appearance of the target object in the virtual scene space. It is composed of multiple visual points. The visual points form a polygonal surface to describe the shape and appearance characteristics of the visual appearance of the target object. The visual model can move or deform as the object model of the target object moves or deforms in the virtual scene space. The visual point model includes but is not limited to: mesh model, voxel model, texture model and UV map model. For example, the clothing model of the character, the object model of the character, the skin model of the character, the fur model of the animal, the appearance model of the plant, the appearance model of the object, the appearance model of the building, etc. in the scene space of three-dimensional animation (3D animation). Multiple visual points on the visual model need to be tied to the bones on the object model, that is, the skin weight of the visual point is set. Each visual point has a corresponding visual point position, and each visual point has a second topological relationship. For example, in the Unity application, after aligning the object model and the visual model of the target object, the visual point position of a certain visual point is: (x, y, z), and the second topological relationship between the three visual points is: visual point 1-visual point 2-visual point 3.
[0027] Optionally, the object model and the visual model of the target object are aligned object model and visual model of the target object.
[0028] Correspondingly, to obtain the object model and visual model of the aligned target object, one optional method is to obtain the object model and visual model of the target object, and manually align the object model and the visual model to obtain the object model and the visual model of the aligned target object, for example, manually drag or manually input the model position of the object model and / or the visual model to align the object model and the visual model, another optional method is to obtain the object model and the visual model of the target object, and automatically align the object model and the visual model to obtain the object model and the visual model of the aligned target object, for example, in Unity application, you can use the "Blend Shapes" and / or "Skinning" tools for automatic alignment. For another example, in Maya application, you can use the "SkinCluster" tool for automatic alignment. This is not limited here.
[0029] The bone position of a bone is the coordinate position of the bone in the virtual scene space. The bone position is the data basis for representing the posture of the object model. By adjusting the bone position, the bone is moved. The movement of each bone can achieve the animation effect of the target object moving. For example, the bone position of the arm bone in the character model is (10, 20, 5), which represents the coordinate of the bone in the virtual scene space.
[0030] The first topological relationship is a hierarchical topological structure between the bones. The first topological relationship is usually determined according to the connection method between the bones. For example, the character model includes upper arm bone 1, lower arm bone 1.1, and hand bone 1.1.3. Since the upper arm bone 1 is connected to the lower arm bone 1.1, and the lower arm bone 1.1 is connected to the hand bone 1.1.3, the first topological relationship can be expressed as: upper arm bone 1-lower arm bone 1.1-hand bone 1.1.3.
[0031] The visual point position is the coordinate position of the visual point in the virtual scene space. The visual point position is the data basis for representing the posture of the visual point model. By adjusting the visual point position, the visual point is moved. The movement of each visual point can achieve the animation effect of moving or deforming the visual appearance of the target object. For example, the visual point position of the cuff clothing point in the clothing model is (12, 21, 7), which represents the coordinates of the cuff clothing point in the virtual scene space.
[0032] The second topological relationship is the hierarchical topological structure between the visual points. The second topological relationship is usually determined based on the geometric structure of the appearance vision. For example, visual point 1, visual point 2 and visual point 3 form a plane. The three visual points jointly define the edge of a plane. The second topological relationship can be expressed as: visual point 1-visual point 2-visual point 3.
[0033] Figure 2 A schematic diagram showing an object model and a visual model of a target object in an object skinning method provided by an embodiment of the present specification is shown. Figure 2 As shown: The aligned 3D character skeleton model and clothing mesh model. The skeleton model of the character simulates the human skeleton structure, including arm skeletons, palm skeletons and finger skeletons, each skeleton has a corresponding skeleton position, and each skeleton has a first topological relationship. The clothing mesh model simulates the shape and geometric structure of the clothing, including multiple visual points, which form a polygonal mesh for representing the visual details of the clothing. The mesh model includes visual point A at the arm position and visual point B at the hand position.
[0034] For example, during the game development process, a skeleton model of character A and a mesh model of clothing a to be adapted for character A are obtained from the model library. The skeleton model includes 200 bones, and the 200 bones have a first topological relationship. The mesh model of clothing a includes 3,000 visual points, and the 3,000 visual points have a second topological relationship. In the Unity application, the above skeleton model and mesh model are imported, and the skeleton model and mesh model are automatically aligned using "Blend Shapes" to obtain the aligned skeleton model and mesh model. At this time, the 200 bones have a skeleton position in the virtual scene space ( , , ),in , 3000 visual points have visual point positions in the virtual scene space ( , , ),in .
[0035] Obtaining the object model and visual model of the target object provides a positional basis for subsequent distance calculation and provides structural relationship support for the bones or visual points on the model for subsequent generation of the target skeleton chain.
[0036] Step 104: Calculate the distance of each visual point relative to each bone according to the position of each bone and the position of each visual point.
[0037] The distance of the visual point relative to the bone is the spatial distance between the visual point and the bone in the virtual scene space. The distance is the basis for calculating the skin weight, which is used to determine which bone has a higher correlation with the visual point, thereby determining how the visual point moves or deforms accordingly when the bone changes. The distance of the visual point relative to the bone includes but is not limited to: straight-line distance, Manhattan distance, shortest path distance, tangent space distance, and geodesic distance.
[0038] For example, straight-line distance is the most direct spatial distance.
[0039] For example, for Manhattan distance, the surface suitable for the model consists of multiple planes and the distance needs to be calculated along a specific path.
[0040] For example, for models with complex hollow structures, such as clothing models with hollow structures, using the shortest path distance can help more accurately evaluate the distance between the visual point and the skeleton.
[0041] For example, tangent space distance is useful when the surface of the model has highly nonlinear features, such as wrinkled clothing or complex animal fur models, where using tangent space distance can improve the accuracy of skin weight prediction.
[0042] For example, for geodesic distance, it is suitable for situations where the surface geometry of the model needs to be considered, such as a clothing model that requires realistic details.
[0043] For example, according to the position of each bone [( , , ),in ] and the position of each visual point [( , , ),in ], calculate the geodesic distance d of 3000 visual points relative to 200 skeletons.
[0044] According to the positions of each bone and each visual point, the distance of each visual point relative to each bone is calculated, and the spatial relationship between each visual point and each bone is accurately measured, providing spatial relationship support for the subsequent generation of the target bone chain.
[0045] Step 106: Generate a target skeleton chain corresponding to each visual point according to the distance, the first topological relationship and the second topological relationship.
[0046] The target bone chain corresponding to the visual point is a collection of multiple bones bound to the visual point. Optionally, each bone in the target bone chain is arranged according to a first topological relationship, and can control the movement of the visual point bound thereto. For example, the arm of a character model is composed of three main bones: an upper arm bone, a lower arm bone, and a hand bone. It is necessary to set skin weights for each visual point on the visual model of the character's gloves. Then, each visual point on the gloves corresponds to a target bone chain, and the target bone chain includes an upper arm bone, a lower arm bone, and a hand bone. This means that each point on the glove moves with the movement of the bones in this bone chain to ensure that the glove moves or deforms naturally with the movement or deformation of the arm.
[0047] With the above Figure 2 For example, using Figure 3 and Figure 4 The bone chains are described below.
[0048] in, Figure 3 A schematic diagram of a skeleton chain in an object skinning method provided by an embodiment of the present specification is shown. Figure 3 As shown: for Figure 2 For the visual point A at the middle arm position, the target bone chain corresponding to the visual point A is: upper arm - forearm - hand, such as Figure 3 Indicated by the white line.
[0049] in, Figure 4 A schematic diagram of a skeleton chain in another object skinning method provided by an embodiment of the present specification is shown. Figure 4 As shown: for Figure 2 For the visual point B at the hand position, the target bone chain corresponding to the visual point B is: hand - finger 0 - finger 1 - finger 2. Figure 4 Indicated by the white line.
[0050] A target skeleton chain corresponding to each visual point is generated according to the distance, the first topological relationship and the second topological relationship. An optional method is: according to the distance, the first topological relationship and the second topological relationship, a target skeleton chain composed of target bones related to each visual point is determined. For example, for a visual point, its nearest bone is bone 1, and the first topological relationship indicates that bone 1 is connected to bone 2, and bone 2 is connected to bone 3. Then the target skeleton chain corresponding to the visual point is: bone 1-bone 2-bone 3. For another example, for a visual point, a weighted calculation is performed according to the distance between the visual point and each bone, the first topological relationship and the second topological relationship, and the target skeleton chain composed of target bones related to each visual point is determined to be: bone 1-bone 2-bone 3. Another optional method is: using a pre-trained machine learning network, according to the distance, the first topological relationship and the second topological relationship, a target skeleton chain corresponding to each visual point is generated. For example, for a visual point, the distance between the visual point and each bone, the first topological relationship and the second topological relationship are input into the pre-trained machine learning network, and the target skeleton chain corresponding to the visual point is predicted to be: bone 1-bone 2-bone 3, which is not limited here.
[0051] Exemplarily, according to the geodesic distance d of the 3000 visual points relative to the 200 bones, the first topological relationship between the 200 bones, and the second topological relationship between the 3000 visual points, 3000 target bone chains consisting of target bones associated with the 3000 visual points are determined.
[0052] According to the distance, the first topological relationship and the second topological relationship, a target skeleton chain corresponding to each visual point is generated, and an accurate binding relationship between the visual point and the skeleton is established to avoid the situation where the visual point is incorrectly bound to the skeleton.
[0053] Step 108: predict the skin weight of each visual point according to the target skeleton chain, and perform skinning processing on the target object based on the skin weight.
[0054] The skin weight of a visual point is the degree of influence of the position of the visual point relative to the bound bones. When the bones move, the visual point follows the movement of the bones. Usually, a visual point can be bound to multiple bones, and different bones have different degrees of influence on the position of the same visual point. The skin weight of a visual point is usually expressed as a collection of multiple weights. For example, for a visual point, the visual point is bound to bones 1, 2, and 3, and the skin weights of the three bones for the visual point are 0.6, 0.2, and 0.2, respectively, which means that when bones 1, 2, and 3 move at the same time, the visual point will follow bone 1 more and follow bones 2 and 3 less. The skin weight ensures that the visual point can move reasonably with the movement of the bones, thereby producing a smooth and natural animation effect.
[0055] Skinning is the process of setting skin weights for visual points. For example, in a Unity application, you can use tools or scripts in the editor to set the skin weights of the bones bound to each visual point.
[0056] Optionally, the method of predicting the skin weight of each visual point includes, but is not limited to: using a machine learning network to predict, using a linear regression algorithm to predict, which is not limited here.
[0057] According to the target skeleton chain, the skin weight of each visual point is predicted. An optional method is: according to each bone position, the first topological relationship, each visual point position, the second topological relationship, at least one of the distance, and the target skeleton chain, the skin weight of each visual point is predicted.
[0058] Exemplarily, according to each bone position [bone position ( , , ),in ], the first topological relationship, the position of each visual point [( , , ),in ], the second topological relationship, the geodesic distance d of 3000 visual points relative to 200 bones, and 3000 target bone chains, use the pre-trained machine learning network to predict the skin weights of 3000 visual points, and use the tools or scripts in the editor to set the skin weights of the bones bound to each visual point.
[0059] In the illustrated embodiment, an object model and a visual model of a target object are obtained, and the distance of each visual point relative to each bone is calculated based on the bone position of each bone in the object model and the visual point position of each visual point in the visual model, so as to accurately measure the spatial relationship between each visual point and each bone, and then a target bone chain corresponding to each visual point is generated based on the distance, the first topological relationship of each bone and the second topological relationship of each visual point, and an accurate binding relationship between the visual point and the bone is established to avoid the situation where the visual point is incorrectly bound to the bone, and the skin weight of each visual point is predicted based on the target bone chain, so as to improve the accuracy of the predicted skin weight, and the target object is skinned based on the skin weight, so as to improve the skinning effect of the object skinning and the realism of the object skinning.
[0060] In an optional embodiment of the present specification, step 104 includes the following specific steps: Determine the visual relationship between each skeleton and each visual point according to the position of each skeleton and the position of each visual point, wherein the visual relationship includes a visible relationship and an invisible relationship; According to the visual relationship, the positions of each bone and each visual point, the distance of each visual point relative to each bone is calculated.
[0061] The visual relationship between the skeleton and the visual point is the line of sight accessibility relationship between the skeleton and the visual point in the virtual scene space, which represents whether there is an occlusion state between the skeleton and the visual point by other model points (model vertices, visual points or skeletons).
[0062] If there is no other model point blocking the line of sight from a visual point to a certain bone, then it is considered that there is a visible relationship between the visual point and the bone. For example, in a virtual character model, if a visual point is located on the surface of a double-layer clothing, and the inner layer of the clothing is not blocked, then there is a visible relationship between the visual point and the character's arm bone.
[0063] If there are other model points that block the line of sight from a visual point to a certain bone, then it is considered that there is an invisible relationship between the visual point and the bone. For example, in a virtual character model, if a visual point is located on the inner layer of a double-layer clothing, and the outer layer of the clothing blocks the character's arm bone, then there is an invisible relationship between the visual point and the character's arm bone.
[0064] According to the visual relationship, the position of each bone and the position of each visual point, the distance of each visual point relative to each bone is calculated. An optional method is: if the visual relationship between the bone and the visual point is a visible relationship, the distance of the visual point relative to the bone is calculated according to the bone position of the bone and the visual point position of the visual point; if the visual relationship between the bone and the visual point is an invisible relationship, the distance of the visual point relative to the bone is indirectly calculated according to the bone position of the adjacent visible bone or the visual point position of the adjacent visible visual point and the visual point position of the visual point.
[0065] For example, if the visual relationship between bone 1 and visual point 1 is a visible relationship, according to the bone position of bone 1 ( , , ) and the visual point position of visual point 1 ( , , ), calculate the geodesic distance of visual point 1 relative to bone 1 , if the visual relationship between bone 2 and visual point 2 is an invisible relationship, according to the visual point position of the adjacent visible visual point 3 ( , , ), and the visual point position of visual point 2 ( , , ), indirectly calculate the geodesic distance of the visual point 2 relative to the skeleton 2 .
[0066] In the embodiments of this specification, for object models and visual models with complex structures, the distance of each visual point relative to each bone is calculated by using visual relationships, which fully considers the structure of the model, more accurately measures the spatial relationship between each visual point and each bone, and provides more accurate spatial relationship support for the subsequent generation of the target skeleton chain.
[0067] Figure 5 A schematic diagram of distance in an object skinning method provided by an embodiment of this specification is shown, such as Figure 5 As shown: The aligned 3D character skeleton model and clothing mesh model. The skeleton model of the character simulates the human skeleton structure, including leg and foot bones, and the clothing mesh model simulates the shape and geometric structure of the clothing, including multiple visual points, which form a polygonal mesh to represent the visual details of the clothing.
[0068] The calf bone is point B, the previous visual point on the outer layer of the clothing mesh model is point A, and the previous visual point on the inner layer of the clothing mesh model is point C.
[0069] The relationship between point A and point B is invisible, and the relationship between point C and point B is visible.
[0070] In an optional embodiment of the present specification, each skeleton includes a first skeleton, and each visual point includes a first visual point; Correspondingly, according to the visual relationship, the positions of the bones and the positions of the visual points, the distances of the visual points relative to the bones are calculated, including the following specific steps: If the visual relationship between the first skeleton and the first visual point is a visible relationship, the spatial distance of the first visual point relative to the first skeleton is calculated according to the skeleton position of the first skeleton and the visual point position of the first visual point.
[0071] The first skeleton is any one of multiple skeletons in the object model, and the first visual point is any one of multiple visual points in the visual model.
[0072] For example, Figure 5 As shown, point B is the first skeleton, point C is the first visual point, and there is a visible relationship between point C and point B. According to the skeleton position of point B and the visual point position of point C, the spatial distance d of point C relative to point B is calculated, and the spatial distance d is relatively close.
[0073] In the embodiments of this specification, the distance of each visual point relative to each bone is directly calculated by introducing a visually visible relationship. This not only takes into account the physical distance between the bone and the visual point, but also combines the line of sight accessibility between the two. This fully considers the structure of the model, and more accurately measures the spatial relationship between each visual point and each bone, providing more accurate spatial relationship support for the subsequent generation of the target bone chain.
[0074] In an optional embodiment of the present specification, each skeleton includes a first skeleton, and each visual point includes a first visual point and a second visual point; According to the visual relationship, the positions of the bones and the visual points, the distances of the visual points relative to the bones are calculated, including the following specific steps: If the visual relationship between the first skeleton and the first visual point is an invisible relationship, and the visual relationship between the first skeleton and the second visual point is a visible relationship, a first distance of the first visual point relative to the second visual point is calculated according to the visual point position of the first visual point and the visual point position of the second visual point, and a second distance of the second visual point relative to the first skeleton is calculated according to the skeleton position of the first skeleton and the visual point position of the second visual point; A spatial distance of the first visual point relative to the first skeleton is determined according to the first distance and the second distance.
[0075] The first skeleton is any one of the multiple skeletons in the object model, the first visual point is any one of the multiple visual points in the visual model, and the second visual point is one of the multiple visual points in the visual model except the first visual point. Optionally, the first visual point and the second visual point are close to each other.
[0076] Based on the first distance and the second distance, determine the spatial distance of the first visual point relative to the first skeleton. One optional method is: take a weighted sum of the first distance and the second distance to obtain the spatial distance of the first visual point relative to the first skeleton. Another optional method is: calculate the sum of the first distance and the second distance to obtain the spatial distance of the first visual point relative to the first skeleton. This is not limited here.
[0077] For example, Figure 5 As shown, point B is the first skeleton, point A is the first visual point, point C is the second visual point, point A and point B are in an invisible relationship, and point C and point B are in a visible relationship. According to the visual point position of point A and the visual point position of point C, the surface distance d1 of point A relative to point C is calculated, and according to the skeleton position of point B and the visual point position of point C, the surface distance d2 of point C relative to point B is calculated. The sum of the surface distance d1 and the surface distance d2 is calculated: d1+d2, and the spatial distance d=d1+d2 of point A relative to point B is obtained, which is a longer distance.
[0078] In the embodiments of this specification, the distance of each visual point relative to each bone is indirectly calculated by introducing a visually invisible relationship. This not only takes into account the physical distance between the bone and the visual point, but also combines the line of sight accessibility between the two. This fully considers the structure of the model, and more accurately measures the spatial relationship between each visual point and each bone, providing more accurate spatial relationship support for the subsequent generation of the target bone chain.
[0079] In an optional embodiment of the present specification, step 106 includes the following specific steps: Determine a target skeleton associated with each visual point according to the distance, the first topological relationship, and the second topological relationship; Combine the target bones to generate the target bone chain corresponding to each visual point.
[0080] The target bone is a bone bound to a visual point, and the target bone can control the movement of the visual point bound to it. For example, the arm of a character model consists of three main bones: the upper arm bone, the lower arm bone, and the hand bone. It is necessary to bind a target bone to a visual point on the visual model of the character's glove, including the upper arm bone, the lower arm bone, and the hand bone, which means that each point on the glove moves with the movement of the target bone to ensure that the glove moves or deforms naturally with the movement or deformation of the arm.
[0081] According to the distance, the first topological relationship and the second topological relationship, the target skeleton related to each visual point is determined. An optional method is: according to the distance, the first target skeleton related to each visual point space is determined, according to the first topological relationship and the second topological relationship, the second target skeleton related to the first target skeleton structure is determined, and the target skeleton related to each visual point is obtained. Among them, according to the distance, the first target skeleton related to each visual point space is determined, which can be determined by sorting according to the distance, or by comparing the distance with a preset distance threshold, which is not limited here.
[0082] Combining the target bones to generate a target bone chain corresponding to each visual point, an optional way is: combining the target bones according to the first topological relationship to generate a target bone chain corresponding to each visual point.
[0083] Exemplarily, based on the geodesic distance d of the 3000 visual points relative to the 200 bones, the first topological relationship between the 200 bones, and the second topological relationship between the 3000 visual points, a first target bone spatially related to the 3000 visual points is determined, and based on the first topological relationship and the second topological relationship, a second target bone related to the first target bone structure is determined to obtain the target bones related to the 3000 visual points, and according to the first topological relationship, the target bones are combined to generate 3000 target bone chains corresponding to each visual point.
[0084] In the embodiments of the present specification, the target skeleton associated with each visual point is determined based on the distance, the first topological relationship and the second topological relationship to avoid the situation where the visual point is incorrectly bound to the skeleton, and the target skeletons are combined to generate a target skeleton chain corresponding to each visual point, thereby establishing an accurate binding relationship between the visual point and the skeleton.
[0085] In an optional embodiment of the present specification, in step 108, predicting the skin weight of each visual point according to the target skeleton chain includes the following specific steps: The skin weight of each visual point is predicted according to the position of each bone, the first topological relationship, the position of each visual point, the second topological relationship, the distance and the target bone chain.
[0086] Exemplarily, according to each bone position [bone position ( , , ),in ], the first topological relationship, the position of each visual point [( , , ),in ], the second topological relationship, the geodesic distance d of 3000 visual points relative to 200 bones, and 3000 target bone chains, and use the linear regression algorithm to predict the skin weights of 3000 visual points.
[0087] In the embodiments of the present specification, various factors such as the position of each bone, the first topological relationship, the position of each visual point, the second topological relationship, the distance and the target bone chain are comprehensively considered to predict the skinning weight of each visual point, thereby improving the accuracy and reliability of the prediction, better adapting to complex and changeable models, further improving the skinning effect of the object skinning, and further improving the realism of the object skinning.
[0088] At present, the main method of automatically predicting skin weights is to align the object model and the visual model, calculate the distance of each visual point relative to each bone, train the machine learning network based on the distance, and predict the skin weight of each visual point for new automatic skin binding requirements after the model is trained. The above method relies solely on distance, and there may be errors in the distance on complex and changing appearances, which may lead to the situation where the visual point is incorrectly bound to the bone, and the problem of insufficient accuracy in predicting the skin weight of the visual point relative to the bone.
[0089] In view of the above problem, in an optional embodiment of the present specification, in step 108, predicting the skin weight of each visual point according to the target skeleton chain includes the following specific steps: According to the target skeleton chain, the skinning weight of each visual point is predicted using a pre-trained machine learning network.
[0090] The machine learning network is a pre-trained neural network for predicting skin weights. The machine learning network can receive multiple inputs (at least one of the positions of each bone, the first topological relationship, the positions of each visual point, the second topological relationship, the distance, and the target bone chain), and automatically predict the appropriate skin weight by learning the relationship between the input and the skin weight. In order for the machine learning network to accurately predict the skin weight, a large amount of sample data is required for training, and the machine learning network optimizes its network parameters during the training process. The machine learning network includes but is not limited to: Convolutional Neural Network (CNN), Recurrent Neural Network (RNN), Long Short-Term Memory Network (LSTM), Fully Connected Network (FCN), Multi-Layer Perceptron (MLP), Deep Self-Attention (Transformer) Architecture Network and Generative Network (such as Generative Adversarial Network (GAN), Generative Pre-trained Deep Self-Attention Network (GPT)).
[0091] According to the target skeleton chain, a pre-trained machine learning network is used to predict the skin weight of each visual point. An optional method is: according to each bone position, the first topological relationship, each visual point position, the second topological relationship, at least one of the distances, and the target skeleton chain, a pre-trained machine learning network is used to predict the skin weight of each visual point.
[0092] Exemplarily, according to each bone position [bone position ( , , ),in ], the first topological relationship, the position of each visual point [( , , ),in ], the second topological relationship, the geodesic distance d of 3000 visual points relative to 200 bones, and 3000 target bone chains, and use the pre-trained machine learning network to predict the skin weights of 3000 visual points.
[0093] In the embodiments of the present specification, the skin weights of each visual point are predicted based on the precise binding relationship between the visual point and the bones in the target skeleton chain, thereby avoiding the problem of inaccurate prediction when the visual point is incorrectly bound to the bones, improving the accuracy of the predicted skin weights, and improving the efficiency of predicting the skin weights.
[0094] In an optional embodiment of the present specification, before predicting the skin weight of each visual point using a pre-trained machine learning network according to the target skeleton chain, the following specific steps are also included: Acquire a sample object model and a sample visual model of the sample object, wherein each sample visual point of the sample visual model has a sample skeleton chain relative to a sample skeleton of the sample object model, and each sample visual point has a label skinning weight; According to the sample skeleton chain, the predicted skin weight of each sample visual point is predicted using a machine learning network; Calculate the loss value based on the predicted skin weight and the label skin weight; Based on the loss value, the network parameters of the machine learning network are adjusted to obtain a trained machine learning network.
[0095] The sample object is a physical object in a virtual scene used to train a machine learning network, and there is at least one sample object.
[0096] The sample object model is a spatial model of the sample object used as sample data in the virtual scene space, which is composed of multiple vertices. The vertices form a polygonal surface to describe the shape and appearance characteristics of the sample object. The sample object model of the sample object can be moved or deformed in the virtual scene space. The sample object model includes but is not limited to: a skeleton model. The sample object model includes multiple sample skeletons, and the sample skeleton controls the movement of model vertices within a certain range.
[0097] The sample visual model is a spatial model of the visual appearance of a sample object used as sample data in a virtual scene space. It is composed of multiple sample visual points. The sample visual points constitute a polygonal surface to describe the shape and appearance characteristics of the visual appearance of the sample object. The sample visual model can move or deform as the sample object model moves or deforms in the virtual scene space. The sample visual point model includes but is not limited to: mesh model, voxel model, texture model and UV map model.
[0098] The sample skeleton chain is a collection of multiple sample skeletons bound to sample visual points and used as sample data. Optionally, each sample skeleton in the sample skeleton chain is arranged according to a first topological relationship and can control the movement of the sample visual points bound thereto.
[0099] The label skin weight is used as label data to represent the influence of the position of the sample visual point relative to the bound sample bone. The label skin weight is a known correct skin weight, which is used to evaluate the accuracy of the machine learning network's prediction, and then guide the machine learning network to learn to predict the correct skin weight during the training process by calculating the loss value.
[0100] The predicted skin weight is the output of the machine learning model that represents the influence of the position of the sample visual point relative to the bound sample bone. The predicted skin weight is an unknown and possibly erroneous skin weight.
[0101] The loss value is a metric that measures the difference between the predicted skinned weights and the labeled skinned weights. It is the supervisory information for evaluating the performance of the machine learning network.
[0102] The network parameters of a machine learning network refer to the learnable parameters such as weights and biases that constitute the machine learning network. These parameters determine the performance of the machine learning network.
[0103] According to the sample skeleton chain, a machine learning network is used to predict the predicted skin weight of each sample visual point. An optional method is: according to the bone position of each sample skeleton, the topological relationship between each sample skeleton, the visual point position of each sample visual point, the topological relationship between each sample visual point, at least one of the distances of each sample visual point relative to each sample skeleton, and the sample skeleton chain, a machine learning network is used to predict the predicted skin weight of each sample visual point.
[0104] Based on the loss value, the network parameters of the machine learning network are adjusted to obtain a trained machine learning network. An optional method is: based on the loss value, the network parameters of the machine learning network are adjusted using the gradient update method to obtain a trained machine learning network when the preset training convergence conditions are met.
[0105] Exemplarily, a sample object model and a sample visual model are obtained. The sample object model is a virtual character skeleton model containing 10 bones, and the sample visual model is a mesh model containing 1000 vertices, representing the visual appearance of the virtual character. One of the vertices is selected as an example. It is bound to 3 bones to form a sample bone chain. The 3 bones are located on the character's arm, wrist and finger. For this vertex, its label skin weight is (0.6, 0.3, 0.1), which means that it is mainly affected by the arm bone, followed by the wrist bone, and finally the finger bone. In the initial stage, the machine learning network may predict different skin weights, (0.4, 0.4, 0.2). The difference between the predicted skin weight and the label skin weight is measured using a loss function (such as mean square error MSE), and the loss value is calculated to be 0.06. The network parameters are adjusted using the gradient descent method to reduce the loss value. If it is found that the loss value mainly comes from the underestimation of the weight of the first bone (arm), then the corresponding network weight will be adjusted to increase the weight estimate of the first bone. This process is repeated for all sample visual points until the preset training convergence condition is reached (the loss value is lower than a certain threshold or the maximum number of iterations is reached). After multiple iterations, the machine learning network is able to predict the skin weights more accurately. For example, for the same vertex, the network may now predict a skin weight of (0.59, 0.31, 0.1), which is very close to the true label skin weight (0.6, 0.3, 0.1) and has a low loss value. In the above training process, the machine learning network can gradually learn how to accurately predict the skin weights of visual points.
[0106] In the embodiments of the present specification, a high-performance machine learning network is obtained by pre-training a machine learning network, which can more accurately predict the skin weights of each visual point, further improve the accuracy of the predicted skin weights, and perform skinning on the target object based on the skin weights, further improving the skinning effect of the object and further improving the realism of the object skinning.
[0107] In an optional embodiment of the present specification, obtaining a sample object model and a sample visual model of a sample object includes the following specific steps: Obtain sample object models and sample visual models of the sample objects in multiple action postures.
[0108] Action posture refers to the movement state or posture of the physical object in the virtual scene space, which can be achieved by adjusting the bone position of each bone in the object model or the visual point position of each visual point in the visual model, for example, standing, walking, running, jumping, etc.
[0109] The sample object models under multiple action postures are sample object models under multiple action postures of the sample object in the virtual scene space, and are dynamic sample object models. In order to ensure that the transition between different action postures of the physical object is smooth and natural, it is necessary to collect sample object models of the sample object under various action postures. The sample object model can be used to train the machine learning network to learn the changing rules of the bone position under different action postures.
[0110] Optionally, the multiple motion postures are multiple motion postures that are continuous in time, that is, motion trajectories.
[0111] The sample visual models under multiple action postures are sample visual models of the visual appearance of the sample object under multiple action postures in the virtual scene space, and are dynamic sample visual models. In order to ensure that the visual appearance transitions smoothly and naturally between different action postures, it is necessary to collect sample visual models of the visual appearance of the sample object under various action postures. The sample visual model can be used to train the machine learning network to learn the changing rules of the visual point position under different action postures.
[0112] Optionally, in the loss value calculation, calculations of sample object models and sample visual models under multiple action postures are added to ensure that the trained machine learning network is optimized with the goal of preventing model penetration, mutation, etc. during subsequent object skinning.
[0113] Exemplarily, sample object models and sample visual models under multiple action postures such as standing, walking, running, and jumping are obtained, and the above training process is performed to obtain a machine learning network, which can gradually learn how to accurately predict the dynamic skinning weights of visual points.
[0114] In the embodiments of the present specification, dynamic sample data is added to the training process of the machine learning network to obtain a high-performance machine learning network that can predict dynamic skin weights, thereby further improving the accuracy of the predicted dynamic skin weights, and skinning the target object based on the skin weights, thereby further improving the skinning effect of the dynamic object skinning and further improving the realism of the dynamic object skinning.
[0115] See also Figure 6 , Figure 6 A flowchart of a method for skinning a character in a virtual scene provided by an embodiment of the present specification is shown, and includes the following specific steps: Step 602: Obtain a character model and a clothing model of a virtual character in a virtual scene, wherein the character model includes the bone position of each bone in the virtual character and the third topological relationship of each bone, and the clothing model includes the clothing point position of each clothing point and the fourth topological relationship of each clothing point.
[0116] Step 604: Calculate the distance of each clothing point relative to each skeleton according to the position of each skeleton and the position of each clothing point.
[0117] Step 606: Generate a target skeleton chain corresponding to each clothing point according to the distance, the third topological relationship and the fourth topological relationship.
[0118] Step 608: According to the target skeleton chain, the pre-trained machine learning network is used to predict the skin weight of each clothing point, and the virtual character is skinned based on the skin weight.
[0119] This specification is applied to applications, websites or system platforms with character skinning functions. It can be an animation engine application that generates a virtual character based on the skeletal motion information of multiple bones of a virtual character, including but not limited to: Unity, Unreal Engine, Maya, 3DS Max, Blender. It can also be an animation generation application for movies and TV commercials, a game production application for games, an engineering simulation application for engineering design, and an educational and scientific research application for education and scientific research, which are not limited here. It should be noted that the embodiments of this specification are applied to the editor mode stage, not the runtime stage of the animation.
[0120] The embodiments of this specification are similar to the above Figure 1 The embodiments of the specification are for the purpose of unifying the inventive concept. For details not described in detail in the embodiments of the specification, please refer to the above Figure 1 The description of the embodiments of the specification will not be repeated here.
[0121] In the embodiments of the present specification, a character model and a clothing model of a virtual character are obtained, and the distance of each clothing point relative to each bone is calculated according to the bone position of each bone in the character model and the clothing point position of each clothing point in the clothing model, and the spatial relationship between each clothing point and each bone is accurately measured. Then, according to the distance, the third topological relationship of each bone and the fourth topological relationship of each clothing point, a target bone chain corresponding to each clothing point is generated, and a precise binding relationship between the clothing point and the bone is established to avoid the situation where the clothing point is incorrectly bound to the bone. According to the target bone chain, the skin weight of each clothing point is predicted, and the accuracy of the predicted skin weight is improved. The virtual character is skinned based on the skin weight, and the skin effect of the character skinning in the virtual scene is improved, and the realism of the character skinning in the virtual scene is improved, so as to achieve a smooth and natural display effect of the virtual scene.
[0122] At present, machine learning networks are mainly trained on closed sample data or modern style sample data. For clothing, for example, the unique long skirt and large sleeves of ancient style cannot be handled well.
[0123] In an optional embodiment of the present specification, before step 608, the following specific steps are also included: Acquire a sample character model and a sample clothing model of a sample virtual character, wherein each sample clothing point of the sample clothing model has a sample bone chain relative to a sample bone of the sample character model, and each sample clothing point has a label skinning weight; According to the sample skeleton chain, the predicted skin weight of each sample clothing point is predicted using the machine learning network; Calculate the loss value based on the predicted skin weight and the label skin weight; Based on the loss value, the network parameters of the machine learning network are adjusted to obtain a trained machine learning network.
[0124] The sample clothing model is a spatial model of clothing used as sample data in the virtual scene space. It is composed of multiple sample clothing points. The sample clothing points constitute polygonal surfaces to describe the shape and appearance characteristics of the clothing. The sample clothing model can move or deform as the sample character model moves or deforms in the virtual scene space. The sample clothing point model includes but is not limited to: mesh model, voxel model, texture model and UV map model.
[0125] The embodiments of this specification are similar to the above Figure 1 The embodiments of the specification are for the purpose of unifying the inventive concept. For details not described in detail in the embodiments of the specification, please refer to the above Figure 1 The description of the training process embodiment of the machine learning model in the embodiment of the specification will not be repeated here.
[0126] In the embodiments of the present specification, a sample clothing model is added to the training process of the machine learning network to obtain a high-performance machine learning network that can predict skin weights for clothing, thereby improving the accuracy of the skin weights predicted in character skinning scenarios, and performing skinning on virtual characters based on the skin weights, further improving the skinning effect of ancient-style character skinning, and further improving the realism of ancient-style character skinning.
[0127] The following combination Figure 7 Taking the application of the object skinning method provided in this specification in the game development scenario as an example, the object skinning method is further explained. Figure 7 A processing flow chart of an object skinning method applied to a game development scenario provided by an embodiment of the present specification is shown, which specifically includes the following steps.
[0128] Step 702: Align the character model of the game character in the game scene with the ancient style clothing model, wherein the character model includes the bone position of each bone in the virtual character and the bone topological relationship of each bone, and the ancient style clothing model includes the clothing point position of each clothing point and the clothing topological relationship of each clothing point.
[0129] Step 704: Determine the clothing relationship between each skeleton and each clothing point according to the position of each skeleton and the position of each clothing point; if the clothing relationship between the first skeleton and the first clothing point is a visible relationship, calculate the geodesic distance of the first clothing point relative to the first skeleton according to the skeleton position of the first skeleton and the clothing point position of the first clothing point; if the clothing relationship between the first skeleton and the first clothing point is an invisible relationship and the clothing relationship between the first skeleton and the second clothing point is a visible relationship, calculate the first distance of the first clothing point relative to the second clothing point according to the clothing point position of the first clothing point and the clothing point position of the second clothing point; calculate the second distance of the second clothing point relative to the first skeleton according to the skeleton position of the first skeleton and the clothing point position of the second clothing point; determine the geodesic distance of the first clothing point relative to the first skeleton according to the first distance and the second distance, and obtain the geodesic distance of each clothing point relative to each skeleton.
[0130] Step 706: Generate a skeleton chain corresponding to each clothing point according to the geodesic distance of each clothing point relative to each skeleton, the skeleton topological relationship and the clothing topological relationship.
[0131] Step 708: Based on the position of each bone, the bone topological relationship, the position of each clothing point, the clothing topological relationship, the geodesic distance and the bone chain, a pre-trained machine learning network is used to predict the skinning weight of each clothing point, wherein the sample data of the machine learning network includes sample character models and sample ancient style clothing models under multiple action postures.
[0132] Step 710: Skinning the game character based on the skin weights.
[0133] In the embodiment of the specification, ancient style clothing with special structure can be processed, and high-precision binding can be achieved by using dynamic sample data under multiple action postures. For clothes with complex structure, the spatial relationship between the skeleton and the clothes to be tied can be measured more accurately by using geodesic distance, taking into account the structure of the clothes. Based on this, according to the geodesic distance of each clothing point relative to each skeleton, the skeleton topological relationship and the clothing topological relationship, the skeleton chain corresponding to each clothing point is generated, and the spatial relationship and structural relationship are comprehensively considered. The corresponding skeleton chain is constructed for each clothing point, and the candidate set is narrowed, which can improve the accuracy of skeleton binding and avoid the situation where the visual point is incorrectly bound to the skeleton. In addition, the action information of the game character is fully utilized during modeling to ensure that the calculated binding result can ensure that the character does not wear the model when moving and there is no shape mutation. A more accurate binding of the appearance of the ancient style is achieved, and the skinning effect of the object skinning in the game development scene is improved, and the realism and efficiency of the object skinning in the game development scene are improved.
[0134] Corresponding to the above method embodiment, this specification also provides an object skinning device embodiment, Figure 8 FIG. 2 shows a schematic diagram of the structure of an object skinning device provided by an embodiment of the present specification. Figure 8 As shown, the device comprises: A first acquisition module 802 is configured to acquire an object model and a visual model of the target object, wherein the object model includes a bone position of each bone in the target object and a first topological relationship of each bone, and the visual model includes a visual point position of each visual point and a second topological relationship of each visual point; A first calculation module 804 is configured to calculate the distance of each visual point relative to each skeleton according to the position of each skeleton and the position of each visual point; A first generating module 806 is configured to generate a target skeleton chain corresponding to each visual point according to the distance, the first topological relationship and the second topological relationship; The first skinning module 808 is configured to predict the skin weight of each visual point according to the target skeleton chain, and perform skinning processing on the target object based on the skin weight.
[0135] Optionally, the first calculation module 804 is further configured to: According to the positions of each bone and each visual point, the visual relationship between each bone and each visual point is determined, wherein the visual relationship includes a visible relationship and an invisible relationship; according to the visual relationship, as well as the positions of each bone and each visual point, the distance of each visual point relative to each bone is calculated.
[0136] Optionally, each skeleton includes a first skeleton, and each visual point includes a first visual point; Correspondingly, the first calculation module 804 is further configured to: If the visual relationship between the first skeleton and the first visual point is a visible relationship, the spatial distance of the first visual point relative to the first skeleton is calculated according to the skeleton position of the first skeleton and the visual point position of the first visual point.
[0137] Optionally, each skeleton includes a first skeleton, and each visual point includes a first visual point and a second visual point; Correspondingly, the first calculation module 804 is further configured to: If the visual relationship between the first skeleton and the first visual point is an invisible relationship, and the visual relationship between the first skeleton and the second visual point is a visible relationship, a first distance of the first visual point relative to the second visual point is calculated according to the visual point position of the first visual point and the visual point position of the second visual point, and a second distance of the second visual point relative to the first skeleton is calculated according to the skeleton position of the first skeleton and the visual point position of the second visual point; A spatial distance of the first visual point relative to the first skeleton is determined according to the first distance and the second distance.
[0138] Optionally, the first generating module 806 is further configured to: According to the distance, the first topological relationship and the second topological relationship, the target skeleton related to each visual point is determined; the target skeleton is combined to generate a target skeleton chain corresponding to each visual point.
[0139] Optionally, the first skinning module 808 is further configured to: The skin weight of each visual point is predicted according to the position of each bone, the first topological relationship, the position of each visual point, the second topological relationship, the distance and the target bone chain.
[0140] Optionally, the first skinning module 808 is further configured to: According to the target skeleton chain, the skinning weight of each visual point is predicted using a pre-trained machine learning network.
[0141] Optionally, the device further comprises: The first training module is configured to obtain a sample object model and a sample visual model of a sample object, wherein each sample visual point of the sample visual model has a sample skeleton chain relative to a sample skeleton of the sample object model, and each sample visual point has a label skinning weight; according to the sample skeleton chain, a machine learning network is used to predict a predicted skinning weight of each sample visual point; based on the predicted skinning weight and the label skinning weight, a loss value is calculated; based on the loss value, network parameters of the machine learning network are adjusted to obtain a trained machine learning network.
[0142] Optionally, the first training module is further configured to: Obtain sample object models and sample visual models of the sample objects in multiple action postures.
[0143] In an embodiment of the present specification, an object model and a visual model of a target object are obtained, and the distance of each visual point relative to each bone is calculated based on the bone position of each bone in the object model and the visual point position of each visual point in the visual model, and the spatial relationship between each visual point and each bone is accurately measured. Then, based on the distance, the first topological relationship of each bone and the second topological relationship of each visual point, a target bone chain corresponding to each visual point is generated, and a precise binding relationship between the visual point and the bone is established to avoid the situation where the visual point is incorrectly bound to the bone. According to the target bone chain, the skin weight of each visual point is predicted, and the accuracy of the predicted skin weight is improved. Based on the skin weight, the target object is skinned, and the skinning effect of the object skinning is improved, and the realism of the object skinning is improved.
[0144] The above is a schematic scheme of an object skinning device of this embodiment. It should be noted that the technical scheme of the object skinning device and the technical scheme of the object skinning method described above belong to the same concept, and the details of the technical scheme of the object skinning device that are not described in detail can all be referred to the description of the technical scheme of the object skinning method described above.
[0145] Corresponding to the above method embodiment, this specification also provides an embodiment of a character skinning device for a virtual scene, Fig. 9 FIG. 1 is a schematic diagram showing a structure of a character skinning device for a virtual scene provided by an embodiment of the present specification. Fig. 9 As shown, the device comprises: The second acquisition module 902 is configured to acquire a character model and a clothing model of a virtual character in a virtual scene, wherein the character model includes a bone position of each bone in the virtual character and a third topological relationship of each bone, and the clothing model includes a clothing point position of each clothing point and a fourth topological relationship of each clothing point; The second calculation module 904 is configured to calculate the distance of each clothing point relative to each skeleton according to the position of each skeleton and the position of each clothing point; The second generating module 906 is configured to generate a target skeleton chain corresponding to each clothing point according to the distance, the third topological relationship and the fourth topological relationship; The second skinning module 908 is configured to predict the skinning weight of each clothing point according to the target skeleton chain using a pre-trained machine learning network, and perform skinning on the virtual character based on the skinning weight.
[0146] Optionally, the device further comprises: The second training module is configured to obtain a sample character model and a sample clothing model of a sample virtual character, wherein each sample clothing point of the sample clothing model has a sample bone chain relative to the sample bone of the sample character model, and each sample clothing point has a label skin weight; according to the sample bone chain, using a machine learning network, predicting the predicted skin weight of each sample clothing point; based on the predicted skin weight and the label skin weight, calculating the loss value; based on the loss value, adjusting the network parameters of the machine learning network to obtain a trained machine learning network.
[0147] In the embodiments of the present specification, a character model and a clothing model of a virtual character are obtained, and the distance of each clothing point relative to each bone is calculated according to the bone position of each bone in the character model and the clothing point position of each clothing point in the clothing model, and the spatial relationship between each clothing point and each bone is accurately measured. Then, according to the distance, the third topological relationship of each bone and the fourth topological relationship of each clothing point, a target bone chain corresponding to each clothing point is generated, and a precise binding relationship between the clothing point and the bone is established to avoid the situation where the clothing point is incorrectly bound to the bone. According to the target bone chain, the skin weight of each clothing point is predicted, and the accuracy of the predicted skin weight is improved. The virtual character is skinned based on the skin weight, and the skin effect of the character skinning in the virtual scene is improved, and the realism of the character skinning in the virtual scene is improved, so as to achieve a smooth and natural display effect of the virtual scene.
[0148] The above is a schematic scheme of a virtual scene character skinning device of this embodiment. It should be noted that the technical scheme of the virtual scene character skinning device and the technical scheme of the virtual scene character skinning method described above belong to the same concept, and the details of the virtual scene character skinning device that are not described in detail can all be referred to the description of the technical scheme of the virtual scene character skinning method described above.
[0149] Fig.10 The block diagram of a computing device 1000 according to an embodiment of the present specification is shown. The components of the computing device 1000 include but are not limited to a memory 1010 and a processor 1020. The processor 1020 is connected to the memory 1010 via a bus 1030, and the database 1050 is used to store data.
[0150] The computing device 1000 also includes an access device 1040, which enables the computing device 1000 to communicate via one or more networks 1060. Examples of these networks include a Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 1040 may include one or more of any type of network interface (e.g., a Network Interface Controller (NIC)) of wired or wireless, such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, and a Near Field Communication (NFC).
[0151] In one embodiment of the present specification, the above components of the computing device 1000 and Fig.10 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig.10 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0152] The computing device 1000 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 1000 may also be a mobile or stationary server.
[0153] The processor 1020 is used to execute the following computer program / instruction, which, when executed by the processor, implements the steps of the above-mentioned object skinning method or the character skinning method of the virtual scene.
[0154] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the object skinning method and the character skinning method of the virtual scene belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the object skinning method or the character skinning method of the virtual scene.
[0155] An embodiment of the present specification also provides a computer-readable storage medium storing a computer program / instruction, which implements the steps of the above-mentioned object skinning method or the character skinning method of a virtual scene when executed by a processor.
[0156] The above is a schematic scheme of a computer-readable storage medium of the present embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the object skinning method and the character skinning method of the virtual scene belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the object skinning method or the character skinning method of the virtual scene.
[0157] An embodiment of the present specification also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the above-mentioned object skinning method or the character skinning method of a virtual scene.
[0158] The above is a schematic scheme of a computer program product of this embodiment. It should be noted that the technical scheme of the computer program product and the technical scheme of the object skinning method and the character skinning method of the virtual scene belong to the same concept, and the details not described in detail in the technical scheme of the computer program product can be referred to the description of the technical scheme of the object skinning method or the character skinning method of the virtual scene.
[0159] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0160] The computer program / instruction includes computer program code, which may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer readable media do not include electric carrier signals and telecommunication signals.
[0161] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0162] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0163] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.
Claims
1. An object skinning method, characterized in that: include: Acquire an object model and a visual model of the target object, wherein the object model includes the bone position of each bone in the target object and the first topological relationship of each bone, and the visual model includes the visual point position of each visual point and the second topological relationship of each visual point; According to the positions of the bones and the visual points, the distances of the visual points relative to the bones are calculated; Generate a target skeleton chain corresponding to each visual point according to the distance, the first topological relationship and the second topological relationship; According to the target skeleton chain, the skin weight of each visual point is predicted, and the target object is skinned based on the skin weight.
2. The method according to claim 1, characterized in that Calculating the distances of the visual points relative to the bones according to the positions of the bones and the positions of the visual points includes: Determining visual relationships between the skeletons and the visual points according to the positions of the skeletons and the visual points, wherein the visual relationships include visible relationships and invisible relationships; According to the visual relationship, the positions of the bones and the positions of the visual points, the distances of the visual points relative to the bones are calculated.
3. The method according to claim 2, characterized in that The skeletons include a first skeleton, and the visual points include a first visual point; The step of calculating the distances of the visual points relative to the bones according to the visual relationship, the positions of the bones and the positions of the visual points comprises: If the visual relationship between the first skeleton and the first visual point is a visible relationship, the spatial distance of the first visual point relative to the first skeleton is calculated according to the skeleton position of the first skeleton and the visual point position of the first visual point.
4. The method according to claim 2, characterized in that: The skeletons include a first skeleton, and the visual points include a first visual point and a second visual point; The step of calculating the distances of the visual points relative to the bones according to the visual relationship, the positions of the bones and the positions of the visual points comprises: If the visual relationship between the first skeleton and the first visual point is an invisible relationship, and the visual relationship between the first skeleton and the second visual point is a visible relationship, a first distance of the first visual point relative to the second visual point is calculated according to the visual point position of the first visual point and the visual point position of the second visual point, and a second distance of the second visual point relative to the first skeleton is calculated according to the skeleton position of the first skeleton and the visual point position of the second visual point; The spatial distance of the first visual point relative to the first skeleton is determined according to the first distance and the second distance.
5. The method according to claim 1, characterized in that: Generating the target skeleton chain corresponding to each visual point according to the distance, the first topological relationship and the second topological relationship includes: Determine a target skeleton associated with each visual point according to the distance, the first topological relationship, and the second topological relationship, and determine a target skeleton associated with each visual point; The target skeletons are combined to generate target skeleton chains corresponding to the visual points.
6. The method according to claim 1, characterized in that The step of predicting the skin weight of each visual point according to the target skeleton chain includes: The skin weight of each visual point is predicted according to the positions of each bone, the first topological relationship, the positions of each visual point, the second topological relationship, the distance and the target bone chain.
7. The method according to any one of claims 1 to 6, characterized in that: The step of predicting the skin weight of each visual point according to the target skeleton chain includes: According to the target skeleton chain, a pre-trained machine learning network is used to predict the skin weights of each visual point.
8. The method according to claim 7, characterized in that Before predicting the skin weights of each visual point according to the target skeleton chain using a pre-trained machine learning network, the method further includes: Acquire a sample object model and a sample visual model of the sample object, wherein each sample visual point of the sample visual model has a sample skeleton chain relative to a sample skeleton of the sample object model, and each sample visual point has a label skinning weight; According to the sample skeleton chain, using a machine learning network, predicting the predicted skin weight of each sample visual point; Calculating a loss value based on the predicted skin weight and the label skin weight; Based on the loss value, the network parameters of the machine learning network are adjusted to obtain a trained machine learning network.
9. The method according to claim 8, characterized in that The step of obtaining a sample object model and a sample visual model of a sample object includes: Obtain sample object models and sample visual models of the sample objects in multiple action postures.
10. A method for skinning a character in a virtual scene, characterized in that: include: Acquire a character model and a clothing model of a virtual character in a virtual scene, wherein the character model includes the bone position of each bone in the virtual character and the third topological relationship of each bone, and the clothing model includes the clothing point position of each clothing point and the fourth topological relationship of each clothing point; According to the positions of the bones and the positions of the clothing points, the distances of the clothing points relative to the bones are calculated; Generate a target skeleton chain corresponding to each clothing point according to the distance, the third topological relationship and the fourth topological relationship; According to the target skeleton chain, a pre-trained machine learning network is used to predict the skin weights of the clothing points, and the virtual character is skinned based on the skin weights.
11. The method according to claim 10, characterized in that Before predicting the skinning weights of each clothing point according to the target skeleton chain using a pre-trained machine learning network, the method further includes: Acquire a sample character model and a sample clothing model of a sample virtual character, wherein each sample clothing point of the sample clothing model has a sample bone chain relative to a sample bone of the sample character model, and each sample clothing point has a label skinning weight; According to the sample skeleton chain, using a machine learning network, predicting the predicted skin weight of each sample clothing point; Calculating a loss value based on the predicted skin weight and the label skin weight; Based on the loss value, the network parameters of the machine learning network are adjusted to obtain a trained machine learning network.
12. An object skinning device, characterized in that: include: A first acquisition module is configured to acquire an object model and a visual model of a target object, wherein the object model includes a skeletal position of each bone in the target object and a first topological relationship of each bone, and the visual model includes a visual point position of each visual point and a second topological relationship of each visual point; A first calculation module is configured to calculate the distance of each visual point relative to each skeleton according to the position of each skeleton and the position of each visual point; A first generating module is configured to generate a target skeleton chain corresponding to each visual point according to the distance, the first topological relationship and the second topological relationship; The first skinning module is configured to predict the skinning weight of each visual point according to the target skeleton chain, and perform skinning processing on the target object based on the skinning weight.
13. A character skinning device for a virtual scene, characterized in that: include: A second acquisition module is configured to acquire a character model and a clothing model of a virtual character in a virtual scene, wherein the character model includes a bone position of each bone in the virtual character and a third topological relationship of each bone, and the clothing model includes a clothing point position of each clothing point and a fourth topological relationship of each clothing point; A second calculation module is configured to calculate the distance of each clothing point relative to each skeleton according to the position of each skeleton and the position of each clothing point; A second generating module is configured to generate a target skeleton chain corresponding to each clothing point according to the distance, the third topological relationship and the fourth topological relationship; The second skinning module is configured to predict the skinning weights of the clothing points according to the target skeleton chain using a pre-trained machine learning network, and perform skinning on the virtual character based on the skinning weights.
14. A computing device, characterized in that include: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the method described in any one of claims 1 to 11 are implemented.
15. A computer-readable storage medium, characterized in that: It stores a computer program / instruction, which implements the steps of the method described in any one of claims 1 to 11 when executed by a processor.
16. A computer program product, characterized in that The invention comprises a computer program / instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 11.