BlendShapes transmission method and system based on UV mapping
By constructing model mapping relationships through UV mapping and calculating and superimposing vertex displacement vectors, the problem of facial expression deformation transmission under inconsistent topological structures is solved, achieving efficient, unified, and standardized facial expression transmission, applicable to different character models.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-01
- Publication Date
- 2026-03-10
AI Technical Summary
Existing technologies struggle to efficiently transfer facial expression deformations when character models have inconsistent topological structures, forcing artists to manually re-sculpt expressions, which is time-consuming, labor-intensive, and makes it difficult to ensure consistency in expression style and quality.
By using a UV mapping method, a mapping relationship between the source model and the target model is constructed, the vertex displacement vector of the target model is calculated, and the vector is superimposed on the base model of the target model to generate a BlendShapes deformable model, which is suitable for character models with different topologies.
It enables accurate transfer of facial expression deformation between different character models, reduces the amount of manual sculpting work, shortens the production cycle, ensures the uniformity and standardization of facial expression effects, and reduces project costs.
Smart Images

Figure CN121639876A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of 3D animation production technology, and in particular relates to a BlendShapes transfer method and system based on UV mapping. Background Technology
[0002] With the rapid development of 3D animation and digital visual effects technologies, BlendShapes has become a core method for creating facial expressions. This technology efficiently and smoothly drives facial deformation by linearly interpolating between a base model of a neutral expression and a series of target expression models, thereby generating rich facial animations. Within this technological framework, if it is necessary to transfer an existing high-quality set of expressions from one character model (called the source model) to another character model (called the target model), the industry typically uses a traditional transfer method that relies on topological consistency.
[0003] Traditional techniques require that the source and target models have completely identical mesh topologies, meaning the number of vertices, connection order, and wiring methods must be exactly the same. Under this premise, the software directly compares vertex indices and assigns the vertex displacement vector corresponding to each facial expression deformation on the source model to the corresponding vertex on the target model, thus achieving rapid facial expression replication. This method significantly improves production efficiency when processing character series with the same topology.
[0004] However, current transfer methods have significant limitations. In actual animation and game production, character models often exhibit significant topological differences. For example, the facial structures of different species (such as humans and animals) are drastically different, the topology rules of models from different art styles (such as realistic and cartoon) vary greatly, or models designed for special appearances have irregular vertex counts and topology. In these scenarios, traditional transfer methods based on topological consistency completely fail, forcing artists to manually resculpt all facial blends for each target model. This process is not only extremely time-consuming and labor-intensive, making it difficult to guarantee project progress, but also makes it difficult to maintain a consistent facial expression style and quality standard across different characters, becoming a major technical bottleneck restricting the reuse of character facial expression assets. Summary of the Invention
[0005] Therefore, it is necessary to provide a UV-mapping-based BlendShapes transfer method and system that can accurately transfer facial expression deformations even when the source model and the target model have completely different topological structures, thereby solving the topological limitation problem existing in the prior art.
[0006] Firstly, this application provides a BlendShapes transfer method based on UV mapping, including:
[0007] The source model's base model, at least one BlendShapes deformable model corresponding to the source model's base model, and the target model's base model are received; the source model and the target model have the same UV layout.
[0008] Based on the vertex UV coordinates of the base model of the target model and the UV mesh structure of the base model of the source model, a mapping relationship between the target model and the source model is constructed.
[0009] Calculate the vertex offsets from the base model of the source model to the BlendShapes deformed model of the source model; and based on the vertex offsets and mapping relationships, calculate the vertex displacement vectors of the target model.
[0010] The vertex displacement vectors of the target model are superimposed onto the base model of the target model to generate the BlendShapes deformable model corresponding to the target model.
[0011] Furthermore, based on the vertex UV coordinates of the base model of the target model and the UV mesh structure of the base model of the source model, a mapping relationship between the target model and the source model is constructed, including:
[0012] Obtain the UV coordinates of each vertex of the base model of the target model;
[0013] Based on the UV coordinates of each vertex, a location query process is performed on the UV mesh of the base model of the source model to determine the triangular facet of the UV mesh of the source model where the UV coordinates of each vertex are located.
[0014] Obtain the centroid coordinates of the UV coordinates of each vertex within the corresponding source model UV mesh triangle; store the centroid coordinates, the UV coordinates of each vertex, and the source model UV mesh triangle containing the UV coordinates of each vertex to generate a mapping relationship between the target model and the source model; the centroid coordinates are used to uniquely determine the relative position of the UV coordinates of each vertex within the triangle.
[0015] Furthermore, the vertex offsets from the base model of the source model to the BlendShapes deformed model of the source model are calculated; and based on the vertex offsets and mapping relationships, the vertex displacement vectors of the target model are calculated, including:
[0016] Perform coordinate operations on all corresponding vertices of the BlendShapes deformed model of the source model and the base model of the source model to obtain the vertex displacement vector of the BlendShapes deformed model of the source model relative to the base model of the source model.
[0017] Based on the mapping relationship, a lookup process is performed to obtain the triangular facet and centroid coordinates of each vertex of the target model's base model in the source model;
[0018] Based on the centroid coordinates, the vertex displacement vectors of the three vertices of the corresponding triangular facet in the source model are weighted and interpolated to obtain the vertex displacement vectors of the target model.
[0019] Furthermore, the vertex displacement vectors of the target model are superimposed onto the base model of the target model to generate the BlendShapes deformation model corresponding to the target model, including:
[0020] The feature size ratio between the base model of the source model and the base model of the target model is calculated; the feature size ratio is used to characterize the scaling factor.
[0021] The vertex displacement vectors of the target model are scaled according to the feature size ratio to obtain normalized vertex displacement vectors.
[0022] The normalized vertex displacement vectors are superimposed onto the corresponding vertex coordinates of the base model of the target model to generate the BlendShapes deformable model corresponding to the target model.
[0023] Furthermore, the method also includes:
[0024] The initial displacement field is obtained by calculating the geometric difference between the BlendShapes deformation model corresponding to the target model and the base model of the target model;
[0025] High-frequency detail components are extracted from the initial displacement field; these high-frequency detail components are key information reflecting local features in the initial displacement field.
[0026] High-frequency detail components are superimposed onto the BlendShapes deformable model corresponding to the target model to generate a BlendShapes deformable model corresponding to the target model with enhanced details.
[0027] Secondly, this application also provides a UV mapping-based BlendShapes transfer system, including:
[0028] The model receiving module is used to receive the base model of the source model, at least one BlendShapes deformable model corresponding to the base model of the source model, and the base model of the target model; the source model and the target model have the same UV layout.
[0029] The mapping relationship construction module is used to construct the mapping relationship between the target model and the source model based on the vertex UV coordinates of the base model of the target model and the UV mesh structure of the base model of the source model.
[0030] The vector generation module is used to calculate the vertex offsets from the base model of the source model to the BlendShapes deformed model of the source model; and based on the vertex offsets and mapping relationships, to calculate the vertex displacement vectors of the target model.
[0031] The deformation model generation module is used to superimpose the vertex displacement vectors of the target model onto the base model of the target model to generate the corresponding BlendShapes deformation model of the target model.
[0032] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, the at least one program, the code set or instruction set is loaded and executed by the processor to implement the UV mapping-based BlendShapes transfer method described in any of the embodiments of this application.
[0033] Fourthly, this application also provides a computer-readable storage medium storing at least one piece of program code, which is loaded and executed by a processor to implement the UV mapping-based BlendShapes transfer method described in any of the embodiments of this application.
[0034] The aforementioned BlendShapes transfer method and system based on UV mapping receives source and target model data with consistent UV layouts, constructs a mapping relationship using UV space as a bridge, calculates the vertex displacement vectors of the target model based on the mapping relationship, and superimposes the vertex displacement vectors of the target model onto the base model of the target model to generate the corresponding BlendShapes deformable model. This completely breaks the limitations of traditional methods on the consistency of model topology, eliminating the need for identical vertex counts, vertex order, and wiring methods between the source and target models. It is applicable to character models of different species, art styles, and unique shapes, effectively reducing the workload of manually resculpting expressions, significantly shortening the 3D animation production cycle, and ensuring that all target models can reuse high-quality expression templates from the source model, guaranteeing the uniformity and standardization of expression effects. This reduces the manpower and time costs of project production and significantly expands the application scenarios of BlendShapes technology in 3D animation, game production, and other fields. Attached Figure Description
[0035] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0036] Figure 1 This is a flowchart illustrating the BlendShapes transfer method based on UV mapping in one embodiment;
[0037] Figure 2 This is a flowchart illustrating the steps of constructing the mapping relationship between the target model and the source model based on the vertex UV coordinates of the base model of the target model and the UV mesh structure of the base model of the source model in one embodiment.
[0038] Figure 3 This is a schematic diagram of the structure of a UV mapping-based BlendShapes transfer system in one embodiment. Detailed Implementation
[0039] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0040] In one embodiment, a BlendShapes transfer method based on UV mapping is provided. This embodiment illustrates the application of this method to a terminal. It is understood that this method can also be applied to a server, and can also be applied to a system including both a terminal and a server, and implemented through the interaction between the terminal and the server. Figure 1 As shown, in this embodiment, the method includes the following steps:
[0041] Step S101: Receive the base model of the source model, at least one BlendShapes deformation model corresponding to the base model of the source model, and the base model of the target model; the source model and the target model have the same UV layout.
[0042] Among them, the base model refers to the neutral expression baseline model of the source character, which does not contain any expression deformation information; the base model of the target model refers to the neutral expression baseline model of the target character to be conveyed; the BlendShapes deformation model refers to a specific expression model obtained by adjusting the vertex position based on the base model of the source model, such as the model corresponding to expressions like smiling and frowning.
[0043] For example, the system receives the base model of the source model, at least one BlendShapes deformation model corresponding to the base model of the source model, and the base model of the target model. Each model contains key information such as vertex coordinates, UV coordinates, and mesh topology. The source model and the target model must have a consistent UV layout. Here, consistent UV layout (User Value Layout) means that their UV unfolded diagrams are similar in topology, that is, key feature regions (such as facial features) correspond in position in UV space, but the topology of the 3D mesh (such as the number of vertices and the connection order) can be arbitrarily different.
[0044] Step S102: Based on the vertex UV coordinates of the base model of the target model and the UV mesh structure of the base model of the source model, construct the mapping relationship between the target model and the source model.
[0045] Vertex UV coordinates refer to the coordinate values of each vertex of the 3D model on the 2D UV plane, which are used to associate the 3D surface with the 2D space; UV mesh structure refers to the mesh framework composed of several triangular facets after the 3D surface of the source model is unfolded into a 2D UV plane.
[0046] For example, a mapping relationship between the target model and the source model is constructed based on the vertex UV coordinates of the base model of the target model and the UV mesh structure of the base model of the source model.
[0047] Step S103: Calculate the vertex offset from the base model of the source model to the BlendShapes deformable model of the source model; and calculate the vertex displacement vector of the target model based on the vertex offset and the mapping relationship.
[0048] The mapping relationship is based on the consistent UV layout of the source model and the "spatial position correspondence rule" established in the UV space. The purpose is to enable the target model to accurately receive the facial expression deformation information of the source model.
[0049] For example, the vertex offsets from the source model's base model to its BlendShapes deformable model are calculated, and the vertex displacement vectors of the target model are calculated based on the constructed mapping relationship and these vertex offsets.
[0050] Step S104: Superimpose the vertex displacement vectors of the target model onto the base model of the target model to generate the BlendShapes deformation model corresponding to the target model.
[0051] For example, the obtained vertex displacement vectors of the target model are superimposed one by one onto the corresponding vertex coordinates of the base model of the target model. The three-dimensional spatial position of each vertex of the target model is adjusted through coordinate update operations. After superposition, the base model of the target model exhibits the same facial expression features as the source model BlendShapes deformed model. Finally, the target model BlendShapes deformed model corresponding to this expression is output, completing the entire expression transmission process. Among them, the coordinate update operation is a calculation process in scenarios such as spatial positioning, motion tracking, and data visualization, which updates the current coordinates of the target according to specific rules or input conditions, such as displacement, error correction, and reference frame changes, so that the coordinates always reflect the true position of the target or the accurate state that meets the application requirements.
[0052] In this embodiment, by receiving source and target model data with consistent UV layout, a mapping relationship is constructed using UV space as a bridge. Based on the mapping relationship, the vertex displacement vectors of the target model are calculated. By superimposing the coordinates of these vertex displacement vectors, a deformed model of the target model is generated. This completely breaks the limitations of traditional methods on the consistency of model topology, eliminating the need for the source and target models to have the same number of vertices, vertex order, and wiring method. It is applicable to character models of different species, art styles, and special shapes, effectively reducing the workload of manually re-sculpting expressions, significantly shortening the 3D animation production cycle, and ensuring that all target models can reuse the high-quality expression templates of the source model, guaranteeing the uniformity and standardization of expression effects, reducing the manpower and time costs of project production, and significantly expanding the application scenarios of BlendShapes technology in 3D animation, game production, and other fields.
[0053] In one embodiment, such as Figure 2 As shown, based on the vertex UV coordinates of the base model of the target model and the UV mesh structure of the base model of the source model, a mapping relationship between the target model and the source model is constructed, including:
[0054] Step S201: Obtain the UV coordinates of each vertex of the base model of the target model.
[0055] Among them, UV coordinates serve as a parametric representation of the surface of the 3D model, mapping the model mesh onto a 2D plane, thus being independent of the 3D topology and allowing corresponding regions of different meshes to be aligned in UV space.
[0056] For example, the original data file of the target model's base model is read. This file contains the 3D coordinates, UV coordinates, and mesh connectivity information of all vertices of the model. A vertex-by-vertex traversal approach can be used to extract the UV coordinate data of each vertex sequentially. Simultaneously, the extracted UV coordinates are validated to check for any values exceeding the standard UV range (typically 0-1), missing coordinate values, or abnormal formats. If abnormal data is found, the abnormal UV coordinates are interpolated and corrected based on the topological continuity of the model surface, resulting in standardized UV coordinate data for all vertices of the target model's base model. Vertex-by-vertex traversal refers to sequentially accessing each vertex of the model and performing specific calculations or data processing on each vertex to achieve target functions such as coordinate operations, attribute mapping, and feature extraction. Validation is a verification process to ensure that the data and operations conform to pre-set rules, standards, or targets.
[0057] Step S202: Based on the UV coordinates of each vertex, perform a location query process on the UV mesh of the base model of the source model to determine the triangular facet of the UV mesh of the source model where the UV coordinates of each vertex are located.
[0058] Among them, the UV mesh refers to the mesh structure formed by splicing together several triangular facets after the source model is unfolded into a two-dimensional UV plane; the triangular facet is the basic building block of the UV mesh, and each facet corresponds to a triangle in the three-dimensional mesh, ensuring the stability of the mapping calculation; the location query refers to accurately determining the corresponding position of the UV coordinates of the vertex of the target model in the UV mesh space of the source model.
[0059] For example, based on the obtained target model vertex UV coordinates, a spatial index structure, such as a KD tree, is constructed for all triangular faces of the source UV mesh, and the faces are "classified into different nodes of the index" according to their UV positions; the target UV coordinates are input, and more than 90% of irrelevant faces are eliminated through spatial index traversal to obtain "a few candidate faces that may contain the target point"; for each candidate face, the centroid coordinates are used to test whether the target point is within the face boundary, and the uniquely belonging triangular face is found (if it exists). The spatial index structure refers to "dividing the UV plane according to rules, quickly locking the 'small region' where the target point may be located, and only traversing the faces within that region"; the KD tree can handle 2D / 3D and other dimensions, dividing space alternately according to the x and y axes of the UV, for example, the first layer is divided into left and right by x, and the second layer is divided into top and bottom by y, forming a tree-like index, which quickly excludes spatial regions that do not contain the target point during the search, reducing the number of faces to be verified; the centroid coordinate test is a commonly used method in computer graphics and computational geometry to determine the positional relationship between a point and a triangle. Through the mathematical tool of "centroid coordinates", it determines whether a point falls inside a specified triangle (including the boundary), and can also be extended to determine the positional relationship between a point and a convex polygon; the centroid coordinates are a set of weight coefficient values (α, β, γ), which can uniquely determine the spatial relationship between a point and the three vertices of a triangle face. After determining the candidate face, the UV coordinates of the three vertices of the corresponding triangle face are obtained. Simultaneously, the target UV coordinates P to be determined are extracted. Based on the vertex coordinates of the triangular facet, a vector relationship in the two-dimensional plane is constructed: vectors AB (BA), AC (CA), and AP (PA) are calculated respectively, and the relative position of the target point and the three sides of the facet is calculated through cross product operation. The sign of the cross product result can reflect which side of the edge the point is located on. In the specific calculation, three key parameters (corresponding to the core coefficients of the centroid coordinates) are obtained through vector cross product: α corresponds to the positional relationship between the target point and edge BC, β corresponds to the positional relationship with edge AC, and γ corresponds to the positional relationship with edge AB. The three satisfy the constraint condition α+β+γ=1. The determination rule is: if the three coefficients α, β, and γ are all greater than or equal to 0, then the target UV coordinates P are located inside or on the boundary of the triangular facet; if any coefficient is less than 0, it means that P is located outside a certain edge of the facet, that is, not within the boundary range of the facet. Cross product (also called vector product) calculation is an operation between two vectors in three-dimensional space. The result is a new vector, not a scalar (as opposed to dot product), used to describe the "perpendicular relationship" and "spatial orientation" of two vectors.
[0060] Step S203: Obtain the centroid coordinates of the UV coordinates of each vertex within the corresponding source model UV mesh triangle; and store the centroid coordinates, the UV coordinates of each vertex, and the source model UV mesh triangle where the UV coordinates of each vertex are located to generate a mapping relationship between the target model and the source model; the centroid coordinates are used to uniquely determine the relative position of the UV coordinates of each vertex within the triangle.
[0061] The centroid coordinates are a set of weight values (α, β, γ) that satisfy α + β + γ = 1 and α, β, and γ are all non-negative, which can uniquely determine the spatial relationship between the point and the three vertices of the triangular facet.
[0062] For example, using the unique identifier of the target model vertex (such as vertex ID) as the index key, the centroid coordinates (α, β, γ) of that vertex are obtained. The UV coordinates, centroid coordinates, and source model triangle facet ID of that vertex are used as index values to construct a key-value pair mapping table. Here, the unique identifier refers to information or symbols that can uniquely and non-repeatingly mark a certain object such as data, entity, or resource, to ensure that the object can be accurately distinguished and to avoid confusion with other objects.
[0063] In this embodiment, by obtaining the UV coordinates of the target model vertices, the source model's UV mesh triangular facets are determined using location queries. Weighted associations between vertices and facets are established through centroid coordinate calculation, forming a complete mapping relationship through structured storage. This effectively solves the technical bottleneck of traditional methods relying on topological consistency. It eliminates the need for the source and target models to have the same number of vertices, vertex order, or wiring method, thus laying a reliable foundation for subsequent deformation propagation through accurate UV space mapping.
[0064] In one embodiment, the vertex offsets from the base model of the source model to the BlendShapes deformed model of the source model are calculated; and based on the vertex offsets and the mapping relationship, the vertex displacement vectors of the target model are calculated, including:
[0065] Step S301: Perform coordinate calculations on all corresponding vertices of the BlendShapes deformed model of the source model and the base model of the source model to obtain the vertex displacement vectors of the BlendShapes deformed model of the source model relative to the base model of the source model.
[0066] Among them, coordinate operations are mathematical operations performed on the coordinates of points or on graphs such as line segments, vectors, and function graphs defined by coordinates. They solve the problems of "position, size, and relationship of shape" through "numerical calculations". Vertex displacement vector is used to describe the three-dimensional spatial position change of the target vertex from the basic model to the BlendShapes deformable model, and includes displacement components in the x, y, and z coordinate axes.
[0067] For example, since the essence of BlendShapes deformation is to describe shape changes through the displacement of vertices in three-dimensional space, the vertex coordinate data of the base model of the source model and the BlendShapes deformation model are read. This data is usually stored in array form, containing the three-dimensional coordinates (x, y, z) of each vertex. Based on the principle of vector subtraction, vertex-by-vertex coordinate operations are performed on all corresponding vertices. That is, for each vertex index, the difference between the coordinates of the deformation model and the coordinates of the base model is calculated to obtain the displacement vector (Δx, Δy, Δz). The displacement vector represents the amount of geometric change from the base state to the deformation state. Parallel computing can be used to optimize the processing of a large number of vertices, for example, by accelerating the process with a GPU (Graphics Processing Unit) to improve efficiency. The principle of vector subtraction is to "transform it into vector addition", using "opposite vectors" to transform the subtraction operation into an existing addition rule (triangle rule or parallelogram rule). Parallel computing optimization refers to the process of maximizing efficiency when multiple computing units work together by reasonably allocating computing tasks, optimizing resource utilization, and reducing parallel overhead. It is used to solve the problem of "no speed improvement or even slowdown after parallelization", balancing "parallel gain" and "parallel cost".
[0068] Step S302: Perform a lookup process based on the mapping relationship to obtain the triangular facets and centroid coordinates corresponding to each vertex of the target model's base model in the source model.
[0069] For example, based on a pre-stored mapping table, which specifies the UV coordinates of each vertex of the target model, the corresponding source model UV mesh triangle index, and the centroid coordinates, the corresponding source model triangle and centroid coordinates are quickly looked up in the mapping table for each vertex of the target model's base model, according to its UV coordinates or vertex index.
[0070] Step S303: Based on the centroid coordinates, perform weighted summation interpolation on the vertex displacement vectors of the three vertices of the corresponding triangular facet in the source model to obtain the vertex displacement vector of the target model.
[0071] Among them, weighted summation interpolation utilizes the weighting characteristics of the centroid coordinates to transform the displacement vector of the target vertex into a linear combination of the displacement vectors of the three vertices of the corresponding triangular facet; the centroid coordinates provide the linear weight of the point within the triangular facet, supporting smooth vector interpolation.
[0072] For example, for each vertex of the target model, the source model's triangular facet and its centroid coordinates (α, β, γ) are obtained. Then, the displacement vectors of the three vertices of the triangular facet are extracted from the displacement vector array calculated in step S301, and the vertex displacement vectors of the target model are calculated in combination with the centroid coordinates. During the calculation, the interpolation results are validated for reasonableness. For example, it is determined whether the direction and magnitude of the displacement vector conform to the expression logic of the source model. For instance, in a "smiling" expression, the displacement direction of the corner of the mouth should be upward. Abnormal interpolation results are eliminated to ensure that the displacement vector of the target model can accurately restore the expression features of the source model. Reasonableness validation refers to checking the validity, logic, and consistency of input data, intermediate results, or output results to ensure that they conform to pre-set rules, business requirements, or technical standards, avoiding invalid data, logical contradictions, or outliers that could cause errors in subsequent processes.
[0073] In this embodiment, by calculating the vertex displacement vectors corresponding to the facial expression deformation of the source model, the source model triangle facets and centroid coordinates corresponding to the vertices are quickly found based on the mapping relationship. Then, a weighted interpolation algorithm based on the centroid coordinates is used to accurately transfer the source model displacement vectors to the target model. This effectively overcomes the dependence of traditional methods on the topological consistency of the source and target models, eliminating the need for both to have the same number of vertices, vertex order, or wiring method. The entire process achieves automated data processing, avoiding the inefficiency and error problems caused by manual sculpting, and significantly improving the efficiency and standardization of BlendShapes transfer.
[0074] In one embodiment, the vertex displacement vectors of the target model are superimposed onto the base model of the target model to generate a BlendShapes deformable model corresponding to the target model, including:
[0075] Step S401: Calculate the feature size ratio between the base model of the source model and the base model of the target model; the feature size ratio is used to characterize the scaling factor.
[0076] Among them, the base model of the source model and the base model of the target model may have different physical scales or scale differences. Directly applying the displacement vector will lead to deformation distortion. Therefore, it is necessary to ensure that the deformation amplitude matches the target model through size normalization. The feature size ratio, as a scale scaling factor, reflects the overall size relationship between the two models in three-dimensional space. It can be quantified by geometric feature values such as the diagonal length of the bounding box, the average vertex distance, or the model volume ratio.
[0077] For example, the vertex coordinate data of the source and target models are read. This data is usually stored in arrays containing the 3D coordinates of each vertex. Vector operations can be performed using a geometry computation library to calculate feature dimensions, such as determining the minimum bounding box of the model, extracting its diagonal vectors, and calculating the length ratio; or by statistically analyzing the average distance ratio from all vertices to the center point. Vector operations encapsulate efficient computational logic around the mathematical properties of vectors (such as direction, length, and dimension). Essentially, it transforms vector operations such as addition, subtraction, dot product, and cross product in linear algebra into directly callable code interfaces, solving the problem of "error-prone and inefficient manual vector operations." The geometry computation library is a collection of software tools for processing geometric data and performing geometric operations. It encapsulates complex geometric algorithms, allowing developers to efficiently complete geometry-related tasks without having to implement the underlying logic from scratch. The minimum bounding box (MBB) is a fundamental concept in computer graphics, computer vision, geographic information systems, and other fields. It can find a regular geometric container with the "smallest volume / area" that can "completely contain" a target object such as a point set, a graphic, or a 3D model.
[0078] Step S402: Scale the vertex displacement vector of the target model according to the feature size ratio to obtain the normalized vertex displacement vector.
[0079] Scaling refers to adjusting the displacement vector proportionally based on the calculated feature size ratio, so that the deformation range adapts to the size of the target model, avoiding excessive or insufficient deformation caused by model size mismatch.
[0080] For example, based on the pre-calculated feature size ratio, a scalar multiplication operation is performed on the displacement vector (Δx, Δy, Δz) of each vertex of the target model, i.e., the normalized displacement vector is obtained. For example, if the width of the target model's face is 1.2 times that of the source model, then each component of the target vertex displacement vector needs to be multiplied by 1.2 to ensure that the magnitude of the facial deformation matches the scale of the target model. During scaling, parallel computing can be used for optimization, such as using a GPU (Graphics Processing Unit) to accelerate the processing of large amounts of vector data to improve efficiency. The normalized displacement vectors are then validated to determine whether their displacement magnitude conforms to the expression logic. For example, in a "frowning" expression, the displacement magnitude of the brow bone vertex will not exceed the geometric range of the target model's forehead, thus eliminating abnormal vectors that are over-scaled or under-scaled.
[0081] Step S403: The normalized vertex displacement vector is superimposed on the corresponding vertex coordinates of the base model of the target model to generate the BlendShapes deformation model corresponding to the target model.
[0082] For example, based on the normalized displacement vector, displacement information can be integrated into the base mesh through vector addition, and deformed mesh can be generated by directly modifying the vertex positions: read the vertex coordinate array and normalized displacement vector array of the target model's base model, and then perform coordinate addition operation on each vertex: new vertex coordinates = base vertex coordinates + normalized displacement vector, and finally generate the BlendShapes deformed model corresponding to the target model, so as to achieve accurate transmission of facial expression deformation.
[0083] In this embodiment, by calculating the feature size ratio and scaling the displacement vector based on the feature size ratio, an expression deformation model adapted to the target model is generated by superimposing the scaled displacement vector using coordinates. This effectively solves the problem of expression distortion caused by the difference in scale between the source and target models in traditional BlendShapes transfer, while maintaining the compatibility of UV mapping with topological differences, without requiring the source and target models to have the same number of vertices, vertex order, or wiring method.
[0084] In one exemplary embodiment, the method further includes:
[0085] Step S501: The initial displacement field is obtained by calculating the geometric difference between the BlendShapes deformation model corresponding to the target model and the base model of the target model.
[0086] Among them, the initial displacement field, as a three-dimensional vector field, quantifies the overall shape change of the deformed model relative to the basic model. Its generation is based on vertex-level coordinate comparison, which can comprehensively capture the macroscopic trend of deformation.
[0087] For example, the vertex coordinate data of the target model's base model and the generated BlendShapes deformable model are read. This data is typically stored as a floating-point array, containing the 3D position information of each vertex. A vector subtraction operation is performed on each corresponding vertex, that is, the difference between the vertex coordinates of the deformable model and the vertex coordinates of the base model is calculated to obtain the displacement vector. The set of all displacement vectors constitutes the initial displacement field. During the calculation, parallel computing can be used to optimize the process, such as accelerating batch vector operations with a GPU to improve efficiency; at the same time, data verification can be implemented, such as checking the consistency of vertex indices, to avoid calculation errors.
[0088] Step S502: Extract high-frequency detail components from the initial displacement field; high-frequency detail components are key information reflecting local features in the initial displacement field.
[0089] Among them, high-frequency detail components refer to the data components in the initial displacement field that characterize the subtle changes in local features of the model, such as fine wrinkles or deformations caused by muscle contraction.
[0090] For example, frequency domain decomposition technology can be used to extract high-frequency detail components from the obtained initial displacement field: first, the initial displacement field is Gaussian smoothed to filter out local subtle changes, resulting in a low-frequency displacement field that only contains overall facial expression deformation; then, vertex-by-vertex subtraction is performed between the initial displacement field and the low-frequency displacement field to eliminate the influence of overall deformation, thus obtaining the high-frequency detail components. The extracted high-frequency detail components are then validated by comparing the physiological or morphological rationality of the model's local features. For example, facial details must conform to the physical laws of skin stretching and compression to avoid abnormal lines that violate physical logic. High-frequency noise data is removed to ensure that the extracted high-frequency detail components can truly reflect the local subtle features that the model should possess. Frequency domain decomposition technology utilizes the principle that "signals can be composed of simple harmonic components of different frequencies (such as sine / cosine waves)" to decompose displacement field data into low-frequency overall deformation components and high-frequency local detail components according to frequency characteristics. The low-frequency components correspond to the macroscopic morphological changes of facial expressions, while the high-frequency components correspond to local subtle features. Gaussian smoothing is achieved by using weights calculated by a Gaussian function to perform a weighted average of each pixel and its surrounding pixels in the image, thereby reducing noise and blurring the image. Essentially, it makes the transition of pixel values smoother and reduces abrupt changes (such as noise and edge details). The Gaussian function determines that the influence of the surrounding pixels decays with distance: the closer to the center pixel, the greater the weight (the stronger the influence on the result); the farther away, the smaller the weight, which conforms to the human eye's perception logic of "stronger neighbor correlation".
[0091] Step S503: Superimpose the high-frequency detail components onto the BlendShapes deformable model corresponding to the target model to generate a BlendShapes deformable model corresponding to the target model with enhanced details.
[0092] For example, the generated high-frequency detail component vector and the vertex coordinates of the target model's BlendShapes deformable model are read, and then coordinate addition is performed on each vertex: new vertex coordinates = original deformable model vertex coordinates + high-frequency detail vector. During the stacking process, constraint mechanisms can be implemented, such as limiting the stacking amplitude to prevent geometric distortion, and the results can be verified using visualization tools. The generated high-detail deformable model can be exported to a standard file format and integrated into the animation pipeline.
[0093] In this embodiment, the global geometric differences of model deformation are obtained by calculating the initial displacement field. High-frequency components reflecting local subtle features are separated by frequency domain decomposition, and these high-frequency components are superimposed onto the basic deformed model. This effectively solves the technical shortcomings of traditional BlendShapes, which can only transmit overall expressions and lose local subtle features, significantly improving the realism and precision of the target model's expression.
[0094] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0095] Based on the same inventive concept, this application also provides a UV-mapping-based BlendShapes transfer system for implementing the UV-mapping-based BlendShapes transfer method described above. The solution provided by this system is similar to the implementation described in the above method. Therefore, the specific limitations of one or more UV-mapping-based BlendShapes transfer system embodiments provided below can be found in the limitations of the UV-mapping-based BlendShapes transfer method described above, and will not be repeated here.
[0096] In one exemplary embodiment, such as Figure 3 As shown, a BlendShapes transfer system 300 based on UV mapping is provided, including:
[0097] The model receiving module 301 is used to receive the base model of the source model, at least one BlendShapes deformable model corresponding to the base model of the source model, and the base model of the target model; the source model and the target model have the same UV layout.
[0098] The mapping relationship construction module 302 is used to construct the mapping relationship between the target model and the source model based on the vertex UV coordinates of the base model of the target model and the UV mesh structure of the base model of the source model.
[0099] The vector generation module 303 is used to calculate the vertex offset from the base model of the source model to the BlendShapes deformed model of the source model; and to calculate the vertex displacement vector of the target model based on the vertex offset and the mapping relationship.
[0100] The deformation model generation module 304 is used to superimpose the vertex displacement vectors of the target model onto the base model of the target model to generate the BlendShapes deformation model corresponding to the target model.
[0101] In one embodiment, the mapping relationship construction module 302 is further configured to:
[0102] Obtain the UV coordinates of each vertex of the base model of the target model;
[0103] Based on the UV coordinates of each vertex, a location query process is performed on the UV mesh of the base model of the source model to determine the triangular facet of the UV mesh of the source model where the UV coordinates of each vertex are located.
[0104] Obtain the centroid coordinates of the UV coordinates of each vertex within the corresponding source model UV mesh triangle; store the centroid coordinates, the UV coordinates of each vertex, and the source model UV mesh triangle containing the UV coordinates of each vertex to generate a mapping relationship between the target model and the source model; the centroid coordinates are used to uniquely determine the relative position of the UV coordinates of each vertex within the triangle.
[0105] In one embodiment, the vector generation module 303 is further configured to:
[0106] Perform coordinate operations on all corresponding vertices of the BlendShapes deformed model of the source model and the base model of the source model to obtain the vertex displacement vector of the BlendShapes deformed model of the source model relative to the base model of the source model.
[0107] Based on the mapping relationship, a lookup process is performed to obtain the triangular facet and centroid coordinates of each vertex of the target model's base model in the source model;
[0108] Based on the centroid coordinates, the vertex displacement vectors of the three vertices of the corresponding triangular facet in the source model are weighted and interpolated to obtain the vertex displacement vectors of the target model.
[0109] In one embodiment, the deformation model generation module 304 is further configured to:
[0110] The feature size ratio between the base model of the source model and the base model of the target model is calculated; the feature size ratio is used to characterize the scaling factor.
[0111] The vertex displacement vectors of the target model are scaled according to the feature size ratio to obtain normalized vertex displacement vectors.
[0112] The normalized vertex displacement vectors are superimposed onto the corresponding vertex coordinates of the base model of the target model to generate the BlendShapes deformable model corresponding to the target model.
[0113] In one exemplary embodiment, the system further includes:
[0114] The displacement field generation module is used to obtain the initial displacement field by calculating the geometric difference between the BlendShapes deformation model corresponding to the target model and the base model of the target model;
[0115] The component extraction module is used to extract high-frequency detail components from the initial displacement field; the high-frequency detail components are key information reflecting local features in the initial displacement field.
[0116] The model optimization module is used to superimpose high-frequency detail components onto the BlendShapes deformable model corresponding to the target model, generating a BlendShapes deformable model corresponding to the target model with enhanced details.
[0117] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the UV mapping-based BlendShapes transfer method as described above.
[0118] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0119] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The components described as separate parts may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0120] The above-described embodiments are merely illustrative of several implementation methods of the embodiments of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the embodiments of this application, and these modifications and improvements all fall within the protection scope of the embodiments of this application.
Claims
1. A method for transferring BlendShapes based on UV mapping, characterized in that, The method comprises: receiving a base model of a source model, at least one BlendShapes deformation model corresponding to the base model of the source model, and a base model of a target model; the source model and the target model have consistent UV layouts; based on vertex UV coordinates of the base model of the target model and a UV grid structure of the base model of the source model, constructing a mapping relationship between the target model and the source model; calculating vertex offset amounts of the base model of the source model to the BlendShapes deformation model of the source model; and based on the vertex offset amounts and the mapping relationship, calculating vertex displacement vectors of the target model; superimposing the vertex displacement vectors of the target model to the base model of the target model to generate a BlendShapes deformation model corresponding to the target model.
2. The method of claim 1, wherein, The method comprises: obtaining UV coordinates of each vertex of the base model of the target model; based on the UV coordinates of each vertex, performing positioning query processing on a UV grid of the base model of the source model to determine a source model UV grid triangular facet in which the UV coordinates of each vertex are located; obtaining barycentric coordinates of the UV coordinates of each vertex in the corresponding source model UV grid triangular facet; and storing the barycentric coordinates, the UV coordinates of each vertex, and the source model UV grid triangular facet in which the UV coordinates of each vertex are located to generate a mapping relationship between the target model and the source model; the barycentric coordinates are used to uniquely determine the relative position of the UV coordinates of each vertex in the triangular facet.
3. The method of claim 1, wherein, The method comprises: performing coordinate operation processing on all corresponding vertices of the BlendShapes deformation model of the source model and the base model of the source model to obtain vertex displacement vectors of the BlendShapes deformation model of the source model relative to the base model of the source model; performing lookup processing according to the mapping relationship to obtain a corresponding triangular facet and barycentric coordinates of each vertex of the base model of the target model in the source model; based on the barycentric coordinates, performing weighted sum interpolation processing on the vertex displacement vectors of the three vertices of the corresponding triangular facet in the source model to obtain vertex displacement vectors of the target model. The method comprises:
4. The method of claim 1, wherein, calculate a feature size ratio of a base model of the source model and a base model of the target model; the feature size ratio is used to represent a scale factor; scale a vertex displacement vector of the target model according to the feature size ratio, to obtain a normalized vertex displacement vector; superimpose the normalized vertex displacement vector to a corresponding vertex coordinate of the base model of the target model, to generate a BlendShapes deformation model corresponding to the target model.
5. The method of claim 1, wherein, The method further comprises: obtain an initial displacement field by calculating a geometric difference between the BlendShapes deformation model corresponding to the target model and the base model of the target model; extract a high-frequency detail component from the initial displacement field; the high-frequency detail component is key information reflecting local features in the initial displacement field; superimpose the high-frequency detail component to the BlendShapes deformation model corresponding to the target model, to generate the BlendShapes deformation model corresponding to the target model with enhanced details.
6. A system for transfer of BlendShapes based on UV mapping, characterized in that, The system comprises: a model receiving module configured to receive a base model of a source model, at least one BlendShapes deformation model corresponding to the base model of the source model, and a base model of a target model; the source model and the target model have consistent UV layouts; a mapping relationship constructing module configured to construct a mapping relationship between the target model and the source model based on vertex UV coordinates of the base model of the target model and a UV grid structure of the base model of the source model; a vector generating module configured to calculate vertex offset amounts from the base model of the source model to the BlendShapes deformation model of the source model, and calculate vertex displacement vectors of the target model based on the vertex offset amounts and the mapping relationship; a deformation model generating module configured to superimpose the vertex displacement vectors of the target model to the base model of the target model, to generate a BlendShapes deformation model corresponding to the target model. 7.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-6 when the computer program is executed by the processor. The processor executes the computer program to implement the steps of the method of any one of claims 1 to 7.
8. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 7.