Maya-based hair patch binding method, electronic equipment and storage medium
By automatically identifying the midline of hair patches in Maya, generating bone nodes, and configuring weights, the problem that existing hair patch binding methods are difficult to ensure consistency and nature is solved, and the efficiency and animation quality of hair binding are improved. Adapt to hair animation needs of different styles and complexities.
Patent Information
- Application Number
- CN202411299547.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2024-12-24
AI Technical Summary
The existing hair patch binding method is difficult to ensure the consistency and nature of the animation, and lacks flexibility, so it cannot adapt to the needs of hair animation of different styles and complexities.
Using Maya-based hair patch binding method, the hair patch is divided into grids, the midline of the grid is automatically identified and bone nodes are generated, and the weight is configured to achieve automatic binding of hair patches. Specific steps include: grid segmentation, midline recognition, and placement and weight configuration of bone nodes, providing grid segmentation module, midline recognition module and hair patch binding module, and using the controller settings module to adjust bones and weights.
It greatly improves the efficiency and animation quality of hair binding, realizes the consistency and nature of animation, and adapts to hair animation needs of different styles and complexities.
Smart Images

Figure CN119180894A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of three-dimensional modeling, and in particular to a hair patch binding method based on Maya, an electronic device and a storage medium. Background Art
[0002] In 3D animation production, hair simulation and animation is a complex and time-consuming process. Traditionally, this process requires artists to manually create hair patches and then bind bones and weights one by one, which is not only inefficient but also difficult to ensure the consistency and naturalness of the animation. With the development of computer graphics and software engineering, although some automated tools have emerged to simplify this process, these tools often lack flexibility and cannot adapt to the needs of hair animation of different styles and complexities. Summary of the invention
[0003] The present invention proposes a hair patch binding method, electronic device and storage medium based on Maya, so as to solve the technical problems that the existing hair patch binding method is difficult to ensure consistency and naturalness and lacks flexibility.
[0004] In order to solve the above technical problems, the present invention provides a hair patch binding method based on Maya, comprising the following steps:
[0005] Step S1: Divide the hair patch into w×h grids;
[0006] Step S2: when the mesh is an even number in the width direction, a skeleton node is generated at the midline position; when the mesh is an odd number in the width direction, a skeleton node is generated at the centerline position of the middle mesh;
[0007] Step S3: configuring the weights of the bone nodes to complete the hair patch binding.
[0008] Preferably, in step S1, the following method is used to identify whether the grid is even or odd in the width direction: extract the outermost circle of the hair patch, then find the surfaces connected to the outermost circle, and continue to diffuse. When the last diffusion covers all surfaces, the last diffused surface is regarded as the core surface; select any one of the core surfaces, traverse the points on the core surface, if this point has four connected surfaces, and the four surfaces all belong to the core surface, then the grid is even in the width direction, otherwise it is odd.
[0009] Preferably, in step S2, when the grid is odd in width, the center line of the middle grid is generated by the following method: list the edges of the core surface, if the two adjacent surfaces of the edge of the core surface are both core surfaces, then the edge is a communication edge; connect the midpoints of the communication edges to form the center line of the middle grid.
[0010] Preferably, in step S2, when placing the bone node, a target constraint is set: the x-axis of the bone node points to the next joint, and the y-axis points to the point to the right.
[0011] Preferably, the right point is determined by the following method:
[0012] Calculate V1 = AO cross product CO, V2 = BO cross product CO, where A and B represent the points on both sides of the joint node O, and C represents the next joint node;
[0013] V1 and V2 are then multiplied by the point vector of point O respectively, and the point corresponding to the smaller value belongs to the point on the right.
[0014] The present invention also provides a hair patch binding system based on Maya, which is implemented based on the above-mentioned hair patch binding method based on Maya, and includes a mesh segmentation module, a midline recognition module and a hair patch binding module;
[0015] The grid segmentation module is used to segment the hair patch into w×h grids;
[0016] The centerline identification module is used to identify the centerline of the grid;
[0017] The hair patch binding module is used to generate skeleton nodes based on the midline and configure weights to complete the hair patch binding.
[0018] Preferably, the system further comprises a controller setting module, and the controller setting module is used to provide a user interface for adjusting bones and weights.
[0019] The present invention also provides an electronic device, comprising: a memory, a processor and a computer program, wherein the computer program is stored in the memory and is configured so that the processor executes the above-mentioned Maya-based hair patch binding method.
[0020] The present invention also provides a computer-readable storage medium, in which a computer program is stored. The computer program is executed by a processor to implement the above-mentioned Maya-based hair patch binding method.
[0021] The beneficial effects of the present invention include at least: the present invention greatly improves the efficiency of binding and the quality of animation by automatically identifying the center line of the hair patch and generating bones and weights accordingly. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 A schematic diagram of a method flow of an embodiment of the present invention;
[0023] Figure 2 A schematic diagram of grid segmentation according to an embodiment of the present invention;
[0024] Figure 3 A schematic diagram of a grid centerline according to an embodiment of the present invention;
[0025] Figure 4 A schematic diagram of core face identification according to an embodiment of the present invention;
[0026] Figure 5 A schematic diagram of centerline identification according to an embodiment of the present invention;
[0027] Figure 6 The figure is a schematic diagram of the placement of skeleton nodes according to an embodiment of the present invention. DETAILED DESCRIPTION
[0028] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the protection scope of the present invention.
[0029] The embodiment of the present invention provides a hair patch binding method based on Maya, comprising the following steps:
[0030] Step S1: Divide the hair patch into w×h grids.
[0031] Specifically, start Maya software and load the hair patch model. Make sure the model has been cleaned and is ready for binding. The mesh division is determined by the modeler based on the modeling requirements. When dividing the mesh, the modeler performs deformation and pulling and other adjustment operations on the regular rectangle to divide the hair patch into w×h grids. w refers to the number of grids on the short side of the rectangle, that is, the number of grids in the width direction, and h refers to the number of grids on the long side of the rectangle, that is, the number of grids in the length direction. In the binding stage, the bones are positioned according to the regular rectangular hair piece for binding.
[0032] Step S2: When the mesh has an even number in the width direction, a bone node is generated at the midline position; when the mesh has an odd number in the width direction, a bone node is generated at the centerline position of the middle mesh.
[0033] Specifically, since the number of grid segments is uncertain, such as Figure 2 As shown, the embodiment of the present invention now needs to identify the grid. For odd-numbered hair pieces, a skeleton needs to be generated in the middle of the grid. For even-numbered hair pieces, a skeleton needs to be generated at the midline position, such as Figure 3 shown.
[0034] Therefore, the embodiment of the present invention provides the following method for automatic recognition of meshes: first find the core face, find the outermost face, then find the faces connected to these faces, and continue to diffuse until the last diffusion covers all faces. The face (BA) diffused in the last diffusion is the core face of the patch to be found, such as Figure 4 shown.
[0035] After that, select any face on the core patch and traverse the points on the face. If this point has 4 connected faces and all 4 faces belong to the core patch, it is an even face, otherwise it is an odd face.
[0036] For odd-numbered faces, we need to further find the intersecting edges of the faces as skeletons, such as Figure 5 As shown: List the edges of the core face. If the two adjacent faces of this edge belong to the core, it is a communication edge. The midpoint of the communication edge can be used to determine the center line of the grid.
[0037] For even-numbered faces, you need to find the midline as the skeleton.
[0038] Step S3: Configure the weights of the bone nodes and the hair patches to complete the hair patch binding.
[0039] In the embodiment of the present invention, when placing each bone, the x-axis is required to face the next joint and the y-axis faces the right.
[0040] Specifically, Figure 6 As shown, calculate V1 = AO cross product CO, V2 = BO cross product CO, where A and B represent the points on both sides of the joint node O, and C represents the next joint node;
[0041] V1 and V2 are then multiplied by the point vector of point O respectively. The smaller one indicates that the direction is more consistent with the point vector and belongs to the point on the right.
[0042] Based on the above results, a target constraint is performed, that is, the x-axis of the bone node points to the next joint, and the y-axis points to the point to the right.
[0043] In the specific operation, open the target constraint window in Maya software, set the x-axis (1, 0, 0) as the target vector, the y-axis (0, 1, 0) as the up vector, and select the world up type as "object up". Build a temporary block through the right point position, and fill the block into the "world up object". After the constraint, the current joint x-axis is constrained by the next joint, that is, the current joint x-axis points to the next joint, and the y-axis points to the right point of the joint. The z-axis is approximately perpendicular to the current surface. It meets the binding requirements.
[0044] Finally, when generating bone nodes, set the density of bones, that is, how many points are there between each bone, and adjust the starting position, that is, from which point the first bone is generated. Ensure that it is correctly arranged along the center line and matches the dynamics of the hair patch.
[0045] Assign weights to the fur patches and bone nodes, making sure the weights are evenly distributed so that the fur moves smoothly with the bones during animation.
[0046] The present invention also provides a hair patch binding system based on Maya, which is implemented based on the above-mentioned hair patch binding method based on Maya, and includes a mesh segmentation module, a midline recognition module and a hair patch binding module;
[0047] A mesh segmentation module is used to segment the hair patch into w×h meshes;
[0048] A centerline identification module, used to identify the centerline of the grid;
[0049] The hair patch binding module is used to generate bone nodes based on the midline and configure weights to complete the hair patch binding.
[0050] 7. A Maya-based hair patch binding system according to claim 6, characterized in that the system further comprises a controller setting module, which is used to provide a user interface for adjusting bones and weights.
[0051] The present invention also provides an electronic device, comprising: a memory, a processor and a computer program, wherein the computer program is stored in the memory and is configured to be executed by the processor to implement the above-mentioned Maya-based hair patch binding method.
[0052] The present invention also provides a computer-readable storage medium, in which a computer program is stored. The computer program is executed by a processor to implement the above-mentioned Maya-based hair patch binding method.
[0053] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. Only the preferred embodiments of the present invention are expressed. The description is more specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. As long as there is no contradiction in the combination of these technical features, they should be considered as the scope recorded in this specification.
[0054] It should be noted that, for those skilled in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these modifications and improvements all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A hair patch binding method based on Maya, characterized in that: The following steps are involved: Step S1: Divide the hair patch into w×h grids; Step S2: when the mesh is an even number in the width direction, a skeleton node is generated at the midline position; when the mesh is an odd number in the width direction, a skeleton node is generated at the centerline position of the middle mesh; Step S3: configuring the weights of the skeleton nodes and the hair patches to complete the hair patch binding.
2. The method for binding hair patches based on Maya according to claim 1, characterized in that: In step S1, the following method is used to identify whether the grid is even or odd in the width direction: extract the outermost circle of the hair patch, then find the surfaces connected to the outermost circle, and continue to diffuse. When the last diffusion covers all surfaces, the last diffused surface is regarded as the core surface; select any one of the core surfaces, traverse the points on the core surface, if this point has four connected surfaces, and the four surfaces all belong to the core surface, then the grid is even in the width direction, otherwise it is odd.
3. The method for binding hair patches based on Maya according to claim 2, characterized in that: In step S2, when the grid is odd in width, the center line of the middle grid is generated by the following method: list the edges of the core surface, if the two adjacent surfaces of the edge of the core surface are both core surfaces, then the edge is a communication edge; connect the midpoints of the communication edges to form the center line of the middle grid.
4. The method for binding hair patches based on Maya according to claim 1, characterized in that: Step S2 sets the target constraint when placing the bone node: the x-axis of the bone node points to the next joint, and the y-axis points to the point to the right.
5. The method for binding hair patches based on Maya according to claim 4, characterized in that: The right point is determined by the following method: Calculate V1 = AO cross product CO, V2 = BO cross product CO, where A and B represent the points on both sides of the joint node O, and C represents the next joint node; V1 and V2 are then multiplied by the point vector of point O respectively, and the point corresponding to the smaller value belongs to the point on the right.
6. A hair patch binding system based on Maya, implemented based on a hair patch binding method based on Maya as claimed in any one of claims 1 to 5, characterized in that: It includes mesh segmentation module, midline recognition module and hair patch binding module; The grid segmentation module is used to segment the hair patch into w×h grids; The centerline identification module is used to identify the centerline of the grid; The hair patch binding module is used to generate skeleton nodes based on the midline and configure weights to complete the hair patch binding.
7. The hair patch binding system based on Maya according to claim 6, characterized in that: The system further comprises a controller setting module, which is used for providing a user interface to adjust bones and weights.
8. An electronic device, comprising: A memory, a processor and a computer program, characterized in that: the computer program is stored in the memory and is configured to be executed by the processor to implement a Maya-based hair patch binding method as described in any one of claims 1 to 5.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the Maya-based hair patch binding method according to any one of claims 1 to 5.
