Data preprocessing method, device, medium and equipment

By pasting expression maps of different expression types on the face of the virtual object model, combined with data preprocessing methods, dynamic switching of facial expressions of virtual characters is solved, and the problem of virtual characters lacking expression changes is improved, and the user experience is reduced and the production cost is reduced.

CN114904279BActive Publication Date: 2025-05-27NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210507592.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-10
Publication Date
2025-05-27
Estimated Expiration
2042-05-10

AI Technical Summary

Technical Problem

In rapid development projects, the quality requirements of virtual character animations are often ignored, resulting in virtual characters lacking expression changes when displaying, lack of emotional richness, and poor user experience.

Method used

By pasting expression maps of different expression types on the face of the virtual object model, combined with data preprocessing methods, dynamic switching of facial expressions of virtual characters can be achieved. The method includes determining the virtual object model and model map, receiving animation frame generation instructions, controlling the display of the emoticon map based on the target map logo, and mapping the submap to the corresponding area of ​​the virtual object model based on UV map technology.

Benefits of technology

The expression and action switching of virtual characters in game scenes is realized, reducing production costs, and improving the expression and user experience of virtual characters in the game.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114904279B_ABST
    Figure CN114904279B_ABST
Patent Text Reader

Abstract

An embodiment of the present application provides a data preprocessing method, apparatus, storage medium, and terminal device. The method includes determining a virtual object model and a model texture map of the virtual object model, and automatically generating an initial animation model; receiving an animation frame generation instruction for the animation model, where the animation frame generation instruction includes a target texture map identifier of the virtual object model in the current animation frame; controlling only the target sub-texture map corresponding to the target texture map identifier to be displayed in the expression texture map on the model texture map according to the target texture map identifier, calling a material sphere, and mapping the target sub-texture map to the virtual object model based on the UV texture mapping technology; and correspondingly writing the target texture map identifier and the number of animation frames corresponding to the target texture map identifier into an animation generation control file. The embodiment of the present application can enable the virtual character in the game scene to perform expression action switching according to a set program, and the expression switching is implemented based on a 3D model, which can reduce the production cost compared with the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electronic communication technology, and in particular to the field of data preprocessing technology, and in particular to a data preprocessing method, device, medium and equipment. Background Art

[0002] In some development projects with fast development progress and short cycles, the quality requirements of virtual character animation are often ignored in order to speed up the progress, resulting in no expression animation when showing the virtual character on stage or on standby, only fixed expression stickers, resulting in action performances, character emotions are not vivid enough, and expressions are dull. Especially in scenes such as game battles, interactive experiences, and interface displays, the lack of emotional richness of virtual characters leads to poor user experience. Summary of the invention

[0003] The embodiments of the present application provide a data preprocessing method, apparatus, medium and device, which can change the facial expression of a virtual character by pasting expression stickers of different expression types on the face of a virtual object model, so that the virtual character in the game scene can switch expression actions according to a set program, and the expression switching is achieved based on a 3D model, which can reduce the production cost compared with the existing technology.

[0004] On the one hand, an embodiment of the present application provides a data preprocessing method, including:

[0005] Determine a virtual object model and a model map of the virtual object model, and automatically generate an initial animation model, wherein the model map includes an expression map, the expression map includes at least two sub-maps, and different sub-maps have different expression types;

[0006] Receiving an animation frame generation instruction for an animation model, the animation frame generation instruction including a target texture identifier of the virtual object model in a current animation frame;

[0007] According to the target texture identifier, controlling the expression texture to display only the target sub-texture corresponding to the target texture identifier on the model texture, calling a material ball, and mapping the target sub-texture to a corresponding area of ​​the virtual object model based on UV mapping technology;

[0008] The target texture identifier and the number of animation frames corresponding to the target texture identifier are correspondingly written into the animation generation control file.

[0009] In the data preprocessing method described in the embodiment of the present application, before controlling the expression map to display only the target sub-map corresponding to the target map identifier on the model map according to the target map identifier, the method further includes:

[0010] The expression map is pixel-splitting on the model map to obtain at least two independent sub-maps, wherein each sub-map has an independent set of pixel points in the model map, and the corresponding sub-map can be displayed or hidden on the model map by controlling the opening or closing of the pixel point set.

[0011] In the data preprocessing method described in the embodiment of the present application, controlling the expression map to display only the target sub-map corresponding to the target map identifier on the model map according to the target map identifier includes:

[0012] According to the target map identifier, a target pixel point set corresponding to the target map identifier is determined, and the target pixel point set is controlled to be in an on state on the model map, while other pixel point sets are controlled to be in a off state on the model map, so as to control the expression map to display only the target sub-map corresponding to the target map identifier.

[0013] In the data preprocessing method described in the embodiment of the present application, the animation frame generation instruction also includes control parameters of the limb controller of the virtual object model body in the current animation frame; after receiving the animation frame generation instruction for the animation model, the method also includes:

[0014] The control parameters are input into the limb controller to control the limb movements of the virtual object model.

[0015] In the data preprocessing method described in the embodiment of the present application, after writing the target texture identifier and the number of animation frames corresponding to the target texture identifier into the animation generation control file, the method further includes:

[0016] Importing the animation generation control file into a preset game program, parsing the animation generation control file to obtain the animation frame number and texture identifier corresponding to each animation frame contained therein;

[0017] Sort the animation frames from small to large, and calculate the time interval between two adjacent target frame numbers;

[0018] The time interval is introduced into a game timer, and the screens of the animation frames corresponding to the respective animation frame numbers are switched and displayed by the game timer.

[0019] In the data preprocessing method described in the embodiment of the present application, the step of calculating the time interval between two adjacent target frame numbers according to two adjacent target frame numbers includes:

[0020] Calculate the frame difference between two adjacent animation frames;

[0021] Multiply the frame number difference by a preset time parameter to obtain the time interval.

[0022] In the data preprocessing method described in the embodiments of the present application, the method further includes:

[0023] Provide a visualization interface, the visualization interface includes a display area, the display area is used to display the animation model, and the facial expression of the animation model in the display area changes in real time following the switching of the target texture map identifier.

[0024] Correspondingly, another aspect of the embodiments of the present application further provides a data preprocessing device, including:

[0025] A data import module, configured to determine a virtual object model and the model texture map of the virtual object model, and automatically generate an initial animation model, where the model texture map includes an expression texture map, the expression texture map includes at least two sub-texture maps and the expression types of different sub-texture maps are different;

[0026] An instruction receiving module, configured to receive an animation frame generation instruction for the animation model, and the animation frame generation instruction includes the target texture map identifier of the virtual object model in the current animation frame;

[0027] A data mapping module, configured to control only the target sub-texture map corresponding to the target texture map identifier in the expression texture map on the model texture map according to the target texture map identifier, call a material ball, and map the target sub-texture map to the corresponding area of the virtual object model based on the UV texture mapping technology;

[0028] A data writing module, configured to correspondingly write the target texture map identifier and the animation frame number corresponding to the target texture map identifier into an animation generation control file.

[0029] Correspondingly, another aspect of the embodiments of the present application further provides a computer-readable storage medium, the computer-readable storage medium stores multiple instructions, and the instructions are suitable for being loaded by a processor to execute the data preprocessing method as described above.

[0030] Correspondingly, another aspect of the embodiments of the present application further provides a terminal device, including a processor and a memory, the memory stores multiple instructions, and the processor loads the instructions to execute the data preprocessing method as described above.

[0031] The embodiments of the present application provide a data preprocessing method, apparatus, medium, and device. The method determines a virtual object model and a model texture map of the virtual object model, and automatically generates an initial animation model. The model texture map includes an expression texture map, and the expression texture map contains at least two sub-texture maps with different expression types; receives an animation frame generation instruction for the animation model, and the animation frame generation instruction includes a target texture map identifier of the virtual object model in the current animation frame; controls only the target sub-texture map corresponding to the target texture map identifier to be displayed in the expression texture map on the model texture map according to the target texture map identifier, calls a material sphere, and maps the target sub-texture map to the corresponding area of the virtual object model based on the UV texture mapping technology; writes the target texture map identifier and the corresponding number of animation frames of the target texture map identifier into the animation generation control file correspondingly. The embodiments of the present application can change the facial expression of the virtual character by pasting expression texture maps with different expression types on the facial part of the virtual object model, enabling the virtual character in the game scene to switch expression actions according to the set program, and realizing expression switching based on the 3D model, which can reduce the production cost compared with the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can obtain other drawings based on these drawings without creative efforts.

[0033] Figure 1 It is a schematic flowchart of the data preprocessing method provided by the embodiments of the present application.

[0034] Figure 2 It is an example diagram of the animation model in the data preprocessing method provided by the embodiments of the present application.

[0035] Figure 3 It is an example diagram of the model texture map in the data preprocessing method provided by the embodiments of the present application.

[0036] Figure 4 It is a schematic structural diagram of the data preprocessing apparatus provided by the embodiments of the present application.

[0037] Figure 5 It is another schematic structural diagram of the data preprocessing apparatus provided by the embodiments of the present application.

[0038] Figure 6 It is a schematic structural diagram of the terminal device provided by the embodiments of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0039] The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the 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 protection scope of the present application.

[0040] The embodiment of the present application provides a data preprocessing method, and the data preprocessing method can be applied to a terminal device. The terminal device can be a device such as a smart phone or a tablet computer.

[0041] In some development projects with the characteristics of fast project development progress and short cycle, usually in order to speed up the progress, the quality requirements of the virtual character animation are ignored, so that there is no expression animation when the virtual character appears or stands by, only a fixed expression texture map, resulting in dull action performances and lack of vividness in the emotional expression of the characters. Especially in scenarios such as game battles, interactive experiences, and interface displays, due to the lack of emotional richness of the virtual characters, the user experience is poor.

[0042] Currently, in the market, in order to achieve the effect that the virtual characters in the scene have expression changes, there are usually two implementation schemes. One is to use planar expression bone switching animations in the spine software of 2D games, that is, add multiple expression pictures to the 2D virtual character, add corresponding bone skins to each expression picture, and use bone displacement, rotation, and scaling to achieve the conversion animation between expressions. The advantage of this scheme is that the expression form is exaggerated without limitation, but it is only suitable for 2D displays or 2D games, and is not applicable to development projects with the characteristics of fast project development progress and short cycle, having certain limitations. The other is to use pure 3D facial bone binding in 3D games to achieve expression animations. A lot of bones will be added to the face, skin the model, and use the bones to drive the vertex changes of the model or blendshape (expression model) to achieve. The advantage of this scheme is that the animation is delicate, vivid, and real, and it is suitable for animated movies and high-quality games. However, due to reasons such as the complexity of the character face model design and binding technology, the production cost is high and the cycle is long, and it is also not applicable to development projects with the characteristics of fast project development progress and short cycle.

[0043] To solve the above technical problems, the embodiment of the present application provides a data preprocessing method. By using the data preprocessing method provided by the embodiment of the present application, it is possible to optimize the operation method of game assets by combining blockchain technology, so that while avoiding the security problem of game assets being stolen, it is also possible to obtain value-added benefits based on unused game assets after the player logs off the game, improving the game experience of game players.

[0044] Please refer to Figures 1 - 3 , Figure 1Schematic flowchart of the data preprocessing method provided by an embodiment of this application. Figure 2 Example diagram of the animation model in the data preprocessing method provided by an embodiment of this application. Figure 3 Example diagram of the model texture map in the data preprocessing method provided by an embodiment of this application. The data preprocessing method is applied to a terminal device and is mainly used for the data preprocessing process before a game software runs. The method may include the following steps:

[0045] Step 101: Determine a virtual object model and the model texture map of the virtual object model, and automatically generate an initial animation model. Among them, the model texture map includes an expression texture map, and the expression texture map includes at least two sub-texture maps, and the expression types of different sub-texture maps are different.

[0046] It should be noted that this step is mainly completed by an animator. In Maya, the virtual object model and the model texture map of the virtual object model can be used to automatically generate an initial animation model in the animation production scene of Maya. Among them, the virtual object model is mainly completed by a modeler. The modeling operation of the virtual object model can be completed in 3ds Max, and at the same time, a model texture map for making an animation model is created. It should be explained that the virtual object model refers to a 3D model used to construct a virtual character. The model texture map refers to a template for storing an expression texture map. From a computer perspective, the model texture map refers to the storage carrier of the expression texture map. Among them, the expression texture map in the model texture map includes at least two sub-texture maps, and the expression types of different sub-texture maps are different, such as "happy" or "sad". By pasting expression texture maps of different expression types on the face part of the virtual object model, the facial expression of the virtual character can be changed, so that the virtual character in the game scene can switch expression actions according to a set program, and the expression switching is realized based on the 3D model, which can reduce the production cost compared with the prior art. It should be understood that the model texture map also includes a limb texture map for performing texture mapping operations on the limb part of the virtual object model.

[0047] Step 102: Receive an animation frame generation instruction for the animation model. The animation frame generation instruction includes the target texture map identifier of the virtual object model in the current animation frame.

[0048] In this embodiment, the animator can input an animation frame generation instruction for the animation model in Maya. The animation frame generation instruction includes the target texture map identifier of the virtual object model in the current animation frame. It should be explained that the texture map identifier refers to the identifier corresponding to different sub-texture maps, such as 1, 2, 3. The animator can achieve the purpose of real-time switching of the current facial expression of the animation model by inputting different texture map identifiers in the operation interface.

[0049] In some embodiments, when the animation frame generation instruction further includes control parameters of the limb controller of the virtual object model body in the current animation frame, the method further includes:

[0050] Input the control parameters into the limb controller to control the limb actions of the virtual object model.

[0051] Step 103, control only the target sub-map corresponding to the target map identifier to be displayed in the expression map on the model map according to the target map identifier, call the material ball, and map the target sub-map to the corresponding area of the virtual object model based on the UV mapping technology.

[0052] In this embodiment, for the sake of simplifying the processing, the models of the facial part and the limb part of the virtual character are not split, but are all merged together as a whole. The material of each character model is specified by a map representing the base color of the model, that is, the model map. Therefore, multiple sub-maps can all be placed in one model map. The multiple sub-maps corresponding to different expressions need to be exactly the same size, and each part occupies one-sixteenth of the entire map and is arranged in the upper quarter of the entire map. In order to enable the face of the animation model to be displayed normally, when making the model, the modeler needs to unfold the uv map of the facial model with expression changes to the upper left one-sixteenth of the entire model map (that is, 0 <= x <= 0.25, 0 <= y <= 0.25) of the uv coordinates, which exactly corresponds to the first expression among the four expressions, that is, the default expression of the animation model. When it is necessary to switch to the second expression, the uv coordinates of the animation model in the facial area need to be offset in the material. Since the uv coordinates of the facial area already have a determined range, the facial area can be judged through the size of the uv coordinates in the material, so that the x value of the uv coordinates can be directly added with 0.25 to switch to the second expression, and the y value remains unchanged. It can be seen from this that the four expressions are numbered in order, and the value of the number is represented by n. When it is necessary to switch to the nth expression, as long as the x value of the uv coordinates of the facial area is added with 0.25 * n, the desired effect can be achieved. By setting n as a parameter of the model material, the switching of expressions can be controlled through the material.

[0053] Since it is impossible to dynamically offset the model UV coordinates in 3D modeling software, from the perspective of computer operation, the program cannot directly call the material sphere to read the target sub-texture at the specified position from the model texture map, resulting in the animation model only showing the default first expression and unable to display the effects of other expressions. This will prevent animators from conveniently editing expression animations. To solve this problem, this solution controls the expression texture map on the model texture map to only display the target sub-texture corresponding to the target texture map identifier, calls the material sphere, and maps the target sub-texture to the corresponding area of the virtual object model based on the UV texture map technology to complete the model texture map operation, facilitating animators to edit expression animations.

[0054] It should be noted that before controlling the expression texture map on the model texture map to only display the target sub-texture corresponding to the target texture map identifier according to the target texture map identifier, it is necessary to pixel-split the expression texture map on the model texture map to obtain at least two independent sub-textures. Each sub-texture has an independent set of pixel points in the model texture map, and by controlling the opening or closing of the set of pixel points, it is possible to control the display or hiding of the corresponding sub-texture on the model texture map.

[0055] Specifically, determine the target set of pixel points corresponding to the target texture map identifier, control the target set of pixel points to be in an open state on the model texture map, and at the same time control other sets of pixel points to be in a closed state on the model texture map to control the expression texture map to only display the target sub-texture corresponding to the target texture map identifier.

[0056] It should be explained that all image files are two-dimensional planes. The horizontal direction is U, and the vertical direction is V. Therefore, through the two-dimensional UV coordinate system of this plane, any pixel on the image can be located. UV is the abbreviation of UV texture mapping coordinates (similar to the X, Y, and Z axes of the spatial model). It defines the information of the position of each pixel on the picture, and these pixels are related to the 3D model to determine the position of the surface texture map. UV is to accurately correspond each pixel on the image to the surface of the model object, and the software performs image smoothing interpolation processing at the gap positions between pixels. This is the so-called UV texture map technology.

[0057] Step 104, write the target texture map identifier and the animation frame number corresponding to the target texture map identifier into the animation generation control file correspondingly.

[0058] In this embodiment, the animation generation control file is created using json encoding technology to obtain a json format file. Specifically, the animation generation control file is generated using MaxScript programming technology and json encoding technology. The reason for using MaxScript programming technology is that MaxScript is the native programming language of 3ds Max and has high cross-version compatibility. The reason for using json encoding technology is that json is a commonly used encoding format and is highly versatile for different software and engines. The benefit of the tool is that the automated creation of multi-dimensional material plug-ins greatly reduces the time savings of manual creation, and the efficiency is close to 100%, and while improving efficiency, it also ensures zero error accuracy.

[0059] By writing the target texture ID and the animation frame number corresponding to the target texture ID into the animation generation control file, the material textures in the same directory are automatically matched with their sub-textures and texture IDs using the MaxScript programming method. After the production is completed, the output of the target texture ID change schedule is supported, so that the effect of synchronization with the expression switching animation made by the animator in the 3D modeling software can be seen in the game scene.

[0060] In some embodiments, after writing the target texture identifier and the animation frame number corresponding to the target texture identifier into the animation generation control file, the method further includes:

[0061] Importing the animation generation control file into a preset game program, parsing the animation generation control file to obtain the animation frame number and texture identifier corresponding to each animation frame contained therein;

[0062] Sort the animation frames from small to large, and calculate the time interval between two adjacent target frame numbers;

[0063] The time interval is introduced into a game timer, and the screens of the animation frames corresponding to the respective animation frame numbers are switched and displayed by the game timer.

[0064] In this embodiment, when the game is running, the exported animation generation control file can be directly read in the logic script and the data therein can be parsed. The data records the number of frames at which the expression needs to be switched and the corresponding texture map identifier. These data are recorded in an array and sorted in ascending order of the number of frames. The first data in the array is read, and the time for the next expression switch is calculated based on the number of frames. The calculation method is as follows: The data exported in the 3D software is calculated at 30 frames per second. Therefore, the time interval can be obtained by multiplying the difference between the current number of frames and the number of frames at the previous expression switch (0 at the first play) by 1 / 30. By using the timer function of the game engine to set the processing of switching the material parameters after this time interval, the corresponding expression can be switched at the correct time point. By analogy, all the data recorded in the animation generation control file are processed in this way, and the same effect as the expression switching animation made by the animator in the 3D modeling software can be seen.

[0065] In some embodiments, the method further includes:

[0066] Providing a visualization interface, the visualization interface includes a display area for displaying the animation model, and the facial expression of the animation model in the display area changes in real time following the switching of the target texture map identifier.

[0067] In this embodiment, by setting the visualization interface, it is convenient for the animator to view the facial expression switching effect of the animation model in real time during the animation production process.

[0068] All the above optional technical solutions can be combined arbitrarily to form alternative embodiments of the present application, which will not be elaborated here one by one.

[0069] Specifically, when implementing, the present application is not limited by the execution order of the described steps. Without conflict, some steps can also be performed in other orders or simultaneously.

[0070] As can be seen from the above, the data preprocessing method provided by the embodiments of the present application determines a virtual object model and a model texture map of the virtual object model, and automatically generates an initial animation model. Among them, the model texture map includes an expression texture map, and the expression texture map contains at least two sub-texture maps with different expression types for different sub-texture maps; receives an animation frame generation instruction for the animation model, and the animation frame generation instruction includes a target texture map identifier of the virtual object model in the current animation frame; controls only the target sub-texture map corresponding to the target texture map identifier to be displayed in the expression texture map on the model texture map according to the target texture map identifier, calls a material ball, and maps the target sub-texture map to the corresponding area of the virtual object model based on the UV texture mapping technology; writes the target texture map identifier and the animation frame number corresponding to the target texture map identifier into the animation generation control file correspondingly. By pasting expression texture maps of different expression types on the face part of the virtual object model, the embodiments of the present application can change the facial expressions of the virtual character, enabling the virtual character in the game scene to switch expression actions according to the set program, and realizing expression switching based on a 3D model, which can reduce the production cost compared with the prior art.

[0071] The embodiments of the present application further provide a data preprocessing device, and the data preprocessing device can be integrated in a terminal device. The terminal device can be a smart phone, a tablet computer or other devices.

[0072] Please refer to Figure 4 , Figure 4 which is a schematic structural diagram of the data preprocessing device provided by the embodiments of the present application. The data preprocessing device 30 may include:

[0073] A data import module 31, configured to determine a virtual object model and a model texture map of the virtual object model, and automatically generate an initial animation model. Among them, the model texture map includes an expression texture map, and the expression texture map contains at least two sub-texture maps with different expression types for different sub-texture maps;

[0074] An instruction receiving module 32, configured to receive an animation frame generation instruction for the animation model, and the animation frame generation instruction includes a target texture map identifier of the virtual object model in the current animation frame;

[0075] A data mapping module 33, configured to control only the target sub-texture map corresponding to the target texture map identifier to be displayed in the expression texture map on the model texture map according to the target texture map identifier, call a material ball, and map the target sub-texture map to the corresponding area of the virtual object model based on the UV texture mapping technology;

[0076] A data writing module 34, configured to write the target texture map identifier and the animation frame number corresponding to the target texture map identifier into the animation generation control file correspondingly.

[0077] In some embodiments, the device further includes a pixel splitting module, configured to split the expression map into at least two independent sub - maps on the model map, obtaining at least two independent sub - maps, where each sub - map has an independent set of pixel points in the model map, and the display or hiding of the corresponding sub - map on the model map can be controlled by controlling the turning on or off of the set of pixel points.

[0078] In some embodiments, the data mapping module 33 is configured to determine the corresponding target set of pixel points according to the target map identifier, control the target set of pixel points to be in an on state on the model map, and at the same time control other sets of pixel points to be in an off state on the model map, so as to control only the target sub - map corresponding to the target map identifier to be displayed in the expression map.

[0079] In some embodiments, the animation frame generation instruction further includes control parameters of the limb controller of the virtual object model body in the current animation frame; the device further includes a limb control module, configured to input the control parameters into the limb controller to control the limb movements of the virtual object model.

[0080] In some embodiments, the device further includes a pre - processing module, configured to import the animation generation control file into a preset game program, parse the animation generation control file to obtain the animation frame numbers and map identifiers corresponding to each animation frame included therein; sort each of the animation frame numbers from smallest to largest, calculate the time interval between two adjacent target frame numbers; import the time interval into a game timer, and switch the display of the screens of the animation frames corresponding to each of the animation frame numbers through the game timer.

[0081] In some embodiments, the pre - processing module is configured to calculate the frame number difference between two adjacent animation frame numbers; multiply the frame number difference by a preset time parameter to obtain the time interval.

[0082] In some embodiments, the device further includes a display module, configured to provide a visualization interface, the visualization interface includes a display area, the display area is used to display the animation model, and the facial expression of the animation model in the display area changes in real time following the switching of the target map identifier.

[0083] Specifically, in implementation, each of the above - mentioned modules can be implemented as an independent entity, or can be combined arbitrarily to be implemented as the same or several entities.

[0084] As described above, the data preprocessing device 30 provided by the embodiments of the present application determines a virtual object model and a model texture map of the virtual object model through a data import module 31, and automatically generates an initial animation model. Among them, the model texture map includes an expression texture map, and the expression texture map includes at least two sub-texture maps with different expression types for different sub-texture maps; an instruction receiving module 32 receives an animation frame generation instruction for the animation model, and the animation frame generation instruction includes a target texture map identifier of the virtual object model in the current animation frame; a data mapping module 33 controls only the target sub-texture map corresponding to the target texture map identifier in the expression texture map on the model texture map according to the target texture map identifier, calls a material ball, and maps the target sub-texture map to the corresponding area of the virtual object model based on the UV texture mapping technology; a data writing module 34 writes the target texture map identifier and the animation frame number corresponding to the target texture map identifier into an animation generation control file correspondingly.

[0085] Please refer to Figure 5 , Figure 5 which is another structural schematic diagram of the data preprocessing device provided by the embodiments of the present application. The data preprocessing device 30 includes a memory 120, one or more processors 180, and one or more application programs. Among them, the one or more application programs are stored in the memory 120 and are configured to be executed by the processor 180; the processor 180 may include a data import module 31, an instruction receiving module 32, a data mapping module 33, and a data writing module 34. For example, the structures and connection relationships of the above components can be as follows:

[0086] The memory 120 can be used to store application programs and data. The application programs stored in the memory 120 contain executable codes. The application programs can form various functional modules. The processor 180 executes various functional applications and data processing by running the application programs stored in the memory 120. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices. Correspondingly, the memory 120 may also include a memory controller to provide the processor 180 with access to the memory 120.

[0087] The processor 180 is the control center of the device, connects various parts of the entire terminal using various interfaces and lines, executes various functions of the device and processes data by running or executing the application programs stored in the memory 120, and calling the data stored in the memory 120, so as to monitor the device as a whole. Optionally, the processor 180 may include one or more processing cores; preferably, the processor 180 may integrate an application processor and a modulation / demodulation processor. Among them, the application processor mainly processes the operating system, user interface, and application programs, etc.

[0088] Specifically in this embodiment, the processor 180 will load the executable code corresponding to the processes of one or more application programs into the memory 120 according to the following instructions, and the processor 180 will run the application programs stored in the memory 120 to implement various functions:

[0089] A data import module 31, configured to determine a virtual object model and a model texture map of the virtual object model, and automatically generate an initial animation model, where the model texture map includes an expression texture map, and the expression texture map includes at least two sub-texture maps and the expression types of different sub-texture maps are different;

[0090] An instruction receiving module 32, configured to receive an animation frame generation instruction for the animation model, where the animation frame generation instruction includes a target texture map identifier of the virtual object model in the current animation frame;

[0091] A data mapping module 33, configured to control only the target sub-texture map corresponding to the target texture map identifier to be displayed on the expression texture map according to the target texture map identifier on the model texture map, call a material ball, and map the target sub-texture map to a corresponding area of the virtual object model based on UV mapping technology;

[0092] A data writing module 34, configured to correspondingly write the target texture map identifier and the number of animation frames corresponding to the target texture map identifier into an animation generation control file.

[0093] In some embodiments, the device further includes a pixel splitting module, configured to perform pixel splitting on the expression texture map on the model texture map to obtain at least two independent sub-texture maps, where each sub-texture map has an independent pixel point set in the model texture map, and by controlling the opening or closing of the pixel point set, it is possible to control the display or hiding of the corresponding sub-texture map on the model texture map.

[0094] In some embodiments, the data mapping module 33 is configured to determine a target pixel point set corresponding to the target texture map identifier, control the target pixel point set to be in an open state on the model texture map, and at the same time control other pixel point sets to be in a closed state on the model texture map, so as to control only the target sub-texture map corresponding to the target texture map identifier to be displayed on the expression texture map.

[0095] In some embodiments, the animation frame generation instruction further includes control parameters of a limb controller of the virtual object model body in the current animation frame; the device further includes a limb control module, configured to input the control parameters into the limb controller to control the limb movements of the virtual object model.

[0096] In some embodiments, the device also includes a preprocessing module, which is used to import the animation generation control file into a preset game program, parse the animation generation control file to obtain the animation frame number and texture identifier corresponding to each animation frame contained therein; sort each of the animation frame numbers from small to large, and calculate the time interval between two adjacent target frame numbers; import the time interval into a game timer, and switch the display of the animation frame corresponding to each of the animation frame numbers through the game timer.

[0097] In some embodiments, the preprocessing module is used to calculate the frame difference between two adjacent animation frames; and multiply the frame difference by a preset time parameter to obtain the time interval.

[0098] In some embodiments, the device also includes a display module for providing a visual interface, wherein the visual interface includes a display area, wherein the display area is used to display the animation model, and the facial expression of the animation model in the display area changes in real time following the switching of the target map identifier.

[0099] The embodiment of the present application also provides a terminal device, which can be a smart phone, a computer, a tablet computer, or other device.

[0100] See also Figure 6 , Figure 6 The schematic diagram of the structure of the terminal device provided in the embodiment of the present application is shown, and the terminal device can be used to implement the data preprocessing method provided in the above embodiment. The terminal device 1200 can be a smart phone or a tablet computer.

[0101] like Figure 6 As shown, the terminal device 1200 may include an RF (Radio Frequency) circuit 110, a memory 120 including one or more (only one is shown in the figure) computer-readable storage media, an input unit 130, a display unit 140, a sensor 150, an audio circuit 160, a transmission module 170, a processor 180 including one or more (only one is shown in the figure) processing cores, and a power supply 190. Those skilled in the art will understand that Figure 6 The structure of the terminal device 1200 shown in the figure does not constitute a limitation on the terminal device 1200, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0102] The RF circuit 110 is used to receive and transmit electromagnetic waves, realizing the mutual conversion between electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices. The RF circuit 110 may include various existing circuit elements for performing these functions, such as antennas, radio frequency transceivers, digital signal processors, encryption / decryption chips, subscriber identity module (SIM) cards, memories, and so on. The RF circuit 110 can communicate with various networks such as the Internet, enterprise intranets, wireless networks, or communicate with other devices through a wireless network.

[0103] The memory 120 can be used to store software programs and modules, such as the program instructions / modules corresponding to the data preprocessing method in the above embodiments. The processor 180 executes various functional applications and data processing by running the software programs and modules stored in the memory 120. The memory 120 may include a high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 120 may further include a memory remotely disposed relative to the processor 180, and these remote memories can be connected to the terminal device 1200 through a network. Examples of the above networks include but are not limited to the Internet, enterprise intranets, local area networks, mobile communication networks, and their combinations.

[0104] The input unit 130 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls. Specifically, the input unit 130 may include a touch-sensitive surface 131 and other input devices 132. The touch-sensitive surface 131, also known as a touch display screen or a touchpad, can collect touch operations of a user thereon or nearby (such as operations of the user using a finger, a stylus, or any suitable object or accessory on or near the touch-sensitive surface 131), and drive a corresponding connecting device according to a preset program. Optionally, the touch-sensitive surface 131 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the touch position of the user and 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 180, and can receive and execute commands sent by the processor 180. In addition, various types such as resistive, capacitive, infrared, and surface acoustic waves can be used to implement the touch-sensitive surface 131. In addition to the touch-sensitive surface 131, the input unit 130 may further include other input devices 132. Specifically, the other input devices 132 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, power on / off keys, etc.), a trackball, a mouse, a joystick, and the like.

[0105] The display unit 140 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 terminal device 1200. These graphical user interfaces can be composed of graphics, text, icons, videos, and any combination thereof. The display unit 140 may include a display panel 141. Optionally, the display panel 141 can be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), etc. Further, the touch-sensitive surface 131 can cover the display panel 141. When the touch-sensitive surface 131 detects a touch operation on or near it, it is transmitted to the processor 180 to determine the type of touch event. Subsequently, the processor 180 provides a corresponding visual output on the display panel 141 according to the type of touch event. Although in Figure 6 , the touch-sensitive surface 131 and the display panel 141 are implemented as two independent components to perform input and output functions, in some embodiments, the touch-sensitive surface 131 and the display panel 141 can be integrated to implement input and output functions.

[0106] The terminal device 1200 may further include at least one sensor 150, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. Among them, the ambient light sensor can adjust the brightness of the display panel 141 according to the brightness of the ambient light. The proximity sensor can turn off the display panel 141 and / or the backlight when the terminal device 1200 is moved to the ear. As a kind of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in all directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity, and can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors that the terminal device 1200 can also be configured with, they will not be elaborated here.

[0107] The audio circuit 160, the speaker 161, and the microphone 162 can provide an audio interface between the user and the terminal device 1200. The audio circuit 160 can transmit the electrical signal converted from the received audio data to the speaker 161, and the speaker 161 converts it into a sound signal for output; on the other hand, the microphone 162 converts the collected sound signal into an electrical signal, which is received by the audio circuit 160 and then converted into audio data. After the audio data is output to the processor 180 for processing, it is sent to another terminal, for example, via the RF circuit 110, or the audio data is output to the memory 120 for further processing. The audio circuit 160 may also include an earphone jack to provide communication between the peripheral earphone and the terminal device 1200.

[0108] The terminal device 1200 can help users send and receive emails, browse the web, access streaming media, etc. through a transmission module 170 (such as a Wi-Fi module), providing users with wireless broadband Internet access. Although Figure 6 the transmission module 170 is shown, it can be understood that it does not belong to the essential components of the terminal device 1200 and can be omitted entirely within the scope of not changing the essence of the invention as needed.

[0109] The processor 180 is the control center of the terminal device 1200, connecting various parts of the entire mobile phone through various interfaces and lines. By running or executing software programs and / or modules stored in the memory 120, and by calling data stored in the memory 120, it performs various functions of the terminal device 1200 and processes data, thereby monitoring the mobile phone as a whole. Optionally, the processor 180 may include one or more processing cores; in some embodiments, the processor 180 may integrate an application processor and a modem processor, where the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor may not be integrated into the processor 180 either.

[0110] The terminal device 1200 also includes a power supply 190 that powers each component. In some embodiments, the power supply can be logically connected to the processor 180 through a power management system, thereby realizing functions such as discharging management and power consumption management through the power management system. The power supply 190 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, a power status indicator, etc.

[0111] Although not shown, the terminal device 1200 may also include a camera (such as a front camera, a rear camera), a Bluetooth module, etc., which will not be elaborated here. Specifically, in this embodiment, the display unit 140 of the terminal device 1200 is a touch screen display, and the terminal device 1200 also includes a memory 120, and one or more programs, where one or more programs are stored in the memory 120 and are configured to be executed by one or more processors 180. The one or more programs include instructions for performing the following operations:

[0112] A data import instruction for determining a virtual object model and a model texture map of the virtual object model, and automatically generating an initial animation model, where the model texture map includes an expression texture map, and the expression texture map contains at least two sub-texture maps and the expression types of different sub-texture maps are different;

[0113] An instruction receiving instruction is used to receive an animation frame generation instruction for an animation model, wherein the animation frame generation instruction includes a target texture identifier of the virtual object model in a current animation frame;

[0114] A data mapping instruction, for controlling the expression map to display only a target sub-map corresponding to the target map identifier on the model map according to the target map identifier, calling a material ball, and mapping the target sub-map to a corresponding area of ​​the virtual object model based on UV mapping technology;

[0115] The data writing instruction is used to write the target texture identifier and the animation frame number corresponding to the target texture identifier into the animation generation control file accordingly.

[0116] In some embodiments, the program also includes a pixel splitting instruction for performing pixel splitting on the expression map on the model map to obtain at least two independent sub-maps, wherein each sub-map has an independent set of pixel points in the model map, and by controlling the opening or closing of the pixel point set, the corresponding sub-map can be controlled to be displayed or hidden on the model map.

[0117] In some embodiments, the data mapping instruction is used to determine the target pixel point set corresponding to the target map identifier according to the target map identifier, control the target pixel point set to be in an on state on the model map, and simultaneously control other pixel point sets to be in a off state on the model map, so as to control the expression map to display only the target sub-map corresponding to the target map identifier.

[0118] In some embodiments, the animation frame generation instruction also includes control parameters of a limb controller of the virtual object model body in the current animation frame; the program also includes limb control instructions for inputting the control parameters into the limb controller to control the limb movements of the virtual object model.

[0119] In some embodiments, the program also includes preprocessing instructions for importing the animation generation control file into a preset game program, parsing the animation generation control file to obtain the animation frame numbers and texture identifiers corresponding to each animation frame contained therein; sorting each of the animation frame numbers from small to large, and calculating the time interval between two adjacent target frame numbers; importing the time interval into a game timer, and switching the display of the animation frames corresponding to each of the animation frame numbers through the game timer.

[0120] In some embodiments, the pre-processing instruction is used to calculate the frame difference between two adjacent animation frames; and the frame difference is multiplied by a preset time parameter to obtain the time interval.

[0121] In some embodiments, the program further includes a display instruction for providing a visual interface, the visual interface including a display area for displaying the animation model, and the facial expression of the animation model in the display area changing in real time following the switching of the target texture map identifier.

[0122] An embodiment of the present application further provides a terminal device. The terminal device may be a device such as a smart phone or a tablet computer.

[0123] As can be seen from the above, an embodiment of the present application provides a terminal device 1200, and the terminal device 1200 performs the following steps: determining a virtual object model and a model texture map of the virtual object model, and automatically generating an initial animation model, wherein the model texture map includes an expression texture map, the expression texture map includes at least two sub-texture maps and the expression types of different sub-texture maps are different; receiving an animation frame generation instruction for the animation model, the animation frame generation instruction including a target texture map identifier of the virtual object model in the current animation frame; controlling only the target sub-texture map corresponding to the target texture map identifier in the expression texture map to be displayed on the model texture map according to the target texture map identifier, calling a material ball, and mapping the target sub-texture map to the corresponding area of the virtual object model based on the UV texture mapping technology; writing the target texture map identifier and the animation frame number corresponding to the target texture map identifier into an animation generation control file correspondingly. By pasting expression texture maps of different expression types on the facial part of the virtual object model, an embodiment of the present application can realize changing the facial expression of the virtual character, enabling the virtual character in the game scene to perform expression action switching according to a set program, and realizing expression switching based on a 3D model, which can reduce the production cost compared with the prior art.

[0124] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program runs on a computer, the computer executes the data preprocessing method described in any of the above embodiments.

[0125] It should be noted that for the data preprocessing method of the present application, those of ordinary skill in the art can understand that all or part of the process of implementing the data preprocessing method described in the embodiments of the present application can be completed by controlling relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, such as stored in the memory of the terminal device and executed by at least one processor in the terminal device. During the execution process, it may include the process of the embodiment of the data preprocessing method. Among them, the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM, Read Only Memory), a random access memory (RAM, Random Access Memory), etc.

[0126] For the data preprocessing device according to the embodiments of the present application, each functional module may be integrated in a processing chip, or each module may exist physically alone, or two or more modules may be integrated in one module. The above integrated modules may be implemented in the form of hardware or in the form of software functional modules. If the integrated modules are implemented in the form of software functional modules and sold or used as independent products, they may also be stored in a computer-readable storage medium, such as a read-only memory, a magnetic disk, or an optical disc.

[0127] The data preprocessing method, device, computer-readable storage medium, and terminal device provided by the embodiments of the present application have been introduced in detail above. Specific examples are used in this article to illustrate 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 data preprocessing method, characterized in that, it includes: Determine a virtual object model and the model texture map of the virtual object model, and automatically generate an initial animation model, wherein the model texture map includes an expression texture map, and the expression texture map contains at least two sub-texture maps and the expression types of different sub-texture maps are different; Perform pixel splitting on the expression texture map on the model texture map to obtain at least two independent sub-texture maps. Each sub-texture map has an independent set of pixel points in the model texture map. By controlling the opening or closing of the set of pixel points, it is possible to control the display or hiding of the corresponding sub-texture map on the model texture map; Receive an animation frame generation instruction for the animation model, and the animation frame generation instruction includes the target texture map identifier of the virtual object model in the current animation frame; According to the target texture map identifier, control only the target sub-texture map corresponding to the target texture map identifier to be displayed in the expression texture map on the model texture map, call a material ball, and map the target sub-texture map to the corresponding area of the virtual object model based on the UV texture mapping technology; Correspondingly write the target texture map identifier and the animation frame number corresponding to the target texture map identifier into an animation generation control file.

2. The data preprocessing method according to claim 1, characterized in that, The step of controlling only the target sub-texture map corresponding to the target texture map identifier to be displayed in the expression texture map on the model texture map according to the target texture map identifier includes: Determine the target set of pixel points corresponding to it according to the target texture map identifier, control the target set of pixel points to be in an open state on the model texture map, and at the same time control other sets of pixel points to be in a closed state on the model texture map, so as to control only the target sub-texture map corresponding to the target texture map identifier to be displayed in the expression texture map.

3. The data preprocessing method according to claim 1, characterized in that, The animation frame generation instruction further includes the control parameters of the limb controller of the virtual object model body in the current animation frame; After receiving the animation frame generation instruction for the animation model, the method further includes: Input the control parameters into the limb controller to control the limb movements of the virtual object model.

4. The data preprocessing method according to claim 1, characterized in that, After correspondingly writing the target texture map identifier and the animation frame number corresponding to the target texture map identifier into the animation generation control file, the method further includes: Import the animation generation control file into a preset game program, and parse the animation generation control file to obtain the animation frame numbers and texture map identifiers corresponding to each included animation frame; Sort each of the animation frame numbers from smallest to largest, and calculate the time interval between adjacent two target frame numbers according to the adjacent two target frame numbers; Import the time interval into a game timer, and switch the display of the pictures of the animation frames corresponding to each of the animation frame numbers through the game timer.

5. The data preprocessing method according to claim 4, characterized in that, The step of calculating the time interval between adjacent two target frame numbers according to the adjacent two target frame numbers includes: Calculate the frame number difference between two adjacent animation frames; Multiply the frame number difference by a preset time parameter to obtain the time interval.

6. The data preprocessing method according to claim 1, characterized in that, the method further includes: Providing a visualization interface, the visualization interface includes a display area for displaying the animation model, and the facial expression of the animation model in the display area changes in real time following the switching of the target texture map identifier.

7. A data preprocessing device, characterized in that, comprising: A data import module, configured to determine a virtual object model and the model texture map of the virtual object model, and automatically generate an initial animation model, wherein the model texture map includes an expression texture map, the expression texture map contains at least two sub-texture maps and the expression types of different sub-texture maps are different; perform pixel splitting on the expression texture map on the model texture map to obtain at least two independent sub-texture maps, wherein each sub-texture map has an independent pixel point set in the model texture map, and by controlling the opening or closing of the pixel point set, it is possible to control the display or hiding of the corresponding sub-texture map on the model texture map; An instruction receiving module, configured to receive an animation frame generation instruction for the animation model, and the animation frame generation instruction includes the target texture map identifier of the virtual object model in the current animation frame; A data mapping module, configured to control only the target sub-texture map corresponding to the target texture map identifier to be displayed in the expression texture map on the model texture map according to the target texture map identifier, call a material ball, and map the target sub-texture map to the corresponding area of the virtual object model based on the UV texture mapping technology; A data writing module, configured to correspondingly write the target texture map identifier and the animation frame number corresponding to the target texture map identifier into an animation generation control file.

8. 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 data preprocessing method according to any one of claims 1-6.

9. A terminal device, characterized in that, comprising a processor and a memory, the memory stores multiple instructions, and the processor loads the instructions to execute the data preprocessing method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Human face expression generating method and device based on stereoscopic animation

    CN108305309A