Skinning Method, Device, Electronic Device, and Storage Medium for Virtual Objects
By determining the target area according to the motion state on the virtual object and adjusting the skin weight, the unnatural shrinkage and loss problems that the virtual object model has occurred in the simulation actions are solved, and efficient and accurate skin weight settings are achieved, which improves the authenticity and coordination of the simulation actions.
Patent Information
- Application Number
- CN202210389645.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-13
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2042-04-13
AI Technical Summary
In the existing skin binding technology, the virtual object model is prone to unnatural shrinkage and loss defects during the simulation process, and the process of manually setting skin weights is cumbersome and prone to errors, resulting in low efficiency and accuracy.
By determining the target area according to the motion state of the virtual object, and adjusting the skin weight, including obtaining the first skin weight and adjusting it to the second skin weight, to achieve skin binding again, the specific steps include determining the joint node and mesh vertices, adjusting the skin weight to reduce abnormal deformation, and making wiring modifications.
It improves the efficiency and accuracy of adjusting the weight of the virtual object skin, improves the authenticity and coordination of the virtual object simulation actions, and reduces abnormal deformation of the model.
Smart Images

Figure CN114742925B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and particularly to a skinning method, device, electronic device, and storage medium for virtual objects. Background Art
[0002] With the development of computer technology, skinning binding technology can be used to control virtual objects to perform simulation actions. However, due to the limitations of skinning binding technology, there will be defects such as unnatural shrinkage and loss of the model during the process of virtual objects performing simulation actions. It is necessary to reasonably set the skin weights at various positions of the bone control model to connect the bones and the model to avoid the above defects.
[0003] However, currently, most designers need to determine the corresponding skin weights for each area of the model by manual setting according to past experience. The process of manual setting is cumbersome and error-prone, resulting in low efficiency and accuracy in determining skin weights. Summary of the Invention
[0004] Embodiments of this application provide a skinning method, device, electronic device, and storage medium for virtual objects, which can efficiently and accurately set the skin weights of virtual objects.
[0005] Embodiments of this application provide a skinning method for virtual objects, including:
[0006] Determine a target area on the virtual object according to the motion state of the virtual object; wherein, the bones of the virtual object have been initially skinned and bound, the motion state is controlled by the motion state of the bones of the virtual object, and the target area is the area where the virtual object undergoes shrinkage deformation;
[0007] Obtain a first skin weight; the first skin weight represents the control degree of the bones of the virtual object on the target area under the initial skinning binding;
[0008] Adjust the first skin weight to a second skin weight so that the bones of the virtual object are skinned and bound again.
[0009] Optionally, the target area includes a first target area, the motion state is used to represent at least one of the posture, displacement, direction, and angle generated when the virtual object is in motion, and determining the target area on the virtual object according to the motion state of the virtual object includes:
[0010] Obtain the joint points of the bones of the virtual object and the intermediate grid lines of the joint points, and the intermediate grid lines are located at the protrusions of the joint points;
[0011] Obtain the intersection point of the intermediate grid line and the inner grid line of the joint point, and the intersection point is the first grid vertex;
[0012] Determine the area where the grid in the virtual object that has a preset relationship with the first grid vertex is located as the first target area in the target area.
[0013] Optionally, the target area further includes a second target area. Determining the target area on the virtual object according to the motion state of the virtual object includes:
[0014] Obtain the intersection point of the intermediate grid line and the outer grid line of the joint point, and the intersection point is the second grid vertex;
[0015] Determine the area where the grid in the virtual object that has a second preset relationship with the second grid vertex is located as the second target area in the target area.
[0016] Optionally, the target area further includes a third target area. Determining the target area on the virtual object according to the motion state of the virtual object includes:
[0017] Determine at least one grid vertex located between the first target area and the second target area as the third grid vertex, and the third grid vertex is located in the parent bone binding area of the virtual object;
[0018] Determine the area where the grid in the virtual object that has a third preset relationship with the third grid vertex is located as the third target area in the target area.
[0019] Optionally, adjusting the first skinning weight to the second skinning weight includes:
[0020] Reduce the first skinning weight of the first target area, and record the reduced first skinning weight of the first target area as the second skinning weight of the first target area;
[0021] Increase the first skinning weights of the second target area and the third target area controlled by the child bone as the second skinning weights of the second target area and the third target area; wherein, the second skinning weight of the second target area is greater than the second skinning weight of the third target area, and the second skinning weight of the third target area is greater than the second skinning weight of the first target area.
[0022] Optionally, the method further includes:
[0023] Obtain the second skinning weights of the second target area and the third target area;
[0024] Adjust the second skin weights of the second target area and the third target area so that the difference between the second skin weights of the second target area and the third target area becomes smaller.
[0025] Optionally, the method further includes:
[0026] Obtain the second skin weight of the adjusted first target area, where the second skin weight of the adjusted first target area is equal to the first skin weight of the parent bone binding area;
[0027] Obtain the second skin weight of the adjusted second target area, where the second skin weight of the adjusted second target area is equal to the first skin weight of the child bone binding area;
[0028] Obtain the second skin weight of the adjusted third target area, where the second skin weight of the adjusted third target area is equal to the first skin weight of the joint point binding area.
[0029] Optionally, the method further includes:
[0030] Obtain the fourth mesh vertex, where the fourth mesh vertex is the two mesh vertices closest to the first mesh vertex along the bone growth direction;
[0031] Obtain the fifth mesh vertex, and determine the mesh vertex closest to the first mesh vertex along the direction perpendicular to the bone growth direction as the fifth mesh vertex;
[0032] Obtain the connection line between the fourth mesh vertex and the fifth mesh vertex as the newly added mesh line of the virtual object;
[0033] Obtain the wiring result after deleting the first mesh vertex and the mesh line connecting the first mesh vertex and the fifth mesh vertex as the wiring modification result of the virtual object.
[0034] Optionally, before determining the target area on the virtual object according to the motion state of the virtual object, it further includes:
[0035] Perform motion simulation on the virtual object to obtain the simulation result;
[0036] Obtain the motion state from the simulation result.
[0037] An embodiment of the present application also provides a skinning device for a virtual object, including:
[0038] A target area acquisition unit, configured to determine a target area on the virtual object according to the motion state of the virtual object; wherein, the skeleton of the virtual object has been initially skinned and bound, the motion state is controlled by the skeleton of the virtual object, and the target area is the area where the virtual object undergoes shrinkage deformation;
[0039] A first skinning weight acquisition unit, configured to acquire a first skinning weight, where the first skinning weight represents the degree of control of the skeleton of the virtual object over the target area under the initial skinning binding;
[0040] A second skinning weight acquisition unit, configured to adjust the first skinning weight to a second skinning weight so that the skeleton of the virtual object is skinned and bound again.
[0041] An embodiment of the present application further provides an electronic device, including a processor and a memory, where the memory stores multiple instructions; the processor loads the instructions from the memory to execute the steps in the skinning method of the virtual object described in any one of the above embodiments.
[0042] An embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores multiple instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the skinning method of the virtual object described in any one of the above embodiments:
[0043] Determine a target area on the virtual object according to the motion state of the virtual object; wherein, the skeleton of the virtual object has been initially skinned and bound, the motion state is controlled by the skeleton of the virtual object, and the target area is the area where the virtual object undergoes shrinkage deformation;
[0044] Acquire a first skinning weight; the first skinning weight represents the degree of control of the skeleton of the virtual object over the target area under the initial skinning binding;
[0045] Adjust the first skinning weight to a second skinning weight so that the skeleton of the virtual object is skinned and bound again.
[0046] Optionally, the target area includes a first target area, the motion state is used to represent at least one of the posture, displacement, direction, and angle generated when the virtual object moves, and determining the target area on the virtual object according to the motion state of the virtual object includes:
[0047] Acquire the joint points of the skeleton of the virtual object and the intermediate grid lines of the joint points, where the intermediate grid lines are located at the protrusions of the joint points;
[0048] Obtain the intersection point of the intermediate grid line and the inner grid line of the joint point, and the intersection point is the first grid vertex;
[0049] Determine the area where the grid in the virtual object that has a preset relationship with the first grid vertex is located as the first target area in the target area.
[0050] Optionally, the target area further includes a second target area. Determining the target area on the virtual object according to the motion state of the virtual object includes:
[0051] Obtain the intersection point of the intermediate grid line and the outer grid line of the joint point, and the intersection point is the second grid vertex;
[0052] Determine the area where the grid in the virtual object that has a second preset relationship with the second grid vertex is located as the second target area in the target area.
[0053] Optionally, the target area further includes a third target area. Determining the target area on the virtual object according to the motion state of the virtual object includes:
[0054] Determine at least one grid vertex located between the first target area and the second target area as the third grid vertex, and the third grid vertex is located in the parent bone binding area of the virtual object;
[0055] Determine the area where the grid in the virtual object that has a third preset relationship with the third grid vertex is located as the third target area in the target area.
[0056] Optionally, adjusting the first skinning weight to the second skinning weight includes:
[0057] Reduce the first skinning weight of the first target area, and record the reduced first skinning weight of the first target area as the second skinning weight of the first target area; [[ID=2B]]
[0058] Increase the first skinning weights of the second target area and the third target area controlled by the child bone as the second skinning weights of the second target area and the third target area; wherein, the second skinning weight of the second target area is greater than the second skinning weight of the third target area, and the second skinning weight of the third target area is greater than the second skinning weight of the first target area.
[0059] Optionally, the method further includes:
[0060] Obtain the second skinning weights of the second target area and the third target area;
[0061] Adjust the second skin weights of the second target area and the third target area so that the difference between the second skin weights of the second target area and the third target area becomes smaller.
[0062] Optionally, the method further includes:
[0063] Obtain the second skin weight of the adjusted first target area, where the second skin weight of the adjusted first target area is equal to the first skin weight of the parent bone binding area;
[0064] Obtain the second skin weight of the adjusted second target area, where the second skin weight of the adjusted second target area is equal to the first skin weight of the child bone binding area;
[0065] Obtain the second skin weight of the adjusted third target area, where the second skin weight of the adjusted third target area is equal to the first skin weight of the joint point binding area.
[0066] Optionally, the method further includes:
[0067] Obtain the fourth mesh vertex, where the fourth mesh vertex is the two mesh vertices closest to the first mesh vertex along the bone growth direction;
[0068] Obtain the fifth mesh vertex, and determine the mesh vertex closest to the first mesh vertex along the direction perpendicular to the bone growth direction as the fifth mesh vertex;
[0069] Obtain the connection line between the fourth mesh vertex and the fifth mesh vertex as the newly added mesh line of the virtual object;
[0070] Obtain the wiring result after deleting the first mesh vertex and the mesh line connecting the first mesh vertex and the fifth mesh vertex as the wiring modification result of the virtual object.
[0071] Optionally, before determining the target area on the virtual object according to the motion state of the virtual object, it further includes:
[0072] Perform motion simulation on the virtual object to obtain the simulation result;
[0073] Obtain the motion state from the simulation result.
[0074] The embodiments of the present application can quickly and accurately determine the target area of the skin weight to be adjusted on the virtual object, and accurately adjust the skin weight of the target area, so as to efficiently and accurately determine the skin weight of the virtual object, and improve the authenticity and coordination of the virtual object's bone control for the virtual object to perform simulation actions. Brief Description of the Drawings
[0075] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for description in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0076] Figure 1 System schematic diagram of the skinning device for virtual objects provided by the embodiments of the present application;
[0077] Figure 2 Flow schematic diagram of the skinning method for virtual objects provided by the embodiments of the present application;
[0078] Figure 3 Another flow schematic diagram of the skinning method for virtual objects provided by the embodiments of the present application;
[0079] Figure 4 Position schematic diagram of each area of the bone binding model provided by the embodiments of the present application;
[0080] Figure 5 Schematic diagram of the distribution of mesh vertices in the model of the virtual object provided by the embodiments of the present application;
[0081] Figure 6 Schematic diagram of the contraction effect generated by the movement of the bone control model provided by the embodiments of the present application;
[0082] Figure 7 Schematic diagram of modifying the wiring of the model provided by the embodiments of the present application;
[0083] Figure 8 Structural schematic diagram of the skinning device for virtual objects provided by the embodiments of the present application;
[0084] Figure 9 Structural schematic diagram of the electronic device provided by the embodiments of the present application. Detailed Description of the Embodiments
[0085] The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, rather than all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.
[0086] The embodiments of the present application provide a skinning method, device, electronic device, and storage medium for virtual objects. Specifically, the skinning method for virtual objects in the embodiments of the present application can be executed by an electronic device, where the electronic device can be a terminal or a server, etc. The terminal can be a terminal device such as a smart phone, a tablet computer, a laptop computer, a touch screen, a personal computer (PC), a personal digital assistant (PDA), etc. The terminal can also include a client, and the client can be an application client, a browser client with skinning binding software, or an instant messaging client, etc. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0087] For example, when the skinning method for virtual objects runs on a terminal, the terminal device can store skinning binding software. The terminal device can be used to interact with the user through a graphical user interface, for example, perform a skinning binding operation on a virtual object through the terminal device. The ways in which the terminal device can provide the graphical user interface to the user can include multiple types. For example, it can be rendered and displayed on the display screen of the terminal device, or the graphical user interface can be presented through holographic projection. For example, the terminal device can include a touch display screen and a processor. The touch display screen is used to present the graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The graphical user interface includes a skinning operation interface. The processor is used to run the skinning binding software, generate the graphical user interface, respond to operation instructions, and control the display of the graphical user interface on the touch display screen.
[0088] Please refer to Figure 1 , Figure 1System schematic diagram of the skinning device for virtual objects provided by the embodiments of the present application. The system may include at least one terminal 11, at least one server 12, at least one database 13, and a network. The terminal 11 held by the user can be connected to different servers through the network. The terminal 11 is any device with computing hardware that can support and execute software products corresponding to skinning binding operations on virtual objects. In addition, the terminal 11 has one or more multi-touch sensitive screens for sensing and obtaining inputs of touch or swipe operations performed by the user at multiple points on one or more touch display screens. In addition, when the system includes multiple terminals 11, multiple servers 12, and multiple networks, different terminals 11 can be connected to each other through different networks and through different servers 12. The network can be a wireless network or a wired network. For example, the wireless network is WLAN (Wireless Local Area Network), LAN (Local Area Network), cellular network, 2G network, 3G network, 4G network, 5G network, etc. In addition, different terminals 11 can also use their own Bluetooth network or hotspot network to connect to other terminals or to connect to servers, etc. In addition, the system may include multiple databases 13. The multiple databases 13 are coupled to different servers 12 and can store information related to skinning binding of virtual objects, such as control bone data, constraint relationships, skinning weights, etc. in the database 13.
[0089] The embodiments of the present application provide a skinning method for virtual objects. This method can be executed by a terminal or a server. The embodiments of the present application will be described by taking the example that the skinning method of virtual objects is executed by a terminal. As shown in the figure, the server can determine a target area on the virtual object according to the motion state of the virtual object; wherein, the bones of the virtual object have been initially skinned and bound, the motion state is controlled by the motion state of the bones of the virtual object, and the target area is the area where the virtual object undergoes contraction deformation; obtain a first skinning weight; the first skinning weight characterizes the control degree of the bones of the virtual object on the target area under the initial skinning binding; adjust the first skinning weight to a second skinning weight so that the bones of the virtual object are skinned and bound again.
[0090] Specific embodiments will be described in detail below.
[0091] In this embodiment, a description will be made from the perspective of the skinning device of virtual objects. The skinning device of virtual objects can be specifically integrated in electronic devices such as terminals or servers.
[0092] Please refer to Figure 2 , Figure 2The flowchart of the skinning method for virtual objects provided by the embodiments of the present invention. The specific process of this method can be as follows:
[0093] Step 201, determine a target area on the virtual object according to the motion state of the virtual object.
[0094] Among them, the virtual object can be a virtual character, animal or other object, etc. The skeleton of the virtual object can be initially skinned and bound to the model of the virtual object, and the motion state is controlled by the skeleton of the virtual object.
[0095] It should be noted that this application is applied to the skinned mesh animation scenario. In this scenario, on the basis of creating the model of the virtual object, bones can be added to the model, so that the virtual can be divided into two parts: bones and models. Since the bones and the model are independent of each other, in order to make the bones drive the model to generate reasonable motions, the technology of binding the model to the bones is called skinning binding (Skin).
[0096] This bone can be understood as a coordinate space, which forms bone information. The joint points formed by the bones can be understood as the origin of the bone coordinate space, and the position of the joint point is described by its position in the parent bone coordinate space. Taking the elbow joint point as the origin of the forearm bone as an example, this bone forms a skeleton. Each bone can be understood as a vertex in three-dimensional space, that is, bone information. The model can include a model mesh, and there are many mesh vertices on the model mesh. The mesh vertex can be a three-dimensional coordinate. The model mesh can be understood as a layer of skin, such as a piece of clothing, which is attached to the bones. That is, skinning binding means binding the mesh vertices in the model mesh to the bones that affect them, and each mesh vertex can be controlled by multiple bones at the same time to achieve the simulation motion of the virtual object.
[0097] The mesh vertex can include skinning information, which determines how the mesh vertex is bound to the bones. The skinning information also includes which bones the mesh vertex will be affected by, and the weight of the influence of the bones. This weight is the skinning weight, and the skinning weight determines the degree of influence of the bones on the mesh vertex. In order to reasonably set the skinning weight, designers need to determine the corresponding skinning weights for each area of the model by manual setting according to past experience. The process of manual setting is cumbersome and error-prone, resulting in low efficiency and accuracy in determining the skinning weight.
[0098] Among them, the motion state can be used to represent at least one of the posture, displacement, direction, and angle generated when the virtual object is in motion. For example, if the virtual object is a person, when walking, postures such as arm bending and leg bending are generated, that is, data such as the speed and bending angle of the arm swing are accompanied. Another example is that if the virtual object is an object, when it is in passive motion such as being moved or squeezed, postures such as bending, stretching, and shortening can also be generated.
[0099] Among them, the target area can be the area where the model undergoes shrinkage deformation. It should be noted that since there are various organs, tissues, blood vessels, and muscle fibers inside the human body or animal, the body parts of the human body or animal will not be overly shrunk or deformed unnaturally due to the deformation generated by motion.
[0100] As Figure 6 shown, Figure 6 The left figure in shows the abnormal deformation situations such as excessive shrinkage and model loss generated when the model of the virtual object is bent. Compared with the model of the virtual object, it can be understood that since there are no organs, tissues, blood vessels, and muscle fibers inside it, when the model undergoes deformation during motion, deformation effects similar to those of a rubber tube being squeezed will occur, such as abnormal deformations such as excessive volume shrinkage and loss, resulting in poor overall visual and motion simulation effects. Therefore, it is necessary to accurately determine the target area so as to accurately set the skinning weight of the target area subsequently.
[0101] Optionally, before step 201, it may further include:
[0102] Performing motion simulation on the virtual object to obtain a simulation result;
[0103] Obtaining the motion state from the simulation result.
[0104] In the embodiments of the present application, the skinning binding operation includes a series of operations such as determining the target area and setting the skinning weight. Before the skinning binding operation is completed, the skeleton cannot control the model to perform simulation motion. Therefore, motion simulation can be performed on the virtual object first, such as performing simulation motion on another identical or similar model; or first performing skinning binding on the virtual object with the initial skinning weight and then performing motion simulation to obtain the simulation result. Further, the motion state of the virtual object can be obtained from the simulation result, such as the deformation and posture generated when the virtual object raises the arm, rotates the wrist, or bends the leg. Thus, by obtaining the motion state of the virtual object through motion simulation first, during the skinning binding process, even if the virtual object cannot perform simulation motion, the system can accurately determine the target area and the skinning weight.
[0105] Optionally, step 201 may further include:
[0106] Obtain the joint points of the bone and the intermediate grid lines of the joint points, where the intermediate grid lines are located at the convex portions of the joint points;
[0107] Obtain the intersection points of the intermediate grid lines and the inner grid lines of the joint points, and the intersection points are the first grid vertices;
[0108] Determine the area where the grids in the model that have a preset relationship with the first grid vertex are located as the first target area in the target area.
[0109] As described above, the joint point can be understood as the origin of the bone coordinate space. For example, the elbow joint point is the origin of the forearm bone. Correspondingly, when the virtual object is a human body or an animal, the joint point can also be more vividly understood as the actual bone joint, such as the elbow joint, the knee joint, the shoulder joint, etc.
[0110] As Figure 5 shown, taking the arm model of the partial model shown in the figure as the virtual object as an example, the convex portion of the joint point can be understood as the sharpest shape of the elbow joint point, and the intermediate grid line of the joint point is located at the convex portion. It should be noted that since there are multiple grid lines in the model, in the embodiments of the present application, when designing the grid lines of the model, at least one grid line located at the coordinate point of the convex portion of the joint point can be preferentially designed, so as to facilitate accurately obtaining the first grid vertex and the first target area subsequently.
[0111] Among them, the inner side of the joint point refers to the opposite side of the convex portion of the joint point, and the inner grid line of the joint point is the grid line located on the inner side of the joint point. As Figure 5 shown, it shows that the intersection point of the intermediate grid line and the inner grid line of the joint point is the first grid vertex. Among them, the area where the grids in the model that have a preset relationship with the first grid vertex are located can be determined as the first target area in the target area. Among them, the preset relationship can be the grid containing the first grid vertex and other grids adjacent to the above grid.
[0112] It can be understood that when the joint point controls the arm model to bend, the joint point drives the forearm to approach the upper arm, and the arm model changes from the straight state to the bent state. The position where the first grid vertex is located is the deepest part of the bend of the forearm and the upper arm, so that the area where the first grid vertex and the grids that have a preset relationship with the first grid vertex are located is most affected by the deformation, that is, the bone has the greatest influence on the first grid vertex and the first target area, and the first target area is most likely to have abnormal deformations such as excessive contraction and loss of the model.
[0113] Optionally, step 201 may further include:
[0114] Obtain the intersection points of the intermediate grid lines and the outer grid lines of the joint points, and the intersection points are the second grid vertices;
[0115] Determine the area where the grid in the model that has a second preset relationship with the second grid vertex is located as the second target area in the target area.
[0116] Herein, the outside of a joint point refers to the same side as the bulge of the joint point, and the inner grid line of the joint point is the grid line located inside the joint point. As Figure 5 shown, it shows that the intersection point of the middle grid line and the outside grid line of the joint point is the first grid vertex. Among them, the area where the grid in the model that has a second preset relationship with the second grid vertex can be determined as the second target area in the target area. Among them, the preset relationship can be the grid containing the second grid vertex and other grids adjacent to the above grid.
[0117] It can be understood that after obtaining the first target area most affected by deformation, the skinning weights of the first target area can be adjusted subsequently to improve or eliminate abnormal deformations such as excessive shrinkage and loss of the model in the first target area. Correspondingly, in order to improve the authenticity and coordination of the subsequent skeleton control model for simulating actions, when adjusting the skinning weights of the first target area subsequently, the skinning weights of the second target area on the opposite side can be adjusted synchronously to balance the overall skinning weights of the arm model.
[0118] Optionally, step 201 may further include:
[0119] Determine at least one grid vertex located between the first target area and the second target area as the third grid vertex, and the third grid vertex is located in the parent bone binding area of the model;
[0120] Determine the area where the grid in the model that has a third preset relationship with the third grid vertex is located as the third target area in the target area.
[0121] Since the first target area and the second target area are respectively located inside and outside the joint point, the third target area can be regarded as a transition area between the first target area and the second target area. After adjusting the skinning weights of the first target area and the second target area subsequently, the skinning weights of the third target area can be further adjusted to achieve a smooth transition of the skinning weights between different positions of the model.
[0122] As can be seen from the above, in the embodiment of the present application, by obtaining the positions of the first grid vertices in the model, the first target area in the model that is most affected by deformation can be determined; the second target area on the opposite side of the first target area can be determined by the positions of the second grid vertices; and the third grid vertices and the third target area are determined by the first target area and the second target area, so that the skin weight adjustment area of the model can be accurately determined based on the motion state, joint points, and grid lines and grid points related to the joint points of the virtual object, without relying on designers for manual setting, greatly improving the efficiency and accuracy of subsequent skin weight adjustment of the model.
[0123] Step 202, obtain the first skin weight.
[0124] Among them, the first skin weight may refer to the initial skin weight of each position of the bone control model. The setting rule of the initial skin weight may be: each bone sets a relatively high skin weight for the corresponding model part it controls, and the skin weights of other controllable model parts are set to decrease in a ring shape. The specific shape and coverage range of the ring can be designed according to requirements, and this embodiment does not limit it.
[0125] Such as Figure 4 shown, for this model part of the virtual object, it can be divided into a child bone binding area, a transition binding area, a joint point binding area, and a parent bone binding area. Based on the skin weight controlled by the child bone of the model, since the child bone is directly used to control the subset bone binding area, it is closer to the transition binding area and farther from the joint point binding area and the parent bone binding area. Therefore, the first skin weights of the above areas controlled by the child bone can be set from high to low respectively, for example, they can be set to 95%, 75%, 50%, and 5% respectively.
[0126] Step 203, adjust the first skin weight to the second skin weight.
[0127] Among them, the second skin weight can be a weight value that can eliminate the model loss defect. Optionally, step 203 may further include:
[0128] Reduce the first skin weight of the first target area controlled by the child bone of the bone, and the reduced first skin weight of the first target area is recorded as the second skin weight of the first target area;
[0129] Increase the first skin weights of the second target area and the third target area controlled by the child bone as the second skin weights of the second target area and the third target area; among them, the second skin weight of the second target area is greater than the second skin weight of the third target area, and the second skin weight of the third target area is greater than the second skin weight of the first target area.
[0130] Specifically, continuing with the skinning weights of the child bone control model as a reference and combining the example in step 202, assume that the weights of the child bone controlling the above four regions are 95%, 75%, 50%, and 5% respectively. Since the first mesh vertex is located in the joint point binding region, the skinning weights of both the child bone and the parent bone for the first mesh vertex are 50%, that is, in the simulated movement, the influence degrees of the child bone and the parent bone on the first mesh vertex are the same.
[0131] As Figure 6 shown, in the simulated movement of the virtual object, the child bone controls the child bone binding region to be close to the parent bone binding region to achieve simulated actions such as bending and twisting. Since most abnormal deformations such as excessive contraction and loss of the model correspond to simulated actions such as extrusion, bending, and twisting, and the child bone has a greater influence on the above-mentioned abnormal deformations of the model, the first skinning weight of the child bone controlling the first target region can be reduced. It can be understood that by reducing the first skinning weight of the child bone controlling the first target region, the influence of the child bone on the region of the model that is most prone to abnormal deformation can be effectively reduced, so that when the virtual object performs simulated movement, the first target region will no longer have excessive contraction and loss due to the greater influence of the child bone.
[0132] Specifically, the first skinning weights of the child bone controlling the second target region and the third target region can be increased as the second skinning weights of the second target region and the third target region. It can be understood that after reducing the first skinning weight of the first target region, to ensure the balance and coordination of the simulated movement of the bone control model, the skinning weight of the second target region on the opposite side of the first target region can be increased. And the third target region is closer to the outside of the joint point compared with the first target region, so the skinning weight of the child bone controlling the third target region can also be increased. It can be understood that the third target region is farther from the child bone than the second target region, so based on the child bone, the second skinning weight of the third target region can be less than the second skinning weight of the second target region, and the second skinning weight of the first target region can be less than the second skinning weight of the third target region.
[0133] Thus, the embodiment of the present application can not only effectively reduce the influence of the child bone on the position of the model where abnormal deformation is likely to occur by adjusting the skinning weights of different target regions, but also achieve the coordination of the simulated actions of the bone control model through the adjustment of the skinning weights.
[0134] Optionally, the embodiment of the present application may further include:
[0135] Obtain the second skinning weights of the second target region and the third target region;
[0136] Adjust the second skin weights of the second target area and the third target area so that the difference between the second skin weights of the second target area and the third target area becomes smaller.
[0137] Specifically, according to the positions of the second mesh vertex and the third mesh vertex, it can be known that the positions of the second target area and the third target area are in or close to the joint binding area and the transition binding area. To improve the coordination of the child bone and the parent bone in controlling the model, it is necessary to ensure the smoothness of the skin weights in the joint binding area and the transition binding area. Therefore, it can be achieved by reducing the difference between the second target area and the third target area. This process can be called skin weight blending.
[0138] It should be noted that the objects of skin weight blending are not limited to the second target area and the third target area, but can also be other areas of the model, such as at least one mesh adjacent to the second target area or the third target area. The objects of skin weight blending can be selected according to needs, and this embodiment does not make restrictions.
[0139] Optionally, the embodiment of the present application may further include:
[0140] Obtain the second skin weight of the adjusted first target area, and the second skin weight of the adjusted first target area is equal to the first skin weight of the parent bone binding area;
[0141] Obtain the second skin weight of the adjusted second target area, and the second skin weight of the adjusted second target area is equal to the first skin weight of the child bone binding area;
[0142] Obtain the second skin weight of the adjusted third target area, and the second skin weight of the adjusted third target area is equal to the first skin weight of the joint binding area.
[0143] Since the child bone binding area, the transition binding area, the joint binding area, and the parent bone binding area respectively correspond to four different first skin weights. It can be understood that for the same model or model area, to ensure the smooth transition of skin weights between different model areas and the coordination of the model's simulation movement, on the one hand, it can be achieved by reducing the difference in skin weights between adjacent areas, and on the other hand, it can be achieved by reducing the number of meshes with different skin weights. For example, before obtaining the second skin weight, the entire child bone binding area corresponds to one first skin weight. If the child bone binding area corresponds to multiple skin weights, it will increase the complexity of the child bone in controlling the model, thereby affecting the smoothness of the skin weight transition and the coordination of the virtual object's simulation movement.
[0144] Specifically, the values of the second skin weights are set according to the positions of the first target area, the second target area, and the third target area and their respective corresponding second skin weights. For example, the second skin weight of the first target area is obtained by reducing its first skin weight. The first target area is located at or near the joint binding area and is adjacent to the parent bone binding area. Since the first skin weight of the child bone for the parent bone binding area is small, the first skin weight of the first target area can be directly reduced to be equal to the first skin weight of the parent bone binding area to ensure smooth transition of skin weights and coordination of the simulated movement of the virtual object.
[0145] Correspondingly, the adjustment methods of the second skin weights of the second target area and the third target area are the same as that of the first target area. The second skin weight of the second target area is increased compared to its first skin weight. The second target area is located in the joint binding area and is adjacent to the child bone binding area. Therefore, the first skin weight of the second target area can be directly increased to be equal to the first skin weight of the child bone binding area. The second skin weight of the third target area is increased compared to its first skin weight. The third target area is located in the parent bone binding area and is adjacent to the joint binding area. Therefore, the first skin weight of the third target area can be directly increased to be equal to the first skin weight of the joint binding area.
[0146] Thus, by adjusting the second skin weight of the target area to be equal to the skin weight of its adjacent area, the complexity of the bone control model can be greatly reduced, the smoothness of the skin weight transition between different areas of the model can be improved, and the coordination of the simulated movement of the virtual object can be enhanced.
[0147] Optionally, the embodiments of the present application further include:
[0148] Obtain a fourth mesh vertex, where the fourth mesh vertex is the two mesh vertices closest to the first mesh vertex along the bone growth direction;
[0149] Obtain a fifth mesh vertex, and determine the mesh vertex closest to the first mesh vertex in the direction perpendicular to the bone growth direction as the fifth mesh vertex;
[0150] Obtain the connection line between the fourth mesh vertex and the fifth mesh vertex as the newly added mesh line of the model;
[0151] Obtain the wiring result after deleting the first mesh vertex and the mesh line connecting the first mesh vertex and the fifth mesh vertex as the wiring modification result of the model.
[0152] In some embodiments, to eliminate and avoid abnormal deformation of the model to the greatest extent, the model can be further modified in wireframe after obtaining the second skin weight. Among them, wireframe modification refers to modifying the layout of the model mesh lines of the virtual object, such as modifying the distribution position, quantity, direction, etc. of the mesh lines.
[0153] As Figure 7 shown, two fourth mesh vertices closest to the first mesh vertex can be determined first along the bone growth direction, and one fifth mesh vertex closest to the first mesh vertex can be determined along the direction perpendicular to the bone growth direction, and the connection line between the fourth mesh vertex and the fifth mesh vertex is obtained as the newly added mesh line of the model. Correspondingly, after deleting the first mesh vertex and the mesh line connecting the first mesh vertex and the fifth mesh vertex, the wireframe modification operation of the model is completed. It can be understood that the two newly added mesh lines are dispersed on both sides of the mesh line connecting the first mesh vertex and the fifth mesh vertex, which is beneficial to dispersing and weakening the influence of the bone on the original first target area in the model.
[0154] It can be seen from this that in the embodiments of the present application, each target area can be determined first through the first mesh vertex, and after obtaining the second skin weight of each target area, the first mesh vertex and the related mesh lines can be deleted directly, which can eliminate the influence of the bone on the position of the original first mesh vertex in the model, and the influence of the bone on the original first target area in the model can be dispersed and weakened by adding new mesh lines.
[0155] Please refer to Figure 3 , Figure 3 which is another schematic flowchart of the skinning method of the virtual object provided by the embodiments of the present application. The specific process of this method can be as follows:
[0156] Step 301, obtain the motion state of the virtual object;
[0157] Step 302, determine the first target area on the virtual object according to the motion state of the virtual object;
[0158] Step 303, determine the second target area on the virtual object according to the motion state of the virtual object;
[0159] Step 304, determine the third target area on the virtual object according to the motion state of the virtual object;
[0160] Step 305, obtain the first skin weights of the first target area, the second target area, and the third target area;
[0161] Step 306, adjust the first skin weights of the first target area, the second target area, and the third target area to the second skin weights;
[0162] Step 307, adjust the second skin weights.
[0163] Step 308, perform a wiring modification operation on the grid lines of the virtual object.
[0164] To better implement the above method, an embodiment of the present application further provides a skinning device for a virtual object. Please refer to Figure 8 , Figure 8 which is a schematic structural diagram of the skinning device for the virtual object provided by the embodiment of the present application. The skinning device for the virtual object may include:
[0165] A target area acquisition unit 310, configured to determine a target area on the virtual object according to the motion state of the virtual object; wherein, the bones of the virtual object have been initially skinned and bound, the motion state is controlled by the motion state of the bones of the virtual object, and the target area is the area where the virtual object undergoes a contraction deformation;
[0166] A first skinning weight acquisition unit 320, configured to acquire a first skinning weight, where the first skinning weight represents the control degree of the bones of the virtual object on the target area under the initial skinning binding;
[0167] A second skinning weight acquisition unit 330, configured to adjust the first skinning weight to a second skinning weight so that the bones of the virtual object are skinned and bound again.
[0168] Optionally, the target area acquisition unit 310 is further configured to:
[0169] Acquire the joint points of the bones and the intermediate grid lines of the joint points, where the intermediate grid lines are located at the protrusions of the joint points;
[0170] Acquire the intersection points of the intermediate grid lines and the inner grid lines of the joint points, and the intersection points are the first grid vertices;
[0171] Determine the area where the grids in the model have a preset relationship with the first grid vertices as the first target area in the target area.
[0172] Optionally, the target area acquisition unit 310 is further configured to:
[0173] Acquire the intersection points of the intermediate grid lines and the outer grid lines of the joint points, and the intersection points are the second grid vertices;
[0174] Determine the area where the grids in the model have a second preset relationship with the second grid vertices as the second target area in the target area.
[0175] Optionally, the target area acquisition unit 310 is further configured to:
[0176] Determine at least one mesh vertex between the first target area and the second target area as the third mesh vertex, and the third mesh vertex is located in the parent bone binding area of the model;
[0177] Determine the area where the mesh in the model has a third preset relationship with the third mesh vertex as the third target area in the target area.
[0178] Optionally, the second skin weight acquisition unit 330 is further configured to:
[0179] Reduce the first skin weight of the first target area controlled by the child bone of the bone, and record the reduced first skin weight of the first target area as the second skin weight of the first target area;
[0180] Increase the first skin weight of the second target area and the third target area controlled by the child bone as the second skin weight of the second target area and the third target area; wherein, the second skin weight of the second target area is greater than the second skin weight of the third target area, and the second skin weight of the third target area is greater than the second skin weight of the first target area.
[0181] Optionally, the device further includes:
[0182] A first acquisition unit, configured to acquire the second skin weights of the second target area and the third target area;
[0183] A first adjustment unit, configured to adjust the second skin weights of the second target area and the third target area to make the difference between the second skin weights of the second target area and the third target area smaller.
[0184] Optionally, the device further includes:
[0185] A second acquisition unit, configured to acquire the second skin weight of the adjusted first target area, and the second skin weight of the adjusted first target area is equal to the first skin weight of the parent bone binding area;
[0186] A third acquisition unit, configured to acquire the second skin weight of the adjusted second target area, and the second skin weight of the adjusted second target area is equal to the first skin weight of the child bone binding area;
[0187] A fourth acquisition unit, configured to acquire the second skin weight of the adjusted third target area, and the second skin weight of the adjusted third target area is equal to the first skin weight of the joint point binding area.
[0188] Optionally, the device further includes:
[0189] A fourth grid vertex acquisition unit for acquiring fourth grid vertices, where the fourth grid vertices are two grid vertices closest to the first grid vertex along the bone growth direction;
[0190] A fifth grid vertex acquisition unit for acquiring fifth grid vertices, and determining, along the direction perpendicular to the bone growth direction, a grid vertex closest to the first grid vertex as the fifth grid vertex;
[0191] A new grid line acquisition unit for acquiring the connection line between the fourth grid vertex and the fifth grid vertex as the new grid line added to the model;
[0192] A wiring result acquisition unit for acquiring the wiring result after deleting the first grid vertex and the grid line connecting the first grid vertex and the fifth grid vertex as the wiring modification result of the model.
[0193] Optionally, the device further includes:
[0194] A simulation result acquisition unit for performing motion simulation on the virtual object to obtain a simulation result;
[0195] A motion state acquisition unit for acquiring the motion state from the simulation result.
[0196] In specific implementation, the above units can be implemented as independent entities, or can be combined arbitrarily to be implemented as the same or several entities. For the specific implementation of the above units, reference can be made to the method embodiments described above, which will not be elaborated here.
[0197] The skinning device for a virtual object provided in an embodiment of the present application determines a target area on the virtual object according to the motion state of the virtual object; wherein, the bones of the virtual object have been initially skinned and bound, the motion state is controlled by the bones of the virtual object, and the target area is the area where the virtual object undergoes contraction deformation; acquiring a first skinning weight; the first skinning weight characterizes the control degree of the bones of the virtual object on the target area under the initial skinning binding; and adjusting the first skinning weight to a second skinning weight so that the bones of the virtual object are skinned and bound again.
[0198] As can be seen from the above, the embodiment of the present application can quickly and accurately determine the target area for adjusting the skinning weight in the model of the virtual object, and accurately adjust the skinning weight of the target area, so as to efficiently and accurately determine the skinning weight of the virtual object, thereby improving the authenticity and coordination of the virtual object's bones controlling the virtual object to perform simulation actions.
[0199] Correspondingly, an embodiment of the present application further provides a computer device, which can be a terminal or a server. The terminal can be a terminal device such as a smart phone, a tablet computer, a notebook computer, a touch screen, a game console, a personal computer, a personal digital assistant (PDA), etc.
[0200] As Figure 9 shown, Figure 9 is a schematic structural diagram of the computer device provided by the embodiment of the present application. The computer device 400 includes a processor 401 having one or more processing cores, a memory 402 having one or more computer-readable storage media, and a computer program stored on the memory 402 and executable on the processor. Among them, the processor 401 is electrically connected to the memory 402. Those skilled in the art can understand that the structure of the computer device shown in the figure does not constitute a limitation on the computer device, and it may include more or fewer components than shown, or combine certain components, or arrange different components.
[0201] The processor 401 is the control center of the computer device 400, connecting various parts of the entire computer device 400 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 402, and calling data stored in the memory 402, it executes various functions of the computer device 400 and processes data, thereby monitoring the computer device 400 as a whole.
[0202] In the embodiment of the present application, the processor 401 in the computer device 400 will load the instructions corresponding to the processes of one or more application programs into the memory 402 according to the following steps, and the processor 401 will run the application programs stored in the memory 402 to implement various functions:
[0203] Determine a target area on the virtual object according to the motion state of the virtual object; wherein, the skeleton of the virtual object has been initially skinned and bound, the motion state is controlled by the motion state of the skeleton of the virtual object, and the target area is the area where the virtual object undergoes shrinkage deformation;
[0204] Obtain a first skinning weight; the first skinning weight represents the degree of control of the skeleton of the virtual object over the target area under the initial skinning and binding;
[0205] Adjust the first skinning weight to a second skinning weight so that the skeleton of the virtual object is skinned and bound again.
[0206] Optionally, the target area includes a first target area, and the motion state is used to represent at least one of the posture, displacement, direction, and angle generated when the virtual object is in motion. Determining the target area on the virtual object according to the motion state of the virtual object includes:
[0207] Obtain the joint points of the bones of the virtual object and the intermediate grid lines of the joint points, where the intermediate grid lines are located at the convex parts of the joint points;
[0208] Obtain the intersection points of the intermediate grid lines and the inner grid lines of the joint points, and the intersection points are the first grid vertices;
[0209] Determine the area of the grid in the virtual object that has a preset relationship with the first grid vertex as the first target area in the target area.
[0210] Optionally, the target area further includes a second target area. Determining the target area on the virtual object according to the motion state of the virtual object includes:
[0211] Obtain the intersection points of the intermediate grid lines and the outer grid lines of the joint points, and the intersection points are the second grid vertices;
[0212] Determine the area of the grid in the virtual object that has a second preset relationship with the second grid vertex as the second target area in the target area.
[0213] Optionally, the target area further includes a third target area. Determining the target area on the virtual object according to the motion state of the virtual object includes:
[0214] Determine at least one grid vertex between the first target area and the second target area as the third grid vertex, and the third grid vertex is located in the parent bone binding area of the virtual object;
[0215] Determine the area of the grid in the virtual object that has a third preset relationship with the third grid vertex as the third target area in the target area.
[0216] Optionally, adjusting the first skin weight to the second skin weight includes:
[0217] Reduce the first skin weight of the first target area, and record the reduced first skin weight of the first target area as the second skin weight of the first target area;
[0218] Increase the first skinning weights of the second target area and the third target area controlled by the child bone as the second skinning weights of the second target area and the third target area; wherein, the second skinning weight of the second target area is greater than the second skinning weight of the third target area, and the second skinning weight of the third target area is greater than the second skinning weight of the first target area.
[0219] Optionally, the method further includes:
[0220] Obtain the second skinning weights of the second target area and the third target area;
[0221] Adjust the second skinning weights of the second target area and the third target area to make the difference between the second skinning weights of the second target area and the third target area smaller.
[0222] Optionally, the method further includes:
[0223] Obtain the second skinning weight of the adjusted first target area, and the second skinning weight of the adjusted first target area is equal to the first skinning weight of the parent bone binding area;
[0224] Obtain the second skinning weight of the adjusted second target area, and the second skinning weight of the adjusted second target area is equal to the first skinning weight of the child bone binding area;
[0225] Obtain the second skinning weight of the adjusted third target area, and the second skinning weight of the adjusted third target area is equal to the first skinning weight of the joint point binding area.
[0226] Optionally, the method further includes:
[0227] Obtain the fourth mesh vertex, and the fourth mesh vertex is the two mesh vertices closest to the first mesh vertex along the bone growth direction;
[0228] Obtain the fifth mesh vertex, and determine the mesh vertex closest to the first mesh vertex along the direction perpendicular to the bone growth direction as the fifth mesh vertex;
[0229] Obtain the line connecting the fourth mesh vertex and the fifth mesh vertex as the newly added mesh line of the virtual object;
[0230] Obtain the wiring result after deleting the first mesh vertex and the mesh line connecting the first mesh vertex and the fifth mesh vertex as the wiring modification result of the virtual object.
[0231] Optionally, before determining the target area on the virtual object according to the motion state of the virtual object, the method further includes:
[0232] Performing motion simulation on the virtual object to obtain a simulation result;
[0233] Obtaining the motion state from the simulation result.
[0234] It can be seen that the embodiments of the present application can quickly and accurately determine the target area of the skinning weight to be adjusted in the model on the virtual object, and accurately adjust the skinning weight of the target area, so as to efficiently and accurately determine the final skinning weight of the virtual object, thereby improving the authenticity and coordination of the virtual object's bone control for the virtual object to perform simulation actions on the model.
[0235] For the specific implementation of each of the above operations, reference may be made to the previous embodiments, which will not be elaborated here.
[0236] Optionally, as Figure 9 shown, the computer device 400 further includes: a touch display screen 403, a radio frequency circuit 404, an audio circuit 405, an input unit 406, and a power supply 407. Among them, the processor 401 is electrically connected to the touch display screen 403, the radio frequency circuit 404, the audio circuit 405, the input unit 406, and the power supply 407 respectively. Those skilled in the art can understand that Figure 9 the computer device structure shown in
[0237] The touch display screen 403 can be used to display a graphical user interface and receive operation instructions generated by a user acting on the graphical user interface. The touch display screen 403 may include a display panel and a touch panel. Among them, the display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the computer device. These graphical user interfaces can be composed of graphics, text, icons, videos, and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. The touch panel can be used to collect touch operations of the user on or near it (such as operations of the user using a finger, a stylus, or any suitable object or accessory on or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel can include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the touch orientation of the user, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 401, and can receive and execute commands sent by the processor 401. The touch panel can cover the display panel. After the touch panel detects a touch operation on or near it, it is transmitted to the processor 401 to determine the type of touch event. Subsequently, the processor 401 provides corresponding visual output on the display panel according to the type of touch event. In the embodiments of the present application, the touch panel and the display panel can be integrated into the touch display screen 403 to implement input and output functions. However, in some embodiments, the touch panel and the touch panel can be implemented as two independent components to implement input and output functions. That is, the touch display screen 403 can also be used as part of the input unit 406 to implement the input function.
[0238] In the embodiments of the present application, the processor 401 executes a game application to generate a graphical user interface on the touch display screen 403. The virtual scene on the graphical user interface includes at least one skill control area, and the skill control area includes at least one skill control. The touch display screen 403 is used to present the graphical user interface and receive operation instructions generated by a user acting on the graphical user interface.
[0239] The radio frequency circuit 404 can be used to transmit and receive radio frequency signals to establish wireless communication with a network device or other computer devices through wireless communication, and transmit and receive signals with the network device or other computer devices.
[0240] The audio circuit 405 can be used to provide an audio interface between the user and the computer device through a speaker and a microphone. The audio circuit 405 can convert the received audio data into an electrical signal and transmit it to the speaker, which converts it into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 405, converted into audio data, and then the audio data is output to the processor 401 for processing. After that, it is sent through the radio frequency circuit 404 to, for example, another computer device, or the audio data is output to the memory 402 for further processing. The audio circuit 405 may also include an earphone jack to provide communication between the peripheral earphone and the computer device.
[0241] The input unit 406 can be used to receive input digital, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
[0242] The power supply 407 is used to supply power to each component of the computer device 400. Optionally, the power supply 407 can be logically connected to the processor 401 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system. The power supply 407 may also include any components such as one or more DC or AC power supplies, a recharge system, a power failure detection circuit, a power converter or inverter, and a power status indicator.
[0243] Although Figure 9 not shown in the figure, the computer device 400 may also include a camera, a sensor, a Wi-Fi module, a Bluetooth module, etc., which will not be elaborated here.
[0244] In the above embodiments, the descriptions of the various embodiments have their own focuses. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0245] As can be seen from the above, the computer device provided in this embodiment can quickly and accurately determine the target area of the skinning weight to be adjusted on the virtual object by executing the skinning method of the virtual object, and accurately adjust the skinning weight of the target area, so as to be able to efficiently and accurately determine the skinning weight of the virtual object, and improve the authenticity and coordination of the simulation actions of the virtual object controlled by the skeleton of the virtual object.
[0246] Those of ordinary skill in the art can understand that all or part of the steps in the above various methods can be completed by instructions, or by controlling relevant hardware through instructions. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0247] To this end, an embodiment of the present application provides a computer-readable storage medium, which stores multiple computer programs that can be loaded by a processor to execute the steps in any of the skinning methods of virtual objects provided by the embodiments of the present application. For example, the computer program can execute the following steps:
[0248] Determine a target area on the virtual object according to the motion state of the virtual object; wherein, the bones of the virtual object have been initially skinned and bound, the motion state is controlled by the motion state of the bones of the virtual object, and the target area is the area where the virtual object undergoes shrinkage deformation;
[0249] Obtain a first skinning weight; the first skinning weight represents the degree of control of the bones of the virtual object over the target area under the initial skinning binding;
[0250] Adjust the first skinning weight to a second skinning weight so that the bones of the virtual object are skinned and bound again. For the specific implementation of each of the above operations, reference can be made to the previous embodiments, which will not be elaborated here.
[0251] Among them, the storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc.
[0252] Since the computer program stored in the storage medium can execute the steps in any of the skinning methods of virtual objects provided by the embodiments of the present application, the beneficial effects that can be achieved by any of the skinning methods of virtual objects provided by the embodiments of the present application can be realized. For details, reference can be made to the previous embodiments, which will not be elaborated here.
[0253] The above has introduced in detail a skinning method, device, storage medium and computer device of a virtual object provided by the embodiments of the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A skinning method for virtual objects, characterized in that, The method includes: Determine a target area on the virtual object according to the motion state of the virtual object; wherein, the target area includes adjacent first, second, and third target areas, the first target area and the second target area are respectively located inside and outside the joint point of the bone of the virtual object, and the third target area is located in the parent bone binding area of the virtual object; the bone of the virtual object has been initially skinned and bound, the motion state is controlled by the bone of the virtual object, and the target area is the area where the virtual object undergoes contractile deformation; Obtain a first skinning weight; the first skinning weight represents the control degree of the bone of the virtual object over the target area under the initial skinning binding; Adjust the first skinning weight to a second skinning weight so that the bone of the virtual object undergoes re-skinning binding, including: reducing the first skinning weight of the first target area, and increasing the first skinning weights of the second target area and the third target area controlled by the child bone, to obtain the skinning weight of the first target area, the skinning weight of the second target area, and the second skinning weight of the third target area.
2. The skinning method of a virtual object according to claim 1, characterized in that, The motion state is used to represent at least one of the posture, displacement, direction, and angle generated when the virtual object moves. Determining the target area on the virtual object according to the motion state of the virtual object includes: Obtain the joint points of the bone of the virtual object, and the intermediate grid lines of the joint points, where the intermediate grid lines are located at the convex parts of the joint points; Obtain the intersection point of the intermediate grid line and the inner grid line of the joint point, and the intersection point is the first grid vertex; Determine the area where the grid in the virtual object has a preset relationship with the first grid vertex as the first target area in the target area.
3. The skinning method of a virtual object according to claim 2, wherein Determining the target area on the virtual object according to the motion state of the virtual object includes: Obtain the intersection point of the intermediate grid line and the outer grid line of the joint point, and the intersection point is the second grid vertex; Determine the area where the grid in the virtual object has a second preset relationship with the second grid vertex as the second target area in the target area.
4. The skinning method of a virtual object according to claim 3, characterized in that, Determining the target area on the virtual object according to the motion state of the virtual object includes: Determine at least one grid vertex located between the first target area and the second target area as the third grid vertex, and the third grid vertex is located in the parent bone binding area of the virtual object; Determine the area where the grid in the virtual object has a third preset relationship with the third grid vertex as the third target area in the target area.
5. The skinning method of a virtual object according to any one of claims 2-4, characterized in that, The second skinning weight of the second target area is greater than the second skinning weight of the third target area, and the second skinning weight of the third target area is greater than the second skinning of the first target area.
6. The skinning method of a virtual object according to claim 5, characterized in that The method further includes: Obtain the second skinning weights of the second target area and the third target area; Adjust the second skin weights of the second target area and the third target area to make the difference between the second skin weights of the second target area and the third target area smaller.
7. The skinning method of a virtual object as claimed in claim 5, wherein The method further includes: Obtain the second skin weight of the adjusted first target area, where the second skin weight of the adjusted first target area is equal to the first skin weight of the parent bone binding area; Obtain the second skin weight of the adjusted second target area, where the second skin weight of the adjusted second target area is equal to the first skin weight of the child bone binding area; Obtain the second skin weight of the adjusted third target area, where the second skin weight of the adjusted third target area is equal to the first skin weight of the joint point binding area.
8. The skinning method of a virtual object according to any one of claims 2-4, characterized in that, The method further includes: Obtain a fourth mesh vertex, where the fourth mesh vertex is the two mesh vertices closest to the first mesh vertex along the bone growth direction; Obtain a fifth mesh vertex, and determine the mesh vertex closest to the first mesh vertex in the direction perpendicular to the bone growth direction as the fifth mesh vertex; Obtain the line connecting the fourth mesh vertex and the fifth mesh vertex as the newly added mesh line of the virtual object; Obtain the wiring result after deleting the first mesh vertex and the mesh line connecting the first mesh vertex and the fifth mesh vertex as the wiring modification result of the virtual object.
9. The skinning method of the virtual object according to claim 1, wherein Before determining the target area on the virtual object according to the motion state of the virtual object, it further includes: Perform motion simulation on the virtual object to obtain a simulation result; Obtain the motion state from the simulation result.
10. A skinning device for virtual objects, characterized in that, The device includes: A target area acquisition unit, configured to determine a target area on the virtual object according to the motion state of the virtual object; where the target area includes adjacent first, second, and third target areas, the first target area and the second target area are respectively located inside and outside the joint point of the bone of the virtual object, and the third target area is located in the parent bone binding area of the virtual object; the bone of the virtual object has been initially skinned and bound, the motion state is controlled by the bone of the virtual object, and the target area is the area where the virtual object undergoes shrinkage deformation; A first skin weight acquisition unit, configured to obtain a first skin weight, where the first skin weight represents the degree of control of the bone of the virtual object over the target area under the initial skin binding; A second skin weight acquisition unit, configured to adjust the first skin weight to a second skin weight to perform re-skinning binding on the bone of the virtual object, and is further configured to reduce the first skin weight of the first target area and increase the first skin weights of the second target area and the third target area controlled by the child bone, to obtain the skin weight of the first target area, the skin weight of the second target area, and the second skin weight of the third target area.
11. An electronic device, characterized in that, It includes a processor and a memory, and the memory stores multiple instructions; the processor loads the instructions from the memory to execute the steps in the skinning method of the virtual object according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores multiple instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the skinning method of the virtual object according to any one of claims 1 to 9.
Citation Information
Patent Citations
Model training method and device, equipment and storage medium
CN112991502A