Method, device, storage medium and electronic device for adjusting virtual character model
By updating the bone and skin data of the virtual character model and adjusting the expression form of the virtual character model, the problem that the artistic effect and production cost cannot be taken into account due to the diversity of virtual characters depend on bone deformation, and the cost of virtual characters is realized without increasing costs Improve the diversity of virtual characters.
Patent Information
- Application Number
- CN202210096293.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-26
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2042-01-26
AI Technical Summary
In the prior art, the diversity of virtual characters depends on bone deformation, resulting in the problem that artistic effect and production costs cannot be taken into account.
By obtaining the model files, bone files and skin files of the virtual character model, update the bone and skin data of the part to be replaced, generate target bones and target skin files, adjust the expression form of the virtual character model, and achieve the diversity of virtual characters promote.
Without increasing human, learning and performance costs, improving the diversity of virtual characters solves the problem that virtual characters' diversity depends on bone deformation and cannot take into account both artistic effects and production costs.
Smart Images

Figure CN114504825B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to a method, device, storage medium and electronic device for adjusting a virtual character model. Background Art
[0002] In computer game development and virtual character design, it is usually necessary to adjust the mesh, skeleton and skin data of the virtual character model to achieve the design of the virtual character model and its related animation. In recent years, with the development of computer technology and the improvement of user aesthetic needs, the quality requirements for virtual character models have gradually increased. In this regard, technicians in this field are constantly exploring various methods to improve the diversity and vividness of virtual characters.
[0003] In the existing scheme, the virtual character design method mainly includes: making basic virtual character models such as male and female, and realizing the diversity of the virtual character's torso by changing the hairstyle, beard, clothing, headdress and other parts on these basic virtual character models; realizing the diversity of the virtual character's facial features by using the virtual character head skeleton deformation technology (i.e. scaling, translating and rotating the multiple head bones that control the facial features within a reasonable range). However, the defects of this method are: the higher virtual character artistic effect leads to increased model complexity and higher production costs; the skeleton deformation technology is difficult and requires high professionalism of technicians, which is not convenient for practical application.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] At least some embodiments of the present invention provide a method, device, storage medium and electronic device for adjusting a virtual character model, so as to at least solve the technical problem in the related art that the diversity of virtual characters depends on bone deformation, resulting in the inability to balance the artistic effect and production cost of the virtual characters.
[0006] According to one embodiment of the present invention, a method for adjusting a virtual character model is provided, comprising:
[0007] A first model file, a second model file, a first skeleton file and a first skin file corresponding to a first virtual character model are obtained, wherein the first model file is used to determine a part of the model to be replaced in the first virtual character model, the second model file is used to determine a part of the model to be retained in the first virtual character model, the first skeleton file is used to store the initial skeleton data of the virtual character model, and the first skin file is used to store the initial skin data of the virtual character model; a skeleton file to be replaced and a skin file to be replaced corresponding to the part of the model to be replaced are obtained, wherein the skeleton file to be replaced is used to store newly created skeleton data corresponding to the part of the model to be replaced, and the skin file to be replaced is used to store newly created skin data corresponding to the part of the model to be replaced; the first skeleton file is updated using the skeleton file to be replaced to obtain a target skeleton file, and the first skin file is updated using the skin file to be replaced to obtain a target skin file; when a first preset display condition in a virtual game scene is met, the target skeleton file and the target skin file are used to adjust the expression form of the part of the model to be replaced; and / or, in the virtual game scene, the first model file, the second model file, the target skeleton file and the target skin file are used to generate a second virtual character model.
[0008] Optionally, obtaining the first model file, the second model file, the first skeleton file and the first skin file corresponding to the first virtual character model includes: splitting all network data corresponding to the first virtual character model into first mesh data and second mesh data to obtain the first model file and the second model file, wherein the first mesh data is the mesh data corresponding to the part of the model to be replaced, and the second mesh data is the mesh data corresponding to the part of the model to be retained; performing skeleton skinning processing on the first virtual character model to obtain the first skeleton file and the first skin file.
[0009] Optionally, obtaining the skeleton file to be replaced and the skin file to be replaced corresponding to the partial model to be replaced includes: extracting the first mesh data from the first model file; obtaining the second skeleton file and the second skin file corresponding to the first mesh data, wherein the second skeleton file is used to store the newly created skeleton data corresponding to the first mesh data, and the second skin file is used to store the newly created skin data corresponding to the first mesh data, and the second skeleton file includes: the initial skeleton corresponding to the first mesh data.
[0010] Optionally, the first skeleton file is updated using the skeleton file to be replaced to obtain a target skeleton file, and the first skin file is updated using the skin file to be replaced to obtain the target skin file, which includes: determining the skeleton data to be deleted from the first skeleton file and determining the skin data to be deleted from the first skin file, wherein the skeleton data to be deleted is determined by the initial skeleton corresponding to the first mesh data, and the skin data to be deleted is determined by the skeleton data to be deleted; determining the skeleton data to be replaced from the second skeleton file and determining the skin data to be replaced from the second skin file, wherein the skeleton data to be replaced is determined by the initial skeleton corresponding to the first mesh data, and the skin data to be replaced is determined by the skeleton data to be replaced; deleting the skeleton data to be deleted in the first skeleton file and replacing it with the skeleton data to be replaced to obtain the target skeleton file, and deleting the skin data to be deleted in the first skin file and replacing it with the skin data to be replaced to obtain the target skin file.
[0011] Optionally, obtaining the skeleton file to be replaced and the skin file to be replaced corresponding to the partial model to be replaced includes: generating third mesh data, wherein the third mesh data is the newly created mesh data of the partial model to be replaced; obtaining a third skeleton file and a third skin file corresponding to the third mesh data, wherein the third skeleton file is used to store the newly created skeleton data corresponding to the third mesh data, and the third skin file is used to store the newly created skin data corresponding to the third mesh data, and the third skeleton file includes: the initial skeleton corresponding to the first mesh data.
[0012] Optionally, the first skeleton file is updated using the skeleton file to be replaced to obtain a target skeleton file, and the first skin file is updated using the skin file to be replaced to obtain the target skin file, which includes: determining the skeleton data to be deleted from the first skeleton file and determining the skin data to be deleted from the first skin file, wherein the skeleton data to be deleted is determined by the initial skeleton corresponding to the first mesh data, and the skin data to be deleted is determined by the skeleton data to be deleted; determining the skeleton data to be replaced from the third skeleton file and determining the skin data to be replaced from the third skin file, wherein the skeleton data to be replaced is determined by the initial skeleton corresponding to the first mesh data, and the skin data to be replaced is determined by the skeleton data to be replaced; deleting the skeleton data to be deleted in the first skeleton file and replacing it with the skeleton data to be replaced to obtain the target skeleton file, and deleting the skin data to be deleted in the first skin file and replacing it with the skin data to be replaced to obtain the target skin file.
[0013] Optionally, the method for adjusting the virtual character model further includes: when a second preset display condition in the virtual game scene is met, using the first model file, the second model file, the first skeleton file and the first skin file to generate the first virtual character model.
[0014] Optionally, the method for adjusting the virtual character model further includes: when the first virtual character model is a virtual human character model, the part of the model to be replaced is a virtual head model, and the part of the model to be retained is a virtual torso model.
[0015] According to one embodiment of the present invention, there is also provided a device for adjusting a virtual character model, comprising:
[0016] The first acquisition module is used to acquire the first model file, the second model file, the first skeleton file and the first skin file corresponding to the first virtual character model, wherein the first model file is used to determine the part of the model to be replaced in the first virtual character model, the second model file is used to determine the part of the model to be retained in the first virtual character model, the first skeleton file is used to store the initial skeleton data of the virtual character model, and the first skin file is used to store the initial skin data of the virtual character model; the second acquisition module is used to acquire the skeleton file to be replaced and the skin file to be replaced corresponding to the part of the model to be replaced, wherein the skeleton file to be replaced is used to store the initial skeleton data of the part of the model to be replaced The newly created skeleton data of the to-be-replaced skin file is used to store the newly created skin data corresponding to the part of the model to be replaced; an updating module is used to update the first skeleton file with the to-be-replaced skeleton file to obtain a target skeleton file, and to update the first skin file with the to-be-replaced skin file to obtain a target skin file; an adjusting module is used to adjust the expression form of the part of the model to be replaced with the target skeleton file and the target skin file when the preset display conditions in the virtual game scene are met; and / or, in the virtual game scene, the first model file, the second model file, the target skeleton file and the target skin file are used to generate a second virtual character model.
[0017] Optionally, the first acquisition module is also used to: split all network data corresponding to the first virtual character model into first mesh data and second mesh data to obtain a first model file and a second model file, wherein the first mesh data is mesh data corresponding to the part of the model to be replaced, and the second mesh data is mesh data corresponding to the part of the model to be retained; perform skeleton skinning processing on the first virtual character model to obtain a first skeleton file and a first skin file.
[0018] Optionally, the second acquisition module is also used to: extract the first mesh data from the first model file; obtain the second skeleton file and the second skin file corresponding to the first mesh data, wherein the second skeleton file is used to store the newly created skeleton data corresponding to the first mesh data, and the second skin file is used to store the newly created skin data corresponding to the first mesh data, and the second skeleton file includes: the initial skeleton corresponding to the first mesh data.
[0019] Optionally, the update module is also used to: determine the bone data to be deleted from the first bone file and determine the skin data to be deleted from the first skin file, wherein the bone data to be deleted is determined by the initial bone corresponding to the first mesh data, and the skin data to be deleted is determined by the bone data to be deleted; determine the bone data to be replaced from the second bone file and determine the skin data to be replaced from the second skin file, wherein the bone data to be replaced is determined by the initial bone corresponding to the first mesh data, and the skin data to be replaced is determined by the bone data to be replaced; delete the bone data to be deleted in the first bone file and replace it with the bone data to be replaced to obtain a target bone file, and delete the skin data to be deleted in the first skin file and replace it with the skin data to be replaced to obtain a target skin file.
[0020] Optionally, the second acquisition module is also used to: generate third mesh data, wherein the third mesh data is newly created mesh data of the part of the model to be replaced; obtain a third skeleton file and a third skin file corresponding to the third mesh data, wherein the third skeleton file is used to store the newly created skeleton data corresponding to the third mesh data, and the third skin file is used to store the newly created skin data corresponding to the third mesh data, and the third skeleton file includes: the initial skeleton corresponding to the first mesh data.
[0021] Optionally, the update module is also used to: determine the bone data to be deleted from the first bone file and determine the skin data to be deleted from the first skin file, wherein the bone data to be deleted is determined by the initial bone corresponding to the first mesh data, and the skin data to be deleted is determined by the bone data to be deleted; determine the bone data to be replaced from the third bone file and determine the skin data to be replaced from the third skin file, wherein the bone data to be replaced is determined by the initial bone corresponding to the first mesh data, and the skin data to be replaced is determined by the bone data to be replaced; delete the bone data to be deleted in the first bone file and replace it with the bone data to be replaced to obtain a target bone file, and delete the skin data to be deleted in the first skin file and replace it with the skin data to be replaced to obtain a target skin file.
[0022] Optionally, the device for adjusting the virtual character model further includes: a generation module, which is used to generate a first virtual character model using the first model file, the second model file, the first skeleton file and the first skin file when a second preset display condition in the virtual game scene is met.
[0023] According to one embodiment of the present invention, a non-volatile storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute any of the above methods for adjusting a virtual character model when running.
[0024] According to one embodiment of the present invention, there is also provided an electronic device, comprising: a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute any of the above methods for adjusting a virtual character model.
[0025] In at least some embodiments of the present invention, a method is adopted for obtaining a first model file, a second model file, a first skeleton file and a first skin file corresponding to a first virtual character model, and simultaneously obtaining a skeleton file to be replaced and a skin file to be replaced corresponding to a part of the model to be replaced, the first skeleton file is updated by the skeleton file to be replaced to obtain a target skeleton file, and the first skin file is updated by the skin file to be replaced to obtain a target skin file, when a first preset display condition in a virtual game scene is met, the target skeleton file and the target skin file are used to adjust the expression form of the part of the model to be replaced, and / or in the virtual game scene, the second virtual character model is obtained by the first model file, the second model file, the target skeleton file and the target skin file, so as to achieve the purpose of replacing and updating the model file, the skeleton file and the skin file of the virtual character to improve the diversity of the virtual character, thereby achieving the technical effect of improving the diversity of the virtual character without increasing the manpower cost, the learning cost and the performance cost, and further solving the technical problem in the related art that the diversity of the virtual character depends on the skeleton deformation, resulting in the inability to balance the artistic effect and the production cost of the virtual character. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0027] Figure 1 is a hardware structure block diagram of a mobile terminal for a method of adjusting a virtual character model according to an embodiment of the present invention;
[0028] Figure 2 is a flow chart of a method for adjusting a virtual character model according to an embodiment of the present invention;
[0029] Figure 3 is a schematic diagram of an optional structure of a virtual role model according to an embodiment of the present invention;
[0030] Figure 4 is a schematic diagram of an optional virtual role model according to an embodiment of the present invention;
[0031] Figure 5 is a schematic diagram of an optional head structure of a virtual character model according to an embodiment of the present invention;
[0032] Figure 6is a schematic diagram of another optional head structure of a virtual character model according to an embodiment of the present invention;
[0033] Figure 7 is a schematic diagram of an optional refined virtual character model display scene according to an embodiment of the present invention;
[0034] Figure 8 is a schematic diagram of another optional refined virtual character model display scene according to an embodiment of the present invention;
[0035] Fig. 9 is a structural block diagram of a device for adjusting a virtual character model according to an embodiment of the present invention;
[0036] Fig.10 It is a structural block diagram of an optional device for adjusting a virtual character model according to an embodiment of the present invention. DETAILED DESCRIPTION
[0037] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0038] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0039] According to one embodiment of the present invention, an embodiment of a method for adjusting a virtual character model is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0040] In one embodiment of the present invention, the method for adjusting the virtual character model can be run on a terminal device or a server. The terminal device can be a local terminal device. When the method for adjusting the virtual character model is run on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.
[0041] In an optional implementation, various cloud applications, such as cloud games, can be run under the cloud interaction system. Taking cloud games as an example, cloud games refer to a game mode based on cloud computing. In the operation mode of cloud games, the operating body of the game program and the main body of the game screen presentation are separated. The storage and operation of the method for adjusting the virtual character model are completed on the cloud game server. The role of the client device is used for receiving and sending data and presenting the game screen. For example, the client device can be a display device with data transmission function close to the user side, such as a mobile terminal, a TV, a computer, a handheld computer, etc.; but the terminal device for information processing is a cloud game server in the cloud. When playing the game, the player operates the client device to send an operation instruction to the cloud game server. The cloud game server runs the game according to the operation instruction, encodes and compresses the game screen and other data, and returns it to the client device through the network. Finally, the client device decodes and outputs the game screen.
[0042] In an optional embodiment, the terminal device may be a local terminal device. Taking a game as an example, the local terminal device stores a game program and is used to present a game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, the game program is downloaded and installed by an electronic device and run conventionally. The local terminal device may provide the graphical user interface to the player in a variety of ways, for example, it may be rendered and displayed on a display screen of the terminal, or provided to the player through a holographic projection. For example, the local terminal device may include a display screen and a processor, the display screen is used to present a graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate a graphical user interface, and control the display of the graphical user interface on the display screen.
[0043] In a possible implementation, an embodiment of the present invention provides a method for adjusting a virtual character model by providing a graphical user interface through a terminal device, wherein the terminal device may be the local terminal device mentioned above or a client device in the cloud interaction system mentioned above.
[0044] Taking a mobile terminal running in a local terminal device as an example, the mobile terminal can be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, referred to as MID), a PAD, a game console, and other terminal devices. Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal for a method of adjusting a virtual character model according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 (processor 102 may include but is not limited to a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processing (DSP) chip, a microprocessor (MCU), a programmable logic device (FPGA), a neural network processor (NPU), a tensor processor (TPU), an artificial intelligence (AI) type processor, etc.) and a memory 104 for storing data. Optionally, the mobile terminal may also include a transmission device 106 for communication functions, an input and output device 108, and a display device 110. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0045] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for adjusting the virtual character model in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the method for adjusting the virtual character model is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0046] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0047] The inputs in the input / output device 108 may come from a plurality of human interface devices (HIDs), such as keyboards and mice, game controllers, and other dedicated game controllers (such as steering wheels, fishing rods, dance mats, remote controls, etc.). In addition to providing input functions, some human interface devices may also provide output functions, such as force feedback and vibration of game controllers, audio output of controllers, etc.
[0048] The display device 110 may be, for example, a head-up display (HUD), a touch-screen liquid crystal display (LCD), and a touch display (also referred to as a "touch screen" or "touch display screen"). The liquid crystal display may enable a user to interact with a user interface of the mobile terminal. In some embodiments, the mobile terminal has a graphical user interface (GUI), and a user may interact with the GUI by finger contacts and / or gestures on a touch-sensitive surface, wherein the human-computer interaction functions here may optionally include the following interactions: creating web pages, drawing, word processing, making electronic documents, games, video conferencing, instant messaging, sending and receiving emails, call interfaces, playing digital videos, playing digital music, and / or web browsing, etc. The executable instructions for executing the above-mentioned human-computer interaction functions are configured / stored in a computer program product or a readable storage medium executable by one or more processors.
[0049] In this embodiment, a method for adjusting a virtual character model running on the mobile terminal is provided. Figure 2 is a flow chart of a method for adjusting a virtual character model according to one embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:
[0050] Step S21, obtaining a first model file, a second model file, a first skeleton file, and a first skin file corresponding to the first virtual character model, wherein the first model file is used to determine a portion of the model to be replaced in the first virtual character model, the second model file is used to determine a portion of the model to be retained in the first virtual character model, the first skeleton file is used to store initial skeleton data of the virtual character model, and the first skin file is used to store initial skin data of the virtual character model;
[0051] In game development and virtual character model design, since the cost of generating animation data of virtual character models directly based on mesh data of virtual character models is very high in the early stage, skeleton skinning technology is produced. In skeleton skinning technology, dynamic virtual character model data includes: mesh data, skeleton data, skinning data, etc. Based on the above skeleton skinning technology, the present invention proposes a low-cost optimization method for improving the diversity and vividness of virtual character models.
[0052] The mesh data of the virtual character model records the vertex data of the virtual character model and is used to render the virtual character model to the screen. The denser the mesh division of the virtual character model, the more mesh data there is, and the more refined the rendering effect of the virtual character model.
[0053] The skeleton data of the virtual character model is similar to the joint data in the human skeleton. The skeleton data set records the subordinate relationship, relative offset and other information between the skeletons of the virtual character model. The skeleton data of the virtual character model is used to control the body movements and image of the virtual character model. For example, by changing the skeleton data of the virtual character model, the animation effect of the virtual character model is achieved; for another example, by modifying the relative offset information of multiple joints in the skeleton data of the virtual character model, the skeleton deformation is achieved.
[0054] The skinning data of the virtual character model is also called binding data. The mesh data of the virtual character model has a large amount of data, while the skeleton data has a small amount of data. The skinning data records the many-to-one mapping relationship between the mesh data and the skeleton data of the virtual character model. Through the skinning data, the mesh data of the virtual character model can be bound to the skeleton data.
[0055] The above-mentioned first virtual character model can correspond to the above-mentioned first model file, the above-mentioned second model file, the above-mentioned first skeleton file and the above-mentioned first skin file. Obtaining the first model file, the second model file, the first skeleton file and the first skin file can be used to replace and adjust at least part of the model in the first virtual character model.
[0056] When replacing and adjusting at least part of the models in the first virtual character model, it is necessary to determine the part of the model to be replaced and the part of the model to be retained in the first virtual character model through the model file. In an embodiment of the present invention, the part of the model to be replaced in the first virtual character model is determined through the first model file, and the part of the model to be retained in the first virtual character model is determined through the second model file. The first skeleton file is used to store the initial skeleton data of the first virtual character model, and the first skin file is used to store the initial skin data of the first virtual character model.
[0057] Figure 3 is a schematic diagram of the structure of a virtual role model according to an embodiment of the present invention, such as Figure 3 As shown, an initial model of a virtual character is made, which is recorded as the initial virtual character model A. According to one optional embodiment of the present invention, a "head change" operation is performed on the initial virtual character model A to obtain a fine virtual character model A, that is, the animation of the facial features of the virtual character model is displayed more finely, or the virtual character model A can be transformed into another virtual character model B.
[0058] Optionally, the above method of making an initial model of a virtual character can be designed and output by an original painting designer or a model sculptor, wherein the design output software can be commonly used software such as 3Dmax, Maya, ZBrush, etc.
[0059] like Figure 3 As shown, the model file of the initial virtual character model A can be divided into an initial head model file and a torso model file. The initial head model file is equivalent to the above-mentioned first model file, denoted as head01, and the torso model file is equivalent to the above-mentioned second model file, denoted as body. The initial skeleton file corresponding to the initial virtual character model A is equivalent to the above-mentioned first skeleton file, denoted as male.skeleton, wherein the initial skeleton file male.skeleton includes the initial head skeleton file head.skeleton and the initial torso skeleton file body.skeleton. The initial skin file corresponding to the initial virtual character model A is equivalent to the above-mentioned first skin file, denoted as male.skin, wherein the initial skin file male.skin includes the initial head skin file head.skin and the initial torso skin file body.skin.
[0060] Figure 4 is a schematic diagram of an optional virtual role model according to an embodiment of the present invention, such as Figure 4As shown, in order to save rendering costs, the model of the initial virtual character model A is usually made simpler, that is, the mesh division is sparse and the number of bones is small. At this time, the initial virtual character model A can move as a whole, but the liveliness and diversity of the virtual character model are poor.
[0061] In an optional embodiment, when the above-mentioned first virtual character model is a virtual human character model, since in a virtual game scene, the differences in body shape between multiple similar human characters are usually ignored, and more attention is paid to the differences in heads (especially faces) between the multiple similar human characters, therefore, in the above-mentioned method for adjusting the virtual character model provided by the present invention, the virtual head model is used as the partial model to be replaced, and the virtual torso model is used as the partial model to be retained.
[0062] Step S22, obtaining a skeleton file to be replaced and a skin file to be replaced corresponding to the partial model to be replaced, wherein the skeleton file to be replaced is used to store newly created skeleton data corresponding to the partial model to be replaced, and the skin file to be replaced is used to store newly created skin data corresponding to the partial model to be replaced;
[0063] The above-mentioned partial model to be replaced may correspond to the above-mentioned skeleton file to be replaced and the above-mentioned skin file to be replaced, wherein the above-mentioned newly created skeleton data may be stored in the skeleton file to be replaced, and the newly created skeleton data may be skeleton data newly created according to the partial model to be replaced; the above-mentioned newly created skin data may be stored in the skin file to be replaced, and the newly created skin data may be skin data newly created according to the partial model to be replaced. The skeleton file to be replaced and the skin file to be replaced may be obtained, and at least part of the model in the first virtual character model may be replaced and adjusted accordingly.
[0064] Figure 5 is a schematic diagram of an optional virtual character model head structure according to an embodiment of the present invention. Figure 3 and Figure 5 As shown, it is determined that the head of the initial virtual character model A is the part to be replaced. A new and detailed head skeleton data can be created based on the head model of the initial virtual character model A, which is equivalent to the newly created skeleton data. Secondly, the detailed head skeleton data is stored in a newly created skeleton file, which is equivalent to the skeleton file to be replaced, and is recorded as head_1.skeleton. Then, a new and detailed head skin data can also be created based on the head model of the initial virtual character model A, which is equivalent to the newly created skin data, and then the detailed head skin data can be stored in the newly created skin file. The newly created skin file is equivalent to the skin file to be replaced, and is recorded as head_1.skin.
[0065] Figure 6is a schematic diagram of another optional virtual character model head structure according to an embodiment of the present invention. Figure 3 and Figure 6 As shown, it is determined that the head of the initial virtual character model A is the part to be replaced, and the torso is the part to be retained. To this end, a new copy of the head skeleton data of the virtual character model B can be created, which is equivalent to the newly created skeleton data, and then the head skeleton data of the virtual character model B is stored in a newly created head skeleton file. The newly created head skeleton file is equivalent to the above-mentioned skeleton file to be replaced, and is recorded as head_2.skeleton. In addition, a new copy of the head skin data of the virtual character model B can be created, which is equivalent to the newly created skin data, and then the head skin data of the virtual character model B is stored in a newly created head skin file. The newly created head skin file is equivalent to the above-mentioned skin file to be replaced, and is recorded as head_2.skin.
[0066] It should be noted that if Figure 6 As shown, when creating the head skeleton data and the head skin data of the new virtual character model B, it is necessary to ensure that the new head skeleton data and the new head skin data can be connected with the part to be retained of the initial virtual character model A (ie the torso part).
[0067] Step S23, using the skeleton file to be replaced to update the first skeleton file to obtain a target skeleton file, and using the skin file to be replaced to update the first skin file to obtain a target skin file;
[0068] The above-mentioned skeleton file to be replaced is used to store the above-mentioned newly created skeleton data corresponding to the partial model to be replaced. The above-mentioned first skeleton file is used to store the initial skeleton data of the above-mentioned first virtual character model. The skeleton file to be replaced is used to overwrite the partial skeleton file in the first skeleton file corresponding to the partial model to be replaced of the first virtual character model. That is, the first skeleton file is updated to obtain the updated first skeleton file as the target skeleton file.
[0069] The skin file to be replaced is used to store the newly created skin data corresponding to the part of the model to be replaced. The first skin file is used to store the initial skin data of the first virtual character model. The skin file to be replaced is used to overwrite the skin file corresponding to the part of the model to be replaced of the first virtual character model in the first skin file. That is, the first skin file is updated to obtain the updated first skin file as the target skin file.
[0070] like Figure 3 and Figure 5 As shown, the optional method steps for updating the file of the to-be-replaced part (head model) of the initial virtual character model A are as follows:
[0071] The first step is to obtain the initial skeleton file male.skeleton (equivalent to the first skeleton file mentioned above) corresponding to the initial virtual character model A.
[0072] The second step is to delete the initial head skeleton file head.skeleton in the initial skeleton file male.skeleton, and keep the initial torso skeleton file body.skeleton.
[0073] The third step is to obtain a newly created detailed head skeleton file head_1.skeleton (equivalent to the above-mentioned skeleton file to be replaced) based on the head model of the initial virtual character model A.
[0074] The fourth step is to splice the detailed head skeleton file head_1.skeleton with the initial torso skeleton file body.skeleton at the corresponding position of the initial head skeleton file head.skeleton in the initial skeleton file male.skeleton of the initial virtual character model A to obtain the target skeleton file male_1.skeleton.
[0075] The fifth step is to obtain the initial skin file male.skin corresponding to the initial virtual character model A (equivalent to the first skin file mentioned above).
[0076] Step 6. Delete the initial head skin file head.skin in the initial skin file male.skin, and keep the initial torso skin file body.skin.
[0077] The seventh step is to obtain a newly created detailed head skin file head_1.skin (equivalent to the above-mentioned skin file to be replaced) based on the head model of the initial virtual character model A.
[0078] Step 8. At the corresponding position of the initial head skin file head.skin in the initial skin file male.skin of the initial virtual character model A, the refined head skin file head_1.skin is spliced with the initial torso skin file body.skin to obtain the target skin file male_1.skin.
[0079] like Figure 3 and Figure 6 As shown, another optional method for updating the file of the part to be replaced (head model) of the initial virtual character model A is as follows:
[0080] The first step is to obtain the initial skeleton file male.skeleton (equivalent to the first skeleton file mentioned above) corresponding to the initial virtual character model A.
[0081] The second step is to delete the initial head skeleton file head.skeleton in the initial skeleton file male.skeleton, and keep the initial torso skeleton file body.skeleton.
[0082] The third step is to obtain the head skeleton file head_2.skeleton of the virtual character model B (equivalent to the above-mentioned skeleton file to be replaced).
[0083] The fourth step is to splice the head skeleton file head_2.skeleton of the virtual character model B with the initial torso skeleton file body.skeleton at the corresponding position of the initial head skeleton file head.skeleton in the initial skeleton file male.skeleton of the initial virtual character model A to obtain the target skeleton file male_2.skeleton.
[0084] The fifth step is to obtain the initial skin file male.skin corresponding to the initial virtual character model A (equivalent to the first skin file mentioned above).
[0085] Step 6. Delete the initial head skin file head.skin in the initial skin file male.skin, and keep the initial torso skin file body.skin.
[0086] Step 7: Get the head skin file head_2.skin of the virtual character model B (equivalent to the above-mentioned skin file to be replaced).
[0087] Step 8. At the corresponding position of the initial head skin file head.skin in the initial skin file male.skin of the initial virtual character model A, the head skin file head_2.skin of the virtual character model B is spliced with the initial torso skin file body.skin to obtain the target skin file male_2.skin.
[0088] Step S24, when the first preset display condition in the virtual game scene is met, the target skeleton file and the target skin file are used to adjust the expression form of the part of the model to be replaced; and / or, in the virtual game scene, the first model file, the second model file, the target skeleton file and the target skin file are used to generate a second virtual character model.
[0089] After updating the first skeleton file to obtain the target skeleton file and updating the first skin file to obtain the target skin file, the first virtual character model may be adjusted based on one of the following methods:
[0090] Method 1) In a virtual game scene, when a first preset display condition is met, the target skeleton file and the target skin file are used to adjust the expression form of the part of the model to be replaced in the first virtual character model.
[0091] Method 2) In a virtual game scene, the first model file, the second model file, the target skeleton file and the target skin file are used to generate a second virtual character model.
[0092] Method 3) In a virtual game scene, the first model file, the second model file, the target skeleton file and the target skin file are used to generate a second virtual character model, and when a first preset display condition is met, the target skeleton file and the target skin file are used to adjust the expression form of the part of the model to be replaced in the second virtual character model.
[0093] It should be noted that the above-mentioned second virtual character model includes the partial model to be retained of the above-mentioned first virtual character model, and the second virtual character model also includes the partial model to be replaced which is updated and generated by the skeleton file to be replaced and the skin file to be replaced corresponding to the above-mentioned partial model, wherein the skeleton file to be replaced is used to store the newly created skeleton data corresponding to the partial model to be replaced, and the skin file to be replaced is used to store the newly created skin data corresponding to the partial model to be replaced.
[0094] Figure 7 is a schematic diagram of an optional refined virtual role model display scene according to an embodiment of the present invention, such as Figure 7 As shown, in a virtual game scene, usually the scene camera is far away or the animation precision of the virtual character model is low (referred to as the default condition). In order to save the game running cost, the virtual character model rendered on the screen is the initial virtual character model A with sparse grid division and a small number of bones. However, when the scene camera is zoomed in or the facial animation of the virtual character model needs to be played (referred to as the trigger condition), a more refined virtual character model needs to be rendered to achieve richer and more diverse model animations.
[0095] like Figure 7 As shown, when the game scene is switched from the above default condition to the above trigger condition, the method steps for displaying the fine virtual character model A on the screen are as follows:
[0096] The first step is to obtain the target skeleton file male_1.skeleton obtained by updating the above-mentioned refined head skeleton file head_1.skeleton.
[0097] The second step is to obtain the target skin file male_1.skin obtained by updating the above-mentioned refined head skin file head_1.skin.
[0098] The third step is to render a detailed virtual character model A based on the target skeleton file male_1.skeleton and the target skin file male_1.skin.
[0099] After the above operations, the refined virtual character model A displayed on the screen retains the torso model of the initial virtual character model A, optimizes the head model of the initial virtual character model A, realizes the refinement of the virtual character model animation with less increase in cost, and improves the model rendering effect.
[0100] Figure 8 FIG. 1 is a schematic diagram of another optional refined virtual character model display scene according to an embodiment of the present invention. In a virtual game scene, there are often multiple virtual characters with similar torsos but different head features, such as Figure 8 A virtual character model B (equivalent to the second virtual character model) similar to the virtual character model A is created. To save the game running cost, a complete model of the virtual character model B can be obtained by creating a head model of the virtual character model B and combining it with the torso model of the virtual character model A.
[0101] like Figure 8 As shown, under the above triggering conditions, the method steps for displaying the virtual character model B in the game scene are as follows:
[0102] The first step is to obtain the target skeleton file male_2.skeleton obtained by updating the head skeleton file head_2.skeleton of the virtual character model B mentioned above.
[0103] The second step is to obtain the target skin file male_2.skin obtained by updating the head skin file head_2.skin of the virtual character model B.
[0104] The third step is to render the virtual character model B based on the target skeleton file male_2.skeleton and the target skin file male_21.skin.
[0105] After the above operations, the virtual character model B displayed on the screen retains the torso model of the initial virtual character model A, and replaces the head model of the virtual character model A with the head model of the virtual character model B, thereby achieving the diversity of the virtual character models with less increase in cost.
[0106] It should be noted that when generating a virtual character model B based on a virtual character model A, the head features of the virtual character model B can be matched by simply changing factors such as clothing and skin color.
[0107] In particular, when generating virtual character model B based on virtual character model A, the head model of virtual character model A is replaced by the head model of virtual character model B. The head model of virtual character model A can be the head model of the initial virtual character model A or the head model of the refined virtual character model A. The head model of virtual character model B can be the simpler initial head model of virtual character model B or the refined head model of virtual character model B.
[0108] In at least some embodiments of the present invention, a method is adopted for obtaining a first model file, a second model file, a first skeleton file and a first skin file corresponding to a first virtual character model, and simultaneously obtaining a skeleton file to be replaced and a skin file to be replaced corresponding to a part of the model to be replaced, the first skeleton file is updated by the skeleton file to be replaced to obtain a target skeleton file, and the first skin file is updated by the skin file to be replaced to obtain a target skin file, when a first preset display condition in a virtual game scene is met, the target skeleton file and the target skin file are used to adjust the expression form of the part of the model to be replaced, and / or in the virtual game scene, the second virtual character model is obtained by the first model file, the second model file, the target skeleton file and the target skin file, so as to achieve the purpose of replacing and updating the model file, the skeleton file and the skin file of the virtual character to improve the diversity of the virtual character, thereby achieving the technical effect of improving the diversity of the virtual character without increasing the manpower cost, the learning cost and the performance cost, and further solving the technical problem in the related art that the diversity of the virtual character depends on the skeleton deformation, resulting in the inability to balance the artistic effect and the production cost of the virtual character.
[0109] Optionally, the method for adjusting the virtual character model provided by the present invention can be applied to, but not limited to, application scenarios such as virtual reality game design and animation production, thereby enhancing the vividness and diversity of the characters in virtual reality.
[0110] In particular, according to the method for adjusting the virtual character model provided by the present invention, some technicians are no longer restricted by the existing bone binding templates when designing virtual character models, that is, the above is convenient for practical application; the method for adjusting the virtual character model provided by the present invention can be used in conjunction with the existing bone deformation technology to further enhance the diversity of virtual character models; the method for adjusting the virtual character model provided by the present invention is one of the technical means for optimizing the performance of the virtual character model, which can reduce the amount of data of the virtual character animation.
[0111] Optionally, in step S21, obtaining a first model file, a second model file, a first skeleton file, and a first skin file corresponding to the first virtual character model may include the following execution steps:
[0112] Step S211, splitting all network data corresponding to the first virtual character model into first grid data and second grid data to obtain a first model file and a second model file, wherein the first grid data is grid data corresponding to the part of the model to be replaced, and the second grid data is grid data corresponding to the part of the model to be retained;
[0113] Step S212, performing skeleton skinning processing on the first virtual character model to obtain a first skeleton file and a first skinning file.
[0114] All mesh data corresponding to the first virtual character model can be split into the first mesh data and the second mesh data, and the first model file and the second model file can be obtained accordingly. The first mesh data can be mesh data corresponding to the partial model to be replaced in the first virtual character model. The second mesh data can be mesh data corresponding to the partial model to be retained in the first virtual character model. The first model file is used to determine the partial model to be replaced in the first virtual character model. The second model file is used to determine the partial model to be retained in the first virtual character model.
[0115] By performing skeleton skinning on the first virtual character model, the first skeleton file and the first skin file can be obtained. The first skeleton file is used to store the initial skeleton data of the first virtual character model. The first skin file is used to store the initial skin data of the first virtual character model.
[0116] Still like Figure 3 As shown, all mesh data corresponding to the initial virtual character model A is recorded as male.mesh, and the all mesh data can be divided into head mesh data and torso mesh data. Among them, the head mesh data is equivalent to the first mesh data mentioned above, recorded as head.mesh. The torso mesh data is equivalent to the second mesh data mentioned above, recorded as body.mesh.
[0117] The mesh data of the initial virtual character model A has a large amount of data, while the bone data has a small amount of data. Performing bone skinning on the initial virtual character model A refers to recording a many-to-one mapping relationship between the mesh data and the bone data of the initial virtual character model A. After the above-mentioned bone skinning processing, the initial bone file male.skeleton and the initial skin file male.skin corresponding to the initial virtual character model A can be obtained.
[0118] It should be noted that, since the initial virtual character model A is used to be displayed under the above-mentioned default conditions in the virtual game scene, there is no need to display the facial features animation of the initial virtual character model A. Therefore, the mesh division corresponding to the initial virtual character model A is relatively sparse, and during the above-mentioned bone skinning processing, the entire head model of the initial virtual character model A is bound to a head bone, recorded as the initial bone head_bone.
[0119] Optionally, in step S22, obtaining the skeleton file to be replaced and the skin file to be replaced corresponding to the part of the model to be replaced may include the following execution steps:
[0120] Step S221, extracting first grid data from the first model file;
[0121] Step S222, obtaining a second skeleton file and a second skin file corresponding to the first mesh data, wherein the second skeleton file is used to store newly created skeleton data corresponding to the first mesh data, and the second skin file is used to store newly created skin data corresponding to the first mesh data, and the second skeleton file includes: an initial skeleton corresponding to the first mesh data.
[0122] The first model file may include the first mesh data, which is extracted from the first model file. The first model file is used to determine the part of the model to be replaced in the first virtual character model, and the first mesh data is the mesh data corresponding to the part of the model to be replaced in the first virtual character model.
[0123] The second skeleton file is used to store the newly created skeleton data corresponding to the first mesh data, and the second skeleton file includes the initial skeleton corresponding to the first mesh data. The second skin file is used to store the newly created skin data corresponding to the first mesh data. The second skeleton file and the second skin file correspond to the first mesh data.
[0124] like Figure 3 As shown, from the initial head model file head01 (equivalent to the above-mentioned first model file) of the initial virtual character model A, the head mesh data head.mesh of the initial virtual character model A can be extracted.
[0125] like Figure 4 and Figure 5 As shown, according to the head mesh data head.mesh of the initial virtual character model A, fine head skeleton data head_1.skeleton and fine head skin data head_1.skin can be newly created. In particular, the fine head skeleton data head_1.skeleton here includes the initial bone head_bone, which is used to ensure the connection between the newly created fine head model and the torso model in the subsequent replacement and adjustment operation.
[0126] Optionally, in step S23, updating the first skeleton file using the skeleton file to be replaced to obtain a target skeleton file, and updating the first skin file using the skin file to be replaced to obtain the target skin file may include the following execution steps:
[0127] Step S231, determining the skeleton data to be deleted from the first skeleton file and determining the skin data to be deleted from the first skin file, wherein the skeleton data to be deleted is determined by the initial skeleton corresponding to the first mesh data, and the skin data to be deleted is determined by the skeleton data to be deleted;
[0128] Step S232, determining the skeleton data to be replaced from the second skeleton file and determining the skin data to be replaced from the second skin file, wherein the skeleton data to be replaced is determined by the initial skeleton corresponding to the first mesh data, and the skin data to be replaced is determined by the skeleton data to be replaced;
[0129] Step S233, delete the to-be-deleted bone data in the first bone file and replace it with the to-be-replaced bone data to obtain a target bone file, and delete the to-be-deleted skin data in the first skin file and replace it with the to-be-replaced skin data to obtain a target skin file.
[0130] According to the first skeleton file, the skeleton data to be deleted can be determined, and according to the first skin file, the skin data to be deleted can be determined. In addition, according to the initial skeleton corresponding to the first mesh data, the skeleton data to be deleted can be determined, and according to the skeleton data to be deleted, the skin data to be deleted can be determined. The first skeleton file includes the initial skeleton.
[0131] Similarly, according to the second skeleton file, the skeleton data to be replaced can be determined, and according to the second skin file, the skin data to be replaced can be determined. In addition, according to the initial skeleton corresponding to the first mesh data, the skeleton data to be replaced can be determined, and according to the skeleton data to be replaced, the skin data to be replaced can be determined. The second skeleton file includes the initial skeleton.
[0132] The target skeleton file can be obtained by deleting the skeleton data to be deleted in the first skeleton file and replacing it with the skeleton data to be replaced. The target skin file can be obtained by deleting the skin data to be deleted in the first skin file and replacing it with the skin data to be replaced.
[0133] like Figure 3 and Figure 5As shown, when the file of the part to be replaced (head model) of the initial virtual character model A is updated, the initial skeleton head_bone is the key joint of the skeleton file update. The initial head skeleton file head.skeleton corresponding to the initial virtual character model A and the newly-created fine head skeleton file head_1.skeleton all include the initial skeleton head_bone, and the other skeletons in the skeleton file are all sub-skeletons of the initial skeleton head_bone. After deleting the initial head skeleton file head.skeleton in the initial skeleton file male.skeleton, the initial skeleton head_bone in the initial head skeleton file head.skeleton is replaced by the initial skeleton head_bone in the newly-created fine head skeleton file head_1.skeleton. The position in the initial skeleton file male.skeleton is to ensure that in the target skeleton file male_1.skeleton, the newly-created head model is correctly connected with the trunk model. After this, according to the updated head skeleton file, the head skin file can be further updated, and then the updating of the file of the part to be replaced of the initial virtual character model A is completed.
[0134] Optionally, in step S22, obtaining the skeleton file to be replaced and the skin file to be replaced corresponding to the part of the model to be replaced may include the following execution steps:
[0135] Step S223, generating third mesh data, wherein the third mesh data is newly created mesh data of the part of the model to be replaced;
[0136] Step S224, obtaining a third skeleton file and a third skin file corresponding to the third mesh data, wherein the third skeleton file is used to store newly created skeleton data corresponding to the third mesh data, and the third skin file is used to store newly created skin data corresponding to the third mesh data, and the third skeleton file includes: an initial skeleton corresponding to the first mesh data.
[0137] The third grid data may be newly created grid data, and the third grid data corresponds to the part model to be replaced of the first virtual character model.
[0138] The third skeleton file is used to store the newly created skeleton data corresponding to the third mesh data, and the third skeleton file includes the initial skeleton corresponding to the first mesh data. The third skin file is used to store the newly created skin data corresponding to the third mesh data. The third skeleton file and the third skin file correspond to the third mesh data.
[0139] like Figure 6As shown, according to the needs of the virtual game scene, a new virtual character model B can be created based on the virtual character model A. According to the part model to be replaced (i.e., the head model) of the initial virtual character model A, the head mesh data of the new virtual character model B is created, which is equivalent to the third mesh data mentioned above and is recorded as head_2.mesh.
[0140] like Figure 4 and Figure 5 As shown, according to the head mesh data head_2.mesh of the virtual character model B, the head skeleton data head_2.skeleton of the virtual character model B and the head skin data head_2.skin of the virtual character model B can be newly created. In particular, the head skeleton data head_2.skeleton of the virtual character model B here includes the initial bone head_bone, which is used to ensure the connection between the newly created head model of the virtual character model B and the torso model in the subsequent replacement and adjustment operation.
[0141] Optionally, in step S23, updating the first skeleton file using the skeleton file to be replaced to obtain a target skeleton file, and updating the first skin file using the skin file to be replaced to obtain the target skin file may include the following execution steps:
[0142] Step S234, determining the skeleton data to be deleted from the first skeleton file and determining the skin data to be deleted from the first skin file, wherein the skeleton data to be deleted is determined by the initial skeleton corresponding to the first mesh data, and the skin data to be deleted is determined by the skeleton data to be deleted;
[0143] Step S235, determining the skeleton data to be replaced from the third skeleton file and determining the skin data to be replaced from the third skin file, wherein the skeleton data to be replaced is determined by the initial skeleton corresponding to the first mesh data, and the skin data to be replaced is determined by the skeleton data to be replaced;
[0144] Step S236, delete the to-be-deleted bone data in the first bone file and replace it with the to-be-replaced bone data to obtain a target bone file, and delete the to-be-deleted skin data in the first skin file and replace it with the to-be-replaced skin data to obtain a target skin file.
[0145] According to the first skeleton file, the skeleton data to be deleted can be determined, and according to the first skin file, the skin data to be deleted can be determined. In addition, according to the initial skeleton corresponding to the first mesh data, the skeleton data to be deleted can be determined, and according to the skeleton data to be deleted, the skin data to be deleted can be determined. The first skeleton file includes the initial skeleton.
[0146] Similarly, according to the third skeleton file, the skeleton data to be replaced can be determined, and according to the third skin file, the skin data to be replaced can be determined. In addition, according to the initial skeleton corresponding to the first mesh data, the skeleton data to be replaced can be determined, and according to the skeleton data to be replaced, the skin data to be replaced can be determined. The third skeleton file includes the initial skeleton.
[0147] The target skeleton file can be obtained by deleting the skeleton data to be deleted in the first skeleton file and replacing it with the skeleton data to be replaced. The target skin file can be obtained by deleting the skin data to be deleted in the first skin file and replacing it with the skin data to be replaced.
[0148] like Figure 3 and Figure 6 As shown, when the file of the part to be replaced (head model) of the initial virtual character model A is updated, the initial skeleton head_bone is the key joint of the skeleton file update. The initial head skeleton file head.skeleton corresponding to the initial virtual character model A and the head skeleton file head_2.skeleton of the virtual character model B all include the initial skeleton head_bone, and the other skeletons in the skeleton file are all sub-skeletons of the initial skeleton head_bone. After deleting the initial head skeleton file head.skeleton in the initial skeleton file male.skeleton, the initial skeleton head_bone in the initial head skeleton file head.skeleton is replaced by the initial skeleton head_bone in the newly created virtual character model B head skeleton file head_2.skeleton. The position in the initial skeleton file male.skeleton is to ensure that in the target skeleton file male_2.skeleton, the newly created head model is correctly connected with the initial torso model. After this, according to the updated head skeleton file, the head skin file can be further updated, and then the updating of the file of the part to be replaced of the virtual character model A is completed.
[0149] Optionally, the method for adjusting the virtual character model may further include the following execution steps:
[0150] Step S25, when the second preset display condition in the virtual game scene is met, the first model file, the second model file, the first skeleton file and the first skin file are used to generate a first virtual character model.
[0151] In the virtual game scene, when the second preset display condition is met, the first model file, the second model file, the first skeleton file and the first skin file are used to generate a first virtual character model.
[0152] like Figure 7 As shown, when the game scene switches from the above trigger condition to the above default condition, the initial virtual character model A needs to be displayed on the screen. At this time, in order to save the game running cost, the detailed head model will no longer be used to replace the initial head model. The head model file head01, the torso model file body, the initial skeleton file male.skeleton and the initial skin file male.skin are used to render the initial virtual character model A and display it on the screen.
[0153] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the relevant technology, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0154] In this embodiment, a device for adjusting a virtual character model is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0155] Fig. 9 is a structural block diagram of a device for adjusting a virtual character model according to one embodiment of the present invention, such as Fig. 9As shown, the device includes: a first acquisition module 91, which is used to acquire a first model file, a second model file, a first skeleton file and a first skin file corresponding to the first virtual character model, wherein the first model file is used to determine a part of the model to be replaced in the first virtual character model, the second model file is used to determine a part of the model to be retained in the first virtual character model, the first skeleton file is used to store initial skeleton data of the virtual character model, and the first skin file is used to store initial skin data of the virtual character model; a second acquisition module 92, which is used to acquire a skeleton file to be replaced and a skin file to be replaced corresponding to the part of the model to be replaced, wherein the skeleton file to be replaced is used to store the initial skeleton data of the part to be replaced. The newly created skeleton data corresponding to the partial model, the skin file to be replaced is used to store the newly created skin data corresponding to the partial model to be replaced; an update module 93 is used to use the skeleton file to be replaced to update the first skeleton file to obtain a target skeleton file, and use the skin file to be replaced to update the first skin file to obtain a target skin file; an adjustment module 94 is used to use the target skeleton file and the target skin file to adjust the expression form of the partial model to be replaced when the preset display conditions in the virtual game scene are met; and / or, in the virtual game scene, use the first model file, the second model file, the target skeleton file and the target skin file to generate a second virtual character model.
[0156] Optionally, the above-mentioned first acquisition module 91 is also used to: split all network data corresponding to the first virtual character model into first mesh data and second mesh data to obtain a first model file and a second model file, wherein the first mesh data is the mesh data corresponding to the part of the model to be replaced, and the second mesh data is the mesh data corresponding to the part of the model to be retained; perform skeleton skinning processing on the first virtual character model to obtain a first skeleton file and a first skin file.
[0157] Optionally, the above-mentioned second acquisition module 92 is also used to: extract the first mesh data from the first model file; obtain the second skeleton file and the second skin file corresponding to the first mesh data, wherein the second skeleton file is used to store the newly created skeleton data corresponding to the first mesh data, and the second skin file is used to store the newly created skin data corresponding to the first mesh data, and the second skeleton file includes: the initial skeleton corresponding to the first mesh data.
[0158] Optionally, the above-mentioned update module 93 is also used to: determine the bone data to be deleted from the first bone file and determine the skin data to be deleted from the first skin file, wherein the bone data to be deleted is determined by the initial bone corresponding to the first mesh data, and the skin data to be deleted is determined by the bone data to be deleted; determine the bone data to be replaced from the second bone file and determine the skin data to be replaced from the second skin file, wherein the bone data to be replaced is determined by the initial bone corresponding to the first mesh data, and the skin data to be replaced is determined by the bone data to be replaced; delete the bone data to be deleted in the first bone file and replace it with the bone data to be replaced to obtain a target bone file, and delete the skin data to be deleted in the first skin file and replace it with the skin data to be replaced to obtain a target skin file.
[0159] Optionally, the second acquisition module 92 is also used to: generate third mesh data, wherein the third mesh data is newly created mesh data of the part of the model to be replaced; obtain a third skeleton file and a third skin file corresponding to the third mesh data, wherein the third skeleton file is used to store the newly created skeleton data corresponding to the third mesh data, and the third skin file is used to store the newly created skin data corresponding to the third mesh data, and the third skeleton file includes: the initial skeleton corresponding to the first mesh data.
[0160] Optionally, the above-mentioned update module 93 is also used to: determine the bone data to be deleted from the first bone file and determine the skin data to be deleted from the first skin file, wherein the bone data to be deleted is determined by the initial bone corresponding to the first mesh data, and the skin data to be deleted is determined by the bone data to be deleted; determine the bone data to be replaced from the third bone file and determine the skin data to be replaced from the third skin file, wherein the bone data to be replaced is determined by the initial bone corresponding to the first mesh data, and the skin data to be replaced is determined by the bone data to be replaced; delete the bone data to be deleted in the first bone file and replace it with the bone data to be replaced to obtain a target bone file, and delete the skin data to be deleted in the first skin file and replace it with the skin data to be replaced to obtain a target skin file.
[0161] Optionally, Fig.10 is a structural block diagram of an optional device for adjusting a virtual character model according to an embodiment of the present invention, such as Fig.10 As shown, the device includes Fig. 9 In addition to all the modules shown, it also includes: a generation module 95, which is used to generate a first virtual character model using the first model file, the second model file, the first skeleton file and the first skin file when the second preset display condition in the virtual game scene is met.
[0162] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0163] An embodiment of the present invention further provides a non-volatile storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0164] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0165] S1, obtaining a first model file, a second model file, a first skeleton file, and a first skin file corresponding to a first virtual character model, wherein the first model file is used to determine a part of the model to be replaced in the first virtual character model, the second model file is used to determine a part of the model to be retained in the first virtual character model, the first skeleton file is used to store initial skeleton data of the virtual character model, and the first skin file is used to store initial skin data of the virtual character model;
[0166] S2, obtaining a skeleton file to be replaced and a skin file to be replaced corresponding to the part of the model to be replaced, wherein the skeleton file to be replaced is used to store the newly created skeleton data corresponding to the part of the model to be replaced, and the skin file to be replaced is used to store the newly created skin data corresponding to the part of the model to be replaced;
[0167] S3, using the to-be-replaced skeleton file to update the first skeleton file to obtain a target skeleton file, and using the to-be-replaced skin file to update the first skin file to obtain a target skin file;
[0168] S4, when the first preset display condition in the virtual game scene is met, the target skeleton file and the target skin file are used to adjust the expression form of the part of the model to be replaced; and / or, in the virtual game scene, the first model file, the second model file, the target skeleton file and the target skin file are used to generate a second virtual character model.
[0169] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0170] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0171] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0172] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0173] S1, obtaining a first model file, a second model file, a first skeleton file, and a first skin file corresponding to a first virtual character model, wherein the first model file is used to determine a part of the model to be replaced in the first virtual character model, the second model file is used to determine a part of the model to be retained in the first virtual character model, the first skeleton file is used to store initial skeleton data of the virtual character model, and the first skin file is used to store initial skin data of the virtual character model;
[0174] S2, obtaining a skeleton file to be replaced and a skin file to be replaced corresponding to the part of the model to be replaced, wherein the skeleton file to be replaced is used to store the newly created skeleton data corresponding to the part of the model to be replaced, and the skin file to be replaced is used to store the newly created skin data corresponding to the part of the model to be replaced;
[0175] S3, using the to-be-replaced skeleton file to update the first skeleton file to obtain a target skeleton file, and using the to-be-replaced skin file to update the first skin file to obtain a target skin file;
[0176] S4, when the first preset display condition in the virtual game scene is met, the target skeleton file and the target skin file are used to adjust the expression form of the part of the model to be replaced; and / or, in the virtual game scene, the first model file, the second model file, the target skeleton file and the target skin file are used to generate a second virtual character model.
[0177] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0178] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0179] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0180] In the several embodiments provided by the present invention, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0181] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0182] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0183] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0184] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for adjusting a virtual character model, characterized in that: include: Obtaining a first model file, a second model file, a first skeleton file, and a first skin file corresponding to a first virtual character model, wherein the first model file is used to determine a portion of the model to be replaced in the first virtual character model, the second model file is used to determine a portion of the model to be retained in the first virtual character model, the first skeleton file is used to store initial skeleton data of the virtual character model, the first skin file is used to store initial skin data of the virtual character model, the first model file and the second model file are obtained based on splitting all mesh data corresponding to the first virtual character model, and the first skeleton file and the first skin file are obtained based on skeleton skinning processing of the first virtual character model; Obtaining a skeleton file to be replaced and a skin file to be replaced corresponding to the partial model to be replaced, wherein the skeleton file to be replaced is used to store newly created skeleton data corresponding to the partial model to be replaced, and the skin file to be replaced is used to store newly created skin data corresponding to the partial model to be replaced, and the skeleton file to be replaced and the skin file to be replaced are determined based on the first mesh data extracted from the first model file, or the skeleton file to be replaced and the skin file to be replaced are determined based on the newly created mesh data of the partial model to be replaced; The first skeleton file is updated by using the skeleton file to be replaced to obtain a target skeleton file, and the first skin file is updated by using the skin file to be replaced to obtain a target skin file; When a first preset display condition in the virtual game scene is met, the target skeleton file and the target skin file are used to adjust the expression form of the part of the model to be replaced; and / or, in the virtual game scene, the first model file, the second model file, the target skeleton file and the target skin file are used to generate a second virtual character model.
2. The method according to claim 1, characterized in that Acquiring the first model file, the second model file, the first skeleton file, and the first skin file corresponding to the first virtual character model includes: Splitting all mesh data corresponding to the first virtual character model into first mesh data and second mesh data to obtain the first model file and the second model file, wherein the first mesh data is mesh data corresponding to the part of the model to be replaced, and the second mesh data is mesh data corresponding to the part of the model to be retained; Perform skeleton skinning processing on the first virtual character model to obtain the first skeleton file and the first skinning file.
3. The method according to claim 2, characterized in that Acquiring the skeleton file to be replaced and the skin file to be replaced corresponding to the part of the model to be replaced includes: Extracting the first mesh data from the first model file; Obtain a second skeleton file and a second skin file corresponding to the first mesh data, wherein the second skeleton file is used to store newly created skeleton data corresponding to the first mesh data, and the second skin file is used to store newly created skin data corresponding to the first mesh data, and the second skeleton file includes: an initial skeleton corresponding to the first mesh data.
4. The method according to claim 3, characterized in that The method of updating the first skeleton file by using the skeleton file to be replaced to obtain the target skeleton file, and updating the first skin file by using the skin file to be replaced to obtain the target skin file comprises: Determine the skeleton data to be deleted from the first skeleton file and determine the skin data to be deleted from the first skin file, wherein the skeleton data to be deleted is determined by the initial skeleton corresponding to the first mesh data, and the skin data to be deleted is determined by the skeleton data to be deleted; Determine the skeleton data to be replaced from the second skeleton file and determine the skin data to be replaced from the second skin file, wherein the skeleton data to be replaced is determined by the initial skeleton corresponding to the first mesh data, and the skin data to be replaced is determined by the skeleton data to be replaced; The to-be-deleted bone data is deleted in the first bone file and replaced with the to-be-replaced bone data to obtain the target bone file; and the to-be-deleted skin data is deleted in the first skin file and replaced with the to-be-replaced skin data to obtain the target skin file.
5. The method according to claim 2, characterized in that: Acquiring the skeleton file to be replaced and the skin file to be replaced corresponding to the part of the model to be replaced includes: Generate third grid data, wherein the third grid data is newly created grid data of the part of the model to be replaced; Obtain a third skeleton file and a third skin file corresponding to the third mesh data, wherein the third skeleton file is used to store newly created skeleton data corresponding to the third mesh data, the third skin file is used to store newly created skin data corresponding to the third mesh data, and the third skeleton file includes: an initial skeleton corresponding to the first mesh data.
6. The method according to claim 5, characterized in that The method of updating the first skeleton file by using the skeleton file to be replaced to obtain the target skeleton file, and updating the first skin file by using the skin file to be replaced to obtain the target skin file comprises: Determine the skeleton data to be deleted from the first skeleton file and determine the skin data to be deleted from the first skin file, wherein the skeleton data to be deleted is determined by the initial skeleton corresponding to the first mesh data, and the skin data to be deleted is determined by the skeleton data to be deleted; Determine the skeleton data to be replaced from the third skeleton file and determine the skin data to be replaced from the third skin file, wherein the skeleton data to be replaced is determined by the initial skeleton corresponding to the first mesh data, and the skin data to be replaced is determined by the skeleton data to be replaced; The to-be-deleted bone data is deleted in the first bone file and replaced with the to-be-replaced bone data to obtain the target bone file; and the to-be-deleted skin data is deleted in the first skin file and replaced with the to-be-replaced skin data to obtain the target skin file.
7. The method according to claim 1, characterized in that The method further comprises: When a second preset display condition in the virtual game scene is met, the first virtual character model is generated using the first model file, the second model file, the first skeleton file and the first skin file.
8. The method according to claim 1, characterized in that When the first virtual character model is a virtual human character model, the part of the model to be replaced is a virtual head model, and the part of the model to be retained is a virtual torso model.
9. A device for adjusting a virtual character model, characterized in that: include: A first acquisition module, used for acquiring a first model file, a second model file, a first skeleton file and a first skin file corresponding to a first virtual character model, wherein the first model file is used for determining a part of the model to be replaced in the first virtual character model, the second model file is used for determining a part of the model to be retained in the first virtual character model, the first skeleton file is used for storing initial skeleton data of the virtual character model, the first skin file is used for storing initial skin data of the virtual character model, the first model file and the second model file are obtained based on splitting all mesh data corresponding to the first virtual character model, and the first skeleton file and the first skin file are obtained based on skeleton skinning processing of the first virtual character model; A second acquisition module is used to acquire the skeleton file to be replaced and the skin file to be replaced corresponding to the partial model to be replaced, wherein the skeleton file to be replaced is used to store the newly created skeleton data corresponding to the partial model to be replaced, and the skin file to be replaced is used to store the newly created skin data corresponding to the partial model to be replaced, and the skeleton file to be replaced and the skin file to be replaced are determined based on the first mesh data extracted from the first model file, or the skeleton file to be replaced and the skin file to be replaced are determined based on the newly created mesh data of the partial model to be replaced; An updating module, configured to update the first skeleton file using the skeleton file to be replaced to obtain a target skeleton file, and to update the first skin file using the skin file to be replaced to obtain a target skin file; An adjustment module is used to use the target skeleton file and the target skin file to adjust the expression form of the part of the model to be replaced when the preset display conditions in the virtual game scene are met; and / or, in the virtual game scene, use the first model file, the second model file, the target skeleton file and the target skin file to generate a second virtual character model.
10. A non-volatile storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method for adjusting a virtual character model as claimed in any one of claims 1 to 8 when running.
11. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the method for adjusting a virtual character model as claimed in any one of claims 1 to 8.
Citation Information
Patent Citations
Virtual model generation method and device
CN108479070A
Self-adaptive adjustment method and device for virtual skeleton model, and electronic device
CN111161427A
