CN111161365B - Compression method and device for bone animation data - Google Patents

Compression method and device for bone animation data Download PDF

Info

Publication number
CN111161365B
CN111161365B CN201911395462.7A CN201911395462A CN111161365B CN 111161365 B CN111161365 B CN 111161365B CN 201911395462 A CN201911395462 A CN 201911395462A CN 111161365 B CN111161365 B CN 111161365B
Authority
CN
China
Prior art keywords
bone
data
skeleton
scaling
node
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.)
Active
Application number
CN201911395462.7A
Other languages
Chinese (zh)
Other versions
CN111161365A (en
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.)
Zhuhai Kingsoft Digital Network Technology Co Ltd
Original Assignee
Zhuhai Kingsoft Digital Network Technology 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 Zhuhai Kingsoft Digital Network Technology Co Ltd filed Critical Zhuhai Kingsoft Digital Network Technology Co Ltd
Priority to CN201911395462.7A priority Critical patent/CN111161365B/en
Publication of CN111161365A publication Critical patent/CN111161365A/en
Application granted granted Critical
Publication of CN111161365B publication Critical patent/CN111161365B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • 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

Abstract

The application provides a compression method and device of bone animation data, wherein the method comprises the following steps: acquiring skeleton animation data of the virtual object, and acquiring skeleton displacement data, skeleton rotation data and skeleton scaling data corresponding to each key frame of each skeleton node of the virtual object from the skeleton animation data; constructing a first storage table corresponding to each key frame, and storing skeleton rotation data corresponding to each skeleton node of the virtual object in each key frame in the first storage table; and constructing a second storage table corresponding to each key frame, and storing the skeleton identity mark corresponding to at least one skeleton node subjected to displacement and/or scaling and skeleton displacement data and/or skeleton scaling data in the second storage table.

Description

Compression method and device for bone animation data
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a method and apparatus for compressing skeletal animation data, a computing device, and a computer readable storage medium.
Background
The bone animation divides the three-dimensional model into a bone topology and a skin, the bone topology is composed of root bones and mutually connected sub-bones, the bones used as father nodes can influence the bones of all the sub-nodes during movement, and various models of the bone topology can be obtained through different transformation combinations on each bone. If key frames are defined, i.e. a specific transformation of each bone in the bone at a certain point in time, a smooth transition can be inserted between the key frames, thus moving the bone, and therefore the key frame data is critical for the storage and reading of bone animations.
The prior art includes key frame data for any bone topology to represent the displacement, rotation and scaling of the bone nodes transformed at each key frame when processing bone animation data, however, when processing large bone animation files, the data required to be stored and read is huge, thus reducing the processing speed of the computing system.
Disclosure of Invention
In view of the foregoing, embodiments of the present application provide a method, apparatus, computing device and computer-readable storage medium for compressing bone animation data, so as to solve the technical drawbacks in the prior art.
According to a first aspect of embodiments of the present specification, there is provided a compression method of skeletal animation data, comprising:
acquiring skeleton animation data of the virtual object, and acquiring skeleton key frame data and skeleton topology data corresponding to each key frame of each skeleton node of the virtual object from the skeleton animation data, wherein the skeleton key frame data comprises skeleton displacement data, skeleton rotation data and skeleton scaling data;
constructing a first storage table corresponding to each key frame, and storing skeleton rotation data corresponding to each skeleton node of the virtual object in each key frame in the first storage table;
and constructing a second storage table corresponding to each key frame, and storing the skeleton identity mark corresponding to at least one skeleton node subjected to displacement and/or scaling and skeleton displacement data and/or skeleton scaling data in the second storage table.
According to a second aspect of embodiments of the present specification, there is provided a compression method apparatus for bone animation data, including:
the data acquisition module is configured to acquire skeleton animation data of the virtual object, and acquire skeleton key frame data and skeleton topology data corresponding to each key frame of each skeleton node of the virtual object from the skeleton animation data, wherein the skeleton key frame data comprises skeleton displacement data, skeleton rotation data and skeleton scaling data;
the first table module is configured to construct a first storage table corresponding to each key frame, and store bone rotation data corresponding to each bone node of the virtual object in each key frame in the first storage table;
and the second table module is configured to construct a second storage table corresponding to each key frame, and store the bone identification corresponding to at least one of the bone nodes subjected to displacement and/or scaling and bone displacement data and/or bone scaling data in the second storage table.
According to a third aspect of embodiments of the present specification, there is provided a computing device comprising a memory, a processor and computer instructions stored on the memory and executable on the processor, the processor executing the instructions to implement the steps of the method of compressing skeletal animation data.
According to a fourth aspect of embodiments of the present specification, there is provided a computer readable storage medium storing computer instructions which, when executed by a processor, implement the steps of a method of compressing skeletal animation data.
According to the method, the skeleton rotation data corresponding to each skeleton node in each key frame are independent through the first storage table, only the skeleton displacement data and/or the skeleton scaling data corresponding to the skeleton nodes subjected to displacement and/or scaling are stored by utilizing the second storage table, and the corresponding skeleton identity marks are reserved.
Drawings
FIG. 1 is a block diagram of a computing device provided by an embodiment of the present application;
FIG. 2 is a flow chart of a method for compressing skeletal animation data provided in an embodiment of the present application;
FIG. 3 is another flow chart of a method for compressing skeletal animation data provided in an embodiment of the present application;
FIG. 4 is another flow chart of a method for compressing skeletal animation data provided in an embodiment of the present application;
FIG. 5 is another flow chart of a method for compressing skeletal animation data provided in an embodiment of the present application;
fig. 6 is a schematic structural diagram of a device for compressing skeletal animation data according to an embodiment of the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is, however, susceptible of embodiment in many other ways than those herein described and similar generalizations can be made by those skilled in the art without departing from the spirit of the application and the application is therefore not limited to the specific embodiments disclosed below.
The terminology used in the one or more embodiments of the specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of the specification. As used in this specification, one or more embodiments and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present specification refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that, although the terms first, second, etc. may be used in one or more embodiments of this specification to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first may also be referred to as a second, and similarly, a second may also be referred to as a first, without departing from the scope of one or more embodiments of the present description. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
First, terms related to one or more embodiments of the present invention will be explained.
Bone animation: the traditional animation generally carries out displacement, rotation, scaling and deformation on an object, then records the information of a key frame, carries out displacement, rotation, scaling and deformation on the object according to the time of the key frame when playing, and carries out interpolation operation between the key frame and the key frame. The feature of skeletal animation is that the object itself that needs to be animated does not record displacement, rotation, scaling, deformation information, but rather the "skeletal" object that passed the third party records the animation information, and then the object itself only records the weights that are affected by the skeletal object. When playing, the animation is reproduced through the key frames of the bone objects and the weights recorded by the object objects.
Key frame: bone transformation information is recorded in a manner of time, displacement rotation scaling value and transition interpolation.
Bone topology: i.e. to describe the skeleton structure of the three-dimensional virtual model.
In the present application, a method, apparatus, computing device, and computer-readable storage medium for compressing bone animation data are provided, and are described in detail in the following embodiments.
Fig. 1 shows a block diagram of a computing device 100 according to an embodiment of the present description. The components of the computing device 100 include, but are not limited to, a memory 110 and a processor 120. Processor 120 is coupled to memory 110 via bus 130 and database 150 is used to store data.
Computing device 100 also includes access device 140, access device 140 enabling computing device 100 to communicate via one or more networks 160. Examples of such networks include the Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the internet. The access device 140 may include one or more of any type of network interface, wired or wireless (e.g., a Network Interface Card (NIC)), such as an IEEE802.11 Wireless Local Area Network (WLAN) wireless interface, a worldwide interoperability for microwave access (Wi-MAX) interface, an ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a bluetooth interface, a Near Field Communication (NFC) interface, and so forth.
In one embodiment of the present description, the above-described components of computing device 100, as well as other components not shown in FIG. 1, may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device shown in FIG. 1 is for exemplary purposes only and is not intended to limit the scope of the present description. Those skilled in the art may add or replace other components as desired.
Computing device 100 may be any type of stationary or mobile computing device including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), mobile phone (e.g., smart phone), wearable computing device (e.g., smart watch, smart glasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. Computing device 100 may also be a mobile or stationary server.
Wherein the processor 120 may perform the steps of the method shown in fig. 2. Fig. 2 is a schematic flow chart illustrating a method of compressing skeletal animation data, including steps 202 through 206, in accordance with an embodiment of the present application.
Step 202: and acquiring skeleton animation data of the virtual object, and acquiring skeleton key frame data and skeleton topology data corresponding to each key frame of each skeleton node of the virtual object from the skeleton animation data.
In an embodiment of the present application, a system of the present application is capable of reading an animation file corresponding to a virtual object as a three-dimensional model, obtaining bone animation data of the virtual object, and obtaining bone keyframe data and bone topology data corresponding to each keyframe at each bone node of the virtual object from the bone animation data, where the bone keyframe data includes bone displacement data (transformation), bone rotation data (rotation), and bone scaling data (scale).
Step 204: and constructing a first storage table corresponding to each key frame, and storing the bone rotation data corresponding to each bone node of the virtual object in each key frame in the first storage table.
Step 206: and constructing a second storage table corresponding to each key frame, and storing the skeleton identity mark corresponding to at least one skeleton node subjected to displacement and/or scaling and skeleton displacement data and/or skeleton scaling data in the second storage table.
In the embodiment of the application, the system of the application uses two storage tables to store bone animation data, the first storage table stores bone rotation data corresponding to each bone node in each key frame, the second storage table stores only bone displacement data and/or bone scaling data corresponding to the bone node subjected to displacement and/or scaling and retains corresponding bone Identification (ID), the bone Identification (ID) refers to serial numbers or position information of the bone node subjected to displacement and/or scaling in a framework mechanism, as bone displacement data and/or bone scaling data of most bone nodes in the virtual object in each key frame are the same, only bone rotation data changes in each key frame, therefore, the application uses the first storage table to independently store bone rotation data corresponding to each bone node in each key frame, and uses the second storage table to store only bone displacement data and/or bone scaling data corresponding to the bone node subjected to displacement and/or scaling data and retains corresponding bone Identification (ID), thereby realizing that bone animation data are compressed in a large scale manner, and no lossless compression of the bone animation data is realized.
In one embodiment of the present application, as shown in fig. 3, a first storage table corresponding to each key frame is constructed, and bone rotation data corresponding to each bone node of the virtual object at each key frame is stored in the first storage table, including steps 302 to 306.
Step 302: and acquiring skeleton rotation data corresponding to each skeleton node of the virtual object in each key frame.
In an embodiment of the present application, the system of the present application may obtain bone rotation data corresponding to each bone node of the virtual object at each key frame, where the bone rotation data (rotation) includes four parameters of x, y, z and w, that is, a rotation amount of the bone node expressed by using a quaternion manner.
Step 304: and constructing a first storage table corresponding to each key frame by taking the number of skeleton nodes of the virtual object as rows and taking the quaternion of the skeleton rotation data as columns.
Step 306: and storing the rotation amount corresponding to each skeleton node in each key frame into the first storage table in the form of four bytes.
In the embodiment of the present application, taking a virtual object including seven skeletal nodes as an example, a first stored table corresponding to a current key frame is shown in table 1:
TABLE 1
rotation_x rotation_y rotation_z rotation_w
0 0 0 1
0.1 0.122 0.321 1
0.21 0.22 0.501 1
0.12 0.42 0.931 1
0.402 0.32 0.453 1
0.212 0.67 0.213 1
0.673 0.263 0.573 1
As can be seen from table 1, the first storage table sequentially expands all the skeleton nodes of the virtual object of the current key frame according to the ordering of the skeleton nodes in the skeleton topology, and records the skeleton rotation data of each skeleton node in the form of four bytes, so as to obtain a first storage table with the size of 7 rows×4 columns×4 bytes=112 bytes.
Fig. 4 illustrates a method for compressing bone animation data according to an embodiment of the present disclosure, which is described by taking a second stored table of a current key frame as an example, and includes steps 402 to 414.
Step 402: and acquiring skeleton animation data of the virtual object, and acquiring skeleton key frame data and skeleton topology data corresponding to each key frame of each skeleton node of the virtual object from the skeleton animation data.
In an embodiment of the present application, a system of the present application is capable of reading an animation file corresponding to a virtual object as a three-dimensional model, obtaining bone animation data of the virtual object, and obtaining bone keyframe data and bone topology data corresponding to each keyframe at each bone node of the virtual object from the bone animation data, where the bone keyframe data includes bone displacement data (transformation), bone rotation data (rotation), and bone scaling data (scale).
Step 404: and constructing a first storage table corresponding to each key frame, and storing the bone rotation data corresponding to each bone node of the virtual object in each key frame in the first storage table.
The specific embodiment can refer to steps 302 to 306.
Step 406: and determining a bone displacement default value and a bone scaling default value corresponding to the virtual object according to the bone displacement data and the bone scaling data corresponding to each bone node of the virtual object in each key frame.
In an embodiment of the present application, the system of the present application may be capable of generating, according to bone displacement data and bone scaling data corresponding to each keyframe of each bone node of the virtual object, for example, taking a virtual object including seven bone nodes as an example, bone displacement data and bone scaling data corresponding to a current keyframe are shown in table 2:
TABLE 2
scaling_x scaling_y scaling_z translation_x translation_y translation_z
1 1 1 0 0 0
1 1 1 0 0 0
1.25 1.25 1.25 0 0 0
1 1 1 0 0 0
1 1 1 0 0 0
1 1 1 2.0 0 0
1 1 1 0 0 0
As can be seen from table 2, the skeletal displacement default value of the virtual object is (0, 0), the skeletal scaling default value is (1, 1), and the first stored table with the size of 112 bytes is added to obtain the skeletal animation data corresponding to the current key frame with the size of 7 rows×10 columns×4 bytes=280 bytes.
Step 408: and constructing a second storage table corresponding to each key frame, and storing the skeleton identity mark corresponding to at least one skeleton node subjected to displacement and/or scaling and skeleton displacement data and/or skeleton scaling data in the second storage table.
In one embodiment of the present application, as shown in fig. 5, a second storage table corresponding to each keyframe is constructed, and bone identifiers corresponding to the bone nodes subjected to displacement and/or scaling and bone displacement data and/or bone scaling data are stored in the second storage table, including steps 502 to 508.
Step 502: according to the bone displacement data and the bone scaling data corresponding to each bone node of the virtual object in each key frame, bone displacement data and/or bone scaling data, which are different from the bone displacement default value and the bone scaling default value in any key frame, of any bone node and bone identity corresponding to the bone node are obtained.
In an embodiment of the present application, as shown in table 2, according to bone displacement data and bone scaling data corresponding to each key frame of each bone node of the virtual object, the system of the present application finds that bone scaling data (1.25,1.25,1.25) located in the second sequence (from zero) is different from the bone scaling default value (1, 1), and meanwhile, bone displacement data (2.0,0,0) located in the key frame of the bone node located in the fifth sequence is different from the bone displacement default value (0, 0), bone displacement data and/or bone scaling data of the two bone nodes in the key frame and bone identity identifiers "2" and "5" corresponding to the bone node are obtained, where the bone displacement data includes coordinates of the bone node in three-dimensional space, and the bone scaling data includes scaling amounts of the bone node in three orthogonal directions of the three-dimensional space.
Step 504: and constructing a second storage table corresponding to each key frame by taking the number of the skeletal nodes subjected to displacement and/or scaling as a row and taking three orthogonal directions of the skeletal identity marks corresponding to the skeletal nodes subjected to displacement and/or scaling, the coordinate number of the skeletal displacement data and the skeletal scaling data as columns.
Step 506: and saving the skeleton identity corresponding to the skeleton node subjected to displacement and/or scaling into the second storage table in a two-byte form.
Step 508: and storing the coordinates of the skeletal node subjected to displacement and/or scaling in the three-dimensional space and/or the scaling amount of the skeletal node in three orthogonal directions of the three-dimensional space into the second storage table in the form of four bytes.
In an embodiment of the present application, the system of the present application may record, in the second storage table, bone displacement data and/or bone scaling data corresponding to the bone nodes that are displaced and/or scaled in each key frame, taking a virtual object including seven bone nodes as an example, as shown in table 1 and table 2, if two bone nodes of the bone identities "2" and "5" of the current key frame are displaced and/or scaled, then the second storage table corresponding to the current key frame is shown in table 3:
TABLE 3 Table 3
bone_index scaling_x scaling_y scaling_z translation_x translation_y translation_z
2 1.25 1.25 1.25 0 0 0
5 1 1 1 2.0 0 0
As can be seen from table 3, the bone index (bone_index) in the second storage table is a bone identity identifier expressed in the form of two bytes corresponding to the bone node subjected to displacement and/or scaling, and is used for indicating at least one bone node subjected to displacement and/or scaling in the virtual object in the current keyframe and a value of the at least one bone node subjected to displacement and/or scaling in the virtual object, wherein the bone displacement data (transformation) includes three parameters expressed in the form of four bytes, x, y and z, and is used for expressing coordinates of the bone node in the three-dimensional space, the bone scaling data (scale) includes three parameters expressed in the form of four bytes, x, y and z, and is used for expressing scaling amounts of the bone node in three orthogonal directions in the three-dimensional space, therefore, the size of the second storage table is (6 columns×4 bytes+1 columns×2 rows=52 bytes), and finally, the first storage table and the second storage table are combined to obtain the bone scaling data corresponding to the bone scaling data in the current keyframe with the size of 164 bytes, and the bone scaling data corresponding to the current keyframe is compressed by the size of 2 bytes, and the size of the bone scaling data corresponding to the keyframe is compressed, and the size of the animation data is compressed by the size of the keyframe is compared with the size of the compressed data.
Step 410: and compressing and storing the first storage table and the second storage table corresponding to each key frame.
In the embodiment of the application, the system stores the skeleton animation data of the virtual object by using the first storage table and the second storage table, so that the data volume of the skeleton animation is greatly compressed, lossless compression is realized, the data volume stored and read by the system is reduced, and the processing speed of the operation system is improved.
Step 412: and generating a skeleton node tree corresponding to the skeleton topology data according to the skeleton topology data of the virtual object.
Step 414: creating a third storage table, serializing and storing the bone topology data into the third storage table according to the parent-child relationship in the bone node tree and the bone name of each bone node.
In an embodiment of the present application, the system of the present application may further generate a skeleton node tree corresponding to the skeleton topology data according to the skeleton topology data of the virtual object, where the skeleton node tree refers to a tree data structure generated according to a parent-child relationship between each skeleton node, and then the system of the present application may create a third storage table, and according to a parent-child relationship (parent_bone_index) in the skeleton node tree and a skeleton name (bone_name) of each skeleton node, the skeleton topology data is serialized and stored in the third storage table.
Corresponding to the above method embodiments, the present disclosure further provides an embodiment of a method and apparatus for compressing bone animation data, and fig. 6 is a schematic structural diagram of the method and apparatus for compressing bone animation data according to one embodiment of the present disclosure. As shown in fig. 6, the apparatus includes:
a data acquisition module 601 configured to acquire skeletal animation data of the virtual object, and acquire skeletal keyframe data and skeletal topology data corresponding to each keyframe of each skeletal node of the virtual object from the skeletal animation data, wherein the skeletal keyframe data includes skeletal displacement data, skeletal rotation data and skeletal scaling data;
a first table module 602 configured to construct a first storage table corresponding to each key frame, and store bone rotation data corresponding to each bone node of the virtual object at each key frame in the first storage table;
a second table module 603, configured to construct a second storage table corresponding to each key frame, and store the bone identity corresponding to at least one of the bone nodes subjected to displacement and/or scaling and bone displacement data and/or bone scaling data in the second storage table.
Optionally, the first table module 602 includes:
a rotation data acquisition unit configured to acquire bone rotation data corresponding to each bone node of the virtual object at each key frame, wherein the bone rotation data includes a rotation amount of the bone node represented by a quaternion manner;
a first table construction unit configured to construct a first storage table corresponding to each key frame with the number of skeletal nodes of the virtual object as rows and the quaternion of the skeletal rotation data as columns;
and the first table storage unit is configured to store the rotation amount corresponding to each skeleton node in each key frame into the first storage table in a form of four bytes.
Optionally, the apparatus further includes:
and the default value module is configured to determine a bone displacement default value and a bone scaling default value corresponding to the virtual object according to bone displacement data and bone scaling data corresponding to each bone node of the virtual object in each key frame.
Optionally, the second table module 603 includes:
the data comparison unit is configured to obtain bone displacement data and/or bone scaling data of any bone node in any key frame, which are different from the bone displacement default value and the bone scaling default value, and bone identity marks corresponding to the bone node according to bone displacement data and bone scaling data corresponding to each bone node in each key frame of the virtual object, wherein the bone displacement data comprises coordinates of the bone node in a three-dimensional space, and the bone scaling data comprises scaling amounts of the bone node in three orthogonal directions of the three-dimensional space;
a second table construction unit, configured to construct a second storage table corresponding to each key frame by taking the number of the skeletal nodes subjected to displacement and/or scaling as rows and taking the skeleton identity corresponding to the skeletal nodes subjected to displacement and/or scaling, the coordinate number of the skeletal displacement data and three orthogonal directions of skeleton scaling data as columns;
the second table storage unit is configured to store the skeleton identity corresponding to the skeleton node subjected to displacement and/or scaling into the second storage table in a two-byte form;
the second table storage unit is further configured to save coordinates of the skeletal node in three-dimensional space and/or scaling amounts of the skeletal node in three orthogonal directions of the three-dimensional space, which are subjected to displacement and/or scaling, into the second table storage unit in the form of four bytes.
Optionally, the apparatus further includes:
the skeleton topology module is configured to generate a skeleton node tree corresponding to skeleton topology data according to the skeleton topology data of the virtual object;
a topology serialization module configured to create a third storage table, serialize and save the bone topology data into the third storage table according to parent-child relationships in the bone node tree and bone names of each bone node.
Optionally, the apparatus further includes:
and the data compression storage module is configured to compress and store the first storage table and the second storage table corresponding to each key frame.
According to the method, the skeleton rotation data corresponding to each skeleton node in each key frame are independent through the first storage table, only the skeleton displacement data and/or the skeleton scaling data corresponding to the skeleton nodes subjected to displacement and/or scaling are stored by utilizing the second storage table, and the corresponding skeleton identity marks are reserved.
An embodiment of the present application also provides a computing device including a memory, a processor, and computer instructions stored on the memory and executable on the processor, the processor implementing the following steps when executing the instructions:
acquiring skeleton animation data of the virtual object, and acquiring skeleton key frame data and skeleton topology data corresponding to each key frame of each skeleton node of the virtual object from the skeleton animation data, wherein the skeleton key frame data comprises skeleton displacement data, skeleton rotation data and skeleton scaling data;
constructing a first storage table corresponding to each key frame, and storing skeleton rotation data corresponding to each skeleton node of the virtual object in each key frame in the first storage table;
and constructing a second storage table corresponding to each key frame, and storing the skeleton identity mark corresponding to at least one skeleton node subjected to displacement and/or scaling and skeleton displacement data and/or skeleton scaling data in the second storage table.
An embodiment of the present application also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the steps of a method of compressing skeletal animation data as previously described.
The above is an exemplary version of a computer-readable storage medium of the present embodiment. It should be noted that, the technical solution of the computer readable storage medium and the technical solution of the above-mentioned compression method of bone animation data belong to the same concept, and the details of the technical solution of the computer readable storage medium that are not described in detail can be referred to the description of the technical solution of the above-mentioned compression method of bone animation data.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
The computer instructions include computer program code that may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
It should be noted that, for the sake of simplicity of description, the foregoing method embodiments are all expressed as a series of combinations of actions, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily all necessary for the present application.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to the related descriptions of other embodiments.
The above-disclosed preferred embodiments of the present application are provided only as an aid to the elucidation of the present application. Alternative embodiments are not intended to be exhaustive or to limit the invention to the precise form disclosed. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the application and the practical application, to thereby enable others skilled in the art to best understand and utilize the application. This application is to be limited only by the claims and the full scope and equivalents thereof.

Claims (14)

1. A method for compressing skeletal animation data, comprising:
acquiring skeleton animation data of a virtual object, and acquiring skeleton key frame data and skeleton topology data corresponding to each key frame of each skeleton node of the virtual object from the skeleton animation data, wherein the skeleton key frame data comprises skeleton displacement data, skeleton rotation data and skeleton scaling data;
constructing a first storage table corresponding to each key frame, and storing skeleton rotation data corresponding to each skeleton node of the virtual object in each key frame in the first storage table;
and constructing a second storage table corresponding to each key frame, and storing the skeleton identity mark corresponding to at least one skeleton node subjected to displacement and/or scaling and skeleton displacement data and/or skeleton scaling data in the second storage table.
2. The method of claim 1, wherein constructing a first storage table corresponding to each keyframe, storing bone rotation data corresponding to each skeletal node of a virtual object at each keyframe in the first storage table, comprises:
acquiring skeleton rotation data corresponding to each skeleton node of the virtual object in each key frame, wherein the skeleton rotation data comprises rotation amounts of the skeleton nodes represented by quaternions;
constructing a first storage table corresponding to each key frame by taking the number of skeleton nodes of the virtual object as rows and taking quaternion of the skeleton rotation data as columns;
and storing the rotation amount corresponding to each skeleton node in each key frame into the first storage table in the form of four bytes.
3. The method of claim 1, further comprising, after storing in the first storage table, bone rotation data corresponding to each key frame for each bone node of a virtual object:
and determining a bone displacement default value and a bone scaling default value corresponding to the virtual object according to the bone displacement data and the bone scaling data corresponding to each bone node of the virtual object in each key frame.
4. A method according to claim 3, wherein constructing a second storage table corresponding to each key frame, and storing the bone identity corresponding to the bone node that is shifted and/or scaled and bone shift data and/or bone scaling data in the second storage table, comprises:
according to bone displacement data and bone scaling data corresponding to each bone node of the virtual object in each key frame, bone displacement data and/or bone scaling data, and bone identity marks corresponding to the bone nodes, of any bone node in any key frame which are different from the bone displacement default value and the bone scaling default value are obtained, wherein the bone displacement data comprise coordinates of the bone node in a three-dimensional space, and the bone scaling data comprise scaling amounts of the bone node in three orthogonal directions of the three-dimensional space;
constructing a second storage table corresponding to each key frame by taking the number of the skeletal nodes subjected to displacement and/or scaling as a row and taking three orthogonal directions of the skeletal identity corresponding to the skeletal nodes subjected to displacement and/or scaling, the coordinate number of the skeletal displacement data and the skeletal scaling data as columns;
storing the skeleton identity corresponding to the skeleton node subjected to displacement and/or scaling into the second storage table in a two-byte form;
and storing the coordinates of the skeletal node subjected to displacement and/or scaling in the three-dimensional space and/or the scaling amount of the skeletal node in three orthogonal directions of the three-dimensional space into the second storage table in the form of four bytes.
5. The method as recited in claim 1, further comprising:
generating a skeleton node tree corresponding to the skeleton topology data according to the skeleton topology data of the virtual object;
creating a third storage table, serializing and storing the bone topology data into the third storage table according to the parent-child relationship in the bone node tree and the bone name of each bone node.
6. The method according to claim 1, further comprising, after storing in the second storage table the bone identity corresponding to the at least one bone node that is displaced and/or scaled and bone displacement data and/or bone scaling data:
and compressing and storing the first storage table and the second storage table corresponding to each key frame.
7. A compression apparatus for skeletal animation data, comprising:
the data acquisition module is configured to acquire skeleton animation data of a virtual object, and acquire skeleton key frame data and skeleton topology data corresponding to each key frame of each skeleton node of the virtual object from the skeleton animation data, wherein the skeleton key frame data comprises skeleton displacement data, skeleton rotation data and skeleton scaling data;
the first table module is configured to construct a first storage table corresponding to each key frame, and store bone rotation data corresponding to each bone node of the virtual object in each key frame in the first storage table;
and the second table module is configured to construct a second storage table corresponding to each key frame, and store the bone identification corresponding to at least one of the bone nodes subjected to displacement and/or scaling and bone displacement data and/or bone scaling data in the second storage table.
8. The apparatus of claim 7, wherein the first table module comprises:
a rotation data acquisition unit configured to acquire bone rotation data corresponding to each bone node of the virtual object at each key frame, wherein the bone rotation data includes a rotation amount of the bone node represented by a quaternion manner;
a first table construction unit configured to construct a first storage table corresponding to each key frame with the number of skeletal nodes of the virtual object as rows and the quaternion of the skeletal rotation data as columns;
and the first table storage unit is configured to store the rotation amount corresponding to each skeleton node in each key frame into the first storage table in a form of four bytes.
9. The apparatus as recited in claim 7, further comprising:
and the default value module is configured to determine a bone displacement default value and a bone scaling default value corresponding to the virtual object according to bone displacement data and bone scaling data corresponding to each bone node of the virtual object in each key frame.
10. The apparatus of claim 9, wherein the second table module comprises:
the data comparison unit is configured to obtain bone displacement data and/or bone scaling data of any bone node in any key frame, which are different from the bone displacement default value and the bone scaling default value, and bone identity marks corresponding to the bone node according to bone displacement data and bone scaling data corresponding to each bone node in each key frame of the virtual object, wherein the bone displacement data comprises coordinates of the bone node in a three-dimensional space, and the bone scaling data comprises scaling amounts of the bone node in three orthogonal directions of the three-dimensional space;
a second table construction unit, configured to construct a second storage table corresponding to each key frame by taking the number of the skeletal nodes subjected to displacement and/or scaling as rows and taking the skeleton identity corresponding to the skeletal nodes subjected to displacement and/or scaling, the coordinate number of the skeletal displacement data and three orthogonal directions of skeleton scaling data as columns;
the second table storage unit is configured to store the skeleton identity corresponding to the skeleton node subjected to displacement and/or scaling into the second storage table in a two-byte form;
the second table storage unit is further configured to save coordinates of the skeletal node in three-dimensional space and/or scaling amounts of the skeletal node in three orthogonal directions of the three-dimensional space, which are subjected to displacement and/or scaling, into the second table storage unit in the form of four bytes.
11. The apparatus as recited in claim 7, further comprising:
the skeleton topology module is configured to generate a skeleton node tree corresponding to skeleton topology data according to the skeleton topology data of the virtual object;
a topology serialization module configured to create a third storage table, serialize and save the bone topology data into the third storage table according to parent-child relationships in the bone node tree and bone names of each bone node.
12. The apparatus as recited in claim 7, further comprising:
and the data compression storage module is configured to compress and store the first storage table and the second storage table corresponding to each key frame.
13. A computing device comprising a memory, a processor, and computer instructions stored on the memory and executable on the processor, wherein the processor, when executing the instructions, implements the steps of the method of any of claims 1-6.
14. A computer readable storage medium storing computer instructions which, when executed by a processor, implement the steps of the method of any one of claims 1-6.
CN201911395462.7A 2019-12-30 2019-12-30 Compression method and device for bone animation data Active CN111161365B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911395462.7A CN111161365B (en) 2019-12-30 2019-12-30 Compression method and device for bone animation data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911395462.7A CN111161365B (en) 2019-12-30 2019-12-30 Compression method and device for bone animation data

Publications (2)

Publication Number Publication Date
CN111161365A CN111161365A (en) 2020-05-15
CN111161365B true CN111161365B (en) 2023-05-09

Family

ID=70559011

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911395462.7A Active CN111161365B (en) 2019-12-30 2019-12-30 Compression method and device for bone animation data

Country Status (1)

Country Link
CN (1) CN111161365B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111783182B (en) * 2020-07-07 2024-03-01 恒信东方文化股份有限公司 Modeling method and system of three-dimensional virtual mannequin
CN112070868A (en) * 2020-09-08 2020-12-11 北京默契破冰科技有限公司 Animation playing method based on iOS system, electronic equipment and medium
CN112435315B (en) * 2020-11-30 2022-11-18 上海米哈游天命科技有限公司 Anti-threading method and device in game, electronic equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1321894A2 (en) * 2001-11-27 2003-06-25 Samsung Electronics Co., Ltd. Apparatus and method for representing 3-dimensional objects unsing depth images
CN102521860A (en) * 2011-11-16 2012-06-27 戚军 Skeletal animation implementation method
CN104732574A (en) * 2014-12-30 2015-06-24 北京像素软件科技股份有限公司 Compression method and device for role play
CN106296759A (en) * 2016-08-25 2017-01-04 深圳市创梦天地科技有限公司 A kind of three-dimensional skeleton cartoon compression method and device
CN108492338A (en) * 2018-02-09 2018-09-04 腾讯科技(深圳)有限公司 Compression method, device, storage medium and the electronic device of animation file
CN108635849A (en) * 2018-05-15 2018-10-12 深圳市腾讯网络信息技术有限公司 A kind of compression of animation data, decompression method and device
JP6526775B1 (en) * 2017-12-08 2019-06-05 株式会社スクウェア・エニックス Animation data compression program, animation data recovery program, animation data compression device, and animation data compression method
CN109872375A (en) * 2019-01-10 2019-06-11 珠海金山网络游戏科技有限公司 A kind of skeleton cartoon key frame compression method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1321894A2 (en) * 2001-11-27 2003-06-25 Samsung Electronics Co., Ltd. Apparatus and method for representing 3-dimensional objects unsing depth images
CN102521860A (en) * 2011-11-16 2012-06-27 戚军 Skeletal animation implementation method
CN104732574A (en) * 2014-12-30 2015-06-24 北京像素软件科技股份有限公司 Compression method and device for role play
CN106296759A (en) * 2016-08-25 2017-01-04 深圳市创梦天地科技有限公司 A kind of three-dimensional skeleton cartoon compression method and device
JP6526775B1 (en) * 2017-12-08 2019-06-05 株式会社スクウェア・エニックス Animation data compression program, animation data recovery program, animation data compression device, and animation data compression method
CN108492338A (en) * 2018-02-09 2018-09-04 腾讯科技(深圳)有限公司 Compression method, device, storage medium and the electronic device of animation file
CN108635849A (en) * 2018-05-15 2018-10-12 深圳市腾讯网络信息技术有限公司 A kind of compression of animation data, decompression method and device
CN109872375A (en) * 2019-01-10 2019-06-11 珠海金山网络游戏科技有限公司 A kind of skeleton cartoon key frame compression method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘贤梅 ; 赵丹 ; 赵娅 ; .数据驱动人体动画的关键帧技术研究综述.计算机工程与设计.2011,(03),全文. *

Also Published As

Publication number Publication date
CN111161365A (en) 2020-05-15

Similar Documents

Publication Publication Date Title
CN111161365B (en) Compression method and device for bone animation data
CN109961507B (en) Face image generation method, device, equipment and storage medium
CN108010112B (en) Animation processing method, device and storage medium
CN109658484A (en) A kind of Automatic Generation of Computer Animation method and Automatic Generation of Computer Animation system
CN110570499B (en) Expression generating method, device, computing equipment and storage medium
CN108492338B (en) Compression method and device for animation file, storage medium and electronic device
CN110992495B (en) Method and device for deforming virtual model
CN113409437B (en) Virtual character face pinching method and device, electronic equipment and storage medium
CN112598773A (en) Method and device for realizing skeleton skin animation
CN112150587A (en) Animation data encoding method, animation data decoding method, animation data encoding apparatus, animation data decoding apparatus, storage medium, and computer device
CN112233009A (en) Picture rendering method, device, equipment and storage medium
JP2022500728A (en) How to synthesize images based on conditional hostile generation networks and related equipment
CN114359447A (en) Bone data modeling method, computer device and storage medium
KR101845535B1 (en) Story-telling system for changing 3 dimension character into 3 dimension avatar
CN113209625B (en) Data processing method and device
CN113657136B (en) Identification method and device
CN116115995A (en) Image rendering processing method and device and electronic equipment
CN105701858B (en) A kind of stick picture disposing method and device based on alpha fusions
CN113781658A (en) Method and device for processing 3D model data in streaming mode
CN111062638B (en) Project resource processing method and device
CN115908678B (en) Bone model rendering method and device, electronic equipment and storage medium
CN112070866A (en) Animation data encoding method, animation data decoding method, animation data encoding apparatus, animation data decoding apparatus, storage medium, and computer device
CN111651623B (en) Method, device, equipment and storage medium for constructing high-precision facial expression library
CN116912456A (en) Grid merging method and device for skin model
CN113230657B (en) Role interaction method and device

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 519000 Room 102, 202, 302 and 402, No. 325, Qiandao Ring Road, Tangjiawan Town, high tech Zone, Zhuhai City, Guangdong Province, Room 102 and 202, No. 327 and Room 302, No. 329

Applicant after: Zhuhai Jinshan Digital Network Technology Co.,Ltd.

Address before: 519000 Room 102, 202, 302 and 402, No. 325, Qiandao Ring Road, Tangjiawan Town, high tech Zone, Zhuhai City, Guangdong Province, Room 102 and 202, No. 327 and Room 302, No. 329

Applicant before: ZHUHAI KINGSOFT ONLINE GAME TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant