Model animation generation method and device, electronic equipment and storage medium
By obtaining the benchmark model of the virtual model and generating the restoration model, using the restoration animation data to drive the animation, the storage resource consumption problem caused by the large amount of virtual model data is solved, and efficient model animation generation and storage is achieved.
Patent Information
- Application Number
- CN202411101279.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-12-10
AI Technical Summary
In the prior art, when generating model animations, due to the large amount of virtual model data, storage resources are consumed seriously, making it difficult to efficiently generate and store model animations.
By obtaining the benchmark model of the original model, the restoration model is obtained, and the restoration animation data is used to drive the restoration model to generate model animations, reducing the amount of data and ensuring consistent motion state.
Without changing the model movement mode, the storage amount of model data is greatly reduced and the generation and storage efficiency is improved.
Smart Images

Figure CN119107390A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of data processing technology, and in particular to a method, device, electronic device and storage medium for generating a model animation. Background Art
[0002] Model animation can produce animation effects by controlling the movement of virtual models. According to different types of virtual models, model animation can be divided into multiple types such as skeletal animation, vertex animation, material animation, etc.
[0003] For example, when a virtual model is made by a skeleton model and mesh data, it is necessary to make corresponding skeleton data for the virtual object, generate a skeleton model based on the skeleton data, and skin the skeleton model with the mesh data to obtain the final virtual model. The virtual model is driven to move by animation data to generate skeleton animation.
[0004] In the related art, in order to realize virtual animation, a complete virtual model needs to be made. However, many virtual models have a large amount of data, so a large amount of storage resources are consumed in the process of generating model animation. Summary of the invention
[0005] In view of the above problems, the present disclosure is proposed to provide a method, device, electronic device and storage medium for generating a model animation that overcomes the above problems or at least partially solves the above problems.
[0006] According to one aspect of an embodiment of the present disclosure, a method for generating a model animation is provided, comprising:
[0007] Acquire a reference model corresponding to the original model, and process the reference model to obtain a restored model corresponding to the original model; wherein the original model includes at least two regions, and the reference model is used to characterize at least one region in the original model;
[0008] According to the restored animation data of the restored model, the restored model is driven to generate a model animation; wherein the restored animation data of the restored model is obtained according to the original animation data of the original model, and the restored animation data matches the original animation data.
[0009] In an optional implementation, at least two areas in the original model include: a first original area and a second original area associated with the first original area, and the baseline model is generated based on the first original area; and the restored model includes: a first restored area corresponding to the first original area and a second restored area corresponding to the second original area.
[0010] In an optional implementation, the original animation data of the original model includes: first original motion data corresponding to the first original area, and second original motion data corresponding to the second original area;
[0011] The restoration animation data of the restoration model includes: first restoration action data corresponding to the first restoration area, and second restoration action data corresponding to the second restoration area;
[0012] The first restored action data matches the first original action data, and the second restored action data matches the second original action data.
[0013] In an optional implementation, the action type of the second original action data is different from the action type of the first original action data, and the action type of the second restored action data is different from the action type of the first restored action data.
[0014] In an optional implementation, the restored animation data of the restored model is obtained by:
[0015] In the case where the restored model and the original model are bound to each other, the original model is driven to move by the original animation data of the original model, and the restored animation data is obtained according to the motion state of the bound restored model;
[0016] The motion state of the bound restored model matches the motion state of the original model.
[0017] In an optional implementation, the processing the reference model to obtain the restored model includes:
[0018] Processing the reference model according to the association relationship between the first original region and the second original region to obtain an association model corresponding to the reference model;
[0019] The reference model and the associated model are spliced to obtain the restored model.
[0020] In an optional implementation, the association relationship between the first original area and the second original area includes: a scaling association relationship, a rotation association relationship, a copy association relationship, and / or a mirroring association relationship;
[0021] The processing of the reference model includes: scaling, rotating, copying, and / or mirroring the reference model.
[0022] In an optional implementation, the binding of the restored model and the original model to each other includes:
[0023] For a first model element in the original model, determining a second model element in the restored model corresponding to the first model element;
[0024] A constraint relationship is established between the first model element and the second model element so that the second model element moves along with the first model element.
[0025] In an optional implementation, if the element position of the first model element matches the splicing position of the reference model and the associated model, the second model element corresponding to the first model element in the restored model includes:
[0026] a second reference model element corresponding to the reference model, and a second associated model element corresponding to the associated model;
[0027] The element positions of the second reference model element and the second associated model element overlap with each other; and the weight information of the second reference model element and the second associated model element is the same.
[0028] In an optional implementation manner, the second model element following the movement of the first model element includes:
[0029] Controlling the second model element to translate, rotate and / or scale according to the translation information, rotation information and / or scaling information of the first model element;
[0030] The model elements include: grid points and / or skeletons; the constraint relationships include: point constraint relationships and / or parent-child constraint relationships.
[0031] In an optional implementation, the original model includes a skeleton model and mesh data; the reference model is generated by:
[0032] According to the first original region, a skeleton model in the original model is deleted to obtain a reference skeleton model corresponding to the first original region;
[0033] Deleting the mesh data in the original model to obtain reference mesh data corresponding to the first original area;
[0034] Binding the reference mesh data to the reference skeleton model to obtain the reference model;
[0035] The point weight information of any grid point in the reference model is the same as the point weight information of the grid point at the corresponding position in the original model.
[0036] In an optional implementation, the method is applicable to a cloud game client, and the obtaining of a reference model corresponding to the original model and the generation of a restored model corresponding to the reference model include:
[0037] Obtaining the benchmark model sent by the cloud server, and loading the benchmark model into a memory space;
[0038] The restored model is generated in the game engine according to the reference model loaded in the memory space.
[0039] In an optional implementation, before driving the restoration model to generate model animation according to the restoration animation data of the restoration model, it also includes: receiving the restoration animation data of the restoration model sent by the cloud server; and the original model is a virtual object model in the cloud game application.
[0040] According to another aspect of an embodiment of the present disclosure, there is provided a device for generating a model animation, comprising:
[0041] A processing module, adapted to obtain a reference model corresponding to an original model, and process the reference model to obtain a restored model corresponding to the original model; wherein the original model includes at least two regions, and the reference model is used to characterize at least one region in the original model;
[0042] The driving module is adapted to drive the restored model to generate model animation according to the restored animation data of the restored model; wherein the restored animation data of the restored model is obtained according to the original animation data of the original model, and the restored animation data matches the original animation data.
[0043] According to another aspect of the present disclosure, there is provided an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;
[0044] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute the above-mentioned method for generating model animation.
[0045] According to another aspect of the present disclosure, a computer storage medium is provided, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to execute the above-mentioned method for generating a model animation.
[0046] In an embodiment of the present disclosure, the original model includes at least two areas, and accordingly, a reference model corresponding to one of the areas is first generated to achieve the purpose of reducing the amount of model data, and then, based on the reference model, a restoration model corresponding to the original model is obtained, and the restoration model is driven to generate a model animation through the restoration animation data of the restoration model. It can be seen that the above method has at least the following advantages: First, based on the association relationship between at least two areas, it is only necessary to obtain the reference model corresponding to one of the areas, and obtain a restoration model consistent with the appearance of the original model based on the reference model, without obtaining the complete original model, thereby greatly reducing the amount of data. Secondly, this method can ensure that the motion state of the restoration model is exactly the same as the motion state of the original model through the restoration animation data that matches the original animation data. Therefore, this method can greatly reduce the storage amount of model data without changing the model motion mode.
[0047] The above description is only an overview of the technical solution of the present disclosure. In order to more clearly understand the technical means of the present disclosure, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present disclosure more obvious and easy to understand, the specific implementation methods of the present disclosure are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present disclosure. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0049] Figure 1 A flow chart of a method for generating a model animation provided by an embodiment of the present disclosure is shown;
[0050] Figure 2 A schematic diagram showing a method of replicating a reference model and obtaining a restored model;
[0051] Figure 3 A schematic diagram showing the process of mirroring the reference model and obtaining the restored model;
[0052] Figure 4 Shown for splicing Figure 3 Schematic diagram of the baseline model and the associated model of the restoration model in ;
[0053] Figure 5 A schematic diagram showing a flow chart of a method for generating a model animation in an example of the present disclosure;
[0054] Figure 6 It shows a schematic diagram of the skeleton model before and after deletion when the original model is a virtual character model;
[0055] Figure 7 It shows a schematic diagram before and after mesh data deletion when the original model is a virtual character model;
[0056] Figure 8 A schematic diagram of a device for generating a model animation provided by another embodiment of the present disclosure is shown;
[0057] Fig. 9 A schematic structural diagram of an electronic device provided by yet another embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0058] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0059] Figure 1 FIG. 1 is a flow chart showing a method for generating a model animation according to an embodiment of the present disclosure. Figure 1 As shown, the method specifically includes:
[0060] Step S110: obtaining a reference model corresponding to the original model, processing the reference model, and obtaining a restored model corresponding to the original model; wherein the original model includes at least two regions, and the reference model is used to characterize at least one region in the original model.
[0061] The original model usually includes at least two interrelated regions. Since there is an association relationship between at least two regions, the other region can be obtained based on one of the regions. Accordingly, in order to reduce the amount of data, the benchmark model can be generated based on one of the regions.
[0062] In an optional implementation, the original model includes a first original area and a second original area associated with the first original area, and the reference model is generated based on the first original area; the restored model includes: a first restored area corresponding to the first original area and a second restored area corresponding to the second original area.
[0063] Among them, the original model is a virtual model used to generate model animation. The types of original models can be various, for example, it can be a skeleton model, it can also be various types of models such as a vertex model. The original model contains complete data content, and the original model at least includes a first original area and a second original area that has an association relationship with the first original area. In other words, the second original area can be obtained by presetting the first original area. Among them, the specific type of preset processing depends on the specific type of association relationship. For example, the above-mentioned association relationship can be various types such as a scaling association relationship, a mirroring association relationship, a copying association relationship, and a deletion association relationship. The present application does not limit the specific type of the association relationship, as long as the second original area can be obtained on the basis of the first original area. Correspondingly, the preset processing can be a scaling process, a mirroring process, a copying process, a rotation process, a deletion process, etc.
[0064] In addition, since the reference model is generated based on the first original region, the reference model can be processed based on the association relationship between the first original region and the second original region in the original model to obtain a restored model. For example, when the association relationship between the first original region and the second original region is a mirror image relationship, the reference model is mirrored, and the restored model can be obtained based on the reference model after the mirror image and the reference model before the mirror image.
[0065] It can be seen that the restored model at least includes: a first restored area corresponding to the first original area and a second restored area corresponding to the second original area. The first restored area corresponding to the first original area is directly determined according to the reference model, and the second restored area corresponding to the second original area is obtained by processing the reference model. Therefore, the restored model has the same appearance and visual effect as the original model.
[0066] Step S120: driving the restored model to generate model animation according to the restored animation data of the restored model; wherein the restored animation data of the restored model is obtained according to the original animation data of the original model, and the restored animation data matches the original animation data.
[0067] The restored animation data of the restored model is usually generated based on the original animation data of the original model, and the restored animation data matches the original animation data. The so-called matching of the restored animation data and the original animation data means that the motion information contained in the restored animation data is basically the same or consistent with the motion information contained in the original animation data. It can be seen that the animation action driven by the restored animation data is consistent with the animation action driven by the original animation data. In the case where the restored model and the original model are bound to each other, or an association relationship is established between the restored model and the original model, the restored model can be indirectly driven by the original animation data to obtain the restored animation data.
[0068] In an optional implementation, the restored animation data of the restored model is obtained in the following manner: when the restored model and the original model are bound to each other, the original model is driven to move by the original animation data of the original model, and the restored animation data is obtained according to the motion state of the bound restored model; wherein the motion state of the bound restored model matches the motion state of the original model.
[0069] Among them, the restored animation data is the animation resource used to drive the restored model to move. In order to ensure that the restored model moves in the same way as the original model, the restored model and the original model are bound in advance so that the bound restored model can move with the original model, that is, the motion state of the bound restored model matches the motion state of the original model. Among them, the meaning of matching means that the motion state of the bound restored model is the same as the motion state of the original model, or the motion state of the bound restored model is synchronized with the motion state of the original model. Among them, synchronization can be synchronization in a strict sense or synchronization in a broad sense. For example, even if the motion state of the bound restored model is delayed compared to the motion state of the original model, as long as the overall motion trends of the two are the same, it can also be understood as synchronization.
[0070] In addition, there are many ways of binding, for example, a mapping can be established between the restored model and the original model, or a constraint relationship can be established between the restored model and the original model. The present application does not limit the specific details of the binding. Through the binding process, the original animation data used to drive the original model can indirectly drive the restored model to perform the same action as the original model, thereby obtaining the restored animation data with the same content as the original animation data.
[0071] In an optional manner, when the bound restored model follows the original model in moving, the skeleton data of the bound restored model during the moving process may be baked to obtain the restored animation data.
[0072] It can be seen that the motion information contained in the restored animation data is basically the same as that contained in the original animation data. The reason why the restored animation data needs to be generated is mainly to consider the following factors:
[0073] Although the restored model has the same appearance as the original model, the number and number of model elements contained in the restored model are usually different from those in the original model because the restored model is generated in a different way. Therefore, if the original animation data corresponding to the original model is directly used to drive the restored model, the driving will fail due to the differences in the model elements inside the two different models.
[0074] For example, assuming that the original model is implemented based on a skeleton model, the model element is a skeleton. Since the original model is set according to the complete structure of the virtual object, the skeletons contained in the original model are all complete skeletons. However, the reference model is generated according to the local area (i.e., the first original area) in the original model. Therefore, if there is a common skeleton between the first original area and the second original area, the common skeleton will be divided, and the reference model only contains a part of the common skeleton after the division, and the other part of the common skeleton can be generated by copying or mirroring, etc., resulting in the number and number of the skeletons contained in the restored model being inconsistent with the original model. In addition, in the process of copying or mirroring, for special positions such as a line of symmetry or a mirror axis, there may be two overlapping model elements, which will also cause the number and number of the skeletons contained in the restored model to be inconsistent with the original model.
[0075] The restored animation data in the present application is baked during the movement of the restored model. Therefore, it can ensure that the information of the model elements contained in the restored animation data completely matches the information of the model elements contained in the restored model, thereby ensuring the reliable implementation of the animation driving process.
[0076] It can be seen that this embodiment has at least the following advantages: First, based on the association between the first original area and the second original area, it is only necessary to obtain the reference model corresponding to the first original area, and obtain a restored model consistent with the appearance of the original model based on the reference model, without obtaining the complete original model, thereby greatly reducing the amount of data. Secondly, this method can generate restored animation data with the same content as the original animation data by binding the restored model to the original model, thereby ensuring that the motion state of the restored model is exactly the same as the motion state of the original model. Therefore, this method can greatly reduce the storage amount of model data without changing the model's motion mode.
[0077] In addition, in order to achieve better technical effects, those skilled in the art may also make various changes and modifications to the above embodiments:
[0078] In an optional implementation, the restored model can be obtained in the following manner: according to the association relationship between the first original area and the second original area, the baseline model is processed to obtain the associated model corresponding to the baseline model; the baseline model and the associated model are spliced to obtain the restored model.
[0079] Specifically, the reference axis corresponding to the reference model can be determined according to the association relationship between the first original area and the second original area. The reference axis can be a symmetry axis, a symmetry line, a center line, etc. The reference model is processed according to the reference axis and the association relationship to obtain an associated model corresponding to the reference model. The specific processing method depends on the specific type of the association relationship. The reference model and the associated model are spliced to obtain a restored model. It can be seen that in this method, an associated model corresponding to the reference model can be generated based on the reference axis and the association relationship, and the restoration model can be obtained by splicing the reference model and the associated model.
[0080] In an optional implementation, the association relationship between the first original area and the second original area includes: a scaling association relationship, a copy association relationship, a rotation association relationship, and / or a mirror association relationship. Correspondingly, processing the reference model includes: scaling, rotating, copying, and / or mirroring the reference model. In addition, when the number of the second original areas is multiple, the number of associated models corresponding to the reference model can be multiple. In this method, it is necessary to splice the reference model and the multiple associated models. For example, assuming that the original model is a virtual model including multiple train carriages, one of the train carriages is used as the first original area, and the remaining train carriages are used as the second original area. At this time, the number of the second original areas is multiple, and considering the different visual sizes of different carriages, when generating the associated model corresponding to each second original area, in addition to copying the reference model corresponding to the first original area, the reference model can also be further scaled. And, in this method, it is necessary to splice the reference model and the multiple associated models in sequence to obtain the final restored model.
[0081] In an optional implementation, the mutual binding of the restored model and the original model can be achieved in the following manner: for the first model element in the original model, determine the second model element in the restored model corresponding to the first model element; establish a constraint relationship between the first model element and the second model element so that the second model element follows the movement of the first model element. The first model element can be any model element in the original model. The model element can specifically be the smallest unit contained in the model, for example, it can be a skeleton, a vertex, a mesh, etc. For any first model element, the number of second model elements corresponding to the first model element in the restored model can be one or more. If the number of second model elements corresponding to the first model element in the restored model is multiple, it is necessary to establish a constraint relationship between the multiple second model elements and the first model element. By establishing a constraint relationship between each model element in the restored model and each model element in the original model, it can be ensured that the restored model follows the movement of the original model.
[0082] In an optional implementation, if the element position of the first model element matches the splicing position of the reference model and the associated model, the second model element corresponding to the first model element in the restored model includes: a second reference model element corresponding to the reference model, and a second associated model element corresponding to the associated model. The splicing position of the reference model and the associated model refers to: the connection position for splicing the reference model and the associated model. Specifically, the splicing position of the reference model and the associated model can be the axis position of the reference axis mentioned above. For example, Figure 2 The baseline model ( Figure 2 The left part) is copied to obtain the associated model ( Figure 2 The right part), and the schematic diagram of the restored model is obtained by splicing the baseline model and the associated model. Figure 2 In the example, the splicing position is Figure 2 The seam position corresponding to the line segment AB in . For example, Figure 3 The baseline model ( Figure 3 The left part) is mirrored to obtain the association model ( Figure 3 The right part), and the schematic diagram of the restored model is obtained by splicing the baseline model and the associated model. Figure 3 In the example, the splicing position is Figure 3 The joint position corresponding to the line segment AB in (also called the axis position of the reference axis).
[0083] For ease of understanding, Figure 4 Shown for splicing Figure 3 The baseline model of the restoration model in Figure 4 Left part) and the associated model ( Figure 4 The right part of the diagram. Figure 4 As shown, for Figure 3 In terms of the A position of the restored model in Figure 4 The A position in the reference model (corresponding to the second reference model element) and the A' position in the associated model (corresponding to the second associated model element). It can be seen that for the first model element at the splicing position, the number of corresponding second model elements is at least two. In the process of establishing the constraint relationship, in order to ensure that there are no cracks and visual distortions at the splicing position, it is necessary to bind or constrain at least two second model elements corresponding to the splicing position to the first model element. In addition, in order to ensure that the appearance of the restored model is completely consistent with that of the original model, it is necessary to ensure that the element positions of the second reference model element and the second associated model element coincide with each other, that is, the element position coordinates of the second reference model element and the second associated model element are the same.
[0084] Furthermore, preferably, in order to ensure that the splicing position has the same dynamic effect as the skeleton moves, the weight information of the second reference model element and the second associated model element is the same. The weight information of the model element is used to characterize the motion mode of the corresponding model element. For example, when the model element is a vertex or a grid point, Figure 4 The point weight of the grid point at position A in the reference model in is the same as the point weight of the grid point at position A' in the associated model. By setting the point weights of the two grid points corresponding to the same splicing position in the reference model and the associated model to the same value, it is possible to ensure that the two grid points in the reference model and the associated model move with the same amplitude as the skeleton, thereby ensuring that the two grid points can always be synchronized to achieve a visual overlap effect, thereby ensuring that the appearance of the restored model and the original model are exactly the same, and avoiding the crack problem caused by the mismatch of the movement of the two grid points at the splicing position.
[0085] In an optional implementation, the second model element follows the movement of the first model element, including: controlling the second model element to translate, rotate and / or scale according to the translation information, rotation information and / or scaling information of the first model element. It can be seen that the motion state of the second model element is exactly the same as that of the first model element. Among them, the model elements may include: vertices, grid points, and / or bones; the constraint relationship may include: point constraint relationship, and / or parent-child constraint relationship. For example, when the model element is a grid point, it can be implemented through a point constraint relationship; when the model element is a bone, it can be implemented through a parent-child constraint relationship.
[0086] In an optional implementation, the original model includes a skeleton model and mesh data. Accordingly, the benchmark model can be generated in the following manner: according to the first original area, the skeleton model in the original model is deleted and processed to obtain the benchmark skeleton model corresponding to the first original area. It can be seen that the benchmark skeleton model only contains part of the skeleton data in the original model, which depends on the area range of the first original area. The mesh data in the original model is deleted and processed to obtain the benchmark mesh data corresponding to the first original area. The benchmark mesh data also only contains part of the mesh data in the original model, which depends on the area range of the first original area. The benchmark mesh data is bound to the benchmark skeleton model to obtain the benchmark model. Among them, the point weight information of any grid point in the benchmark model is the same as the point weight information of the grid point at the corresponding position in the original model. By making the point weight information of any grid point in the benchmark model the same as the point weight information of the grid point at the corresponding position in the original model, the weight information in the original model can be transferred to the newly generated benchmark model, thereby ensuring that the benchmark model can be driven normally by the skeleton.
[0087] In an optional implementation, the above method is applicable to a cloud game client. Accordingly, when obtaining a benchmark model corresponding to the original model and generating a restored model corresponding to the benchmark model, it can be implemented in the following manner: obtaining the benchmark model sent by the cloud server and loading the benchmark model into the memory space; generating a restored model in the game engine according to the benchmark model loaded in the memory space. It can be seen that in this method, the benchmark model is generated outside the game engine in advance, and the client only needs to obtain the benchmark model from the cloud server and load it into the memory without loading the complete original model, thereby greatly reducing the memory overhead of the client device and improving the game operation efficiency of the client.
[0088] In an optional implementation, before the restoration model is driven to generate model animation based on the restoration animation data of the restoration model, the restoration animation data of the restoration model sent by the cloud server is further received. It can be seen that the operations of generating the reference model and generating the restoration animation data can be pre-implemented by the cloud server, thereby reducing the processing overhead of the client. In addition, the original model can be a virtual object model in a cloud game application, such as a virtual character model, a virtual object model, etc. In the above manner, the storage overhead of the game running end can be greatly reduced, thereby improving the game running efficiency.
[0089] In an optional implementation, the original animation data of the original model includes: first original action data corresponding to the first original area, and second original action data corresponding to the second original area. The restored animation data of the restored model includes: first restored action data corresponding to the first restored area, and second restored action data corresponding to the second restored area. Among them, the first restored action data matches the first original action data, and the second restored action data matches the second original action data. It can be seen that for the corresponding areas in the original model and the restored model, the corresponding action data are also the same. That is: the motion state of each area in the original model is the same as the motion state of the corresponding area in the restored model.
[0090] In an optional implementation, the action type of the second original action data is different from the action type of the first original action data, and the action type of the second restored action data is different from the action type of the first restored action data. It can be seen that in this embodiment, the action types of at least two mutually related areas at the same time can be different, for example, the left and right limbs can perform different actions respectively.
[0091] For ease of understanding, an example is used below to introduce the implementation of the above embodiment. This example can be applied to the field of cloud gaming.
[0092] The following is an explanation of some of the concepts involved in this example:
[0093] Model assets: Three-dimensional models created using 3D modeling software and used to build game worlds.
[0094] Skeletal animation: A technique used in game production to animate model assets. Animators create a bone system and then attach the surface of the model to the bones so that the bones drive the model to move.
[0095] Weight: The weight of the skin is a value that defines how the mesh vertices are affected by the bones during the character binding process. Each vertex can be affected by one or more bones, and the weight value determines the degree of influence of each bone on the vertex. The higher the value, the more likely the vertex will follow the movement of the bones.
[0096] Original assets (corresponding to the original model mentioned above): that is, the assets before optimization by this solution, including the complete repetitive structure model and the complete skeleton structure.
[0097] Non-repeating structure assets (corresponding to the benchmark model mentioned above): The assets processed by this solution have a non-repeating structure. Using non-repeating structure assets, you can restore the assets that are consistent with the original asset's appearance through copying or mirroring. Among them, the corresponding content of non-repeating structure assets can be a carriage, half a body, etc.
[0098] Restored asset (corresponding to the restored model mentioned above): an asset with the same appearance as the original asset restored using a non-repeating structural asset. Compared with the original asset, this asset often has more repeated bones or vertices, but can maintain consistency in appearance.
[0099] Some model assets used in the game development process have many repeated structures, such as each carriage of a train, the left-right symmetrical structure of a robot, etc. Since these model assets often need to be driven by skeletal animation, in related technologies, these model assets are usually fully produced and loaded into the client memory.
[0100] Among them, the need to produce the repeated structure in full in the relevant technology is mainly based on the following considerations: once the skinning processing of the skeletal animation is performed, the data related to the skinning will be stored in the vertex data of the model, resulting in the visually repeated structure becoming a completely different model asset. Therefore, for the model assets that have added the binding relationship between the skin and the skeleton, even if they have a repeated structure, the complete model assets cannot be restored by simply copying and pasting. In addition, if the model assets that have added the binding relationship between the skin and the skeleton are directly copied and pasted, the animation method of the restored assets will be exactly the same as the animation method of the assets before copying and pasting. For example, if the model assets on the left side of the character are obtained by copying the model assets on the right side of the character, the model assets on the left and right sides will only be able to move in the same animation method, and different movements on the left and right sides cannot be made.
[0101] It can be seen that in the relevant technology, a large number of repeated structures in game assets will cause unnecessary memory overhead when the game is running, and the mobile game has more stringent requirements on memory. Therefore, in order to solve the above problems, this example proposes a memory optimization solution based on repeated structure skinning, which can save a lot of memory overhead for skin models with repeated identical structures. The specific implementation method is as follows: the Mesh (grid) of the repeated structure is bound separately, and the point weights of the meshes at the joints must be consistent to ensure that the skin at the joints can achieve more accurate connection. For example, when mirroring, the weights of the vertices at the seams of the repeated places are consistent to ensure that the proportion of the influence of the corresponding bones is the same, otherwise it is easy to have a cracked visual effect. In addition, the Mesh of the repeated structure is copied or mirrored in the game engine to make its spatial position consistent with the complete bone chain, and then the copied Mesh is point constrained with the original Mesh, so that the copied or mirrored Mesh can completely restore the movement of the original Mesh, thereby restoring the complete skin. Specifically, two overlapping points in the restored model can be constrained with a corresponding point in the original model, so that one point in the original model drives the two spliced points in the restored model to move synchronously. This method can restore the complete model asset using a repeated structure while retaining the skin to save memory overhead when the game is running, and will not affect the animator's production process.
[0102] Figure 5 A schematic diagram of the process of generating the model animation in this example is shown. Figure 5 As shown, the method comprises the following steps:
[0103] Step S501: Generate a reference model corresponding to the original model according to the original model.
[0104] Specifically, a single non-repeating structure model asset is created based on the original model, such as a carriage, a half-mirrored body, etc. The single non-repeating structure model asset is the benchmark model, which contains skeleton and Mesh information. In specific implementation, the benchmark model can be obtained by extracting the smallest non-repeating unit in the original model.
[0105] For example, the original model includes a first original region and a second original region associated with the first original region. Accordingly, the reference model can be generated based on the first original region. The number of the second original regions can be one or more, and the region sizes and / or region arrangement modes of the plurality of second original regions can be different.
[0106] Step S502: Process the reference model to obtain a restored model.
[0107] Specifically, a restoration model with a complete bone structure can be produced by copying, scaling, rotating and / or mirroring the reference model, so that the restoration model can be used to generate animation in subsequent steps. For example, the restoration model can be a skeleton model of a whole train or a complete bilaterally symmetrical body. Compared with the original model, the restoration model produced by the above method may have some repeated bones or vertices, but the two models can be consistent in appearance.
[0108] It can be seen that the restoration model includes: a first restoration area corresponding to the first original area and a second restoration area corresponding to the second original area. Wherein, in the case where there are multiple second original areas, the multiple second restoration areas can be obtained in the same or different ways. For example, different second restoration areas can be obtained by performing different scaling and / or rotation processing on the first restoration area. For example, different carriages of a train may have different sizes and arrangement angles, and therefore need to perform different scaling or rotation processing.
[0109] Step S503: Acquire original animation data generated according to the original model.
[0110] The animator can use the original model to create an animation, thereby generating original animation data. The specific animation method included in the original animation data can be flexibly set by those skilled in the art.
[0111] Optionally, the original animation data includes: first action data corresponding to the first original area, and second action data corresponding to the second original area; wherein the action type of the first action data is different from the action type of the second action data. It can be seen that in the original animation data, different areas with the same structure have different action modes. For example, for multiple carriages of a train, different carriages have different animation modes (such as different specific information such as tilt angles) to achieve a more realistic visual effect. For another example, for left and right limbs, the limb movements on different sides are different.
[0112] Step S504: Bind the restored model to the original model.
[0113] Specifically, the bones of the restored model and the bones of the original model can be parent-child constrained so that the action information on the original model (such as translation, rotation, etc.) is transmitted to the restored model, and the bones of the restored model can make the same movements as the bones in the same position on the original model, thereby making the restored model perform exactly the same actions as the original model.
[0114] In addition, since the movement of the original model is driven by the original animation data, this example is equivalent to being able to indirectly drive the restored model through the original animation data, so that the movement of the restored model is consistent with the original animation data.
[0115] Step S505: driving the original model to move by the original animation data, and generating restoration animation data of the restoration model when the restoration model follows the movement of the original model.
[0116] Specifically, since the original model and the restored model are bound to each other, the original model can be directly driven by the original animation data, and the restored model can be indirectly driven. Accordingly, during the movement of the restored model, the skeleton data of the restored model is baked to obtain the restored animation data of the restored model.
[0117] Step S506: Load the benchmark model in the game engine, and obtain a restored model by processing the benchmark model.
[0118] Specifically, the reference model is imported into the game engine, and the restored model is obtained in the game engine in the manner of step S502, thereby achieving the purpose of public model assets. This method only requires loading the reference model into the memory, and does not require storing the restored model in full in the memory, thereby effectively reducing the memory size when the game is running.
[0119] Step S507: driving the restored model to generate model animation using the restored animation data of the restored model.
[0120] In this way, the restored animation data can achieve the same animation effect as the original animation data. Generally, the restored animation data includes: first action data corresponding to the first restored area, and second action data corresponding to the second restored area; wherein the action type of the first action data is different from the action type of the second action data.
[0121] It should be noted that the above steps S501 to S505 are operations pre-performed outside the game engine, the purpose of which is to obtain restored animation data, and when the game is loaded, the reference model stored in step S501 can be imported into the game client. Therefore, the game client does not need to store the complete model data, and only the data content of the reference model needs to be stored in the memory. The restored model can be generated directly inside the game engine without occupying additional memory space, thereby greatly reducing the memory of the game client, which is particularly suitable for scenarios where mobile terminals such as mobile phones are used as game clients.
[0122] The execution subject of the above steps S501 to S505 may be a cloud server, or a game client. The execution subject of steps S506 to S507 may be a game client.
[0123] Figure 6 FIG. 1 shows a schematic diagram of a skeleton model before and after deletion when the original model is a virtual character model. Figure 6 As shown in FIG. 1 , the skeleton data in the complete virtual character model on the right (i.e., the original model) can be deleted, thereby deleting half of the skeleton data in the original model, wherein the asymmetric or non-repetitive axial skeleton needs to be retained, thereby obtaining Figure 6 The deleted skeleton on the left is the baseline skeleton model.
[0124] Figure 7 FIG. 1 shows a schematic diagram of mesh data (also called skin data) before and after deletion when the original model is a virtual character model. Figure 7 As shown, the complete mesh data in the original model (i.e. Figure 7 The right part of the original model is deleted by half, thus obtaining Figure 7 The deleted grid data on the left is the baseline grid data.
[0125] Next, you need to Figure 6 The baseline skeleton model on the left is Figure 7 The reference mesh data on the left is bound to obtain the reference model. During the binding process, the weight of the original model needs to be transferred to the newly bound reference model to ensure that the newly bound reference model can be driven normally by the skeleton.
[0126] Wherein, for the convenience of realizing the operation process in the game engine, the reference model in step S501 can be exported as a model file of FBX format, for step S506 to load. During specific implementation, a copy of the model file of FBX format can be made, and the Root_M under the copied Main node is grouped, the group name is renamed (renamed to Mirror in this example), and all the right-side bones under the group are named as the naming convention of the left-side bones, and the bones that are not dedicated to the right side are named with a specific suffix (this example uses _Mirror as a suffix) to distinguish them from the other side. Change the X-axis scaling of Mirror to -1 (depending on the symmetrical structure, this example is bilaterally symmetrical, and if other symmetry modes, the axis of symmetry may not be the X-axis). Import the original model with complete bones, and the original bones in the imported original model and the bones in the restored model obtained after the mirroring process are subjected to parent-child constraints, so that the original bones can control the bones corresponding to the processed mirror nodes. After importing the above-mentioned benchmark model into the game engine, copy it in the required mirroring direction and rename each node name according to the naming convention in the model asset preparation process to ensure that the restored model can be driven normally by the restored animation data. In addition, if the animation has root displacement, it needs to be processed in the script to ensure that the mirrored model can also be displaced normally.
[0127] Figure 8 A schematic diagram of a model animation generation device provided by another embodiment of the present disclosure is shown, and the device specifically includes:
[0128] A processing module 81 is adapted to obtain a reference model corresponding to the original model, and process the reference model to obtain a restored model corresponding to the original model; wherein the original model includes at least two regions, and the reference model is used to characterize at least one region in the original model;
[0129] The driving module 82 is adapted to drive the restored model to generate model animation according to the restored animation data of the restored model; wherein the restored animation data of the restored model is obtained according to the original animation data of the original model, and the restored animation data matches the original animation data.
[0130] In an optional implementation, at least two areas in the original model include: a first original area and a second original area associated with the first original area, and the baseline model is generated based on the first original area; and the restored model includes: a first restored area corresponding to the first original area and a second restored area corresponding to the second original area.
[0131] In an optional implementation, the original animation data of the original model includes: first original motion data corresponding to the first original area, and second original motion data corresponding to the second original area;
[0132] The restoration animation data of the restoration model includes: first restoration action data corresponding to the first restoration area, and second restoration action data corresponding to the second restoration area;
[0133] The first restored action data matches the first original action data, and the second restored action data matches the second original action data.
[0134] In an optional implementation, the action type of the second original action data is different from the action type of the first original action data, and the action type of the second restored action data is different from the action type of the first restored action data.
[0135] In an optional implementation, the restored animation data of the restored model is obtained by:
[0136] In the case where the restored model and the original model are bound to each other, the original model is driven to move by the original animation data of the original model, and the restored animation data is obtained according to the motion state of the bound restored model;
[0137] The motion state of the bound restored model matches the motion state of the original model.
[0138] In an optional implementation, the processing module is specifically adapted to:
[0139] Processing the reference model according to the association relationship between the first original region and the second original region to obtain an association model corresponding to the reference model;
[0140] The reference model and the associated model are spliced to obtain the restored model.
[0141] In an optional implementation, the association relationship between the first original area and the second original area includes: a scaling association relationship, a rotation association relationship, a copy association relationship, and / or a mirroring association relationship;
[0142] The processing module is specifically adapted to: perform scaling processing, rotation processing, copy processing, and / or mirror processing on the reference model.
[0143] In an optional implementation, the binding of the restored model and the original model to each other includes:
[0144] For a first model element in the original model, determining a second model element in the restored model corresponding to the first model element;
[0145] A constraint relationship is established between the first model element and the second model element so that the second model element moves along with the first model element.
[0146] In an optional implementation, if the element position of the first model element matches the splicing position of the reference model and the associated model, the second model element corresponding to the first model element in the restored model includes:
[0147] a second reference model element corresponding to the reference model, and a second associated model element corresponding to the associated model;
[0148] The element positions of the second reference model element and the second associated model element overlap with each other; and the weight information of the second reference model element and the second associated model element is the same.
[0149] In an optional implementation manner, the second model element following the movement of the first model element includes:
[0150] Controlling the second model element to translate, rotate and / or scale according to the translation information, rotation information and / or scaling information of the first model element;
[0151] The model elements include: grid points and / or skeletons; the constraint relationships include: point constraint relationships and / or parent-child constraint relationships.
[0152] In an optional implementation, the original model includes a skeleton model and mesh data; the reference model is generated by:
[0153] According to the first original region, a skeleton model in the original model is deleted to obtain a reference skeleton model corresponding to the first original region;
[0154] Deleting the mesh data in the original model to obtain reference mesh data corresponding to the first original area;
[0155] Binding the reference mesh data to the reference skeleton model to obtain the reference model;
[0156] The point weight information of any grid point in the reference model is the same as the point weight information of the grid point at the corresponding position in the original model.
[0157] In an optional implementation, the device is applicable to a cloud game client, and the processing module is specifically adapted to:
[0158] Obtaining the benchmark model sent by the cloud server, and loading the benchmark model into a memory space;
[0159] The restored model is generated in the game engine according to the reference model loaded in the memory space.
[0160] In an optional implementation, the processing module is further adapted to: receive the restored animation data of the restored model sent by the cloud server; and the original model is a virtual object model in a cloud game application.
[0161] The specific working principles of the above modules can be found in the description of the corresponding parts in the method embodiment, which will not be repeated here.
[0162] Fig. 9 A schematic structural diagram of an electronic device according to another embodiment of the present disclosure is shown. The specific embodiment of the present disclosure does not limit the specific implementation of the electronic device.
[0163] like Fig. 9 As shown, the electronic device may include: a processor (processor) 502 , a communication interface (Communications Interface) 504 , a memory (memory) 506 , and a communication bus 508 .
[0164] in:
[0165] The processor 502 , the communication interface 504 , and the memory 506 communicate with each other via a communication bus 508 .
[0166] The communication interface 504 is used to communicate with other devices such as clients or other servers.
[0167] The processor 502 is used to execute the program 510, and specifically can execute the relevant steps in the above-mentioned video image detection method embodiment.
[0168] Specifically, the program 510 may include program codes, which include computer operation instructions.
[0169] The processor 502 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present disclosure. The one or more processors included in the electronic device may be processors of the same type, such as one or more CPUs. They may also be processors of different types, such as one or more CPUs and one or more ASICs.
[0170] The memory 506 is used to store the program 510. The memory 506 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0171] The program 510 can be specifically used to enable the processor 502 to execute the corresponding operations in the above-mentioned video image detection method embodiment.
[0172] The algorithms and displays provided herein are not inherently related to any particular computer, virtual device or other device. Various general purpose devices may also be used together with the teachings based thereon. According to the above description, it is apparent that the structure required for constructing such devices is. In addition, the present disclosure is not directed to any particular programming language either. It should be understood that various programming languages may be utilized to implement the disclosure described herein, and the description of the specific languages above is intended to disclose the best mode of implementation of the present disclosure.
[0173] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present disclosure can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0174] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various disclosed aspects, in the above description of exemplary embodiments of the present disclosure, various features of the present disclosure are sometimes grouped together into a single embodiment, figure, or description thereof. However, this method of disclosure should not be interpreted as reflecting an intention that the claimed disclosure requires more features than are expressly recited in each claim.
[0175] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0176] In addition, those skilled in the art will appreciate that, although some embodiments herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present disclosure and form different embodiments. For example, any one of the claimed embodiments may be used in any combination.
[0177] The various component embodiments of the present disclosure may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the device according to the embodiments of the present disclosure. The present disclosure may also be implemented as a device or device program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program implementing the present disclosure may be stored on a computer-readable medium, or may have the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0178] It should be noted that the above embodiments illustrate the present disclosure rather than limit the present disclosure, and that those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets should not be constructed as a limitation to the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of multiple such elements. The present disclosure may be implemented by means of hardware including several different elements and by means of appropriately programmed computers. In a unit claim that lists several devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names.
Claims
1. A method for generating a model animation, comprising: Acquire a reference model corresponding to the original model, and process the reference model to obtain a restored model corresponding to the original model; wherein the original model includes at least two regions, and the reference model is used to characterize at least one region in the original model; According to the restored animation data of the restored model, the restored model is driven to generate a model animation; wherein the restored animation data of the restored model is obtained according to the original animation data of the original model, and the restored animation data matches the original animation data.
2. The method according to claim 1, wherein: The at least two regions in the original model include: a first original region and a second original region associated with the first original region, and the reference model is generated based on the first original region; and the restored model includes: a first restored region corresponding to the first original region and a second restored region corresponding to the second original region.
3. The method according to claim 2, wherein: The original animation data of the original model includes: first original motion data corresponding to the first original area, and second original motion data corresponding to the second original area; The restoration animation data of the restoration model includes: first restoration action data corresponding to the first restoration area, and second restoration action data corresponding to the second restoration area; The first restored action data matches the first original action data, and the second restored action data matches the second original action data.
4. The method according to claim 3, wherein: The motion type of the second original motion data is different from the motion type of the first original motion data, and the motion type of the second restored motion data is different from the motion type of the first restored motion data.
5. The method according to any one of claims 1 to 4, wherein: The restored animation data of the restored model is obtained in the following manner: In the case where the restored model and the original model are bound to each other, the original model is driven to move by the original animation data of the original model, and the restored animation data is obtained according to the motion state of the bound restored model; The motion state of the bound restored model matches the motion state of the original model.
6. The method according to any one of claims 2 to 5, wherein: The processing of the reference model to obtain a restored model corresponding to the original model includes: Processing the reference model according to the association relationship between the first original region and the second original region to obtain an association model corresponding to the reference model; The reference model and the associated model are spliced to obtain the restored model.
7. The method according to claim 6, wherein: The association relationship between the first original area and the second original area includes: a scaling association relationship, a rotation association relationship, a copy association relationship, and / or a mirror association relationship; The processing of the reference model includes: scaling, rotating, copying, and / or mirroring the reference model.
8. The method according to any one of claims 5 to 7, wherein: The restoration model and the original model are bound to each other including: For a first model element in the original model, determining a second model element in the restored model corresponding to the first model element; A constraint relationship is established between the first model element and the second model element so that the second model element moves along with the first model element.
9. The method according to claim 8, wherein: If the element position of the first model element matches the splicing position of the reference model and the associated model, the second model element corresponding to the first model element in the restored model includes: a second reference model element corresponding to the reference model, and a second associated model element corresponding to the associated model; The element positions of the second reference model element and the second associated model element overlap with each other; and the weight information of the second reference model element and the second associated model element is the same.
10. The method according to claim 8 or 9, wherein: The second model element follows the movement of the first model element, comprising: Controlling the second model element to translate, rotate and / or scale according to the translation information, rotation information and / or scaling information of the first model element; The model elements include: grid points and / or skeletons; the constraint relationships include: point constraint relationships and / or parent-child constraint relationships.
11. The method according to any one of claims 2 to 10, wherein: The original model includes a skeleton model and mesh data; the benchmark model is generated by: According to the first original region, a skeleton model in the original model is deleted to obtain a reference skeleton model corresponding to the first original region; Deleting the mesh data in the original model to obtain reference mesh data corresponding to the first original area; Binding the reference mesh data to the reference skeleton model to obtain the reference model; The point weight information of any grid point in the reference model is the same as the point weight information of the grid point at the corresponding position in the original model.
12. The method according to any one of claims 1 to 11, wherein: The method is applicable to a cloud game client, wherein obtaining a reference model corresponding to the original model and processing the reference model to obtain a restored model corresponding to the original model comprises: Obtaining the benchmark model sent by the cloud server, and loading the benchmark model into a memory space; The restored model is generated in the game engine according to the reference model loaded in the memory space.
13. The method according to claim 12, wherein: Before driving the restoration model to generate model animation according to the restoration animation data of the restoration model, the method further includes: receiving the restoration animation data of the restoration model sent by the cloud server; and the original model is a virtual object model in a cloud game application.
14. A device for generating a model animation, comprising: A processing module, adapted to obtain a reference model corresponding to an original model, and process the reference model to obtain a restored model corresponding to the original model; wherein the original model includes at least two regions, and the reference model is used to characterize at least one region in the original model; The driving module is adapted to drive the restored model to generate model animation according to the restored animation data of the restored model; wherein the restored animation data of the restored model is obtained according to the original animation data of the original model, and the restored animation data matches the original animation data.
15. An electronic device, comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute the method for generating a model animation according to any one of claims 1-13.
16. A computer storage medium, wherein at least one executable instruction is stored in the storage medium, and wherein the executable instruction enables a processor to execute the method for generating a model animation according to any one of claims 1 to 13.
