CN114419210A - Role animation sharing method and device, computer equipment and readable storage medium - Google Patents

Role animation sharing method and device, computer equipment and readable storage medium Download PDF

Info

Publication number
CN114419210A
CN114419210A CN202111622802.2A CN202111622802A CN114419210A CN 114419210 A CN114419210 A CN 114419210A CN 202111622802 A CN202111622802 A CN 202111622802A CN 114419210 A CN114419210 A CN 114419210A
Authority
CN
China
Prior art keywords
bone
skeleton
character
role
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111622802.2A
Other languages
Chinese (zh)
Inventor
吕天胜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Pixel Software Technology Co Ltd
Original Assignee
Beijing Pixel Software 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 Beijing Pixel Software Technology Co Ltd filed Critical Beijing Pixel Software Technology Co Ltd
Priority to CN202111622802.2A priority Critical patent/CN114419210A/en
Publication of CN114419210A publication Critical patent/CN114419210A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Landscapes

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

Abstract

The application provides a role animation sharing method and device, computer equipment and a readable storage medium, and relates to the technical field of game role driving. According to the method and the device, under the conditions that the pre-configured bone animation of the universal role, which relates to the action of the target role, and the original posture bone data of the to-be-processed role, which has a similar role bone topological structure with the universal role, are obtained, bone posture adaptation processing is directly carried out on the to-be-processed role according to the original posture bone data of the to-be-processed role on the basis of the pre-configured bone animation, so that the action posture bone data of the to-be-processed role, which relates to the action of the target role, are obtained, so that different game roles directly generate adapted action posture bone data through the bone animation sharing the universal role, appropriate bone animation does not need to be independently created for different game roles, the manual creation workload of the role bone animation is greatly reduced, and the redundancy condition of the animation data is improved.

Description

Role animation sharing method and device, computer equipment and readable storage medium
Technical Field
The present application relates to the field of game role driving technologies, and in particular, to a role animation sharing method and apparatus, a computer device, and a readable storage medium.
Background
With the continuous development of science and technology, the amount of each large three-dimensional game software is larger and larger, the number of game characters related to the corresponding three-dimensional game software is also larger, and different game characters need to construct skeleton animations of different game actions (such as attack actions, jumping actions, running actions and the like) so that the corresponding game characters can be driven to adjust the skeleton data thereof based on the suitable skeleton animations in a specific game scene to show the picture effect of the corresponding actions. However, it is worth noting that, in the mainstream in the industry today, when constructing a character skeleton animation, an engineer is required to independently design a skeleton animation for creating different game actions for each character, and there are problems of large manual workload, redundant animation data and low animation generation efficiency as a whole.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a method and an apparatus for sharing character animation, a computer device, and a readable storage medium, which enable different game characters to directly generate adaptive motion posture skeleton data through a skeleton animation that shares a common character, so as to greatly reduce the workload of manually creating character skeleton animation and improve the redundancy status of animation data.
In order to achieve the above purpose, the embodiments of the present application employ the following technical solutions:
in a first aspect, the present application provides a method for sharing character animation, the method comprising:
acquiring original posture skeleton data of a character to be processed and a preset skeleton animation of a universal character, wherein the preset skeleton animation is matched with the action of a target character, and the respective character skeleton topological structures of the character to be processed and the universal character are similar;
and carrying out bone posture adaptation processing on the character to be processed according to the original posture bone data of the character to be processed on the basis of the pre-prepared bone animation to obtain action posture bone data of the character to be processed, wherein the action posture bone data corresponds to the action of the target character.
In an optional embodiment, the preset bone animation includes bone offset data of a bone posture of the universal character relative to an original posture in each bone animation frame, and the step of performing bone posture adaptation processing on the character to be processed according to the original posture bone data of the character to be processed on the basis of the preset bone animation to obtain action posture bone data of the character to be processed, which corresponds to an action of a target character, includes:
calculating the role height ratio between the role to be processed and the universal role;
and aiming at each skeleton animation frame of the preset skeleton animation, carrying out skeleton posture offset on the original posture skeleton data according to the character height ratio and the skeleton offset data corresponding to the skeleton animation frame to obtain target posture skeleton data of the character to be processed in the action posture skeleton data corresponding to the skeleton animation frame.
In an optional embodiment, the bone offset data corresponding to the same bone animation frame includes position offset information of each character bone node of the general character relative to a parent bone node, the original posture bone data includes original position information of each character bone node of the character to be processed relative to a parent bone node, and the step of performing bone posture offset on the original posture bone data according to the character height ratio and the bone offset data corresponding to the bone animation frame to obtain target posture bone data of the character to be processed in the action posture bone data corresponding to the bone animation frame includes:
for each role skeleton node of the universal role, multiplying the position offset information of a target skeleton node which is matched with the role skeleton node in the skeleton offset data of the skeleton animation frame in function with the role height ratio to obtain the position translation amount of the role skeleton node corresponding to the role to be processed;
and aiming at each role skeleton node of the role to be processed, carrying out position translation processing on original position information corresponding to the role skeleton node in the original posture skeleton data according to the calculated position translation amount of the role skeleton node to obtain target position information corresponding to the role skeleton node in the target posture skeleton data.
In an optional embodiment, the bone offset data corresponding to the same bone animation frame further includes scaling offset information and rotation offset information of each character bone node of the general character relative to a parent bone node, the original posture bone data includes original scaling information and original rotation information of each character bone node of the character to be processed relative to a parent bone node, and the step of performing bone posture offset on the original posture bone data according to the character height ratio and the bone offset data corresponding to the bone animation frame to obtain target posture bone data of the character to be processed in the action posture bone data corresponding to the bone animation frame further includes:
for each role skeleton node of the role to be processed, multiplying scaling offset information of a target skeleton node in skeleton offset data of the skeleton animation frame, which is matched with the role skeleton node in function, and original scaling information, which is corresponding to the role skeleton node, in the original posture skeleton data to obtain target scaling information, which is corresponding to the role skeleton node, in the target posture skeleton data;
and for each role skeleton node of the role to be processed, multiplying the rotation offset information of the target skeleton node in the skeleton offset data of the skeleton animation frame, which is matched with the role skeleton node in function, and the original rotation information, which is corresponding to the role skeleton node in the original posture skeleton data, to obtain the target rotation information, which is corresponding to the role skeleton node in the target posture skeleton data.
In a second aspect, the present application provides a character animation sharing apparatus, the apparatus comprising:
the skeleton information acquisition module is used for acquiring original posture skeleton data of a character to be processed and a preset skeleton animation of a universal character, wherein the preset skeleton animation is matched with the action of a target character, and the respective role skeleton topological structures of the character to be processed and the universal character are similar;
and the character animation adaptation module is used for carrying out bone posture adaptation processing on the character to be processed according to the original posture bone data of the character to be processed on the basis of the pre-configured bone animation to obtain action posture bone data, corresponding to the action of the target character, of the character to be processed.
In an alternative embodiment, the pre-configured bone animation includes bone offset data of a bone pose of the generic character relative to an original pose at each bone animation frame, and the character animation adaptation module includes:
the height ratio calculation submodule is used for calculating the height ratio of the roles to be processed and the universal roles;
and the bone posture offset submodule is used for carrying out bone posture offset on the original posture bone data according to the character height ratio and the bone offset data corresponding to the bone animation frame aiming at each bone animation frame of the pre-prepared bone animation to obtain target posture bone data of the character to be processed in the action posture bone data, wherein the target posture bone data corresponds to the bone animation frame.
In an optional embodiment, the bone offset data corresponding to the same bone animation frame includes position offset information of each character bone node of the generic character relative to a parent bone node, the original pose bone data includes original position information of each character bone node of the to-be-processed character relative to a parent bone node, and the bone pose offset submodule includes:
a position translation calculation unit, configured to perform a multiplication operation on position offset information of a target skeleton node in the skeleton offset data of the skeleton animation frame, where the target skeleton node is functionally matched with the role skeleton node, and the role height ratio, so as to obtain a position translation amount of a role skeleton node corresponding to the to-be-processed role;
and the position translation processing unit is used for carrying out position translation processing on original position information corresponding to the role skeleton node in the original posture skeleton data according to the calculated position translation amount of the role skeleton node aiming at each role skeleton node of the role to be processed to obtain target position information corresponding to the role skeleton node in the target posture skeleton data.
In an optional embodiment, the bone offset data corresponding to the same bone animation frame further includes scaling offset information and rotation offset information of each character bone node of the generic character relative to a parent bone node, the original pose bone data includes original scaling information and original rotation information of each character bone node of the to-be-processed character relative to a parent bone node, and the bone pose offset sub-module further includes:
a skeleton scaling adjustment unit, configured to perform, for each role skeleton node of the to-be-processed role, multiplication on scaling offset information of a target skeleton node in the skeleton offset data of the skeleton animation frame, which is functionally matched with the role skeleton node, and original scaling information, which is corresponding to the role skeleton node, in the original posture skeleton data, to obtain target scaling information, which is corresponding to the role skeleton node, in the target posture skeleton data;
and the skeleton rotation processing unit is used for multiplying the rotation offset information of a target skeleton node which is matched with the role skeleton node in the skeleton offset data of the skeleton animation frame and the original rotation information which is corresponding to the role skeleton node in the original posture skeleton data aiming at each role skeleton node of the to-be-processed role to obtain the target rotation information which is corresponding to the role skeleton node in the target posture skeleton data.
In a third aspect, the present application provides a computer device, comprising a processor and a memory, wherein the memory stores a computer program executable by the processor, and the processor can execute the computer program to implement the character animation sharing method according to any one of the foregoing embodiments.
In a fourth aspect, the present application provides a readable storage medium, on which a computer program is stored, the computer program, when executed by a processor, implementing the character animation sharing method according to any one of the foregoing embodiments.
In this case, the beneficial effects of the embodiments of the present application include the following:
according to the method and the device, under the conditions that the pre-configured bone animation of the universal role, which relates to the action of the target role, and the original posture bone data of the to-be-processed role, which has a similar role bone topological structure with the universal role, are obtained, bone posture adaptation processing is directly carried out on the to-be-processed role according to the original posture bone data of the to-be-processed role on the basis of the pre-configured bone animation, so that the action posture bone data of the to-be-processed role, which relates to the action of the target role, are obtained, so that different game roles directly generate adapted action posture bone data through the bone animation sharing the universal role, appropriate bone animation does not need to be independently created for different game roles, the manual creation workload of the role bone animation is greatly reduced, and the redundancy condition of the animation data is improved.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
FIG. 1 is a schematic diagram of a computer device according to an embodiment of the present disclosure;
FIG. 2 is a schematic flow chart illustrating a role animation sharing method according to an embodiment of the present disclosure;
FIG. 3 is a flowchart illustrating the sub-steps included in step S220 in FIG. 2;
FIG. 4 is a schematic flow chart of the sub-steps included in the sub-step S222 in FIG. 3;
FIG. 5 is a schematic diagram illustrating a component of a character animation sharing apparatus according to an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of the character animation adaptation module of FIG. 5;
fig. 7 is a schematic diagram of the bone pose offset submodule of fig. 6.
Icon: 10-a computer device; 11-a memory; 12-a processor; 13-a communication component; 100-character animation sharing means; 110-a bone information acquisition module; 120-character animation adaptation module; 121-height ratio calculation submodule; 122-bone pose offset submodule; 1221-a position translation calculation unit; 1222-a position translation processing unit; 1223-a bone scaling unit; 1224-bone rotation processing unit.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
In the description of the present application, it is to be understood that relational terms such as the terms first and second, and the like, are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element. The specific meaning of the above terms in the present application can be understood in a specific case by those of ordinary skill in the art.
Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating a computer device 10 according to an embodiment of the present disclosure. In the embodiment of the present application, the computer device 10 enables at least one game character with a similar character skeleton topology to share the skeleton animation of a general character corresponding to the character skeleton topology, and adjusts and obtains self-adapted action posture skeleton data related to a certain or several game actions based on the shared skeleton animation, so that it is not necessary to create a suitable skeleton animation for different game characters separately, the workload of manually creating character skeletons is greatly reduced, meaningless generation of character skeleton animations is avoided, and the redundancy status of animation data is effectively improved. The common character may include all the bone structures of a plurality of game characters having similar bone topologies corresponding to the characters, and at this time, the common character and the plurality of game characters also have similar character bone topologies.
The role skeleton topological structure is used for representing the skeleton structure distribution condition of a corresponding game role and comprises a plurality of role skeleton nodes and parent-child relations between adjacent role skeleton nodes; two game roles with similar role skeleton topological structures need to have main body skeleton structures with identical functional effects (no matter whether the sizes are identical or not), the skeleton node parent-child relationships of a plurality of role skeleton nodes corresponding to the main body skeleton structures at the two game roles are kept identical, for example, the role skeleton topological structures of the game roles such as human, monkey, orangutan and the like are similar, the main body skeleton structure corresponding to the role skeleton topological structures is a human skeleton structure, and the game roles have left thigh skeleton nodes with matched functions. In the present embodiment, the computer device 10 may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a server, and the like.
In this embodiment, the computer device 10 may include a memory 11, a processor 12, a communication component 13, and a character animation sharing apparatus 100. The various elements of the memory 11, the processor 12 and the communication component 13 are electrically connected to each other directly or indirectly to enable data transmission or interaction. For example, the memory 11, the processor 12 and the communication component 13 may be electrically connected to each other through one or more communication buses or signal lines.
In this embodiment, the Memory 11 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 Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like. The memory 11 is used for storing a computer program, and the processor 12 can execute the computer program after receiving an execution instruction.
In this embodiment, the memory 11 can be further configured to store a plurality of preset skeleton animations of a general character corresponding to different character skeleton topologies, where each preset skeleton animation of the same general character corresponds to a game action separately. Wherein, each role skeleton topology corresponds to a class of role forms with similar action effects, for example, the role forms related to the general role having the role skeleton topology representing human-type skeleton architecture include human, monkey, orangutan, etc., the role forms related to the general role having the role skeleton topology representing flying bird skeleton architecture include sparrow, pigeon, ostrich, etc., and the role forms related to the general role having the role skeleton topology representing animal skeleton architecture include tiger, lion, kylin, leopard, etc.
The preset skeleton animation of a certain universal character comprises skeleton offset data of a skeleton posture of the universal character relative to an original posture of the universal character under each skeleton animation frame in the process of realizing the corresponding game action, wherein the skeleton offset data is used for describing the skeleton distribution difference condition of the corresponding skeleton posture relative to the original posture (namely the default posture when the universal character is created). The skeletal offset data for a single skeletal animation frame includes positional offset information, scaling offset information, and rotational offset information for each character skeletal node of the generic character relative to a corresponding parent skeletal node within the game skeletal animation frame.
In this embodiment, the processor 12 may be an integrated circuit chip having signal processing capabilities. The Processor 12 may be a general-purpose Processor including at least one of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a Network Processor (NP), a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, and discrete hardware components. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like that implements or executes the methods, steps and logic blocks disclosed in the embodiments of the present application.
In this embodiment, the communication component 13 is configured to establish a communication connection between the computer device 10 and other electronic devices through a network, and to send and receive data through the network, where the network includes a wired communication network and a wireless communication network. For example, the computer device 10 may obtain, from a game server via the communication component 13, character model data of at least one game character that needs to borrow a skeleton animation of a general character having a similar character skeleton topology, and send, to a certain game terminal via the communication component 13, action posture skeleton data of a certain character action of the at least one game character, so that the at least one game character can exhibit a corresponding action effect directly with reference to the action posture skeleton data adapted to itself.
In this embodiment, the character animation sharing apparatus 100 includes at least one software function module that can be stored in the memory 11 in the form of software or firmware or solidified in the operating system of the computer device 10. The processor 12 may be used to execute executable modules stored by the memory 11, such as software functional modules and computer programs included in the character animation sharing device 100. The computer device 10 can enable different game characters with similar character skeleton topological structures to generate adaptive action posture skeleton data through the skeleton animation sharing device 100, and does not need to create proper skeleton animation for different game characters, so that the manual creation workload of the character skeleton animation is greatly reduced, and the redundancy condition of animation data is improved.
It is understood that the block diagram shown in fig. 1 is only one constituent schematic diagram of the computer device 10, and that the computer device 10 may also include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1. The components shown in fig. 1 may be implemented in hardware, software, or a combination thereof.
In the present application, in order to ensure that the computer device 10 can enable different game characters with similar character skeleton topologies to generate adaptive action posture skeleton data by sharing skeleton animations of a general character with similar character skeleton topologies, it is not necessary to create appropriate skeleton animations separately for different game characters, so as to greatly reduce the workload of manual creation of character skeleton animations and improve the redundancy status of animation data.
Referring to fig. 2, fig. 2 is a flowchart illustrating a role animation sharing method according to an embodiment of the present application. In the embodiment of the present application, the character animation sharing method may include steps S210 to S220.
Step S210, obtaining original posture skeleton data of the character to be processed and preset skeleton animation of the universal character matched with the action of the target character, wherein the respective character skeleton topological structures of the character to be processed and the universal character are similar.
In this embodiment, the target character action is a game action required to be exhibited by the character to be processed, the original posture bone data is used to describe a bone distribution condition of the character to be processed when the character to be processed is in an original posture, and the original posture bone data includes original position information, original scaling information, and original rotation information of each character bone node of the character to be processed relative to a parent bone node in the original posture. The original postures of the to-be-processed role and the corresponding general role can be the same or different, and the original postures of different to-be-processed roles can be the same or different, for example, the original postures of a monkey role and a character role with similar skeleton topological structures are respectively in a stooping state and a standing state. Meanwhile, the node identifier of each role skeleton node in the to-be-processed role may be the same as or different from the node identifier of the role skeleton node with the same functional effect in the general role, for example, the node identifier of the role skeleton node corresponding to the left femur in the to-be-processed role may be a, and the node identifier of the role skeleton node corresponding to the left femur in the general role may be a or B.
And step S220, carrying out bone posture adaptation processing on the character to be processed according to the original posture bone data of the character to be processed on the basis of the pre-configured bone animation to obtain action posture bone data of the character to be processed, wherein the action posture bone data corresponds to the action of the target character.
In this embodiment, after the computer device 10 determines the to-be-processed character and the general character having similar character skeleton topology structures, the bone posture adaptation adjustment may be performed with reference to the original posture skeleton data of the to-be-processed character on the basis of the pre-configured skeleton animation of the general character related to the target character action, so as to obtain the action posture skeleton data related to the target character action, which is adapted to the to-be-processed character.
Therefore, by executing the steps S210 and S220, different game characters having similar character skeleton topologies can generate adaptive motion posture skeleton data by sharing the skeleton animation of a general character also having a similar character skeleton topology, and it is not necessary to create an appropriate skeleton animation for different game characters individually, so as to greatly reduce the manual creation workload of the character skeleton animation and improve the redundancy of animation data.
Optionally, referring to fig. 3, fig. 3 is a flowchart illustrating sub-steps included in step S220 in fig. 2. In the present embodiment, the step S220 includes a sub-step S221 and a sub-step S222.
And a substep S221 of calculating a character height ratio between the character to be processed and the general character.
In this embodiment, the character height ratio is used to represent a height ratio between the character height of the character to be processed in the original posture and the character height of the general character in the original posture.
And a substep S222, carrying out bone posture offset on the original posture bone data according to the height ratio of the character and the bone offset data corresponding to the bone animation frame aiming at each bone animation frame of the pre-configured bone animation to obtain target posture bone data of the character to be processed, which corresponds to the bone animation frame in the action posture bone data.
In this embodiment, each piece of target pose bone data in the motion pose bone data corresponds to one bone animation frame of the pre-configured bone animation, and the total number of pieces of target pose bone data in the motion pose bone data is consistent with the total number of bone animation frames in the pre-configured bone animation. The computer device 10 may perform bone posture shift on bone shift data representing a bone posture of the character in each bone animation frame of the pre-configured bone animation by using the character height ratio and the original posture bone data of the character to be processed, to obtain target posture bone data corresponding to each bone animation frame of the character to be processed in the action posture bone data, so as to ensure that the finally constructed action posture bone data is substantially completely matched with the character to be processed.
Therefore, by executing the substep S221 and the substep S222, the motion posture skeleton data related to the motion of the target character, which is completely matched with the character to be processed and has a similar topological structure with the character skeleton, is constructed by effectively using the skeleton animation of the universal character, so that the redundancy condition of the animation data is improved.
Optionally, referring to fig. 4, fig. 4 is a flowchart illustrating the sub-steps included in the sub-step S222 in fig. 3. In this embodiment, the sub-step S222 may include sub-steps S2221 to S2222.
And a substep S2221 of multiplying the position offset information of the target skeleton node which is matched with the role skeleton node in function in the skeleton offset data of the skeleton animation frame by the height ratio of the role to each role skeleton node of the universal role to obtain the position translation amount of the corresponding role skeleton node of the role to be processed.
And a substep S2222 of, for each role skeleton node of the role to be processed, performing position translation processing on the original position information corresponding to the role skeleton node in the original posture skeleton data according to the calculated position translation amount of the role skeleton node to obtain target position information corresponding to the role skeleton node in the target posture skeleton data.
In this embodiment, when constructing the target posture bone data representing a certain motion posture of the motion posture bone data, it is necessary to select the bone offset data of the corresponding bone animation frame in the pre-configured bone animation for performing the related transformation. The bone offset data corresponding to a single bone animation frame includes position offset information of each character bone node of the universal character relative to a parent bone node in the bone animation frame, the original posture bone data includes original position information of each character bone node of the character to be processed relative to the parent bone node in an original posture, and at this time, target position information of each character bone node of the character to be processed relative to the parent bone node in target posture bone data representing a certain action posture included in corresponding action posture bone data can be obtained by executing the substep S2221 and the substep S2222, so as to determine a bone position distribution condition of the character to be processed when a single action posture of a target character action is maintained.
Optionally, referring to fig. 4 again, in the present embodiment, the sub-step S222 may further include a sub-step S2223 and a sub-step S2224.
And a substep S2223 of, for each role skeleton node of the to-be-processed role, performing a multiplication operation on the scaling offset information of the target skeleton node in the skeleton offset data of the skeleton animation frame, which is functionally matched with the role skeleton node, and the original scaling information corresponding to the role skeleton node in the original posture skeleton data to obtain the target scaling information corresponding to the role skeleton node in the target posture skeleton data.
And a substep S2224 of, for each role skeleton node of the to-be-processed role, performing a multiplication operation on the rotation offset information of the target skeleton node in the skeleton offset data of the skeleton animation frame, which is functionally matched with the role skeleton node, and the original rotation information, which is corresponding to the role skeleton node in the original posture skeleton data, to obtain target rotation information, which is corresponding to the role skeleton node in the target posture skeleton data.
In this embodiment, the bone offset data corresponding to a single bone animation frame includes scaling offset information and rotation offset information of each character bone node of the generic character relative to a parent bone node within the bone animation frame, the original posture bone data comprises original scaling information and original rotation information of each character bone node of the character to be processed relative to a father bone node under the original posture, and at the moment, target scaling information and target rotation information of each character bone node of the character to be processed relative to the father bone node in target posture bone data representing a certain action posture, which is included in corresponding action posture bone data, can be obtained by executing the substep S2223 and the substep S2224, to determine a bone scaling distribution condition and a bone rotation distribution condition of the character to be processed while maintaining the single action pose of the target character action.
In the present application, in order to ensure that the computer device 10 can execute the above-described character animation sharing method through the character animation sharing apparatus 100, the present application implements the aforementioned functions by dividing the function modules of the character animation sharing apparatus 100. The following describes specific components of the character animation sharing apparatus 100 provided in the present application.
Referring to fig. 5, fig. 5 is a schematic diagram illustrating a composition of a character animation sharing device 100 according to an embodiment of the present application. In the embodiment of the present application, the character animation sharing device 100 may include a skeleton information obtaining module 110 and a character animation adapting module 120.
The skeleton information obtaining module 110 is configured to obtain original posture skeleton data of the to-be-processed character and a pre-configured skeleton animation of the general character, where the to-be-processed character and the general character have similar respective character skeleton topological structures, and the pre-configured skeleton animation matches with the target character action.
And the character animation adaptation module 120 is configured to perform bone posture adaptation processing on the character to be processed according to the original posture bone data of the character to be processed on the basis of the pre-configured bone animation to obtain action posture bone data of the character to be processed, which corresponds to the action of the target character.
Optionally, referring to fig. 6, fig. 6 is a schematic diagram illustrating the character animation adaptation module 120 in fig. 5. In the embodiment of the present application, the pre-configured bone animation includes bone offset data of a bone pose of the general-purpose character relative to an original pose in each bone animation frame, and the character animation adaptation module 120 may include a height ratio calculation sub-module 121 and a bone pose offset sub-module 122.
And the height ratio value operator module 121 is used for calculating the height ratio of the character to be processed to the universal character.
And the bone posture offset submodule 122 is used for carrying out bone posture offset on the original posture bone data according to the height ratio of the character and the bone offset data corresponding to the bone animation frame aiming at each bone animation frame of the pre-prepared bone animation to obtain target posture bone data of the character to be processed in the action posture bone data corresponding to the bone animation frame.
Optionally, referring to fig. 7, fig. 7 is a schematic diagram illustrating the bone pose offset submodule 122 in fig. 6. In this embodiment, the bone offset data corresponding to the same bone animation frame includes position offset information of each character bone node of the general character relative to a parent bone node, the original pose bone data includes original position information of each character bone node of the character to be processed relative to the parent bone node, and the bone pose offset submodule 122 may include a position translation calculation unit 1221 and a position translation processing unit 1222.
And the position translation calculation unit 1221 is configured to, for each role skeleton node of the general role, perform multiplication operation on position displacement information of a target skeleton node, which is in the skeleton displacement data of the skeleton animation frame and is functionally matched with the role skeleton node, and a role height ratio, to obtain a position translation amount of a role skeleton node corresponding to the to-be-processed role.
A position translation processing unit 1222, configured to perform, for each role bone node of the role to be processed, position translation processing on original position information corresponding to the role bone node in the original posture bone data according to the calculated position translation amount of the role bone node, so as to obtain target position information corresponding to the role bone node in the target posture bone data.
Optionally, the bone offset data corresponding to the same bone animation frame further includes scaling offset information and rotation offset information of each character bone node of the general character relative to a parent bone node, the original pose bone data includes original scaling information and original rotation information of each character bone node of the character to be processed relative to the parent bone node, and the bone pose offset submodule 122 further includes a bone scaling adjustment unit 1223 and a bone rotation processing unit 1224.
A skeleton scaling adjustment unit 1223, configured to, for each role skeleton node of the role to be processed, perform multiplication on scaling offset information of a target skeleton node in the skeleton offset data of the skeleton animation frame, where the scaling offset information is functionally matched with the role skeleton node, and original scaling information, which is corresponding to the role skeleton node, in the original posture skeleton data, to obtain target scaling information, which is corresponding to the role skeleton node, in the target posture skeleton data;
the skeleton rotation processing unit 1224 is configured to, for each role skeleton node of the role to be processed, perform multiplication on the rotation offset information of the target skeleton node in the skeleton offset data of the skeleton animation frame, which is functionally matched with the role skeleton node, and the original rotation information, which is corresponding to the role skeleton node, in the original posture skeleton data to obtain target rotation information, which is corresponding to the role skeleton node, in the target posture skeleton data.
The basic principle and the technical effects of the character animation sharing apparatus 100 according to the embodiment of the present application are the same as those of the character animation sharing method described above. For a brief description, where not mentioned in this embodiment section, reference may be made to the above description of the character animation sharing method.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part. The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned readable storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In summary, in the role animation sharing method and apparatus, the computer device, and the readable storage medium provided by the present application, under the condition that the pre-configured skeleton animation of the general role related to the action of the target role and the original posture skeleton data of the to-be-processed role having a similar role skeleton topology structure to the general role are obtained, the to-be-processed role is subjected to skeleton posture adaptation processing directly according to the original posture skeleton data of the to-be-processed role on the basis of the pre-configured skeleton animation, so as to obtain the action posture skeleton data of the to-be-processed role related to the action of the target role, thereby enabling different game roles to directly generate adapted action posture data through the skeleton animation sharing the general role, without separately creating appropriate skeleton animations for different game roles, and further greatly reducing the workload of manual creation of the skeleton animation, and improve the redundancy status of the animation data.
The above description is only for various embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of changes or substitutions within the technical scope of the present application, and all such changes or substitutions are included in the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method for sharing character animation, the method comprising:
acquiring original posture skeleton data of a character to be processed and a preset skeleton animation of a universal character, wherein the preset skeleton animation is matched with the action of a target character, and the respective character skeleton topological structures of the character to be processed and the universal character are similar;
and carrying out bone posture adaptation processing on the character to be processed according to the original posture bone data of the character to be processed on the basis of the pre-prepared bone animation to obtain action posture bone data of the character to be processed, wherein the action posture bone data corresponds to the action of the target character.
2. The method of claim 1, wherein the preset bone animation includes bone offset data of a bone posture of the universal character relative to an original posture in each bone animation frame, and the step of performing bone posture adaptation processing on the character to be processed according to the original posture bone data of the character to be processed on the basis of the preset bone animation to obtain action posture bone data of the character to be processed, which corresponds to the action of the target character, includes:
calculating the role height ratio between the role to be processed and the universal role;
and aiming at each skeleton animation frame of the preset skeleton animation, carrying out skeleton posture offset on the original posture skeleton data according to the character height ratio and the skeleton offset data corresponding to the skeleton animation frame to obtain target posture skeleton data of the character to be processed in the action posture skeleton data corresponding to the skeleton animation frame.
3. The method according to claim 2, wherein the bone offset data corresponding to the same bone animation frame includes position offset information of each character bone node of the generic character relative to a parent bone node, the original pose bone data includes original position information of each character bone node of the character to be processed relative to a parent bone node, and the step of performing bone pose offset on the original pose bone data according to the character height ratio and the bone offset data corresponding to the bone animation frame to obtain the target pose bone data of the character to be processed in the action pose bone data corresponding to the bone animation frame includes:
for each role skeleton node of the universal role, multiplying the position offset information of a target skeleton node which is matched with the role skeleton node in the skeleton offset data of the skeleton animation frame in function with the role height ratio to obtain the position translation amount of the role skeleton node corresponding to the role to be processed;
and aiming at each role skeleton node of the role to be processed, carrying out position translation processing on original position information corresponding to the role skeleton node in the original posture skeleton data according to the calculated position translation amount of the role skeleton node to obtain target position information corresponding to the role skeleton node in the target posture skeleton data.
4. The method of claim 3, wherein the bone offset data corresponding to the same bone animation frame further includes scaling offset information and rotation offset information of each character bone node of the generic character relative to a parent bone node, the original pose bone data includes original scaling information and original rotation information of each character bone node of the to-be-processed character relative to a parent bone node, and the step of performing bone pose offset on the original pose bone data according to the character height ratio and the bone offset data corresponding to the bone animation frame to obtain the target pose bone data of the to-be-processed character in the action pose bone data corresponding to the bone animation frame further includes:
for each role skeleton node of the role to be processed, multiplying scaling offset information of a target skeleton node in skeleton offset data of the skeleton animation frame, which is matched with the role skeleton node in function, and original scaling information, which is corresponding to the role skeleton node, in the original posture skeleton data to obtain target scaling information, which is corresponding to the role skeleton node, in the target posture skeleton data;
and for each role skeleton node of the role to be processed, multiplying the rotation offset information of the target skeleton node in the skeleton offset data of the skeleton animation frame, which is matched with the role skeleton node in function, and the original rotation information, which is corresponding to the role skeleton node in the original posture skeleton data, to obtain the target rotation information, which is corresponding to the role skeleton node in the target posture skeleton data.
5. A character animation sharing apparatus, the apparatus comprising:
the skeleton information acquisition module is used for acquiring original posture skeleton data of a character to be processed and a preset skeleton animation of a universal character, wherein the preset skeleton animation is matched with the action of a target character, and the respective role skeleton topological structures of the character to be processed and the universal character are similar;
and the character animation adaptation module is used for carrying out bone posture adaptation processing on the character to be processed according to the original posture bone data of the character to be processed on the basis of the pre-configured bone animation to obtain action posture bone data, corresponding to the action of the target character, of the character to be processed.
6. The apparatus of claim 5, wherein the pre-configured bone animation comprises bone offset data of a bone pose of the generic character relative to an original pose at each bone animation frame, the character animation adaptation module comprising:
the height ratio calculation submodule is used for calculating the height ratio of the roles to be processed and the universal roles;
and the bone posture offset submodule is used for carrying out bone posture offset on the original posture bone data according to the character height ratio and the bone offset data corresponding to the bone animation frame aiming at each bone animation frame of the pre-prepared bone animation to obtain target posture bone data of the character to be processed in the action posture bone data, wherein the target posture bone data corresponds to the bone animation frame.
7. The apparatus of claim 6, wherein bone offset data corresponding to a same bone animation frame comprises position offset information of each character bone node of the generic character relative to a parent bone node, wherein the raw pose bone data comprises raw position information of each character bone node of the character to be processed relative to a parent bone node, and wherein the bone pose offset submodule comprises:
a position translation calculation unit, configured to perform a multiplication operation on position offset information of a target skeleton node in the skeleton offset data of the skeleton animation frame, where the target skeleton node is functionally matched with the role skeleton node, and the role height ratio, so as to obtain a position translation amount of a role skeleton node corresponding to the to-be-processed role;
and the position translation processing unit is used for carrying out position translation processing on original position information corresponding to the role skeleton node in the original posture skeleton data according to the calculated position translation amount of the role skeleton node aiming at each role skeleton node of the role to be processed to obtain target position information corresponding to the role skeleton node in the target posture skeleton data.
8. The apparatus of claim 7, wherein the bone offset data for the same bone animation frame further comprises scaling offset information and rotation offset information for each character bone node of the generic character relative to a parent bone node, wherein the raw pose bone data comprises raw scaling information and raw rotation information for each character bone node of the character to be processed relative to a parent bone node, and wherein the bone pose offset sub-module further comprises:
a skeleton scaling adjustment unit, configured to perform, for each role skeleton node of the to-be-processed role, multiplication on scaling offset information of a target skeleton node in the skeleton offset data of the skeleton animation frame, which is functionally matched with the role skeleton node, and original scaling information, which is corresponding to the role skeleton node, in the original posture skeleton data, to obtain target scaling information, which is corresponding to the role skeleton node, in the target posture skeleton data;
and the skeleton rotation processing unit is used for multiplying the rotation offset information of a target skeleton node which is matched with the role skeleton node in the skeleton offset data of the skeleton animation frame and the original rotation information which is corresponding to the role skeleton node in the original posture skeleton data aiming at each role skeleton node of the to-be-processed role to obtain the target rotation information which is corresponding to the role skeleton node in the target posture skeleton data.
9. A computer device comprising a processor and a memory, the memory storing a computer program executable by the processor, the processor being configured to execute the computer program to implement the character animation sharing method of any one of claims 1 to 4.
10. A readable storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the character animation sharing method of any one of claims 1-4.
CN202111622802.2A 2021-12-28 2021-12-28 Role animation sharing method and device, computer equipment and readable storage medium Pending CN114419210A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111622802.2A CN114419210A (en) 2021-12-28 2021-12-28 Role animation sharing method and device, computer equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111622802.2A CN114419210A (en) 2021-12-28 2021-12-28 Role animation sharing method and device, computer equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN114419210A true CN114419210A (en) 2022-04-29

Family

ID=81269434

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111622802.2A Pending CN114419210A (en) 2021-12-28 2021-12-28 Role animation sharing method and device, computer equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN114419210A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114898022A (en) * 2022-07-15 2022-08-12 杭州脸脸会网络技术有限公司 Image generation method, image generation device, electronic device, and storage medium
CN117557699A (en) * 2024-01-11 2024-02-13 腾讯科技(深圳)有限公司 Animation data generation method, device, computer equipment and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114898022A (en) * 2022-07-15 2022-08-12 杭州脸脸会网络技术有限公司 Image generation method, image generation device, electronic device, and storage medium
CN114898022B (en) * 2022-07-15 2022-11-01 杭州脸脸会网络技术有限公司 Image generation method, image generation device, electronic device, and storage medium
CN117557699A (en) * 2024-01-11 2024-02-13 腾讯科技(深圳)有限公司 Animation data generation method, device, computer equipment and storage medium
CN117557699B (en) * 2024-01-11 2024-04-02 腾讯科技(深圳)有限公司 Animation data generation method, device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN114419210A (en) Role animation sharing method and device, computer equipment and readable storage medium
US10062197B2 (en) Animating a virtual object in a virtual world
CN113610981A (en) Face model generation method, interaction method and related device
US20170344907A1 (en) Information processing apparatus, information processing method and program
CN110163938B (en) Animation control method and device, storage medium and electronic device
US9984488B2 (en) Animating a virtual object in a virtual world
US20170221251A1 (en) Animating a virtual object in a virtual world
CN111598987B (en) Skeleton processing method, device, equipment and storage medium of virtual object
US10410393B2 (en) Animating a virtual object in a virtual world
CN112989211B (en) Method and system for determining information similarity
CN108159694B (en) Flexible body flutter simulation method, flexible body flutter simulation device and terminal equipment
CN112597612B (en) Robot optimization method, device, terminal equipment and computer readable storage medium
US20160171740A1 (en) Real-time method for collaborative animation
CN114404951A (en) Game rendering updating method and device, computer equipment and storage medium
CN112642149A (en) Game animation updating method, device and computer readable storage medium
CN111462015A (en) Map track processing method and device, electronic equipment and storage medium
CN115205411A (en) Occlusion body generation method and device, electronic equipment and medium
CN113470151B (en) Method and device for realizing animation state machine
CN114093033A (en) Human motion posture migration method and device, control equipment and readable storage medium
CN114359469A (en) Method, apparatus, device and medium for generating main control object projection
CN113450438A (en) Virtual character driving method and device based on motion capture and computer equipment
CN113034651A (en) Interactive animation playing method, device, equipment and storage medium
JP2022516196A (en) Image processing and neural network training methods, equipment, equipment, media and programs
CN115690267B (en) Animation processing method, device, equipment, storage medium and product
CN115937371B (en) Character model generation method and system

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