CN116228941A - Animation generation method and device for model, storage medium and electronic device - Google Patents

Animation generation method and device for model, storage medium and electronic device Download PDF

Info

Publication number
CN116228941A
CN116228941A CN202310223049.2A CN202310223049A CN116228941A CN 116228941 A CN116228941 A CN 116228941A CN 202310223049 A CN202310223049 A CN 202310223049A CN 116228941 A CN116228941 A CN 116228941A
Authority
CN
China
Prior art keywords
model
vertex
animation
models
weight information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310223049.2A
Other languages
Chinese (zh)
Inventor
欧阳恒
冯委
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202310223049.2A priority Critical patent/CN116228941A/en
Publication of CN116228941A publication Critical patent/CN116228941A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • G06T13/203D [Three Dimensional] animation
    • G06T13/403D [Three Dimensional] animation of characters, e.g. humans, animals or virtual beings

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The application discloses an animation generation method and device of a model, a storage medium and an electronic device. The method comprises the following steps: acquiring a plurality of first models; merging the plurality of first models into a second model; determining first weight information of a vertex of the second model; determining second weight information of the vertex of at least one first model based on the first weight information; and controlling the corresponding first models to move based on the second weight information to obtain skeleton animation of each first model, wherein the skeleton animation of the plurality of first models forms the crushing animation of the second model. The present disclosure solves the technical problem of low animation efficiency of models.

Description

Animation generation method and device for model, storage medium and electronic device
Technical Field
The present invention relates to the field of animation technologies, and in particular, to a method and an apparatus for generating an animation of a model, a storage medium, and an electronic apparatus.
Background
At present, when a broken animation of a model is generated, the complete model to be broken is usually cut off line, then bone binding is carried out on each broken sub-model, animation is produced for each broken sub-model, then each broken sub-model is combined into the complete model, but one model only corresponds to one set of bone, therefore, after a plurality of sub-models are combined into one complete model, only one set of bone is reserved, other bones can be discarded, therefore, multiple bone binding needs to be carried out, however, the calculation amount is greatly increased due to multiple binding, and the technical problem of low production efficiency of the broken animation of the model is caused.
In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
At least some embodiments of the present application provide a method, an apparatus, a storage medium, and an electronic device for generating an animation of a model, so as to at least solve a technical problem of low animation efficiency of the model.
According to one embodiment of the present application, a method for generating an animation of a model is provided. The method comprises the following steps: acquiring a plurality of first models, wherein the plurality of first models are used for generating crushing animation of a second model; combining the plurality of first models into a second model, wherein the vertex of at least one first model is used for determining the vertex of the second model; determining first weight information of vertexes of the second model, wherein the first weight information is used for representing the influence degree of each first target bone in at least one first target bone bound to the vertexes of the second model on the movement of the vertexes of the second model; determining second weight information of vertexes of at least one first model based on the first weight information, wherein the second weight information is used for representing the influence degree of each second target bone in at least one second target bone to which the corresponding vertexes of each first model are bound on the movement of the vertexes driving the first model; and controlling the corresponding first models to move based on the second weight information to obtain skeleton animation of each first model, wherein the skeleton animation of the plurality of first models forms the crushing animation of the second model.
According to one embodiment of the present application, a method for generating an animation of a model is provided. The method comprises the following steps: displaying a plurality of first models on a graphical user interface, wherein the plurality of first models are used to generate a crush animation of the second model; in response to an animation production operation acting on a graphical user interface, invoking a target plug-in to generate a bone animation of each first model, wherein the second model is obtained by combining a plurality of first models, the vertex of at least one first model is used for determining the vertex of the second model, first weight information of the vertex of the second model is used for generating second weight information of the vertex of at least one first model, the first weight information is used for representing the influence degree of the vertex of the second model on the movement of each first target bone of at least one first target bone to which the vertex of the second model is bound, the second weight information is used for representing the influence degree of the vertex of each second target bone of at least one second target bone to which the vertex of the corresponding first model is bound, and the bone animation of each first model is obtained by controlling the movement of each corresponding first model based on the second weight information; a breaking animation of a second model composed of skeletal animations of the plurality of first models is presented on the graphical user interface.
According to one embodiment of the present application, an animation generating device for a model is provided. The device comprises: an acquisition unit configured to acquire a plurality of first models, wherein the plurality of first models are used to generate a crush animation of a second model; a first merging unit, configured to merge the plurality of first models into a second model, where a vertex of at least one first model is used to determine a vertex of the second model; the first determining unit is used for determining first weight information of vertexes of the second model, wherein the first weight information is used for representing the influence degree of each first target bone in at least one first target bone to which the vertexes of the second model are bound on the movement of the vertexes of the driving second model; the second determining unit is used for determining second weight information of vertexes of at least one first model based on the first weight information, wherein the second weight information is used for representing the influence degree of each second target bone in at least one second target bone to which the corresponding vertexes of each first model are bound on the movement of the vertexes driving the first model; and the control unit is used for controlling the corresponding first models to move based on the second weight information to obtain the skeleton animation of each first model, wherein the skeleton animations of the plurality of first models form the broken animation of the second model.
According to one embodiment of the present application, an animation generating device for a model is provided. The device comprises: a first display unit for displaying a plurality of first models on a graphical user interface, wherein the plurality of first models are used for generating a crushing animation of the second model; the system comprises a calling unit, a target plug-in unit and a control unit, wherein the calling unit is used for responding to animation production operation acted on a graphical user interface, the target plug-in unit is used for generating a bone animation of each first model, the second model is obtained by combining a plurality of first models, the vertex of at least one first model is used for determining the vertex of the second model, first weight information of the vertex of the second model is used for generating second weight information of the vertex of at least one first model, the first weight information is used for representing each first target bone in at least one first target bone to which the vertex of the second model is bound, the influence degree of the vertex motion of the second model is driven, the second weight information is used for representing each second target bone in at least one second target bone to which the vertex of the corresponding first model is bound, and the bone animation of each first model is obtained by controlling the corresponding movement of each first model based on the second weight information; and a second display unit for displaying a crushing animation of a second model composed of skeletal animations of the plurality of first models on the graphical user interface.
According to one embodiment of the present application, there is also provided a computer-readable storage medium having a computer program stored therein, wherein the computer program is configured to perform the animation generation method of the model in any one of the above-mentioned items when run.
According to one embodiment of the present application, there is also provided an electronic device including a memory in which a computer program is stored, and a processor configured to run the computer program to perform the animation generation method of the model in any one of the above.
In at least some embodiments of the present application, a plurality of first models may be acquired, where the plurality of first models are sub-models corresponding to the second model, and the plurality of first models are used to generate a crushing animation of the second model, after the plurality of first models are acquired, the plurality of first models may be combined to obtain the second model, after the second model is obtained, first weight information of vertices of the second model may be determined, then second weight information of vertices of at least one first model may be determined based on the first weight information, and movement of each corresponding first model may be controlled based on the second weight information to obtain a bone animation of each first model, where the bone animation of the plurality of first models forms the crushing animation of the second model. That is, in this embodiment of the present application, the sub-models may be combined into one complete model, then, weight information of vertices of the complete model is determined, weight information of vertices of each sub-model is determined based on the weight information of the complete model, and then, each sub-model is controlled to move based on the weight information of vertices of the sub-model, so as to obtain a broken animation of the complete model.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
FIG. 1 is a block diagram of a hardware architecture of a mobile terminal of a model animation generation method according to an embodiment of the present application;
FIG. 2 is a flow chart of a method of animation generation of a model according to one embodiment of the present application;
FIG. 3 is a flow chart of a method of animation generation of a model according to one embodiment of the present application;
FIG. 4 is a flow chart of a method of animating a model according to an embodiment of the application;
FIG. 5 is a schematic illustration of a stalagmite model according to an embodiment of the present application;
FIG. 6 is a schematic illustration of a stalagmite crushing model according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a key animation frame of a broken virtual object according to an embodiment of the present application;
FIG. 8 is a schematic illustration of a baked skeletal animation in accordance with an embodiment of the present application;
FIG. 9 is a schematic illustration of a baked skeletal animation in accordance with an embodiment of the present application;
FIG. 10 is a schematic illustration of a baked skeletal animation in accordance with an embodiment of the present application;
FIG. 11 is a schematic illustration of a skeletal animation of a fragmentation model in accordance with an embodiment of the present application;
FIG. 12 is a schematic illustration of a skeletal animation of a fragmentation model in accordance with an embodiment of the present application;
FIG. 13 is a schematic diagram of an animation generation device of a model according to an embodiment of the present application;
FIG. 14 is a schematic diagram of an animation generation device of a model according to an embodiment of the present application;
fig. 15 is a schematic diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In one possible implementation, the model breaking is an animation technology commonly used in the game development process, for example, the building model is broken by objects caused by hitting a weapon, the number of fragments is difficult to achieve a shocking effect when breaking, the occurrence of a large number of fragments is very huge for real-time games, the generation efficiency of broken animation of the model breaking is low, in order to solve the technical problem, a method generally adopted in the art is to bind bones separately for sub-models corresponding to complete models of the model breaking to be executed, and make a bone animation for each sub-model, and then combine the sub-models with the bone animation to be made into one complete model, but because one model only corresponds to one set of bones, in the process of combining a plurality of sub-models into one complete model, bones of different sub-models may collide with each other, only one set of bones is reserved, and in the process of combining a plurality of sub-models into the complete model, multiple binding needs to be performed for multiple times, so that the efficiency of making the integrated complete model in the process of binding each sub-model to show the broken model is very low, however, the problem of the technology is that the efficiency of making the model with the complete model is increased.
The embodiment of the application provides an animation generation method of a model, wherein a plurality of first models are obtained, the plurality of first models are sub-models corresponding to a second model, the plurality of first models are used for generating a crushing animation of the second model, after the plurality of first models are obtained, the plurality of first models can be combined based on position information of the plurality of first models to obtain the second model, after the second model is obtained, first weight information of vertexes of the second model can be determined, and the first weight information is used for representing the influence degree of movement of vertexes of the second model on each first target skeleton in at least one first target skeleton bound to the vertexes of the second model; and then, determining second weight information of the vertexes of at least one first model based on the first weight information, wherein the second weight information is used for representing the influence degree of each second target skeleton in at least one second target skeleton bound to the vertexes of each corresponding first model on the operation of driving the vertexes of the first model, and then controlling the corresponding first models to move based on the second weight information to obtain the skeleton animation of each first model, wherein the skeleton animation of a plurality of first models forms the breaking animation of the second model. In the process, a plurality of first models are combined into a second model, then, the weight information of the vertexes of the second model is determined, the weight information of each first model is generated based on the weight information of the second model, the first sub-model is controlled to move based on the first weight information, multiple times of skeleton binding is not needed, calculation resources are saved greatly, calculation efficiency is improved, the technical effect of improving the animation production efficiency of the models is achieved, and the technical problem of low animation production efficiency of the models is solved.
The above-described method embodiments referred to in the present application may be performed in a mobile terminal, a computer terminal or similar computing device. Taking the mobile terminal as an example, the mobile terminal can be a smart phone, a tablet computer, a palm computer, a mobile internet device, a PAD, a game machine and other terminal devices. Fig. 1 is a block diagram of a hardware structure of a mobile terminal according to an animation generation method of a model according to an embodiment of the present application. As shown in fig. 1, the mobile terminal may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a Central Processing Unit (CPU), a Graphics Processor (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, and in one embodiment of the present application, may further include: input output device 108 and display device 110.
In some optional embodiments, which are based on game scenes, the device may further provide a human-machine interaction interface with a touch-sensitive surface, where the human-machine interaction interface may sense finger contacts and/or gestures to interact with a Graphical User Interface (GUI), where the human-machine interaction functions may include the following interactions: executable instructions for performing the above-described human-machine interaction functions, such as creating web pages, drawing, word processing, making electronic documents, games, video conferencing, instant messaging, sending and receiving electronic mail, talking interfaces, playing digital video, playing digital music, and/or web browsing, are configured/stored in a computer program product or readable storage medium executable by one or more processors.
It will be appreciated by those skilled in the art that the structure shown in fig. 1 is merely illustrative and not limiting of the structure of the mobile terminal described above. For example, the mobile terminal may also include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1.
According to one embodiment of the present application, there is provided an embodiment of an animation generation method of a model, it should be noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer-executable instructions, and that although a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different from that herein.
In a possible implementation manner, the embodiment of the present application provides a method for generating an animation of a model, and fig. 2 is a flowchart of a method for generating an animation of a model according to the embodiment of the present application, as shown in fig. 2, and the method includes the following steps:
step S201, a plurality of first models are obtained, wherein the plurality of first models are used for generating crushing animation of the second model.
In the technical solution provided in step S201, the second model may be a complete model, and the plurality of first models are crushing models of the second model, that is, the plurality of first models may be a plurality of sub-models corresponding to the second model, where the plurality of first models are used to generate the crushing animation of the second model.
For example, after the model is crushed, a complete model may be crushed into a plurality of sub-models, wherein the complete model may be regarded as a second model, the plurality of sub-models may be regarded as a plurality of first models, based on which the plurality of sub-models after the second model is crushed may be acquired first, and a crushing animation of the complete model may be generated based on the plurality of sub-models.
Step S202, merging the plurality of first models into a second model, wherein the vertex of at least one first model is used for determining the vertex of the second model.
In the technical solution provided in step S202, after obtaining the plurality of first models, because each first model is a sub-model of the second model, based on this, the plurality of first models may be combined to obtain the second model, where in the process of combining the plurality of first models, vertices of the combined second model may be determined according to vertex information of the first models, where the vertex information includes at least a vertex position, a vertex index, a vertex sequence, and an associated vertex of at least one vertex of the first model.
In this embodiment, after a complete second model is broken, the complete second model may be broken into a plurality of first models, in which case, a vertex in the second model may correspond to a vertex in two or more broken first sub-models, a position of the vertex in the second model may be determined based on vertex information of the vertex in each first model, based on which a position of each vertex in the second model may be determined based on a vertex position of the vertex in each first model in the plurality of first models, and then the plurality of first models may be combined based on the determined vertex position of the vertex in the second model in each first model, to obtain the second model.
Step S203, determining first weight information of vertices of the second model, where the first weight information is used to represent a degree of influence of each first target bone in at least one first target bone bound by the vertices of the second model on motion of the vertices driving the second model.
In the above step S203, each first model may bind at least one bone, where the center of the first model corresponds to the center of the bound bone, each first model corresponds to the bone to which it is bound, the vertex of each first model is bound to its corresponding bone, and the motion of the bone may drive the motion of the bound vertex, after the merging of the plurality of first models into the second model, since there may be overlapping vertices or edges of two or more first models in the plurality of first models, i.e. the vertex of the two or more first models corresponds to one vertex of the second model after merging, in which case one vertex of the second model may be affected by the two or more bones to which it is bound, based on which the first weight information of the vertex of the second model may be determined, the first weight information being used to represent the driving effect of the vertex of the second model on the motion of each first target in the at least one first target bone to which the vertex of the second model is bound.
In this embodiment, since bones are bound at the center of the first models, and the vertices in each first model are bound to bones that it is erected, in this case, when a plurality of first models are combined to obtain a second model, bones bound by vertices of the first model combined to vertices of the second model can be regarded as first target bones bound by the vertices in the second model, and each vertex in the second model is affected by all the first target bones bound thereto. Wherein if the vertex in the second model is merged from a vertex in a first model, in which case the vertex in the second model is affected only by a first target bone; if the vertices in the second model are merged from two or more vertices in the first model, in which case the vertices in the second model are affected by a plurality of first target bones, based on which the first weight information of the vertices of the second model can be determined according to the degree of influence of the first target bones bound by the respective vertices in the second model on driving the motion of the respective vertices, which degree of influence can be expressed by a weight value.
For example, assuming that a certain vertex in the second model is affected by two first target bones, for convenience of description, the vertex may be referred to herein as a vertex a, and the two first target bones may be referred to as a first target bone X and a first target bone Y, respectively, where the weight value of the vertex a affected by the first target bone X is 0.4, and the weight value of the vertex a affected by the first target bone Y is 0.6, based on this, the first weight information of the vertex a of the second model may be determined according to the weight values of all the first target bones affected by the vertex a, where the weight information of the vertex a includes the weight values of all the first target bones affected by which the vertex a is bound. Based on the method, first weight information for each vertex in the second model may be determined.
Step S204, determining second weight information of vertexes of at least one first model based on the first weight information, wherein the second weight information is used for representing the influence degree of each second target bone in at least one second target bone to which the corresponding vertexes of each first model are bound on the movement of the vertexes driving the first model.
In the step S204, as can be seen from the foregoing description, the first weight information of the vertex of the second model may include a plurality of weight values, where the plurality of weight values are the degrees of influence on the motion of the vertex driving the second model by all the first target bones to which the vertex of the second model is subjected, and since the second model is obtained by combining the plurality of first models, after determining the first weight information of the vertex of the second model, the second weight information of the vertex of at least one first model may be determined based on the first weight information, where the second weight information is used to represent the degrees of influence on the motion of the vertex driving the first model by each of the at least one second target bones to which the vertex of each corresponding first model is bound.
In this embodiment, as can be seen from the foregoing description, the first weight information of the vertices of the second model may include one or more weight values, where the weight values are used to represent the degree to which the vertices in the second model are affected by the first target bone to which they are bound. Based on this, the second weight information of the vertices of the at least one first model may be determined from the weight values in the first weight information of the vertices of the second model.
Continuing with the previous example, assume that the weight values included in the second weight information of the vertex a in the second model are 0.4 and 0.6, wherein 0.4 is used to represent the degree of influence on the driving of the movement of the first target bone X to which the vertex a in the second model is bound; 0.6 is used to represent the extent of the effect of the first target bone Y to which the vertex a in the second model is bound on driving the motion of the vertex. Since the vertex a of the second model is obtained by merging the vertices of the first model, it is assumed that the vertex a of the second model is obtained by merging the vertex a1 of the first model M and the vertex a2 of the first model N, wherein the first model M corresponds to the first target bone X and the second model N corresponds to the first target bone Y, based on this, the weight value 0.4 of the influence of the first target bone X on the vertex a of the second model can be used as the second weight information of the vertex a1 of the first model M corresponding to the vertex a, and the weight value 0.6 of the influence of the first target bone Y on the vertex a of the second model can be used as the second weight information of the vertex a2 of the first model N corresponding to the first target bone Y. Based on the method, second weight information for vertices of each first model may be determined.
Step S205, controlling the corresponding first models to move based on the second weight information to obtain skeleton animation of each first model, wherein the skeleton animation of the plurality of first models forms the broken animation of the second model.
In the step S205, since the first weight information is used to represent the influence degree of each second target bone in the at least one second target bone to which the vertex of each first model is bound, the movement of the vertex driving the first model may be driven by the movement of the bone, based on this, after the first weight information of the vertex of each first model is determined, the movement of each corresponding first model may be controlled based on the first weight information, so as to obtain the bone animation of each first model, where the bone animations of the plurality of first models form the crushing animation of the second model.
In this embodiment, since the second weight information includes the influence degree of each second target bone in at least one second target bone to which the vertex of each first model is bound, the motion of the vertex can be driven by the motion of the bone, so that the vertex in the first model can be controlled to move based on the second weight information, the motion of the vertex can drive the model to move, and further, the bone animation of the first model is generated, wherein the bone animations of the plurality of first models are played simultaneously to form the broken animation of the second model.
In at least some embodiments of the present application, a plurality of first models may be combined into a second model, so as to determine first weight information of each vertex of the second model, determine weight information of the vertex of the first model based on the weight information, and then control movement of the first model based on the weight information of the vertex of the first model to obtain a skeletal animation of the first model.
The above method of this embodiment is further exemplified below.
As an alternative embodiment, the animation generation method of the model further includes: binding at least one bone to each first model to obtain a plurality of bones of a plurality of first models; combining the plurality of bones into a skeleton of a second model; in the skeleton of the second model, at least one first target skeleton to which vertices of the second model are bound is determined.
In this embodiment, at least one bone may be bound to each first model, so as to obtain a plurality of bones of the first models, where the vertex of each first model is bound to the bone corresponding to the model, and movement of the bone may drive movement of the vertex of the model, and then the bones may be combined into a skeleton of the second model, where at least the first target bone to which the vertex of the second model is bound may be determined.
For example, since the vertex of each first model is bound to the bone corresponding to the model, and each first model is a broken model of the second model, based on this, the vertices of the plurality of first models can be combined according to the position of the vertex of each first model in the corresponding vertex of the second model, and since the vertex is bound to the bone, based on this, in the process of vertex combination, bone combination can be achieved, and the combined bone can form the bone of the second model. Since the vertices in the first model may be changed to one vertex in the second model after the two vertices in the two first models are merged at the time of merging, and since the two vertices in the two first models are bound to at least one bone, respectively, in this case, the bone to which the vertices in the first model before merging are bound may be regarded as the first target bone to which the vertices in the second model after merging are bound. Wherein if the vertex in the second model corresponds to a vertex in a first model, the first target bone bound by the vertex in the second model is one; if the vertices in the second model correspond to at least two vertices in at least two first models, in which case the first target bone to which the vertices in the second model are bound is two or more.
As an alternative embodiment, merging the plurality of bones into the skeleton of the second model comprises: and establishing a level relation among a plurality of bones based on the vertexes of each first model to obtain a skeleton of the second model.
In this embodiment, since the first model is a broken model of the second model, the bones bound by the first model are independent and are not affected by each other, but after merging the bones to obtain the skeleton of the second model, the movements between the bones are mutually affected, i.e. the movement of one bone affects the movement of the other bone, in which case a level relationship between the bones needs to be established, which may be a father-son relationship between the bones, and the father bone and the son bone may be determined based on the level relationship between the bones, wherein the movement of the father bone may drive the movement of the son bone, and the movement of the son bone may not affect the movement of the father bone. A hierarchical relationship between the multi-calcaneus bones may be established based on the vertices of each first model to obtain a skeleton of the second model.
Alternatively, since the vertices of the first models may bind a plurality of bones, a level relationship between bones may be determined according to a degree of influence of the bones bound by each first model on driving the motion of the vertices, wherein a level of bones may be determined according to a magnitude of influence of the bones bound by the vertices on driving the motion of the vertices, for example, a level of bones having a large influence is higher than a level of bones having a small influence.
For example, as can be seen from the foregoing description, the degree of influence of the bone bound by the vertex on driving the vertex can be represented by a weight value, and the greater the weight value, the greater the degree of influence of the bone bound by the vertex on driving the vertex; the smaller the weight value, the smaller the influence degree of the bones bound by the vertexes on the motion driving of the vertexes, and based on the influence degree, the level relation among the bones can be determined based on the weight value of the vertexes. For example, two bones bound by a vertex in the first model correspond, the first bone bound by the vertex has a weight value of 0.3 for the degree of influence of driving the vertex, and the second bone bound by the vertex has a weight value of 0.7 for the degree of influence of driving the vertex, and since 0.7 is greater than 0.3, in this case, it can be determined that the level of the second bone is greater than that of the first bone, that is, the second bone can be regarded as a parent bone and the first bone can be regarded as a child bone.
As an alternative embodiment, the animation generation method of the model further includes: at least one second target bone to which the vertex of each first model is bound is determined in the plurality of bones.
In this embodiment, at least one bone is bound to each of the plurality of first models, based on which the plurality of first models are bound to a plurality of bones, and the bones are combined to obtain a skeleton of the second model, where the skeleton bound to the vertex of the second model is a first target skeleton, and since the second model is combined to the plurality of first models, one vertex in the second model may correspond to one vertex in one first model, or may be combined to two or more vertices in the first model, that is, one vertex in the second model may correspond to two or more vertices in the first model, based on which the vertex in the second model may be bound to one first target skeleton, or may be bound to a plurality of first target bones. Thus, a second target bone to which vertices in the first model corresponding to vertices in the second model are bound may be determined based on the first target bone to which vertices in the second model are bound.
For example, assume that the target skeleton bound by the vertex a in the second model includes a first target skeleton X and a first target skeleton Y, where the first target skeleton X corresponds to the first model M and the second target skeleton Y corresponds to the second model N, where the vertex a is obtained by merging the vertex a1 in the first model M and the vertex a2 in the second model N, based on which the first target skeleton X may be determined as a second target skeleton bound by the vertex a1 in the first model M and the first target skeleton Y may be determined as a second target skeleton bound by the vertex a2 in the first model N.
As an optional implementation manner, step S203, determining the first weight information of the vertex of the second model includes: and determining first weight information matched with the crushing animation of the second model, wherein the first weight information is used for controlling each first target bone to drive the vertex of the second model to move so as to enable at least one first model corresponding to the vertex of the second model to generate the bone animation.
In this embodiment, since the second model is obtained by combining a plurality of first models, the plurality of first models are crushing sub-models of the second model, based on which first weight information matched with the crushing animation of the second model can be determined, where the first weight information is used to control each first target bone to drive the vertex of the second model to move, so that at least one first model corresponding to the vertex of the second model generates the bone animation.
For example, when a plurality of first models are combined to obtain a second model, the bone bound by the vertex of the first model combined to the vertex of the second model may be regarded as the first target bone bound by the vertex in the second model, and each vertex in the second model is affected by all the first target bones bound thereto. Wherein if the vertex in the second model is merged from a vertex in a first model, in which case the vertex in the second model is affected only by a first target bone; if a vertex in the second model is merged from two or more vertices in the first model, the vertex in the second model may be affected by a plurality of first target bones in this case. All first target bone effects on vertices in the second model may be represented by first weight information that may be used to control movement of vertices of each first target bone driving the second model.
For example, it is assumed that a certain vertex in the second model is affected by two first target bones, where the weight value of the vertex affected by the first target bone is 0.4, and the weight value of the vertex affected by the second first target bone is 0.6, based on this, it is possible to control each first target bone to drive the vertex of the second model to move according to the weight values of all the first target bones affected by the vertex a, so that at least one first model corresponding to the vertex of the second model generates a bone animation.
As an optional implementation manner, step S204, based on the first weight information, determines second weight information of the vertex of at least one first model, including: and adjusting the first weight information based on the vertex of at least one first model corresponding to the vertex of the second model to obtain second weight information of the vertex of at least one first model.
In this embodiment, after determining the first weight information of the vertex in the second model, the second weight information of the vertex of the at least one first model may be obtained based on the vertex of the at least one first model corresponding to the vertex of the second model, and the first weight information may be adjusted.
For example, the first weight information of the vertex of the second model may include one or more weight values, where the weight values are used to represent the degree of influence of the vertex in the second model by the first target bone bound thereto, and the vertex in the second model may be obtained by merging one or more vertices in the first model, where a mapping relationship exists between the vertex in the first model and the first target bone in the second model, based on which the vertex of the at least one first model corresponding to the vertex of the second model may be determined first, and then, based on the mapping relationship between the vertex in the first model and the first target bone in the second model, the first target bone corresponding to the vertex in the first model is determined, and the weight value of the influence of the first target bone bound by the vertex of the second model in the first weight information on driving the movement of the vertex is used as the second weight information of the vertex in the first model.
As an optional implementation manner, step S202, merging the plurality of first models into the second model includes: baking the first models respectively; and merging the baked first models to obtain a second model.
In this embodiment, in the process of merging the plurality of first models, baking operations may be performed on the plurality of first models, and merging the plurality of baked first models to obtain the second model.
For example, baking the plurality of first models is to render a map of the models based on the model application scene, and the baked models have more detailed information, so that the plurality of baked first models are combined in the later stage, the obtained second models are more complete, and in the process of combining the models in the later stage, the models do not need to be adjusted again, so that the computing resources are greatly saved.
As an alternative embodiment, the animation generation method of the model further includes: obtaining an original animation, wherein the original animation is used for displaying a process of shredding the virtual object represented by the second model; and determining a plurality of fragment virtual objects in the original animation as a plurality of first models, wherein the plurality of fragment virtual objects are used for forming virtual objects, and each first model is provided with a key animation frame of each corresponding fragment virtual object.
In this embodiment, the original animation of the second model is used to demonstrate a process of breaking up the virtual object represented by the second model, where the original animation includes a plurality of fragmented virtual objects, and the plurality of fragmented virtual objects may be determined as a plurality of first models, that is, the plurality of first models are broken models of the second model, where each fragmented virtual object is used to construct a virtual object, and each first model is fabricated with a key animation frame of each corresponding fragmented virtual object.
For example, when a virtual object is broken up, a plurality of fragmented virtual objects may be generated that combine to obtain the virtual object, wherein the virtual object may be represented by a second model and the fragmented virtual object may be represented by a first model.
As an alternative embodiment, the animation generation method of the model further includes: generating vertices of the second model based on at least one of the following information of vertices of the at least one first model: vertex position, vertex index, vertex order, and associated vertices of at least one vertex of the first model.
In this embodiment, since the second model is obtained by combining a plurality of first models, the vertex of each of the plurality of first models includes vertex information, wherein the vertex information of the vertex includes at least: the method comprises the steps of vertex positions, vertex indexes, vertex sequences and associated vertexes of at least one vertex of a first model, wherein the vertex positions are used for representing positions of the vertexes in a second model, the vertex indexes are used for searching the vertexes in the second model, the vertex sequences are used for representing vertex serial numbers of the vertexes in the second model, and the associated vertexes of the at least one first model are used for combining in the first model to obtain vertexes of the same vertex in the second model. Based on this, vertices of the second model may be generated based on vertex information of vertices of the at least one first model.
In one possible implementation, another method for generating an animation of a model is provided in the embodiments of the present application. FIG. 3 is a flow chart of a method of animation generation of a model according to one embodiment of the present application, as shown in FIG. 3, the method may include the steps of:
step S301, displaying a plurality of first models on a graphical user interface, wherein the plurality of first models are used for generating crushing animation of the second model.
In the above step S301, the plurality of first models are crush sub-models of the second model, and after the second model is acquired, the plurality of first models for generating crush animations of the second model may be displayed on the graphical user interface.
For example, the step S301 may be performed by animation software, where the animation software may be 3d Max software, and the 3d Max software includes a graphical user interface, and the 3d Max software may display the plurality of first models on the graphical user interface in response to acquiring the plurality of first models.
Step S302, in response to the animation operation on the graphical user interface, invoking the target plug-in to generate a skeleton animation of each first model.
In step S302 described above, when in response to an animation operation of the graphical user interface, the target plug-in may be invoked to generate a skeletal animation for each first model. The second model is obtained by combining a plurality of first models, the vertex of at least one first model is used for determining the vertex of the second model, first weight information of the vertex of the second model is used for generating second weight information of the vertex of at least one first model, the first weight information is used for representing the influence degree of each first target bone in at least one first target bone bound by the vertex of the second model on the movement of the vertex driving the second model, the second weight information is used for representing the influence degree of each second target bone in at least one second target bone bound by the vertex of each corresponding first model on the movement of the vertex driving the first model, and the bone animation of each first model is obtained by controlling the movement of each corresponding first model based on the second weight information.
For example, the 3d Max software includes a target plug-in, and the graphical user interface of the 3d Max software may include an animation control, when the 3d Max software responds to a selection operation of the animation control by a user, that is, responds to an animation operation acting on the graphical user interface, based on this, the 3d Max software may call the target plug-in to build a skeleton for each first model and record a mapping relationship between each first model and its corresponding skeleton, and then the target plug-in may combine the plurality of first models to obtain a second model, so as to determine first weight information of vertices of the second model, where the first weight information is used to represent an influence degree of each first target skeleton, which is bound to vertices of the second model, on motion of vertices driving the second model. After determining the first weight information of the vertex of the second model, the second weight information of the vertex of at least one first model may be determined based on the first weight information, where the second weight information is used to represent at least one second target bone to which the vertex of each first model is bound, and the degree of influence on the motion of the vertex driving the first model, and further, the motion of each corresponding first model may be controlled based on the second weight information, so as to obtain a bone animation of each first model. The method for determining the first weight information of the vertex of the second model and the second weight information of the vertex of the first model may refer to the methods described in the foregoing step S203 and step S204, and will not be described herein.
Step S303, displaying a broken animation of a second model formed by skeletal animations of a plurality of first models on a graphical user interface.
In the above step S303, in generating the skeletal animation of each first model, the crushed animations of the second model composed of the skeletal animations of the plurality of first models may be presented on the graphical user interface.
For example, after generating the skeletal animation of each first model, the 3d Max software may simultaneously display the skeletal animations of multiple first models on the graphical user interface to form a crushed animation of the second model.
In at least some embodiments of the present application, a plurality of first models may be displayed on a graphical user interface, wherein the plurality of first models are used to generate a crush animation of a second model; when the animation production operation acting on the graphical user interface is responded, the target plug-in can be called to generate the skeleton animation of each first model, and then the broken animation of the second model formed by the skeleton animations of the plurality of first models is displayed on the graphical user interface, namely, in the embodiment of the application, the skeleton animations of the plurality of first models can be generated through the target plug-in, and can form the broken animation of the second model, multiple skeleton binding is not needed, so that the computing resources are saved greatly, the computing efficiency is improved, the technical effect of improving the animation production efficiency of the models is achieved, and the technical problem of low animation production efficiency of the models is solved.
The technical solution of the embodiment of the present invention is further described by way of example in conjunction with the preferred embodiments.
In the related art, when generating a crush animation of a model, offline cutting is generally performed on the model of the crush animation to be generated based on a physical engine, then, a plurality of sub-models obtained by cutting are combined into a whole to obtain a complete model, the complete model comprises a plurality of sub-models, bones are erected in the plurality of sub-models, and then, the bones are bound, and finally, the bone animation is manufactured. However, after the multiple sub-models are combined, the center points of the sub-models included in the combined complete model are difficult to determine, which in turn results in difficulty in determining the center point of each sub-model when setting up bones in the sub-models, resulting in inaccurate bone setting up positions. In addition, in the process of merging a plurality of sub-models, there is a case where edges and vertices of the sub-models are merged and then overlapped, and based on this, when binding the vertices of the sub-models with bones erected by the sub-models, there is a problem that selection is difficult, and thus there is a technical problem that animation generation efficiency of the models is low.
In the related art, when a broken animation of a model is generated, after offline cutting is performed on the model to be generated to obtain a plurality of sub-models, bone binding is performed on the plurality of sub-models separately, animation is manufactured for each sub-model, and then sub-model merging is performed to obtain a complete model, so that the animation effect of each sub-model, such as the complete model, is achieved when the model is broken, but because one model only corresponds to one set of bone, in the process of merging the plurality of sub-models into one complete model, the bones of different sub-models possibly collide with each other, only one set of bone is reserved, and other bones are discarded, so that in the process of merging the plurality of sub-models into the complete model, multiple binding is needed, the combined complete model displays the bone animation of each sub-model in the process of model breaking, however, the multiple binding can greatly increase the calculation amount, and the technical problem of low manufacturing efficiency of the broken animation of the model is also existed.
However, the embodiment of the application provides an animation generation method of a model, by acquiring a plurality of first models, where the plurality of first models are sub-models corresponding to a second model, and the plurality of first models are used for generating a crushing animation of the second model, after the plurality of first models are acquired, the plurality of first models can be combined based on position information of the plurality of first models to obtain the second model, after the second model is obtained, first weight information of vertices of the second model can be determined, and the first weight information is used for representing an influence degree of motion of vertices of the second model on each first target bone in at least one first target bone to which the vertices of the second model are bound; and then, determining second weight information of the vertexes of at least one first model based on the first weight information, wherein the second weight information is used for representing the influence degree of each second target skeleton in at least one second target skeleton bound to the vertexes of each corresponding first model on the operation of driving the vertexes of the first model, and then controlling the corresponding first models to move based on the second weight information to obtain the skeleton animation of each first model, wherein the skeleton animation of a plurality of first models forms the breaking animation of the second model. In the process, a plurality of first models are combined into a second model, then, the weight information of the vertexes of the second model is determined, the weight information of each first model is generated based on the weight information of the second model, the first sub-model is controlled to move based on the first weight information, multiple times of skeleton binding is not needed, calculation resources are saved greatly, calculation efficiency is improved, the technical effect of improving the animation production efficiency of the models is achieved, and the technical problem of low animation production efficiency of the models is solved.
The method for animating a model according to an embodiment of the present application is further described below. FIG. 4 is a flowchart of a method for animating a model according to an embodiment of the present application, as shown in FIG. 4, the method comprising the steps of:
step S401, creating a corresponding skeleton for the crushing model.
In the step S401, the 3d Max three-dimensional software includes a self-made plug-in, and when the 3d Max software obtains the broken model of the complete model, the self-made plug-in can be called to bind the skeleton for each broken model, and the mapping relationship between the broken model and the skeleton is recorded.
In the embodiment, the self-made plug-in can be utilized for binding the bones of the crushing model, manual binding is not needed, the technical problems of inaccurate bone binding position and difficult vertex selection are solved, and the bone binding efficiency is improved.
Fig. 5 is a schematic illustration of a stalagmite model according to an embodiment of the present application, as shown in fig. 5, which is a complete model that can be crushed into multiple crushing models.
Fig. 6 is a schematic view of a stalagmite crushing model according to an embodiment of the present application, as shown in fig. 6, which can be crushed into a plurality of crushing models, each of which is a separate sub-model, the crushing models having irregular shape distribution.
And step S402, carrying out grid collapse on the broken model to obtain a complete model.
In the step S402, a self-made plug-in 3d Max software may be used to collapse the grids of the multiple crush models, so as to obtain a complete model.
Optionally, since each crush model is bound with a bone, and the vertex of each crush model is bound with the bone corresponding to the crush model, after the crush models are combined into the complete model, the bones of the plurality of crush models can be bound to obtain the bone corresponding to the complete model.
For example, since the vertex of each crushing model is bound to the bone corresponding to the crushing model, the motion of the bone may drive the motion of the vertex, and after the crushing models are combined into the complete model, since the vertices of some crushing models may overlap after being combined, based on this, one vertex in the combined complete model may be bound to multiple bones, based on this, weight information of each vertex in the complete model may be determined, where the weight information is used to indicate the degree of influence of the bone bound by the vertex on the motion of the driving vertex.
Step S403, skinning is carried out on the complete model, and the skinning weight of the vertex is restored.
In the step S403, after the complete model is obtained and the weight information of the vertex of the complete model is determined, the complete model may be covered, that is, the complete model and the skeleton corresponding to the complete model are bound.
For example, because the mapping relationship exists between the vertex of the crush model and the vertex of the complete model obtained after collapse, based on this, the weight information of the vertex of the crush model before collapse can be determined according to the weight information of the vertex after collapse, and then the determined weight information of the vertex is determined as the skin weight of the vertex.
Alternatively, in the embodiment of the present application, when the breaking animation of the model is made, the breaking animation is generally made based on the key animation frames of the breaking virtual object, and fig. 7 is a schematic diagram of a key animation frame of the breaking virtual object according to the embodiment of the present application.
Optionally, before collapsing the multiple crushing models into the complete model, a bone animation baking operation may be further performed on the multiple crushing models to optimize the bone animation of the crushing models, where a homemade plug-in of the 3d Max software includes a baking option, and the baking option includes two functional controls, where one functional control is "all", and the other functional control is "select", and based on the "all" functional controls, the bone animation of each crushing sub-model in the complete model may be baked at the same time, and based on the "select" functional control, the bone animation of the crushing model that is desired to be baked may be selected from the complete sub-model to be baked.
FIG. 8 is a schematic illustration of a baked skeletal animation, as shown in FIG. 8, in which all of the crushed models of the complete model may be baked simultaneously when the "all" control is selected in the baking option, in accordance with an embodiment of the present application.
FIG. 9 is a schematic illustration of a baked skeletal animation, as shown in FIG. 9, that may select a desired baked fragmentation model from the complete model for baking when the "select" control is selected in the baking option, in accordance with an embodiment of the present application.
FIG. 10 is a schematic illustration of a baked skeletal animation, as shown in FIG. 10, after baking of the home-made insert is completed, a baked stalagmite model may be displayed on the interface, according to an embodiment of the present application.
Alternatively, the 3d Max software interface may continue to play the animation of each frame break during the model break. FIG. 11 is a schematic illustration of a skeletal animation of a fragmentation model in accordance with an embodiment of the present application. Fig. 12 is a schematic diagram of a bone animation of a crushing model according to an embodiment of the present application, wherein fig. 11 is an animation of the crushing model displayed on an initial crushing interface, the crushing model is larger, and fig. 12 is an animation of the crushing model displayed on a later crushing interface, the crushing model is smaller. Based on the crushing models of fig. 11 and 12, the crushing model is larger in the early stage of crushing and smaller in the later stage of crushing.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method described in the embodiments of the present application.
The embodiment also provides an animation generating device of the model, which is used for realizing the embodiment and the preferred implementation, and the description is omitted. As used below, the terms "unit," "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
Fig. 13 is a schematic diagram of an animation generation device of a model according to an embodiment of the present application, and as shown in fig. 13, an animation generation device 1300 of the model includes: an acquisition unit 1301, a first combining unit 1302, a first determining unit 1303, a second determining unit 1304, a control unit 1305.
An obtaining unit 1301 is configured to obtain a plurality of first models, where the plurality of first models are used to generate a crush animation of the second model.
The first merging unit 1302 is configured to merge the plurality of first models into a second model, where a vertex of at least one first model is used to determine a vertex of the second model.
The first determining unit 1303 is configured to determine first weight information of vertices of the second model, where the first weight information is used to represent a degree of influence of each first target bone of at least one first target bone to which the vertices of the second model are bound on motion of the vertices driving the second model.
The second determining unit 1304 is configured to determine second weight information of vertices of at least one first model based on the first weight information, where the second weight information is used to represent a degree of influence of each of at least one second target bones to which the vertices of the corresponding first model are bound on motion of vertices driving the first model.
And a control unit 1305, configured to control movement of each corresponding first model based on the second weight information, so as to obtain a skeleton animation of each first model, where the skeleton animations of the plurality of first models form a broken animation of the second model.
Optionally, the apparatus 1300 further includes: the binding unit is used for binding at least one bone to each first model to obtain a plurality of bones of a plurality of first models; a second merging unit for merging the plurality of bones into a skeleton of a second model; and the third determining unit is used for determining at least one first target skeleton to which the vertex of the second model is bound in the skeleton of the second model.
Optionally, the second merging unit is further configured to establish a level relationship between the multiple bones based on the vertex of each first model, so as to obtain a skeleton of the second model.
Optionally, the apparatus 1300 further includes: a binding unit for determining at least one second target bone to which the vertex of each first model is bound in the plurality of bones.
Optionally, the first determining unit 1303 includes: the determining module is used for determining first weight information matched with the crushing animation of the second model, wherein the first weight information is used for controlling each first target bone to drive the vertex of the second model to move so as to enable at least one first model corresponding to the vertex of the second model to generate bone animation.
Alternatively, the second determination unit 1304 includes: the adjusting module is used for adjusting the first weight information based on the vertex of at least one first model corresponding to the vertex of the second model to obtain second weight information of the vertex of the at least one first model.
Optionally, the first merging unit 1302 includes: a baking module for performing baking operations on the plurality of first molds, respectively; and the merging module is used for merging the baked first models to obtain a second model.
Optionally, the apparatus 1300 is further configured to: obtaining an original animation, wherein the original animation is used for displaying a process of shredding the virtual object represented by the second model; and determining a plurality of fragment virtual objects in the original animation as a plurality of first models, wherein the plurality of fragment virtual objects are used for forming virtual objects, and each first model is provided with a key animation frame of each corresponding fragment virtual object.
Optionally, the apparatus 1300 further includes: a generating unit, configured to generate a vertex of the second model based on at least one of the following information of the vertex of the at least one first model: vertex position, vertex index, vertex order, and associated vertices of at least one vertex of the first model.
In the animation generation device of the model of this embodiment, an acquisition unit 1301 for acquiring a plurality of first models for generating a crushing animation of a second model; a merging unit, configured to merge the plurality of first models into a second model, where a vertex of at least one first model is used to determine a vertex of the second model; a first determining unit configured to determine first weight information of a vertex of the second model; a second determining unit, configured to determine second weight information of the vertex of at least one first model based on the first weight information; and the control unit is used for controlling the corresponding first models to move based on the second weight information to obtain the skeleton animation of each first model, wherein the skeleton animations of the plurality of first models form the broken animation of the second model. That is, in this embodiment of the present application, the sub-models may be combined into one complete model, then, weight information of vertices of the complete model is determined, weight information of vertices of each sub-model is determined based on the weight information of the complete model, and then, each sub-model is controlled to move based on the weight information of vertices of the sub-model, so as to obtain a broken animation of the complete model.
Fig. 14 is a schematic diagram of an animation generation device of a model according to an embodiment of the present application, and as shown in fig. 14, the animation generation device 1400 of the model includes: a first display unit 1401, a calling unit 1402, and a second display unit 1403.
A first display unit 1401 for displaying a plurality of first models on the graphical user interface, wherein the plurality of first models are used to generate a crushing animation of the second model.
A calling unit 1402, configured to, in response to an animation operation applied to the graphical user interface, call the target plug-in to generate a bone animation of each first model, where the second model is obtained by merging a plurality of first models, vertices of at least one first model are used to determine vertices of the second model, first weight information of the vertices of the second model is used to generate second weight information of the vertices of at least one first model, the first weight information is used to represent a degree of influence on movement of the vertices of the second model by each first target bone in at least one first target bone to which the vertices of the second model are bound, the second weight information is used to represent a degree of influence on movement of the vertices of the corresponding each second target bone in at least one second target bone to which the vertices of the first model are bound, and the bone animation of each first model is obtained by controlling movement of the corresponding each first model based on the second weight information;
A second display unit 1403 for displaying, on the graphical user interface, a crushing animation of a second model composed of skeletal animations of the plurality of first models.
In the animation generation device of a model of this embodiment, a first display unit configured to display a plurality of first models on a graphical user interface, wherein the plurality of first models are used to generate a crushing animation of a second model; a calling unit, configured to call the target plugin to generate a skeletal animation of each first model in response to an animation operation acting on the graphical user interface; and a second display unit for displaying a crushing animation of a second model composed of skeletal animations of the plurality of first models on the graphical user interface. That is, in the embodiment of the application, the skeletal animation of each first model can be generated based on the target plug-in, multiple skeletal binding is not needed, the computing resource is saved, the animation production efficiency of the model is improved, and the technical problem of low animation production efficiency of the model is further solved.
It should be noted that each of the above units and modules may be implemented by software or hardware, and the latter may be implemented by, but not limited to: the units and the modules are all positioned in the same processor; alternatively, the units and modules are located in different processors in any combination.
Embodiments of the present application also provide a computer readable storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
Alternatively, in the present embodiment, the above-described computer-readable storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
Alternatively, in this embodiment, the above-mentioned computer-readable storage medium may be located in any one of the computer terminals in the computer terminal group in the computer network, or in any one of the mobile terminals in the mobile terminal group.
Alternatively, in the present embodiment, the above-described computer-readable storage medium may be configured to store a computer program for performing the steps of:
s1, acquiring a plurality of first models, wherein the plurality of first models are used for generating crushing animation of a second model;
s2, combining the plurality of first models into a second model, wherein the vertex of at least one first model is used for determining the vertex of the second model;
S3, determining first weight information of vertexes of the second model, wherein the first weight information is used for representing the influence degree of each first target skeleton in at least one first target skeleton bound to the vertexes of the second model on the movement of the vertexes of the second model;
s4, determining second weight information of vertexes of at least one first model based on the first weight information, wherein the second weight information is used for representing the influence degree of each second target bone in at least one second target bone bound to the corresponding vertexes of each first model on the movement of the vertexes driving the first model;
and S5, controlling the corresponding first models to move based on the second weight information to obtain skeleton animation of each first model, wherein the skeleton animation of the plurality of first models forms the broken animation of the second model.
Optionally, the above computer readable storage medium is further configured to store program code for performing the steps of: binding at least one bone to each first model to obtain a plurality of bones of a plurality of first models; combining the plurality of bones into a skeleton of a second model; in the skeleton of the second model, at least one first target skeleton to which vertices of the second model are bound is determined.
Optionally, the above computer readable storage medium is further configured to store program code for performing the steps of: and establishing a level relation among a plurality of bones based on the vertexes of each first model to obtain a skeleton of the second model.
Optionally, the above computer readable storage medium is further configured to store program code for performing the steps of: at least one second target bone to which the vertex of each first model is bound is determined in the plurality of bones.
Optionally, the above computer readable storage medium is further configured to store program code for performing the steps of: and determining first weight information matched with the crushing animation of the second model, wherein the first weight information is used for controlling each first target bone to drive the vertex of the second model to move so as to enable at least one first model corresponding to the vertex of the second model to generate the bone animation.
Optionally, the above computer readable storage medium is further configured to store program code for performing the steps of: and adjusting the first weight information based on the vertex of at least one first model corresponding to the vertex of the second model to obtain second weight information of the vertex of at least one first model.
Optionally, the above computer readable storage medium is further configured to store program code for performing the steps of: baking the first models respectively; and merging the baked first models to obtain a second model.
Optionally, the above computer readable storage medium is further configured to store program code for performing the steps of: obtaining an original animation, wherein the original animation is used for displaying a process of shredding the virtual object represented by the second model; and determining a plurality of fragment virtual objects in the original animation as a plurality of first models, wherein the plurality of fragment virtual objects are used for forming virtual objects, and each first model is provided with a key animation frame of each corresponding fragment virtual object.
Optionally, the above computer readable storage medium is further configured to store program code for performing the steps of: generating vertices of the second model based on at least one of the following information of vertices of the at least one first model: vertex position, vertex index, vertex order, and associated vertices of at least one vertex of the first model.
In the nonvolatile storage medium of this embodiment, a technical solution of an animation generation method of a model is provided. The sub-models can be combined into a complete model, then, the weight information of the vertexes of the complete model is determined, the weight information of the vertexes of each sub-model is determined based on the weight information of the complete model, and then, each sub-model is controlled to move based on the weight information of the vertexes of the sub-model, so that the broken animation of the complete model is obtained.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present application may be embodied in the form of a software product, which may be stored in a computer readable storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, and includes several instructions to cause a computing device (may be a personal computer, a server, a terminal device, or a network device, etc.) to perform the method according to the embodiments of the present application.
In an exemplary embodiment of the present application, a computer-readable storage medium stores thereon a program product capable of implementing the method described above in the present embodiment. In some possible implementations, the various aspects of the embodiments of the present application may also be implemented in the form of a program product comprising program code for causing a terminal device to carry out the steps according to the various exemplary embodiments of the present application as described in the "exemplary methods" section of the embodiments, when the program product is run on the terminal device.
A program product for implementing the above method according to an embodiment of the present application may employ a portable compact disc read-only memory (CD-ROM) and comprise program code and may be run on a terminal device, such as a personal computer. However, the program product of the embodiments of the present application is not limited thereto, and in the embodiments of the present application, the computer-readable storage medium may be any tangible medium that can contain, or store the program for use by or in connection with the instruction execution system, apparatus, or device.
Any combination of one or more computer readable media may be employed by the program product described above. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
It should be noted that the program code embodied on the computer readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
The present application also provides an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, acquiring a plurality of first models, wherein the plurality of first models are used for generating crushing animation of a second model;
s2, combining the plurality of first models into a second model, wherein the vertex of at least one first model is used for determining the vertex of the second model;
s3, determining first weight information of vertexes of the second model, wherein the first weight information is used for representing the influence degree of each first target skeleton in at least one first target skeleton bound to the vertexes of the second model on the movement of the vertexes of the second model;
S4, determining second weight information of vertexes of at least one first model based on the first weight information, wherein the second weight information is used for representing the influence degree of each second target bone in at least one second target bone bound to the corresponding vertexes of each first model on the movement of the vertexes driving the first model;
and S5, controlling the corresponding first models to move based on the second weight information to obtain skeleton animation of each first model, wherein the skeleton animation of the plurality of first models forms the broken animation of the second model.
Optionally, the above processor may be further configured to perform the following steps by a computer program: binding at least one bone to each first model to obtain a plurality of bones of a plurality of first models; combining the plurality of bones into a skeleton of a second model; in the skeleton of the second model, at least one first target skeleton to which vertices of the second model are bound is determined.
Optionally, the above processor may be further configured to perform the following steps by a computer program: and establishing a level relation among a plurality of bones based on the vertexes of each first model to obtain a skeleton of the second model.
Optionally, the above processor may be further configured to perform the following steps by a computer program: at least one second target bone to which the vertex of each first model is bound is determined in the plurality of bones.
Optionally, the above processor may be further configured to perform the following steps by a computer program: and determining first weight information matched with the crushing animation of the second model, wherein the first weight information is used for controlling each first target bone to drive the vertex of the second model to move so as to enable at least one first model corresponding to the vertex of the second model to generate the bone animation.
Optionally, the above processor may be further configured to perform the following steps by a computer program: and adjusting the first weight information based on the vertex of at least one first model corresponding to the vertex of the second model to obtain second weight information of the vertex of at least one first model.
Optionally, the above processor may be further configured to perform the following steps by a computer program: baking the first models respectively; and merging the baked first models to obtain a second model.
Optionally, the above processor may be further configured to perform the following steps by a computer program: obtaining an original animation, wherein the original animation is used for displaying a process of shredding the virtual object represented by the second model; and determining a plurality of fragment virtual objects in the original animation as a plurality of first models, wherein the plurality of fragment virtual objects are used for forming virtual objects, and each first model is provided with a key animation frame of each corresponding fragment virtual object.
Optionally, the above processor may be further configured to perform the following steps by a computer program: generating vertices of the second model based on at least one of the following information of vertices of the at least one first model: vertex position, vertex index, vertex order, and associated vertices of at least one vertex of the first model.
In the electronic device of this embodiment, a technical scheme of an animation generation method of a model is provided. The sub-models can be combined into a complete model, then, the weight information of the vertexes of the complete model is determined, the weight information of the vertexes of each sub-model is determined based on the weight information of the complete model, and then, each sub-model is controlled to move based on the weight information of the vertexes of the sub-model, so that the broken animation of the complete model is obtained.
Fig. 15 is a schematic diagram of an electronic device according to an embodiment of the present application. As shown in fig. 15, the electronic device 1500 is merely an example, and should not impose any limitation on the functionality and scope of use of the embodiments of the present application.
As shown in fig. 15, the electronic apparatus 1500 is embodied in the form of a general purpose computing device. The components of the electronic device 1500 may include, but are not limited to: the at least one processor 1510, the at least one memory 1520, a bus 1530 connecting the various system components (including the memory 1520 and the processor 1510), and a display 1540.
Therein, the above-described memory 1520 stores program codes that can be executed by the processor 1510, so that the processor 1510 performs steps according to various exemplary implementations of the present application described in the above-described method section of the present application embodiment.
The memory 1520 may include readable media in the form of volatile memory units such as Random Access Memory (RAM) 15201 and/or cache memory 15202, and may further include Read Only Memory (ROM) 15203, as well as nonvolatile memory such as one or more magnetic storage devices, flash memory, or other nonvolatile solid state memory.
In some examples, memory 1520 may also include a program/utility 15204 having a set (at least one) of program modules 15205, such program modules 15205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Memory 1520 may further include memory located remotely from processor 1510, which may be connected to electronic device 1500 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Bus 1530 may be a bus representing one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processor 1510, or a local bus using any of a variety of bus architectures.
The display 1540 may be, for example, a touch screen type Liquid Crystal Display (LCD) that may enable a user to interact with a user interface of the electronic device 1500.
Optionally, the electronic apparatus 1500 may also communicate with one or more external devices 1400 (e.g., keyboard, pointing device, bluetooth device, etc.), one or more devices that enable a user to interact with the electronic apparatus 1500, and/or any device (e.g., router, modem, etc.) that enables the electronic apparatus 1500 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 1550. Also, the electronic device 1500 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, e.g., the internet, through the network adapter 1560. As shown in fig. 15, the network adapter 1560 communicates with other modules of the electronic device 1500 over the bus 1530. It should be appreciated that although not shown in fig. 15, other hardware and/or software modules may be used in connection with electronic device 1500, which may include, but are not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The electronic device 1500 may further include: a keyboard, a cursor control device (e.g., a mouse), an input/output interface (I/O interface), a network interface, a power supply, and/or a camera.
It will be appreciated by those of ordinary skill in the art that the configuration shown in fig. 15 is merely illustrative and is not intended to limit the configuration of the electronic device described above. For example, electronic device 1500 may also include more or fewer components than shown in FIG. 15, or have a different configuration than shown in FIG. 1. The memory 1520 may be used to store a computer program and corresponding data, such as a computer program and corresponding data corresponding to an animation generation method of a model in an embodiment of the present application. The processor 1510 executes a computer program stored in the memory 1520 to perform various functional applications and data processing, i.e., to implement the animation generation method of the model described above.
The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed technology content may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, for example, may be a logic function division, and may be implemented in another manner, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application and are intended to be comprehended within the scope of the present application.

Claims (14)

1. A method for generating an animation of a model, comprising:
acquiring a plurality of first models, wherein the plurality of first models are used for generating crushing animation of a second model;
combining the plurality of first models into the second model, wherein the vertex of at least one first model is used for determining the vertex of the second model;
determining first weight information of vertexes of the second model, wherein the first weight information is used for representing the influence degree of each first target skeleton in at least one first target skeleton bound to the vertexes of the second model on the movement of the vertexes of the second model;
determining second weight information of vertexes of at least one first model based on the first weight information, wherein the second weight information is used for representing the influence degree of each second target bone in at least one second target bone to which the corresponding vertexes of each first model are bound on the movement of the vertexes driving the first model;
And controlling the corresponding first model to move based on the second weight information to obtain skeleton animation of each first model, wherein the skeleton animation of the plurality of first models forms the broken animation of the second model.
2. The method according to claim 1, wherein the method further comprises:
binding at least one bone to each first model to obtain a plurality of bones of the plurality of first models;
merging the plurality of bones into a skeleton of the second model;
in the skeleton of the second model, the at least one first target skeleton to which the vertices of the second model are bound is determined.
3. The method of claim 2, wherein merging the plurality of bones into a skeleton of the second model comprises:
and establishing a level relation among the bones based on the vertexes of each first model to obtain the bones of the second model.
4. The method according to claim 2, wherein the method further comprises:
the at least one second target bone to which the vertex of each of the first models is bound is determined in the plurality of bones.
5. The method of claim 1, wherein determining first weight information for vertices of the second model comprises:
and determining the first weight information matched with the crushing animation of the second model, wherein the first weight information is used for controlling each first target bone to drive the vertex of the second model to move so as to enable at least one first model corresponding to the vertex of the second model to generate the bone animation.
6. The method of claim 1, wherein determining second weight information for vertices of at least one of the first models based on the first weight information comprises:
and adjusting the first weight information based on at least one vertex of the first model corresponding to the vertex of the second model to obtain the second weight information of at least one vertex of the first model.
7. The method of claim 1, wherein merging the plurality of first models into the second model comprises:
baking the plurality of first models respectively;
and merging the baked first models to obtain the second model.
8. The method according to any one of claims 1 to 7, further comprising:
obtaining an original animation, wherein the original animation is used for displaying a process of breaking up the virtual object represented by the second model;
and determining a plurality of fragmented virtual objects in the original animation as a plurality of first models, wherein the plurality of fragmented virtual objects are used for forming the virtual objects, and each first model is manufactured with a key animation frame of each corresponding fragmented virtual object.
9. The method according to any one of claims 1 to 7, further comprising:
generating vertices of the second model based on at least one of the following information of at least one of the vertices of the first model: vertex position, vertex index, vertex order, and associated vertices of at least one vertex of the first model.
10. A method for generating an animation of a model, comprising:
displaying a plurality of first models on a graphical user interface, wherein the plurality of first models are used to generate a crush animation of a second model;
in response to an animation operation acting on the graphical user interface, invoking a target plug-in to generate a bone animation of each first model, wherein the second model is obtained by combining a plurality of first models, the vertex of at least one first model is used for determining the vertex of the second model, first weight information of the vertex of the second model is used for generating second weight information of the vertex of at least one first model, the first weight information is used for representing the influence degree of each first target bone in at least one first target bone to which the vertex of the second model is bound on the movement of the vertex of driving the second model, the second weight information is used for representing each second target bone in at least one second target bone to which the vertex of each corresponding first model is bound, and the bone animation of each first model is obtained by controlling the corresponding first movement based on the second weight information;
A crush animation of the second model composed of skeletal animations of the plurality of first models is presented on the graphical user interface.
11. An animation generation device for a model, comprising:
an acquisition unit configured to acquire a plurality of first models, wherein the plurality of first models are used to generate a crush animation of a second model;
a merging unit, configured to merge the plurality of first models into the second model, where at least one vertex of the first model is used to determine a vertex of the second model;
a first determining unit, configured to determine first weight information of vertices of the second model, where the first weight information is used to represent a degree of influence of each of at least one first target bone to which the vertices of the second model are bound on a motion of the vertices driving the second model;
a second determining unit, configured to determine second weight information of vertices of at least one first model based on the first weight information, where the second weight information is used to represent a degree of influence of each of at least one second target bone to which a vertex of each corresponding first model is bound on a motion of a vertex driving the first model;
And the control unit is used for controlling the corresponding first model to move based on the second weight information to obtain the skeleton animation of each first model, wherein the skeleton animations of the plurality of first models form the broken animation of the second model.
12. An animation generation device for a model, comprising:
a first display unit for displaying a plurality of first models on a graphical user interface, wherein the plurality of first models are used for generating a crushing animation of a second model;
a calling unit, configured to respond to an animation operation acting on the graphical user interface, and call a target plug-in to generate a bone animation of each first model, where the second model is obtained by combining the plurality of first models, at least one vertex of the first model is used to determine the vertex of the second model, first weight information of the vertex of the second model is used to generate second weight information of the vertex of the at least one first model, the first weight information is used to represent a degree of influence on movement of the vertex of the corresponding first model by each first target bone in at least one first target bone to which the vertex of the second model is bound, and the second weight information is used to represent a degree of influence on movement of the vertex of the corresponding first model by each second target bone in at least one second target bone to which the vertex of the corresponding first model is bound, and the bone animation of each first model is obtained by controlling movement of the corresponding first model based on the second weight information;
And a second display unit for displaying a crushing animation of the second model composed of skeletal animations of the plurality of first models on the graphical user interface.
13. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program, wherein the computer program is arranged to perform the method of any of the claims 1 to 10 when being run by a processor.
14. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to run the computer program to perform the method of any of the claims 1 to 10.
CN202310223049.2A 2023-03-03 2023-03-03 Animation generation method and device for model, storage medium and electronic device Pending CN116228941A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310223049.2A CN116228941A (en) 2023-03-03 2023-03-03 Animation generation method and device for model, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310223049.2A CN116228941A (en) 2023-03-03 2023-03-03 Animation generation method and device for model, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN116228941A true CN116228941A (en) 2023-06-06

Family

ID=86569306

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310223049.2A Pending CN116228941A (en) 2023-03-03 2023-03-03 Animation generation method and device for model, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN116228941A (en)

Similar Documents

Publication Publication Date Title
CN109395390B (en) Method and device for processing face model of game character, processor and terminal
CN110689604B (en) Personalized face model display method, device, equipment and storage medium
US20230405452A1 (en) Method for controlling game display, non-transitory computer-readable storage medium and electronic device
CN112891943B (en) Lens processing method and device and readable storage medium
JP2023524368A (en) ADAPTIVE DISPLAY METHOD AND DEVICE FOR VIRTUAL SCENE, ELECTRONIC DEVICE, AND COMPUTER PROGRAM
CN113952720A (en) Game scene rendering method and device, electronic equipment and storage medium
CN111467791A (en) Target object control method, device and system
CN112386911A (en) Navigation grid generation method and device, nonvolatile storage medium and electronic device
CN115861498A (en) Redirection method and device for motion capture
CN115375822A (en) Cloud model rendering method and device, storage medium and electronic device
KR20230129526A (en) Virtual scenario conversion methods, devices, devices, storage media and program products
WO2024124805A1 (en) Interactive animation processing method and device, storage medium and electronic device
CN115888085A (en) Game information processing method, device and storage medium
CN116228941A (en) Animation generation method and device for model, storage medium and electronic device
CN115115814A (en) Information processing method, information processing apparatus, readable storage medium, and electronic apparatus
CN111111154B (en) Modeling method and device for virtual game object, processor and electronic device
CN114742970A (en) Processing method of virtual three-dimensional model, nonvolatile storage medium and electronic device
CN109697001B (en) Interactive interface display method and device, storage medium and electronic device
CN114816629B (en) Method and device for drawing display object, storage medium and electronic device
US20220392152A1 (en) Method for operating component, electronic device, storage medium and program product
CN116090071A (en) Virtual model generation method and device and electronic device
WO2023216771A1 (en) Virtual weather interaction method and apparatus, and electronic device, computer-readable storage medium and computer program product
CN115908682A (en) Method and device for synchronizing grid data, storage medium and electronic device
CN114405000A (en) Game data synchronization method and device, computer equipment and storage medium
CN115761106A (en) Information processing method, information processing apparatus, storage medium, and electronic apparatus

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination