Bone animation updating method and device, electronic equipment and storage medium

By using mask coefficients and priority to filter animation status data in the game, the problems of low skeleton animation update efficiency and large resource utilization are solved, and more efficient animation updates and resource management are achieved.

CN119559302APending Publication Date: 2025-03-04BEIJING PIXEL SOFTWARE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411637245.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

In the game, skeleton animation updates are inefficient and resource occupies too much, especially when the character completes complex action performance, it is necessary to create a lot of additional animation resources.

Method used

By utilizing mask coefficients and priority, the target animation state data is filtered out from the animation state data for updating skeleton animations, reducing the amount of animation data required and optimizing the update logic.

Benefits of technology

It effectively improves the efficiency of skeleton animation updates, reduces the amount of animation data required by characters in the game to perform complex movements, and optimizes resource usage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119559302A_ABST
    Figure CN119559302A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a skeletal animation updating method and device, electronic equipment and a storage medium, and relates to the technical field of computer graphics. The method comprises the following steps: in response to an updating instruction of a skeletal animation, acquiring a priority corresponding to a to-be-updated skeletal and animation state data; the animation state data represents state information of the skeleton at different time points; determining target animation state data from the animation state data according to the mask coefficient and the priority of the to-be-updated skeleton; and updating the skeletal animation according to animation data corresponding to the target animation state data. According to the method, the target animation state data used for updating the skeletal animation is screened from the animation state data by utilizing the mask coefficient and the priority, so that the amount of animation data required when a role in a game completes various complex action expressions is greatly reduced, the skeletal animation updating logic is optimized, and the skeletal animation updating efficiency is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer graphics technology, and in particular to a skeletal animation updating method, device, electronic equipment and storage medium. Background Art

[0002] In the field of gaming, when updating skeletal animation, in order to complete the action performance of some characters, it is always necessary to produce a lot of corresponding animation resources. This will lead to slow updates of skeletal animation and also cause additional resource usage. Summary of the invention

[0003] In view of this, an object of the present invention is to provide a skeletal animation updating method, device, electronic device and storage medium, which can effectively improve the skeletal animation updating efficiency.

[0004] In order to achieve the above purpose, the technical solution adopted by the embodiment of the present invention is as follows:

[0005] In a first aspect, the present invention provides a skeletal animation updating method, the method comprising:

[0006] In response to the update instruction of the skeleton animation, the priorities of the skeleton to be updated and the animation state data are obtained; the animation state data represents the state information of the skeleton at different time points;

[0007] Determining target animation state data from the animation state data according to the mask coefficient of the to-be-updated bone and the priority;

[0008] The skeletal animation is updated according to the animation data corresponding to the target animation state data.

[0009] In an optional implementation, the update instruction includes an animation identifier and a plurality of animation state data; the animation state data includes a mask identifier; and obtaining the priorities corresponding to the skeleton to be updated and the animation state data includes:

[0010] Acquire corresponding original animation data according to the animation identifier;

[0011] Acquire the skeleton to be updated according to the original animation data;

[0012] The priority level corresponding to the animation state data is obtained according to the mask identifier.

[0013] In an optional implementation, the obtaining the priority corresponding to the animation state data according to the mask identifier includes:

[0014] When the mask flag indicates that the mask is not to be applied, setting the priority corresponding to the animation state data to the lowest level;

[0015] When the mask identifier indicates that a mask is to be applied, a mask template corresponding to the mask identifier is determined, and the priority in the mask template is determined as the priority corresponding to the animation state data.

[0016] In an optional implementation, determining target animation state data from the animation state data according to the mask coefficient of the to-be-updated bone and the priority includes:

[0017] Acquire the to-be-processed animation state data corresponding to the to-be-updated skeleton from the animation state data;

[0018] The target animation state data is determined from the animation state data to be processed according to a preset weight of the animation state data to be processed, a priority of the animation state data to be processed and a mask coefficient of the bone to be updated in the animation state data to be processed.

[0019] In an optional implementation, the animation state data includes a mask identifier; and obtaining the to-be-processed animation state data corresponding to the to-be-updated skeleton from the animation state data includes:

[0020] When the mask identifier indicates that the mask is not to be applied and the animation data corresponding to the animation state data contains the skeleton to be updated, determining the animation state data as the animation state data to be processed;

[0021] When the mask identifier indicates that a mask is applied and the mask template corresponding to the animation state data includes the skeleton to be updated, the animation state data is determined as the animation state data to be processed.

[0022] In an optional implementation, the determining the target animation state data from the animation state data to be processed according to a preset weight of the animation state data to be processed, a priority of the animation state data to be processed, and a mask coefficient of the bone to be updated in the animation state data to be processed comprises:

[0023] The animation state data to be processed are acquired in order of priority from low to high, and the newly acquired animation state data to be processed is used as the current state data and stored in the cache;

[0024] Determine the real-time weight of the current state data by multiplying the preset weight of the current state data by the mask coefficient of the to-be-updated bone in the current state data;

[0025] Determining the real-time weight of the cached state data according to the real-time weight of the current state data and the preset weight of the cached state data; the cached state data is the animation state data to be processed in the cache except the current state data;

[0026] When the real-time weight of the current state data is a preset value, the cached state data is deleted; when the real-time weight of the current state data is not a preset value, the real-time weights are summed in descending order of priority, and when the sum of the real-time weights is the preset value, the cached state data corresponding to the real-time weights that are not included in the summation are deleted, until all the animation state data to be processed are traversed, and the animation state data to be processed in the cache is determined as the target animation state data.

[0027] In a second aspect, the present invention provides a skeletal animation updating device, the device comprising:

[0028] A processing module, for responding to the update instruction of the skeleton animation, obtaining the priority corresponding to the skeleton to be updated and the animation state data; the animation state data represents the state information of the skeleton at different time points; and determining the target animation state data from the animation state data according to the mask coefficient of the skeleton to be updated and the priority;

[0029] The updating module is used to update the skeletal animation according to the animation data corresponding to the target animation state data.

[0030] In an optional embodiment, the update instruction includes an animation identifier and multiple animation status data; the animation status data includes a mask identifier; a processing module is used to obtain the corresponding original animation data based on the animation identifier; obtain the skeleton to be updated based on the original animation data; and obtain the priority corresponding to the animation status data based on the mask identifier.

[0031] In a third aspect, the present invention provides an electronic device, comprising a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions to implement the skeletal animation updating method described in any of the aforementioned implementations.

[0032] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the skeletal animation updating method as described in any one of the aforementioned embodiments is implemented.

[0033] Compared with the prior art, the skeletal animation updating method, device, electronic device and storage medium provided in the embodiments of the present invention utilize mask coefficients and priorities to filter target animation state data for updating skeletal animation from animation state data, thereby greatly reducing the amount of animation data required for in-game characters to perform various complex actions, optimizing the skeletal animation updating logic, and effectively improving the skeletal animation updating efficiency.

[0034] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0036] Figure 1 A schematic flow chart of a skeletal animation updating method provided by an embodiment of the present invention is shown.

[0037] Figure 2 Another schematic flow chart of a skeletal animation updating method provided by an embodiment of the present invention is shown.

[0038] Figure 3 Another schematic flow chart of a skeletal animation updating method provided by an embodiment of the present invention is shown.

[0039] Figure 4 A block diagram of a skeletal animation updating device provided by an embodiment of the present invention is shown.

[0040] Figure 5 A block diagram of an electronic device provided by an embodiment of the present invention is shown.

[0041] Icon: 100 - electronic device; 110 - memory; 120 - processor; 130 - communication module; 300 - skeletal animation updating device; 301 - processing module; 302 - updating module. DETAILED DESCRIPTION

[0042] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0043] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present invention.

[0044] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0045] Under the calculation and update framework of the existing engine animation system, it is impossible to better cope with the more complex requirements for character animation performance in the game. The inventor has found that when the existing engine animation system performs skeletal animation update calculations, it uses the main thread to collect all skeletal animations required for this update before each update, and uses the child thread to merge each skeletal animation onto the skeleton according to the corresponding weight, so that the game character can perform corresponding animation actions according to the skeleton drive.

[0046] Since the algorithm structure of skeletal animation update only merges the entire animation data, it is necessary to produce a lot of corresponding animation resources when completing the animation performance of some characters. This is mainly because when the characters in the game are performing some complex animation performances, they are mainly based on the fusion of each skeletal animation according to a certain weight. Each skeletal animation will be fully applied to the bones according to the weight, and it is impossible to focus on the animation performance of a certain part of the character for a certain animation. In this case, it is necessary to produce additional and independent animation resources for this animation performance, which will lead to low efficiency of skeletal animation update and generate additional resource consumption.

[0047] Based on this, the skeletal animation updating method and device provided in the embodiments of the present invention utilize mask coefficients and priorities to filter target animation state data for updating skeletal animation from animation state data, thereby greatly reducing the amount of animation data required for in-game characters to perform various complex actions, optimizing the skeletal animation updating logic, and effectively improving the skeletal animation updating efficiency.

[0048] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0049] See also Figure 1 , Figure 1 A schematic flow chart of a skeletal animation updating method provided by an embodiment of the present invention is shown. The method should include the following steps:

[0050] Step S10, responding to the update instruction of the skeleton animation, obtaining the priority corresponding to the skeleton to be updated and the animation state data; the animation state data represents the state information of the skeleton at different time points.

[0051] In an embodiment of the present invention, a user performs operations such as moving, jumping, attacking, etc. through a keyboard, mouse, game controller, or other input devices, and these inputs trigger the character's skeletal animation update and generate a skeletal animation update instruction. After receiving the skeletal animation update instruction, the electronic device obtains the priority corresponding to the skeletal and animation state data to be updated according to the update instruction.

[0052] Step S20, determining target animation state data from the animation state data according to the mask coefficient and priority of the bone to be updated.

[0053] Step S30, updating the skeletal animation according to the animation data corresponding to the target animation state data.

[0054] In an embodiment of the present invention, the animation state data is screened using the priority corresponding to the animation state data and the mask coefficient of each skeleton to be updated to obtain the target animation state data. The animation data corresponding to the target animation state data is obtained, and the skeleton animation is updated using the animation data corresponding to the target animation state data. The animation state data corresponds to the animation data one by one.

[0055] In summary, the skeletal animation updating method provided by the embodiment of the present invention responds to the updating instruction of the skeletal animation, obtains the priority corresponding to the skeletal and animation state data to be updated; the animation state data represents the state information of the skeletal at different time points; according to the mask coefficient and priority of the skeletal to be updated, the target animation state data is determined from the animation state data; and the skeletal animation is updated according to the animation data corresponding to the target animation state data. The present invention uses the mask coefficient and priority to filter the target animation state data for updating the skeletal animation from the animation state data, greatly reducing the amount of animation data required for the in-game characters to complete various complex action performances, optimizing the skeletal animation updating logic, and effectively improving the skeletal animation updating efficiency.

[0056] Optionally, the update instruction includes an animation identifier and multiple animation state data, and the animation state data includes a mask identifier. The following provides a possible implementation method for how to use the animation identifier and the mask identifier to obtain the bones to be updated and the priority. Figure 2 , Figure 1 The sub-steps of step S10 may include:

[0057] Step S101, acquiring corresponding original animation data according to the animation identifier.

[0058] In the embodiment of the present invention, the animation identifier corresponds to the original animation data one by one, and the animation identifier can be an animation name or an animation ID. The original animation data includes the animation data corresponding to each animation state data.

[0059] Step S102, obtaining the skeleton to be updated according to the original animation data.

[0060] Step S103, obtaining the priority corresponding to the animation state data according to the mask identifier.

[0061] In the embodiment of the present invention, the original animation data is parsed, and which bones need to be updated are determined according to the animation state and time progress to obtain the bones to be updated. The animation state data uses a mask mark to obtain the corresponding priority, and then the animation state data is processed in order of priority.

[0062] Optionally, a possible implementation method is provided below on how to obtain the priority using the mask identifier. Figure 2 The sub-steps of step S103 may include:

[0063] When the mask identifier indicates that the mask is not applied, the priority corresponding to the animation status data is set to the lowest level; when the mask identifier indicates that the mask is applied, the mask template corresponding to the mask identifier is determined, and the priority in the mask template is determined as the priority corresponding to the animation status data.

[0064] In an embodiment of the present invention, the ID index of the mask template applied to the current animation state is recorded by the mask identifier in the animation state data, which is used to apply the corresponding skeleton mask template during animation calculation. Assume that the mask identifier is 0, indicating that the mask is not applied, and the mask identifier is non-0, indicating that the mask is applied. For example, the mask identifier in the animation state data is 1, which means that the animation state data applies the mask template with ID index 1 during animation calculation.

[0065] Specifically, multiple mask templates can be pre-set for the same game character, and the mask identifier is used to uniquely identify the mask template of the same game character. The mask template includes the mask template name, priority, and bone container; the bone container includes the character bone and the corresponding mask coefficient. Among them, the mask template name is the name set by the resource creator when editing the mask template in the editor, and the priority is used for the calculation of the skeletal animation layering.

[0066] As a possible implementation method, assume that the BlendMask class is used to set the corresponding mask template for the character's skeleton tree. The character's action performance is driven by its bones. The essence of animation performance is to modify the position, rotation and other parameters of the character's entire body or part of the skeleton to drive the character to achieve the purpose.

[0067] Therefore, the BlendMask class provides a class BoneMaskMap to record the mask coefficients of the character's entire body bones. BoneMaskMap contains name, priority, and mBoneMaskMap. Among them, name is the name of the mask template; priority is the priority of the mask template; mBoneMaskMap is a bone container, which records the mask coefficients of the character's entire body bones in the form of key-value. The key value is the character's bone index, and the value value is the occlusion coefficient of the bone corresponding to the bone index.

[0068] A set of pointers to the BoneMaskMap class is recorded in the BlendMask class to store multiple mask templates. The pointers to the BoneMaskMap class of the mask template are saved in the occlusion container in the form of key-value. The key value is the occlusion identifier of the occlusion template, and the value is the pointer to the BoneMaskMap class of the occlusion template.

[0069] It should be noted that, in addition to using BlendMask to manage the occlusion template, the occlusion template may also be managed in a list, a linked list, or the like, which is not limited in the present invention.

[0070] Optionally, the following provides a possible implementation method for how to filter the target animation state data involved in animation calculation. Figure 2 , Figure 1 The sub-steps of step S20 may include:

[0071] Step S201, obtaining the to-be-processed animation state data corresponding to the to-be-updated skeleton from the animation state data.

[0072] As a possible implementation, after obtaining the priorities corresponding to all animation state data, the animation state data can be sorted in order from low to high priority. In this way, the animation state data to be processed corresponding to the skeleton to be updated follows the order from low to high priority.

[0073] As another possible implementation, after obtaining the priorities corresponding to all animation state data, no sorting is performed first. After determining the animation state data to be processed for each skeleton to be updated, the animation state data to be processed are sorted in order from low to high priority. The present invention is not limited to this.

[0074] Step S202, determining target animation state data from the animation state data to be processed according to the preset weight of the animation state data to be processed, the priority of the animation state data to be processed and the mask coefficient of the bone to be updated in the animation state data to be processed.

[0075] In an embodiment of the present invention, for each bone to be updated, the animation state data to be processed corresponding to the bone to be updated is determined from the animation state data, and the target animation state data is obtained by filtering from the animation state data to be processed according to the priority of the animation state data to be processed and in combination with the preset weight and mask coefficient of the animation state data to be processed.

[0076] Optionally, the animation state data includes a mask identifier. The following provides a possible implementation method for obtaining the animation state data to be processed corresponding to the bone to be updated. Figure 3 , Figure 2 The sub-steps of step S201 may include:

[0077] Step S2011, when the mask flag indicates that the mask is not to be applied and the animation data corresponding to the animation state data contains bones to be updated, the animation state data is determined as animation state data to be processed.

[0078] Step S2012: when the mask identifier indicates that a mask is applied and the mask template corresponding to the animation state data contains bones to be updated, the animation state data is determined as animation state data to be processed.

[0079] In the embodiment of the present invention, for each bone to be updated, the first animation state data is obtained, and when the mask mark in the animation state data indicates that the mask is not applied, the animation data corresponding to the animation state data is obtained, and if the animation data contains the bone to be updated, the animation state data is determined as the animation state data to be processed, and the next animation state data is obtained. If the animation data does not contain the bone to be updated, the next animation state data is obtained.

[0080] When the mask indicator in the animation state data indicates that a mask is applied, the mask template corresponding to the animation state data is obtained. If the mask template records the mask coefficient of the bone to be updated, the animation state data is determined as the animation state data to be processed, and the next animation state data is obtained. If the mask template does not record the mask coefficient of the bone to be updated, the next animation state data is obtained until all animation state data are traversed.

[0081] Optionally, the animation state data includes a mask identifier. The following is a possible implementation method for reducing the amount of animation state data to be processed in the cache. Figure 3 , Figure 2 The sub-steps of step S202 may include:

[0082] Step S2021, obtaining the animation state data to be processed in order from low to high priority, taking the newly obtained animation state data to be processed as the current state data and saving it in the cache.

[0083] In the embodiment of the present invention, for each skeleton to be updated, the currently newly retrieved animation state data to be processed is determined as the current state data, and the real-time weight of each animation state data to be processed in the cache is calculated based on the current state data.

[0084] Step S2022: The product of the preset weight of the current state data and the mask coefficient of the bone to be updated in the current state data is determined as the real-time weight of the current state data.

[0085] Step S2023, determining the real-time weight of the cached state data according to the real-time weight of the current state data and the preset weight of the cached state data; the cached state data is the animation state data to be processed in the cache except the current state data.

[0086] In the embodiment of the present invention, the difference between the preset value and the real-time weight of the current state data is calculated, and the product of the difference and the preset weight of the cached state data is determined as the real-time weight of the cached state data.

[0087] Step S2024, comparing the real-time weight of the current state data with the preset value to see if they are the same.

[0088] Specifically, if they are the same, execute step S2025; if they are different, execute step S2026.

[0089] Step S2025, delete the cached status data.

[0090] In an embodiment of the present invention, if the real-time weight of the current state data is a preset value, when updating the skeleton to be updated, the animation state data with a priority lower than the current state data will not be used, so all cached state data will be deleted.

[0091] Step S2026, summing up the real-time weights in descending order of priority, and when the sum of the real-time weights reaches a preset value, deleting the cached state data corresponding to the real-time weights that are not included in the summation.

[0092] In an embodiment of the present invention, the real-time weights corresponding to the animation state data to be processed in the cache are summed in order of priority from high to low. When the sum of the accumulated real-time weights is a preset value, the cached state data corresponding to the real-time weights that are not involved in the summation are deleted.

[0093] It should be noted that if the sum of the accumulated real-time weights is greater than the preset value, normalization will be performed.

[0094] Step S2027, determining whether all the animation state data to be processed have been traversed.

[0095] If the traversal is not completed, the process returns to step S2021 to obtain the next animation state data to be processed. If the traversal is completed, the process proceeds to step S2028.

[0096] Step S2028: determine the animation state data to be processed in the cache as the target animation state data.

[0097] In an embodiment of the present invention, each time an animation state data to be processed is obtained, steps S2021 to S2026 need to be executed to clean up the animation state data to be processed in the cache, until all the animation state data to be processed corresponding to the bones to be updated are traversed, and the remaining animation state data to be processed in the cache is determined as the target animation state data.

[0098] When there are multiple target animation state data for the bone to be updated, it means that multiple animation states simultaneously affect the same bone to be updated. The animation data corresponding to the target animation state data are weighted mixed according to the real-time weight corresponding to each target animation state data to update the bone animation.

[0099] In order to more clearly illustrate the skeletal animation updating method provided by the embodiment of the present invention, an exemplary description is given in conjunction with a skeleton of a character.

[0100] Assuming that the bone to be updated is the right thigh, the animation state data to be processed corresponding to the bone to be updated includes animation state data 1, animation state data 2, and animation state data 3.

[0101] Animation state data 1: The preset weight is 0.5, the mask flag is 1, the mask coefficient is 0.4, and the priority is 1.

[0102] Animation state data 2: The preset weight is 0.5 and the mask flag is 0, which means that no mask is applied.

[0103] Animation state data 3: preset weight is 1, mask flag is 2, mask coefficient is 1, priority is 2.

[0104] When calculating the skeletal animation update, first sort the three animation state data in order of priority from low to high, and obtain animation state data 2, animation state data 1, and animation state data 3. Here, animation state data 2 does not apply a mask, and the default priority is set to the lowest level (i.e. 0) and is processed first, followed by animation state data 1, and finally animation state data 3.

[0105] For the right thigh, firstly, the animation state data 2 is obtained, and the animation state data 2 is used as the current state data and saved in the cache. Since the animation state data 2 is the first animation state data to be processed saved in the cache, the next animation state data to be processed, that is, the animation state data 1, is obtained.

[0106] The animation state data 1 is used as the current state data and saved in the cache, and the product of the preset weight of the animation state data 1 (i.e. 0.5) and the mask coefficient (i.e. 0.4) is used as the real-time weight of the current state data (i.e. 0.2). At this time, the right thigh detects that the priority of applying the mask has changed, and the priority has changed from 0 to 1.

[0107] Calculate the difference between the preset value (i.e., 1) and the real-time weight of the current state data (i.e., 0.2), and determine the real-time weight of the cached state data (i.e., 0.4) as the product of the difference (i.e., 0.8) and the preset weight of the cached state data (i.e., the preset weight of animation state data 2, 0.5). Sum the real-time weight of animation state data 1 (i.e., 0.4) and the real-time weight of animation state data 2 (0.2). Since the sum of the real-time weights is less than the preset value, continue to obtain the next animation state data to be processed, i.e., animation state data 3.

[0108] Repeat the above steps, take animation state data 3 as the current state data, calculate the real-time weight of the current state data (i.e. 1), so the real-time weights of animation state data 1 and animation state data 2 are both 0. Since the real-time weight of animation state data 3 is the same as the preset value, animation state data 1 and animation state data 2 are deleted from the cache, that is, the low-priority animation state data is cleared. When traversing to animation state data 3, the traversal has been completed, and animation state data 3 is determined as the target animation state data.

[0109] It can be seen that the embodiment of the present invention calculates the real-time weight of each animation state data to be processed in the cache for each skeleton to be updated by using the preset weight of the newly retrieved animation state data to be processed, the mask coefficient and the preset weight of the cached state data, and clears the low-priority animation state data to be processed in the cache according to the real-time weight, which greatly reduces the amount of animation data required for the characters in the game to complete various complex actions, optimizes the skeleton animation update logic, and effectively improves the skeleton animation update efficiency.

[0110] Based on the same inventive concept, the embodiment of the present invention also provides a skeletal animation updating device, the basic principle and technical effects of which are the same as those of the above embodiment. For the sake of brief description, for parts not mentioned in this embodiment, reference may be made to the corresponding contents in the above embodiment.

[0111] See also Figure 4 , Figure 4 The block diagram of a skeletal animation updating device 300 provided by an embodiment of the present invention is shown. The skeletal animation updating device 300 comprises a processing module 301 and an updating module 302 .

[0112] Processing module 301, for responding to the update instruction of the skeleton animation, obtaining the priority corresponding to the skeleton to be updated and the animation state data; the animation state data represents the state information of the skeleton at different time points; according to the mask coefficient and priority of the skeleton to be updated, determining the target animation state data from the animation state data;

[0113] The updating module 302 is used to update the skeletal animation according to the animation data corresponding to the target animation state data.

[0114] To sum up, the skeleton updating device provided in the embodiment of the present invention uses mask coefficients and priorities to filter target animation state data for updating skeleton animation from animation state data, greatly reducing the amount of animation data required for characters in the game to complete various complex action performances, optimizing the skeleton animation update logic, and effectively improving the skeleton animation update efficiency.

[0115] Optionally, the update instruction includes an animation identifier and multiple animation status data; the animation status data includes a mask identifier; the processing module 301 is specifically used to obtain the corresponding original animation data according to the animation identifier; obtain the skeleton to be updated according to the original animation data; and obtain the priority corresponding to the animation status data according to the mask identifier.

[0116] Optionally, the processing module 301 is specifically used to set the priority corresponding to the animation status data to the lowest level when the mask identifier indicates that the mask should not be applied; when the mask identifier indicates that the mask should be applied, determine the mask template corresponding to the mask identifier, and determine the priority in the mask template as the priority corresponding to the animation status data.

[0117] Optionally, the processing module 301 is specifically used to obtain the animation state data to be processed corresponding to the bone to be updated from the animation state data; determine the target animation state data from the animation state data to be processed according to the preset weight of the animation state data to be processed, the priority of the animation state data to be processed and the mask coefficient of the bone to be updated in the animation state data to be processed.

[0118] Optionally, the animation state data includes a mask identifier; the processing module 301 is specifically used to determine the animation state data as animation state data to be processed when the mask identifier indicates that a mask is not applied and the animation data corresponding to the animation state data contains bones to be updated; when the mask identifier indicates that a mask is applied and the mask template corresponding to the animation state data contains bones to be updated, the animation state data is determined as animation state data to be processed.

[0119] Optionally, the processing module 301 is specifically used to obtain the animation state data to be processed in order from low to high priority, take the newly obtained animation state data to be processed as the current state data and save it in the cache; determine the product of the preset weight of the current state data and the mask coefficient of the bone to be updated in the current state data as the real-time weight of the current state data;

[0120] Determine the real-time weight of the cached state data according to the real-time weight of the current state data and the preset weight of the cached state data; the cached state data is the animation state data to be processed in the cache except the current state data;

[0121] When the real-time weight of the current state data is a preset value, the cached state data is deleted; when the real-time weight of the current state data is not a preset value, the real-time weights are summed in descending order of priority, and when the sum of the real-time weights is a preset value, the cached state data corresponding to the real-time weights that are not included in the summation are deleted until all the animation state data to be processed are traversed, and the animation state data to be processed in the cache is determined as the target animation state data.

[0122] See also Figure 5 , Figure 5 A block diagram of an electronic device 100 provided in an embodiment of the present invention. The electronic device 100 may be any device with a graphics processing function, such as a personal computer, a laptop computer, a server, etc. The electronic device 100 includes a memory 110, a processor 120, and a communication module 130. The memory 110, the processor 120, and the communication module 130 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.

[0123] The memory 110 is used to store programs or data. The memory 110 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc.

[0124] The processor 120 is used to read / write data or programs stored in the memory 110 and execute corresponding functions. For example, when the computer program stored in the memory 110 is executed by the processor 120, the skeletal animation updating method disclosed in the above embodiments can be implemented.

[0125] The communication module 130 is used to establish a communication connection between the electronic device 100 and other communication terminals through a network, and to send and receive data through the network.

[0126] It should be understood that Figure 5 The structure shown is only a schematic diagram of the structure of the electronic device 100. The electronic device 100 may also include Figure 5 More or fewer components as shown, or with Figure 5 Different configurations are shown. Figure 5 Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0127] The embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by the processor 120, the skeletal animation updating method disclosed in the above embodiments is implemented.

[0128] In several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0129] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.

[0130] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0131] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A skeletal animation updating method, characterized in that: The method comprises: In response to the update instruction of the skeleton animation, the priorities of the skeleton to be updated and the animation state data are obtained; the animation state data represents the state information of the skeleton at different time points; Determining target animation state data from the animation state data according to the mask coefficient of the to-be-updated bone and the priority; The skeletal animation is updated according to the animation data corresponding to the target animation state data.

2. The skeletal animation updating method according to claim 1, characterized in that: The update instruction includes an animation identifier and a plurality of animation state data; the animation state data includes a mask identifier; the obtaining of the priorities corresponding to the skeleton to be updated and the animation state data includes: Acquire corresponding original animation data according to the animation identifier; Acquire the skeleton to be updated according to the original animation data; The priority level corresponding to the animation state data is obtained according to the mask identifier.

3. The skeletal animation updating method according to claim 2, characterized in that: The obtaining the priority corresponding to the animation state data according to the mask identifier includes: When the mask flag indicates that the mask is not to be applied, setting the priority corresponding to the animation state data to the lowest level; When the mask identifier indicates that a mask is to be applied, a mask template corresponding to the mask identifier is determined, and the priority in the mask template is determined as the priority corresponding to the animation state data.

4. The skeletal animation updating method according to claim 1, characterized in that: The step of determining target animation state data from the animation state data according to the mask coefficient of the to-be-updated bone and the priority comprises: Acquire the to-be-processed animation state data corresponding to the to-be-updated skeleton from the animation state data; The target animation state data is determined from the animation state data to be processed according to a preset weight of the animation state data to be processed, a priority of the animation state data to be processed and a mask coefficient of the bone to be updated in the animation state data to be processed.

5. The skeletal animation updating method according to claim 4, characterized in that: The animation state data includes a mask identifier; and obtaining the to-be-processed animation state data corresponding to the to-be-updated skeleton from the animation state data includes: When the mask identifier indicates that the mask is not to be applied and the animation data corresponding to the animation state data contains the skeleton to be updated, determining the animation state data as the animation state data to be processed; When the mask identifier indicates that a mask is applied and the mask template corresponding to the animation state data includes the skeleton to be updated, the animation state data is determined as the animation state data to be processed.

6. The skeletal animation updating method according to claim 4, characterized in that: The step of determining the target animation state data from the animation state data to be processed according to a preset weight of the animation state data to be processed, a priority of the animation state data to be processed, and a mask coefficient of the bone to be updated in the animation state data to be processed comprises: The animation state data to be processed are acquired in order of priority from low to high, and the newly acquired animation state data to be processed is used as the current state data and stored in the cache; Determine the real-time weight of the current state data by multiplying the preset weight of the current state data by the mask coefficient of the to-be-updated bone in the current state data; Determining the real-time weight of the cached state data according to the real-time weight of the current state data and the preset weight of the cached state data; the cached state data is the animation state data to be processed in the cache except the current state data; When the real-time weight of the current state data is a preset value, the cached state data is deleted; when the real-time weight of the current state data is not a preset value, the real-time weights are summed in descending order of priority, and when the sum of the real-time weights is the preset value, the cached state data corresponding to the real-time weights that are not included in the summation are deleted, until all the animation state data to be processed are traversed, and the animation state data to be processed in the cache is determined as the target animation state data.

7. A skeletal animation updating device, characterized in that: The device comprises: A processing module, for responding to the update instruction of the skeleton animation, obtaining the priority corresponding to the skeleton to be updated and the animation state data; the animation state data represents the state information of the skeleton at different time points; and determining the target animation state data from the animation state data according to the mask coefficient of the skeleton to be updated and the priority; The updating module is used to update the skeletal animation according to the animation data corresponding to the target animation state data.

8. The skeletal animation updating device according to claim 7, characterized in that: The update instruction includes an animation identifier and multiple animation status data; the animation status data includes a mask identifier; a processing module is used to obtain the corresponding original animation data according to the animation identifier; obtain the skeleton to be updated according to the original animation data; and obtain the priority corresponding to the animation status data according to the mask identifier.

9. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions to implement the skeletal animation updating method according to any one of claims 1-6.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the skeletal animation updating method according to any one of claims 1 to 6 is implemented.