Animation character creation method and device, equipment, storage medium and program product
By adjusting template skeleton data and adding animation data, animated characters are automatically created, which solves the problems of high animation character creation cost and low efficiency in the existing technology, and achieves efficient animation character creation.
Patent Information
- Application Number
- CN202310426647.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-11
- Publication Date
- 2024-10-18
AI Technical Summary
In the existing animated character creation scheme, the production cost of action images is high and the efficiency is low, resulting in the creation of animated characters with high cost and low efficiency.
By obtaining the character image and template skeleton data, adjusting based on the size difference between the character object and the template character, generating matching skeleton data, and adding animation data to the character object, the animated character is automatically created to avoid additional production of action images with different actions.
It reduces the cost of creating animated characters, improves the efficiency of creating animated characters, and realizes the ability to automatically create animated characters.
Smart Images

Figure CN118799457A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment, storage medium and program product for creating an animation character. Background Art
[0002] With the rapid development of computer technology, the application business fields of animated characters are becoming more and more extensive. For example, animated characters can be used as emoticons in the social business field, and as video production materials in the video business field, and so on.
[0003] At present, the scheme for creating animated characters is essentially a scheme for creating action pictures. Specifically, after importing the character image, the creator of the animated character needs to continue to upload the action images of different actions of the character object in the character image, and then perform splicing processing between the action images of different actions to create the animated character. It can be seen that in the current scheme for creating animated characters, the action images of different actions need to be produced by the creator himself, and the production cost of the action images is high and the efficiency is low, resulting in high cost and low efficiency for creating animated characters. Summary of the invention
[0004] The embodiments of the present application provide a method, apparatus, device, storage medium and program product for creating an animated character, which can reduce the cost of creating an animated character and improve the efficiency of creating an animated character.
[0005] On the one hand, an embodiment of the present application provides a method for creating an animated character, the method for creating an animated character comprising:
[0006] Obtain a character image; the character image contains a character object for which a corresponding animation character needs to be created, and the animation character corresponding to the character object has animation capabilities;
[0007] Obtain template skeleton data; the template skeleton data is created based on the template character, and the template skeleton data is used to describe the skeleton attribute information of the template character;
[0008] Based on the size difference between the character object and the template character, the template skeleton data is adjusted to obtain matching skeleton data that matches the character object; the matching skeleton data is used to describe the skeleton attribute information of the character object;
[0009] Add animation data to the character object, and create an animated character corresponding to the character object based on the character image, matching skeleton data and animation data.
[0010] Accordingly, an embodiment of the present application provides a device for creating an animated character, the device for creating an animated character comprising:
[0011] An acquisition unit is used to acquire a character image; the character image contains a character object for which a corresponding animation character needs to be created, and the animation character corresponding to the character object has animation capability;
[0012] The acquisition unit is also used to acquire template skeleton data; the template skeleton data is created based on the template character, and the template skeleton data is used to describe the skeleton attribute information of the template character;
[0013] A processing unit, used for adjusting the template skeleton data based on the size difference between the character object and the template character, to obtain matching skeleton data that matches the character object; the matching skeleton data is used to describe the skeleton attribute information of the character object;
[0014] The processing unit is also used to add animation data to the character object, and create an animation character corresponding to the character object according to the character image, matching skeleton data and animation data.
[0015] In one implementation, the template skeleton data includes skeleton-associated body data of the template character, and the skeleton-associated body data of the template character is used to describe the character body information of the template character;
[0016] The processing unit is used to adjust the template skeleton data based on the size difference between the character object and the template character, and to obtain matching skeleton data that matches the character object, specifically to perform the following steps:
[0017] Based on the size difference between the character object and the template character, the skeleton-associated body data of the template character in the template skeleton data is modified into the skeleton-associated body data of the character object to obtain matching skeleton data;
[0018] The skeleton-associated body data of the character object is used to describe the character body information of the character object.
[0019] In one implementation, the processing unit is used to modify the skeleton-associated body data of the template character in the template skeleton data into the skeleton-associated body data of the character object based on the size difference between the character object and the template character, and when the matching skeleton data is obtained, specifically to perform the following steps:
[0020] Determine a body transformation coefficient based on the size difference between the character object and the template character;
[0021] Get the raw body data of the character object;
[0022] According to the body transformation coefficient, the original body data of the character object is transformed to obtain the skeleton-related body data of the character object;
[0023] The skeleton-associated body data of the template character in the template skeleton data is modified into the skeleton-associated body data of the character object to obtain matching skeleton data.
[0024] In one implementation, the skeleton-associated body data of the template character includes: the body size data of the template character, the body offset data of the template character, and the body scale transformation data of the template character; the skeleton-associated body data of the character object includes: the body size data of the character object, the body offset data of the character object, and the body scale transformation data of the character object; the original body data of the character object includes: the original size data, the original offset data, and the original scale transformation data of the character object's body;
[0025] The processing unit is used to transform the original body data of the character object according to the body transformation coefficient to obtain the skeleton-associated body data of the character object, and specifically to perform the following steps:
[0026] According to the body transformation coefficient, the original size data of the character object's body is transformed to obtain the body size data of the character object;
[0027] According to the body transformation coefficient, the original offset data of the character object's body is transformed to obtain the body offset data of the character object;
[0028] According to the body transformation coefficient, the original scale transformation data of the character object's body is transformed to obtain the body scale transformation data of the character object.
[0029] In one implementation, the processing unit is used to determine the body transformation coefficient according to the size difference between the character object and the template character, and is specifically used to perform the following steps:
[0030] Determine the diagonal length information of the character object according to the width information and the height information of the character object;
[0031] Determine the diagonal length information of the template character according to the width information of the template character and the height information of the template character;
[0032] The body transformation coefficient is determined based on the ratio between the diagonal length information of the template character and the diagonal length information of the character object.
[0033] In one implementation, the processing unit is used to perform the following steps before creating an animation character corresponding to the character object according to the character image, matching skeleton data and animation data:
[0034] Output the character object and the skeleton of the character object, the skeleton of the character object includes bones;
[0035] In response to a bone adjustment operation on a bone in a skeleton of a character object, the bone adjustment data corresponding to the bone adjustment operation is updated into the matching skeleton data.
[0036] In one implementation, the character object in the character image does not include facial expressions; the processing unit is used to perform the following steps before creating an animated character corresponding to the character object based on the character image, matching skeleton data and animation data:
[0037] Add target facial expressions to character objects;
[0038] In response to an expression adjustment operation on a target facial expression, updating expression adjustment data corresponding to the expression adjustment operation into the matching skeleton data;
[0039] Among them, the expression adjustment operation is used to adjust the target facial expression to match the character object.
[0040] In one implementation, the processing unit is used to perform the following steps when adding animation data to the character object:
[0041] Add body animation data to the character object; wherein the body animation data is used to describe the body animation added to the character object, and the body animation data includes body animation material data and body animation logic data; the body animation material data is used to describe the body material corresponding to the body animation added to the character object, and the body animation logic data is used to describe the animation logic of the body animation added to the character object;
[0042] When facial expressions are added to the character object in the character image, the processing unit is used to add animation data to the character object and is also used to perform the following steps:
[0043] Add expression animation data to the character object; wherein the expression animation data is used to describe the expression animation added for the character object, and the expression animation data includes expression animation material data and expression animation logic data; the expression animation material data is used to describe the expression material corresponding to the expression animation added to the character object, and the expression animation logic data is used to describe the animation logic of the expression animation added to the character object.
[0044] In one implementation, the processing unit is used to add body animation data to the character object, specifically to perform the following steps:
[0045] Outputting body animation preview information of multiple body animations supported by the template skeleton data, each body animation supported by the template skeleton data corresponds to respective body animation data;
[0046] In response to the body animation selection operation, adding target body animation data to the character object;
[0047] The target body animation data is the body animation data corresponding to the target body animation preview information selected by the body animation selection operation.
[0048] In one implementation, when a target facial expression provided by a facial expression library is added to a character object in a character image, a processing unit, when adding expression animation data to the character object, is specifically configured to perform the following steps:
[0049] Outputting expression animation preview information of multiple expression animations supported by the target facial expression, each expression animation supported by the target facial expression corresponding to respective expression animation data;
[0050] In response to the expression animation selection operation, adding target expression animation data to the character object;
[0051] The target facial expression animation data is facial expression animation data corresponding to the target facial expression animation preview information selected by the facial expression animation selection operation.
[0052] In one implementation, when a customized target facial expression is added to a character object in a character image, the processing unit is used to add expression animation data to the character object, specifically to perform the following steps:
[0053] Add expression animation materials and expression animation logic of the target expression animation corresponding to the target facial expression to the character object;
[0054] Generate expression animation data of the target expression animation according to the added expression animation material and expression animation logic;
[0055] Add the expression animation data of the target expression animation to the character object.
[0056] In one implementation, the processing unit is used to adjust the template skeleton data based on the size difference between the character object and the template character to obtain matching skeleton data that matches the character object, and is also used to perform the following steps:
[0057] Checking the character image with respect to the format conditions for creation;
[0058] If the image format of the character image does not meet the creation format condition, preprocessing the character image to obtain a preprocessed character image;
[0059] The processing unit is used to adjust the template skeleton data based on the size difference between the character object and the template character, and to obtain matching skeleton data that matches the character object, specifically to perform the following steps:
[0060] Based on the size difference between the character object in the preprocessed character image and the template character, the template skeleton data is adjusted to obtain matching skeleton data that matches the character object in the preprocessed character image.
[0061] In one implementation, the image format of the character image does not meet the creation format condition means that the image format of the character image is an image format other than the target image format; the processing unit is used to pre-process the character image to obtain the pre-processed character image, specifically to perform the following steps:
[0062] Convert the character image into a format to obtain the character image in a target image format;
[0063] Get the channel image of the transparency channel from the character image in the target image format;
[0064] Count the number of transparent pixels in the channel image of the transparency channel to obtain the transparent pixel ratio;
[0065] If the transparency pixel ratio is less than or equal to the ratio threshold, background subtraction processing is performed on the character image in the target image format to obtain a preprocessed character image.
[0066] In one implementation, the acquisition unit is used to acquire the template skeleton data by performing the following steps:
[0067] Acquire template skeleton data from a plurality of reference skeleton data included in the skeleton library;
[0068] Among them, among the multiple reference skeleton data included in the skeleton library, one reference skeleton data corresponds to one character type; any reference skeleton data is skeleton data created based on the reference character under the corresponding character type, and any reference skeleton data is used to describe the skeleton attribute characteristics of the reference character under the corresponding character type.
[0069] In one implementation, the acquiring unit is used to acquire the template skeleton data from the plurality of reference skeleton data included in the skeleton library, and is specifically used to perform the following steps:
[0070] Identify the role type of the role object in the role image to obtain the target role type;
[0071] From the multiple reference skeleton data included in the skeleton library, reference skeleton data matching the target character type is obtained as template skeleton data.
[0072] In one implementation, the acquiring unit is used to acquire the template skeleton data from the plurality of reference skeleton data included in the skeleton library, and is specifically used to perform the following steps:
[0073] Output the skeleton morphology preview information corresponding to each reference skeleton data in the skeleton library;
[0074] In response to the skeleton selection operation, the reference skeleton data corresponding to the skeleton morphology preview information selected by the skeleton selection operation is acquired from a plurality of reference skeleton data included in the skeleton library as template skeleton data.
[0075] Accordingly, an embodiment of the present application provides a computer device, the computer device comprising:
[0076] a processor suitable for implementing a computer program;
[0077] A computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor and executing the above-mentioned method for creating an animation character.
[0078] Accordingly, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is read and executed by a processor of a computer device, the computer device executes the above-mentioned method for creating an animation character.
[0079] Accordingly, an embodiment of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned method for creating an animated character.
[0080] In an embodiment of the present application, when it is necessary to create an animated character corresponding to a character object, a character image and template skeleton data containing the character object can be obtained. The template skeleton data can be created based on the template character and can be used to describe the skeleton attribute information of the template character; then, the template skeleton data can be adjusted based on the size difference between the character object and the template character to obtain matching skeleton data that matches the character object. After adding animation data to the character object, the animated character corresponding to the character object can be created based on the character image, matching skeleton data, and animation data. In other words, the embodiment of the present application can automatically create an animated character corresponding to a character object based on a character image containing the character object, without the need to additionally produce action images of different actions of the character object, which can reduce the creation cost of the animated character and improve the creation efficiency of the animated character. BRIEF DESCRIPTION OF THE DRAWINGS
[0081] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0082] Figure 1 It is a schematic diagram of the architecture of an animation character creation system provided in an embodiment of the present application;
[0083] Figure 2 It is a flowchart of a method for creating an animation character provided in an embodiment of the present application;
[0084] Figure 3 It is a schematic diagram of an interface of a character image uploading process provided by an embodiment of the present application;
[0085] Figure 4 It is a flowchart of a pre-processing process for creating a character image provided by an embodiment of the present application;
[0086] Figure 5 This is a schematic diagram of an interface for removing the background of a character image provided by an embodiment of the present application;
[0087] Figure 6 is a schematic diagram of a skeleton selection interface provided in an embodiment of the present application;
[0088] Figure 7 It is a schematic diagram of the data structure of a template skeleton data provided in an embodiment of the present application;
[0089] Figure 8 It is a data structure diagram of skeleton-associated body data of a template character provided in an embodiment of the present application;
[0090] Fig. 9 It is a data structure diagram of skeleton-associated body data of a character object provided in an embodiment of the present application;
[0091] Fig.10 is a schematic diagram of a skeleton adjustment interface of a character object provided in an embodiment of the present application;
[0092] Fig.11 is a schematic diagram of a skeleton adjustment result of a character object provided in an embodiment of the present application;
[0093] Fig.12 is a schematic diagram of an interface for a facial expression adding process provided in an embodiment of the present application;
[0094] Fig.13It is a schematic diagram of updating expression adjustment data of a facial expression provided by an embodiment of the present application;
[0095] Fig.14 It is a flowchart of another method for creating an animation character provided in an embodiment of the present application;
[0096] Fig.15 is a schematic diagram of an expression sprite provided in an embodiment of the present application;
[0097] Fig.16 It is a schematic diagram of the structure of node data of a skin node provided in an embodiment of the present application;
[0098] Fig.17 It is a schematic diagram of the structure of node data of an animation node provided in an embodiment of the present application;
[0099] Fig.18 It is a schematic diagram of an interface of an animation adding process provided in an embodiment of the present application;
[0100] Fig.19 It is a logical diagram of creating an animation character provided by an embodiment of the present application;
[0101] Fig. 20 is a schematic diagram of an interface for adding additional role information provided in an embodiment of the present application;
[0102] Fig.21 This is a schematic diagram of an interface of a retry interaction method provided in an embodiment of the present application;
[0103] Fig. 22 This is a schematic diagram of an interface of another retry interaction method provided in an embodiment of the present application;
[0104] Fig.23 This is a schematic diagram of an interface of a usage scenario of an animated character provided in an embodiment of the present application;
[0105] Fig.24 is a schematic diagram of an animation character resource provided in an embodiment of the present application;
[0106] Fig.25 It is a relationship diagram of a resource class diagram provided in an embodiment of the present application;
[0107] Fig.26 It is a schematic diagram of binding between a character object and animation data provided by an embodiment of the present application;
[0108] Fig. 27 This is a schematic diagram of a submission review process for an animation character provided in an embodiment of the present application;
[0109] Fig.28It is a structural schematic diagram of a device for creating an animation character provided in an embodiment of the present application;
[0110] Fig.29 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0111] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0112] The embodiment of the present application relates to creating an animated character for a character object. The animated character created for a character object refers to a character object with animation capabilities. The character object has animation capabilities, which can be understood as the character object being able to make actions, and the actions may include but are not limited to body actions (e.g., moving, bouncing, rolling, waving, etc.) and facial expressions (e.g., sighing, being moved, being speechless, being shy, etc.). It should be noted that the embodiment of the present application does not limit the role type of the character object, that is, the embodiment of the present application does not limit the role type of the animated character created for the character object, for example, the role type of the character object or the animated character may include but is not limited to any of the following: human character, quadruped character, spherical creature character and insect character, etc. The embodiment of the present application does not limit the role dimension of the character object, that is, the embodiment of the present application does not limit the role dimension of the animated character created for the character object, for example, the role dimension of the character object or the animated character may include two-dimensional, three-dimensional angles, and 2.5 dimensions, etc.
[0113] The embodiment of the present application is to create an animated character for a character object using skeletal animation as the technical principle. Skeletal animation is a computer animation technology that divides the character model into two parts, one is the skin used to draw the model, and the other is the skeleton used to control the action. Different from traditional stop-motion animation, skeletal animation uses the established skeleton to apply to one or more pictures to make them move, without the need to produce additional action images of different actions, with low production cost, high efficiency and more flexible and vivid actions.
[0114] Based on this, the embodiment of the present application proposes a method for creating an animated character. In the method for creating an animated character, a character image containing a character object is provided. By adjusting the template skeleton data to match the character object and adding animation data, the animated character of the character object can be automatically created. There is no need to additionally produce action images of different actions of the character object, which can reduce the cost of creating the animated character and improve the efficiency of creating the animated character. In particular, when the character object in the character image is an original character object, the method for creating an animated character provided by the embodiment of the present application can create an original animated character corresponding to the original character object, which can reduce the cost of creating the original animated character and improve the efficiency of creating the original animated character.
[0115] The following is an introduction to an animation character creation system suitable for implementing an animation character creation method.
[0116] like Figure 1 As shown, the animation character creation system may include a terminal 101 and a server 102. The terminal 101 and the server 102 may establish a direct communication connection through wired communication, or may establish an indirect communication connection through wireless communication. The embodiment of the present application does not limit the communication connection method between the terminal 101 and the server 102. Among them:
[0117] (1) Terminal 101: The terminal may include but is not limited to any of the following: a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart watch, a smart home appliance, a smart vehicle terminal, and an aircraft, etc. An animation character creation client may be running in the terminal. The animation character creation client refers to a client with an animation character creation function. For example, the animation character creation client is a social client with an animation character creation function, the animation character creation client is a video production client with an animation character creation function, etc. The animation character creation client may include but is not limited to any of the following: an animation character creation application, an animation character creation applet, an animation character creation software, an animation character creation webpage, etc.
[0118] The animation character creation client can provide a visual interface to the creator of the animation character (hereinafter referred to as the creator), and the creator can perform at least one of the following operations through the visual interface: upload a character image containing a character object, select facial expressions to be added to the character object, select animations to be added to the character object (which may include at least one of body animation and expression animation), add character name, cover, timbre, speech speed and other character-related data to the created animation character, submit the created animation character, etc. The creator may include any of the following: a registrant of the animation character creation client who has a need to create an animation character, an operator, a robot, an artificial intelligence program, etc.
[0119] (2) Server 102: The server can be a single physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms, etc., which are not limited in the embodiments of the present application. When the animation character creation client runs on the terminal, the animation character creation client can communicate with the server through the terminal. When there is a demand for animation character creation in the animation character creation client, the animation character creation client and the server can interact to create the animation character. During the animation character creation process, the server is the data processing server of the animation character creation client. The server can provide the animation character creation client with various data libraries required in the animation character creation process. For example, the server can provide a skeleton library, a facial expression library, and a body animation library, etc. Among them:
[0120] The skeleton library can provide different types of skeleton data to the animation character creation client. During the creation process of the animation character, the skeleton data matching the character object can be selected from the skeleton library as the template skeleton data, and the template skeleton data can be adapted and bound to the character object. The facial expression library can provide different facial expression maps to the animation character creation client, as well as the expression animation data corresponding to different expression animations under each facial expression map; during the creation process of the animation character, after adding the target facial expression map in the facial expression library to the character object, the expression animation under the target facial expression map can be added to the character object, and the character object can be bound to the expression animation data corresponding to the added expression animation. The body animation library can provide body animation data corresponding to different body animations to the animation character creation client. During the creation process of the animation character, body animation can be added to the character object, and the character object can be bound to the body animation data corresponding to the added body animation.
[0121] Based on the above introduction to animation character creation client and server, Figure 1 As shown, the animation character creation process of the interaction between the animation character creation client, the server and the creator may include:
[0122] (a) The animation character creation client requests skeleton data from the server.
[0123] (b) The server sends skeleton data to the animation character creation client.
[0124] (c) The creator uploads the character image to the animation character creation client.
[0125] The character image contains a character object for which a corresponding animated character needs to be created. After the character image is uploaded to the animated character creation client, the animated character creation client can perform a series of processing on the character image. The series of processing may include: checking whether the character image is in the image format required for creating an animated character (for example, the image format required for creating an animated character is PNG (Portable Network Graphics) format); if not, the image format of the character image needs to be converted to the image format required for creating an animated character; if so, or after the image format of the character image is converted to the image format required for creating an animated character, it is possible to count whether the ratio of transparency pixels in the character image is less than or equal to a ratio threshold; if so, it is necessary to perform background subtraction processing on the character image; if not, it can be determined that the character image is a transparent background image, and subsequent processing can be performed directly on the character image.
[0126] (d) The animation character creation client adapts and binds the template skeleton data to the character object.
[0127] The animation character creation client can select skeleton data that matches the character type of the character object from the skeleton data issued by the server as template skeleton data. For example, if the character type of the character object is a human character, the skeleton data of the human character can be selected from the skeleton data issued by the server as template skeleton data. If the character type of the character object is a quadruped character, the skeleton data of the quadruped character can be selected from the skeleton data issued by the server as template skeleton data. Then, the template skeleton data can be created based on the template character. There is a more or less size difference between the character object and the template character. Therefore, based on the size difference between the character object and the template character, the template skeleton data can be adjusted to adapt to the character object, and then the adjusted template skeleton data can be bound to the character object.
[0128] (e) The animation character creation client requests the facial expression map from the server.
[0129] (f) The server sends facial expression maps to the animation character creation client.
[0130] (g) The creator selects a target facial expression map in the animation character creation client and adds it to the character object, and adjusts the target facial expression map to fit the character object.
[0131] (h) The animation character creation client requests the server for body animation data and expression animation data.
[0132] The animation character creation client can request the server for body animation data corresponding to the template skeleton data and expression animation data corresponding to the target facial expression map.
[0133] (i) The server sends body animation data and expression animation data to the animation character creation client.
[0134] (j) The creator selects body animation data and expression animation data to be added to the character object in the animation character creation client.
[0135] (k) The animation character creation client shows the creator a preview of the added body animation and facial expression animation.
[0136] (l) The creator adds character attachment data of the character object in the animation character creation client.
[0137] Character-related data may include, for example, character name, character cover, voice, speech speed, etc.
[0138] (m) The animation character creation client submits the created animation character to the server.
[0139] based on Figure 1 The animation character creation system shown provides a character image containing a character object. By adjusting the template skeleton data to adapt to the character object and adding animation data, the animation character of the character object can be automatically created. There is no need to additionally produce action images of different actions of the character object, which can reduce the creation cost of the animation character and improve the creation efficiency of the animation character.
[0140] It can be understood that the animation character creation system described in the embodiment of the present application is for the purpose of more clearly illustrating the technical solution of the embodiment of the present application, and does not constitute a limitation on the technical solution provided in the embodiment of the present application. A person of ordinary skill in the art can know that with the evolution of the system architecture and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.
[0141] The following is a detailed introduction to the method for creating an animated character provided in an embodiment of the present application in conjunction with the accompanying drawings.
[0142] The embodiment of the present application provides a method for creating an animated character. The method mainly introduces the preprocessing process of the character image and the adaptation and adjustment process between the character object in the character image and the template skeleton data. The method for creating an animated character can be executed by a computer device. The computer device can be a terminal or a server running an animated character creation client. The embodiment of the present application takes the computer device as an example. Figure 2 As shown, the method for creating the animation character may include but is not limited to the following steps S201 to S204:
[0143] S201, obtaining a character image.
[0144] The character image can be uploaded by the creator to the animation character creation client. The character image can contain the character object for which the corresponding animation character needs to be created. The character image upload process is as follows: Figure 3 As shown, please refer to the following description for details: the character creation interface 30 of the animation character creation client may include the created animation characters (for example, characters 1-9 in the character creation interface 30) provided by the animation character creation client, and by triggering the character creation entry 301 in the character creation interface 30, the character creation window 302 may be pulled up, and the character creation window 302 may include character image upload requirement information 3021 and a character image upload entry 3022; by triggering the character image upload entry 3022, the terminal album may be pulled up, and the terminal album may be displayed in the image selection interface 31, and after selecting the character image in the terminal album displayed in the image selection interface 31, the image confirmation interface 32 may be entered, and after confirming the selected character image in the image confirmation interface 32, the image cropping interface 33 may be entered; the image cropping interface 33 may support operations such as scaling and moving the cropping frame, and after performing the cropping operation on the image inside the cropping frame, the character image inside the cropping frame is used as the acquired character image. During the character image upload process, background content irrelevant to the character object can be removed by cropping the uploaded character image. These background contents irrelevant to the character object are irrelevant to the creation process of the animation character corresponding to the character.
[0145] After acquiring the character image, the character image can be checked for the creation format conditions, that is, whether the character image meets the creation format conditions; if the image format of the character image does not meet the creation format conditions, the character image can be preprocessed (the preprocessing here is the first preprocessing) to obtain the preprocessed character image, and the subsequent processing logic can be performed based on the preprocessed character image. Among them, the image format of the character image does not meet the creation format conditions means that the image format of the character image is an image format other than the target image format, and the target image format refers to the image format required for creating an animated character, for example, the target image format is PNG (Portable Network Graphics) format. Performing a first preprocessing on the character image may specifically include: performing format conversion on the character image to obtain a character image in a target image format; obtaining a channel image of a transparency channel (e.g., an alpha channel) from the character image in the target image format; counting the number of transparent pixels in the channel image of the transparency channel to obtain a transparent pixel ratio; if the transparency pixel ratio is less than or equal to a ratio threshold, it can be said that the character image has a non-transparent background image, and the character image in the target image format can be subjected to background subtraction processing to obtain a preprocessed character image, and the preprocessed character image has a transparent background image; if the transparency pixel ratio is greater than the ratio threshold, it can be said that the character image has a transparent background image, and the character image in the target image format can be directly determined as the preprocessed character image.
[0146] If the image format of the character image meets the creation format condition, that is, the image format of the character image is the target image format, the character image can be preprocessed (the preprocessing here is the second preprocessing) to obtain the preprocessed character image, and the subsequent processing logic can be performed based on the preprocessed character image. The second preprocessing of the character image can specifically include: obtaining a channel image of a transparency channel (for example, an alpha channel) from the character image in the target image format; counting the number of transparent pixels in the channel image of the transparency channel to obtain a transparent pixel ratio; if the transparency pixel ratio is less than or equal to a ratio threshold, it can be said that the character image is a non-transparent background image, and the character image in the target image format can be subjected to background removal processing to obtain a preprocessed character image, and the preprocessed character image is a transparent background image; if the transparency pixel ratio is greater than the ratio threshold, it can be said that the character image is a transparent background image, and the character image in the target image format can be directly determined as the preprocessed character image.
[0147] It should be noted that character images with transparent backgrounds can achieve better animation character creation effects. The channel image of the transparency channel in the target image format can determine whether the character image is a transparent background image. Therefore, when the uploaded character image is in an image format other than the target image format, the character image can be converted to the target image format first, and then the channel image of the transparency channel can be obtained to determine whether the character image is a transparent background image. If not, the character image can be subjected to background subtraction processing to achieve better animation character creation effects.
[0148] Furthermore, in order to avoid performance problems of the animation character creation client caused by the excessive pixel size of the acquired character image, before checking the acquired character image for the creation format condition, the acquired character image can be checked for pixel size; if the maximum pixel in the width pixel or height pixel of the character image exceeds the pixel threshold, the character image can be compressed with the same aspect ratio so that the width pixel or height pixel of the character image is within the pixel threshold, and then the character image after the compression with the same aspect ratio can be checked for the creation format condition; if the maximum pixel in the width pixel or height pixel of the character image is less than or equal to the pixel threshold, the acquired character image can be directly checked for the creation format condition. The pixel threshold can be set according to the resolution of the commonly used device of the client and the normal size of the character object in the device rendering area.
[0149] The above aspect ratio compression, creation format condition check, and preprocessing can be uniformly considered as the process of pre-processing the acquired character image. The process of pre-processing the acquired character image can be summarized as follows: Figure 4:First, it is possible to check whether the maximum pixel in the width pixel or height pixel of the obtained character image exceeds the pixel threshold; if so, the character image can be compressed with the same aspect ratio so that the maximum pixel in the width pixel or height pixel of the character image is within the pixel threshold. After the character image is compressed with the same aspect ratio, it is possible to check whether the image format of the character image is the target image format; if not, it is possible to check whether the image format of the character image is the target image format. Secondly, if the image format of the character image is the target image format, it is possible to check whether the character image in the target image format is a transparent background image; if the image format of the character image is not the target image format, it is possible to convert the character image to the target image format and then check whether the character image in the target image format is a transparent background image. Then, if the character image in the target image format is a transparent background image, the subsequent processing logic of the character image can be continued; if the character image in the target image format is a non-transparent background image, the background of the character image can be removed and the subsequent processing logic can be executed. In addition, the background removal processing can be implemented by calling the background removal cloud service provided by the server, and the background removal cloud service can be implemented by a background removal algorithm. The background removal algorithm can be an AI (Artificial Intelligence)-based background removal algorithm, which can improve the background removal effect. In addition, the character image after the background is removed contains the object character itself, and does not contain other image content that interferes with the creation of the animation character, which can improve the creation effect of the animation character.
[0150] In the interface presentation, such as Figure 5 As shown in (a) in FIG. 1 , if the obtained character image has a non-transparent background image, the intelligent background removal function can be automatically turned on, and the effect after the background removal is displayed, such as Figure 5 As shown in (b), if the acquired character image is a transparent background image, the smart background removal function can be turned off by default, and the acquired character image original image can be directly displayed. If the creator needs the smart background removal function, the creator can manually turn on the smart background removal function.
[0151] S202, obtaining template skeleton data.
[0152] The template skeleton data may be obtained from a skeleton library provided by a server, and specifically may be obtained from a plurality of reference skeleton data included in the skeleton library. Among the plurality of reference skeleton data included in the skeleton library, one reference skeleton data may correspond to a character type; any reference skeleton data is skeleton data created based on a reference character under the corresponding character type, and any reference skeleton data is used to describe the skeleton attribute characteristics of the reference character under the corresponding character type. Acquiring the template skeleton data from the plurality of reference skeleton data included in the skeleton library may specifically include:
[0153] In one implementation, template skeleton data may be obtained based on a character type matching method. Specifically, the character type of the character object in the character image may be identified to obtain a target character type; reference skeleton data matching the target character type may be obtained from a plurality of reference skeleton data included in the skeleton library as template skeleton data. In this way, template skeleton data matching the character type of the character object may be obtained, and an animation character may be created based on the skeleton data matching the character type of the character object, thereby improving the animation effect of the animation character corresponding to the created character object.
[0154] In another implementation, the creator can customize the template skeleton data. Specifically, the skeleton morphology preview information corresponding to each reference skeleton data in the skeleton library can be output; Figure 6 As shown, the skeleton morphology preview information corresponding to each reference skeleton data in the skeleton library can be output in the character skeleton selection interface. The skeleton morphology preview information can be a skeleton morphology preview image corresponding to the reference skeleton data (for example, Figure 6 The human skeleton morphology preview image, quadruped skeleton morphology preview image and spherical creature skeleton morphology preview image in the skeleton library can be used to understand the skeleton morphology corresponding to each reference skeleton data. Then, in response to the skeleton selection operation, the reference skeleton data corresponding to the skeleton morphology preview information selected by the skeleton selection operation can be obtained from the multiple reference skeleton data included in the skeleton library as the template skeleton data; for example, in Figure 6 After selecting the human skeleton morphology preview image in the character skeleton selection interface shown, the reference skeleton data corresponding to the human skeleton can be used as the template skeleton data. In this way, the creator can select a skeleton morphology with a higher degree of adaptability to the character object from the skeleton morphologies of the reference skeleton data by understanding the skeleton morphologies corresponding to the reference skeleton data. Thus, the reference skeleton data corresponding to the selected skeleton morphology can be determined as the template skeleton data, and the animation character can be created based on the skeleton morphology with a higher degree of adaptability to the character object, which is conducive to improving the animation effect of the animation character corresponding to the created character object.
[0155] The above content introduces the method of obtaining template skeleton data. The following is an introduction to template skeleton data: Template skeleton data (SpineAnimationJSON) is a lightweight, extensible JSON format file used to describe skeletal animation; template skeleton data can be created using a skeletal animation editing tool. When the animated character to be created is a two-dimensional animated character, the skeletal animation editing tool can be, for example, Spine, which is a 2D skeletal animation editing tool for game development, and provides a set of skeletal animation data definitions and runtime libraries.
[0156] Template skeleton data can be created based on a template character. Template skeleton data can be used to describe the skeleton attribute information of the template character. The skeleton attribute information can include attribute information of the entire skeleton, attribute information of each bone in the skeleton, attribute information of the slots, skin attribute information and animation attribute information. Figure 7 The data structure of the template skeleton data is shown as follows: ① The node data of the skeleton node can be used to describe the attribute information of the entire skeleton. The node data of the skeleton node can include the body size data of the skeleton-associated character (for example, width information (width) and height information (height)), the body offset data of the skeleton-associated character (for example, lateral offset (x) and longitudinal offset (y)), etc. ② The node data of the bone node (bones node) can be used to describe the attribute information of each bone in the skeleton. The node data of the bone node can include the name data (name) of each bone child node (for example, body (body), facial expression (face), mouth (mouth) and other bone child nodes), the parent node data (parent), the offset data of the associated character's body parts, etc. ③ The node data of the slot node (slots node) can be used to describe the attribute information of the slot. The node data of the slot node (slots) can include the name data (name) of each slot point, the bone data (bone) where it is located, and the binding attachment data (attachment). ④ The node data of the skin node (skins node) can be used to describe skin attribute information, and the node data of the skin node can include animation material data (for example, it can include at least one of body animation material data and expression animation material data). ⑤ The node data of the animation node (animations node) can be used to describe animation attribute information, and the node data of the animation node can include animation logic data (for example, it can include at least one of body animation logic data and expression animation logic data).
[0157] S203, adjusting the template skeleton data based on the size difference between the character object and the template character to obtain matching skeleton data that matches the character object.
[0158] As can be seen from the above content, the template skeleton data is created based on the template role, that is, the template skeleton data is adapted to the template role, and there is more or less size difference between the template role and the role object. If the template skeleton data is directly assigned to the role object, it is obviously inappropriate. Therefore, it is necessary to adjust the template skeleton data based on the size difference between the role object and the template role to obtain matching skeleton data that matches the role object, that is, the adjusted matching skeleton data is adapted to the role object, and the matching skeleton data can be used to describe the skeleton attribute information of the role object. The adjustment process of the template skeleton data may include: the template skeleton data may include the skeleton-associated body data of the template role, the skeleton-associated body data of the template role refers to the skeleton-associated character body data of the template role, and the skeleton-associated body data of the template role can be used to describe the character body information of the template role; based on the size difference between the role object and the template role, the skeleton-associated body data of the template role in the template skeleton data can be modified to the skeleton-associated body data of the role object to obtain matching skeleton data; wherein, the skeleton-associated body data of the role object refers to the skeleton-associated character body data of the role object, and the skeleton-associated body data of the role object can be used to describe the character body information of the role object.
[0159] In more detail, based on the size difference between the character object and the template character, the skeleton-associated body data of the template character in the template skeleton data is modified into the skeleton-associated body data of the character object, and the process of obtaining the matching skeleton data may include the following sub-steps s11 to s14:
[0160] s11, determine the body transformation coefficient based on the size difference between the character object and the template character.
[0161] Considering that during the adaptation process between the character object and the template skeleton data, the character object cannot be deformed (for example, becoming taller, shorter, fatter or thinner, etc.), therefore, during the adaptation process, the diagonal length information of the character object can be used to represent the size of the character object. This ensures that the character object can be adapted to the template skeleton data while the aspect ratio of the character object remains unchanged.
[0162] In sub-step s11, the process of determining the body transformation coefficient based on the size difference between the character object and the template character may include: the diagonal length information of the character object may be determined based on the width information of the character object and the height information of the character object; and the diagonal length information of the template character may be determined based on the width information of the template character and the height information of the template character; then, the body transformation coefficient may be determined based on the ratio between the diagonal length information of the template character and the diagonal length information of the character object. It should be noted that the width information of the character object may refer to the width information of the character image, and the height information of the character object may refer to the height information of the character image; the template skeleton data may be created based on a template image containing the template character, the width information of the template character may refer to the width information of the template image, and the height information of the template character may refer to the height information of the template image. The process of determining the body transformation coefficient may refer to the following formula 1:
[0163]
[0164] As shown in the above formula 1: scale represents the body transformation coefficient; w1 and h1 represent the width information and height information of the template image (i.e., the template character), represents the diagonal length information of the template character; w2 and h2 represent the width information and height information of the character image (i.e., the character object), respectively. Represents the diagonal length information of the character object.
[0165] s12, obtain the original body data of the character object.
[0166] The skeleton-associated body data of the template character may include: the body size data of the template character, the body offset data of the template character and the body scale transformation data of the template character; wherein, the body size data of the template character may be used to describe the body size of the template character, namely, the width information (width) and the height information (height); the body offset data of the template character may be used to describe the coordinate offset of the template character, namely, the lateral offset (x) and the longitudinal offset (y); the body scale transformation data of the template character may be used to describe the scaling ratio of the template character, and may include the lateral scaling ratio (scaleX) and the longitudinal scaling ratio (scaleY).
[0167] Similarly, the skeleton-associated body data of the character object may include: the body size data of the character object, the body offset data of the character object and the body scale transformation data of the character object; wherein the body size data of the character object may be used to describe the body size of the character object, i.e., width information and height information; the body offset data of the character object may be used to describe the coordinate offset of the character object, i.e., the lateral offset and the longitudinal offset; the body scale transformation data of the character object may be used to describe the scaling ratio of the character object, which may include the lateral scaling ratio and the longitudinal scaling ratio.
[0168] The original body data of the character object may include: original size data, original offset data and original scale transformation data of the character object's body; wherein, the original size data of the character object's body may be used to describe the original body size of the character object, i.e., original width information and original height information; the original offset data of the character object may be used to describe the original coordinate offset of the character object, i.e., original horizontal offset and original vertical offset; the original scale transformation data of the character object may be used to describe the original scaling ratio of the character object, which may include original horizontal scaling ratio and original vertical scaling ratio. Since the original character image is not scaled, the original horizontal scaling ratio and the original vertical scaling ratio are both 1.
[0169] s13, transforming the original body data of the character object according to the body transformation coefficient to obtain the skeleton-associated body data of the character object.
[0170] The principle of transforming the original body data of the character object by the body transformation coefficient can be to multiply the body transformation coefficient by the original body data of the character object. Specifically, the original size data of the character object's body can be transformed according to the body transformation coefficient to obtain the body size data of the character object, that is, the body size data of the character object is the product of the body transformation coefficient and the original size data; the original offset data of the character object's body can be transformed according to the body transformation coefficient to obtain the body offset data of the character object, that is, the body offset data of the character object is the product of the body transformation coefficient and the original offset data; the original scale transformation data of the character object's body can be transformed according to the body transformation coefficient to obtain the body scale transformation data of the character object, that is, the body scale transformation data of the character object is the product of the body transformation coefficient and the original scale transformation data.
[0171] s14, modifying the skeleton-associated body data of the template character in the template skeleton data into the skeleton-associated body data of the character object to obtain matching skeleton data.
[0172] As can be seen from the foregoing, the skeleton-associated body data of the template character may include: the body size data of the template character, the body offset data of the template character, and the body scale transformation data of the template character; the skeleton-associated body data of the character object may include: the body size data of the character object, the body offset data of the character object, and the body scale transformation data of the character object; Figure 7 The skeleton-associated body data of the template character in the template skeleton data is combined with the data structure of the template skeleton data shown, and the skeleton-associated body data of the template character in the template skeleton data is modified to the skeleton-associated body data of the character object, which can be specifically: the body size data of the template character under the skeleton node is modified to the body size data of the character object, and the body offset data of the template character under the skeleton node is modified to the body offset data of the character object; the body offset data of the template character under the body sub-node (bones-body) in the bones node is modified to the body offset data of the character object, and the body scale transformation data of the template character under the body sub-node (bones-body) in the bones node is modified to the body scale transformation data of the character object; the body size data of the template character under the body sub-node (skins-body) in the skins node is modified to the body size data of the character object.
[0173] From the above sub-steps s11 to s14, it can be seen that the adaptation between the character object and the template skeleton data can be summarized as adjusting the size of the character object so that the character object and the template character are adapted to each other. In essence, the size of the character image is adjusted so that the character image and the template character are adapted to each other. Then, the relevant information describing the template character's body in the template skeleton data (which may include the template character's body size data, the template character's body offset data and the template character's body scale transformation data) is modified to the relevant information describing the adjusted character object's body (which may include the original size data, the original offset data and the original scale transformation data of the character object's body).
[0174] For example, the skeleton node, bones-body node, and skins-body node in the template skeleton data are related to the body data of the template character. Figure 8 As shown (as Figure 8The data filled in medium gray is the skeleton-associated body data of the template character), the size of the template image is (width information 571*height information 1894), and the size of the obtained character image is (width information 708*height information 1116). The body transformation coefficient scale calculated by formula 1 is 1.497, and scale is greater than 1. That is to say, it is necessary to enlarge and adapt based on the character image, multiply scale by the original body data of the character object, and obtain the skeleton-associated body data of the character object. Then, the skeleton node, bones-body node, and skins-body node in the template skeleton data of the template character's skeleton-associated body data are modified to the skeleton-associated body data of the character object, and the following is obtained: Fig. 9 The skeleton-associated body data of the character object under the skeleton node, bones-body node, and skins-body node in the matching skeleton data shown (such as Fig. 9 The data filled in medium gray is the skeleton-associated body data of the character object).
[0175] By performing size adaptation between the character object and the template skeleton data, matching skeleton data that matches the character object can be obtained, corresponding to the interface in the animation character creation client, such as Fig.10 As shown, the character object and the character object's skeleton can be output in the skeleton adjustment interface. It can be seen that after the size adaptation between the character object and the template skeleton data, the character object and the character object's skeleton size are adapted. However, the template skeleton data is created based on the template character, and the template character and the character object's posture are not exactly the same. Even if the character object and the character object's skeleton size are adjusted to adapt, the character object and the character object's skeleton may still have posture mismatches, for example, Fig.10 The two feet of the character object shown are both facing left, but the foot bone of one foot in the character object's skeleton is facing right. Therefore, the animation character creation client can support adjusting the character object's skeleton after the size adaptation between the character object and the template skeleton data, so that the adaptation between the character object and the skeleton of the character object is higher.
[0176] The technical implementation of skeleton adjustment can be specifically described as follows: a skeleton adjustment operation on a bone in a character object's skeleton can be received in a skeleton adjustment interface, and the skeleton adjustment data corresponding to the skeleton adjustment operation can be updated to the matching skeleton data. The character object's skeleton can include bones; the skeleton adjustment operation can include a skeleton position adjustment operation on the original bones in the character object's skeleton, for example, Fig.11 Shows the Fig.10 The result of bone adjustment of the skeleton shown. Fig.10 The skeleton shown is the foot bone facing right, Fig.11 In this case, the bone adjustment data corresponding to the bone adjustment operation may be specifically updated to the node data of the bone node adjusted in the matching skeleton data. For example, the original foot bones in the character object's skeleton may be adjusted, and the bone adjustment data corresponding to the bone adjustment operation may be updated to the node data of the foot bone nodes; or, the bone adjustment operation may include adding bones to the character object's skeleton. In this case, updating the bone adjustment data corresponding to the bone adjustment operation to the matching skeleton data means adding bone nodes to the matching skeleton data and adding the node data of the newly added bone nodes. For example, a tail bone may be added to the character object's skeleton, and then a tail bone node and the node data of the tail bone node need to be added to the matching skeleton data. It should be noted that the bone adjustment operation for adjusting the original bones in the character object's skeleton may be specifically performed by adjusting the bone points in the character object's skeleton (for example, Fig.10 By adjusting the original bones in the character object's skeleton, the compatibility between the character object and the character object's skeleton can be made higher; similarly, the bone adjustment operation of adding new bones to the character object's skeleton can be specifically performed by adding new bone points to the character object's skeleton. By adding new bones to the character object's skeleton, the character object's animation capabilities can be expanded, and the character object can implement more animation logic.
[0177] If the character object in the acquired character image does not contain facial expressions, the animation character creation client can also support adding facial expressions to the character object. The creator can add target facial expressions to the character object in the animation character creation client. The target facial expression can be a facial expression map selected from the facial expression library provided by the server to the animation character creation client; Fig.12 As shown, a facial expression selection window 122 can be pulled up through a facial expression adding entry 121 in the character editing interface. The facial expression selection window 122 can include a plurality of facial expression maps in a facial expression library. A facial expression map can be selected in the facial expression selection window 122 to add the selected facial expression map (i.e., the target facial expression) to the character object; or, the target facial expression can be customized and uploaded by the creator. For example, the creator can upload a customized facial expression to the facial expression selection window 122 through a facial expression upload control 123 in the facial expression selection window. That is to say, a creator-customized facial expression can be added to the character object, which can improve the customization level of the animated character to a certain extent and improve the originality of the animated character.
[0178] Furthermore, the target facial expression may be added to a default position. For example, the template skeleton data is created based on the template character. The default position is the position of the facial expression in the template character. The default position may not match the expected position of the creator adding the target facial expression to the character object. In addition, the size and angle of the target facial expression may not match the character object. Therefore, the animation character creation client can support adjustment of the added target facial expression. Specifically, Fig.12 As shown, the character object and the target facial expression added for the character object can be displayed in the character editing interface. It can be seen that the target facial expression does not match the character object. An expression adjustment operation for the target facial expression can be received in the character editing interface. The expression adjustment operation can be used to adjust the target facial expression to match the character object; in response to the expression adjustment operation for the target facial expression, the expression adjustment data corresponding to the expression adjustment operation can be updated to the matching skeleton data. The expression adjustment data corresponding to the expression adjustment operation can be updated to the node data of the facial expression node (bones-face node); the expression adjustment operation can include at least one of the following: a move operation, a scaling operation, and a rotation operation. Accordingly, the expression adjustment data corresponding to the expression adjustment operation can include at least one of the following: move data, rotation data, and scaling data; as shown in FIG. Fig.13 As shown, the movement data (x and y), rotation data (rotation) and scaling data (scaleX and scaleY) are updated to the node data of the facial expression node (bones-face node).
[0179] Based on the above description of steps S201 to 203, it can be known that by adapting the existing skeleton data (i.e., template skeleton data) to the character object, matching skeleton data that matches the character object can be obtained. In addition, the animation character creation client can also provide the creator with a function of customizing matching skeleton data that matches the character object. Specifically, similar to Fig.10 As shown in the skeleton adjustment interface, the creator can customize the skeleton in the skeleton creation interface, and can generate matching skeleton data that matches the character object based on the skeleton customized by the creator; this method requires the creator to have a certain foundation in skeletal animation, and the matching skeleton data created by this method has a higher degree of match with the character object.
[0180] S204, adding animation data to the character object, and creating an animation character corresponding to the character object according to the character image, matching skeleton data and animation data.
[0181] After adjusting the template skeleton data based on the size difference between the character object and the template character to obtain matching skeleton data that matches the character object, animation data can be added to the character object. Then, an animated character corresponding to the character object can be created based on the character image, matching skeleton data and animation data.
[0182] In an embodiment of the present application, when it is necessary to create an animated character corresponding to a character object, a character image and template skeleton data containing the character object can be obtained. The template skeleton data can be created based on the template character and can be used to describe the skeleton attribute information of the template character; then, the template skeleton data can be adjusted based on the size difference between the character object and the template character to obtain matching skeleton data that matches the character object. After adding animation data to the character object, the animated character corresponding to the character object can be created based on the character image, matching skeleton data, and animation data. In other words, the embodiment of the present application can automatically create an animated character corresponding to a character object based on a character image containing the character object, without the need to additionally produce action images of different actions of the character object, which can reduce the creation cost of the animated character and improve the creation efficiency of the animated character.
[0183] The embodiment of the present application provides a method for creating an animated character. The method for creating an animated character mainly introduces the process of adding animation data to a character object. The method for creating an animated character can be executed by a computer device. The computer device can specifically be a terminal or a server running an animated character creation client. The embodiment of the present application takes the computer device as a terminal for example. Fig.14 As shown, the method for creating the animation character may include but is not limited to the following steps S1401 to S1406:
[0184] S1401, obtaining a character image.
[0185] In the embodiment of the present application, the execution process of step S1401 is the same as that of the above Figure 2 The execution process of step S201 in the embodiment shown is the same, and the details can be referred to above. Figure 2 The relevant description of step S201 in the illustrated embodiment will not be repeated here.
[0186] S1402, obtaining template skeleton data.
[0187] In the embodiment of the present application, the execution process of step S1402 is the same as that of the above Figure 2 The execution process of step S202 in the embodiment shown is the same, and the details can be referred to above. Figure 2 The relevant description of step S202 in the illustrated embodiment will not be repeated here.
[0188] S1403, adjusting the template skeleton data based on the size difference between the character object and the template character to obtain matching skeleton data that matches the character object.
[0189] In the embodiment of the present application, the execution process of step S1403 is the same as that of the above Figure 2 The execution process of step S203 in the embodiment shown is the same, and the details can be referred to above. Figure 2 The relevant description of step S203 in the illustrated embodiment will not be repeated here.
[0190] S1404, adding body animation data to the character object.
[0191] The body animation data can be used to describe the body animation added to the character object. The body animation data may include body animation material data and body animation logic data. The body animation material data and body animation logic data are first introduced below:
[0192] The body animation material data can be used to describe the body material corresponding to the body animation added to the character object. For single-bone animation, that is, the skeleton of the character object contains one bone, the body material can be a character image, and the single bone is bound to the entire body material; the body material is controlled by controlling the single bone to control the overall movement of the body material to achieve the effect of body animation, for example, moving, bouncing, etc. are all single-bone animation. For multi-bone animation, that is, the skeleton of the character object contains multiple bones, the body material can be a body sprite obtained by splitting the body parts of the character image, and the body sprite can include each body part material obtained by splitting the body parts of the character image, and each body part material is bound to the corresponding body part skeleton; by controlling each body part skeleton, the body part material movement bound to each body part skeleton is controlled to achieve the effect of body animation. Compared with single-bone animation, multi-bone animation has richer animation effects, for example, more complex body animations such as waving and bowing can be made; Sprite Sheet is a technology that merges multiple small images into a large image, which can reduce the number of image loading times and improve performance and loading speed.
[0193] The body animation logic data can be used to describe the animation logic of the body animation added to the character object. The animation logic of the body animation refers to the logic that controls the position of the bones bound to the body material (whole body material or body part material) to change over time; for example, the bones are in the first position at the first moment and in the second position at the second moment. By controlling the bones to change to different positions at different times, the body material controlled by the bones changes to different positions at different times, so as to form a body animation effect.
[0194] Based on the above introduction to body animation material data and body animation logic data, the process of adding body animation data to a character object may include: body animation preview information of multiple body animations supported by template skeleton data may be output in the character animation adding interface, and each body animation supported by the template skeleton data corresponds to its own body animation data; then, in response to a body animation selection operation, target body animation data may be added to the character object; wherein the target body animation data is the body animation data corresponding to the target body animation preview information selected by the body animation selection operation.
[0195] S1405, when facial expressions are added to the character object, expression animation data is added to the character object.
[0196] Expression animation data can be used to describe the expression animation added to the character object. Expression animation data can include expression animation material data and expression animation logic data. The following first introduces expression animation material data and expression animation logic data:
[0197] The expression animation material data can be used to describe the expression material corresponding to the expression animation added to the character object; in the case of adding facial expressions in the facial expression library to the character object, each facial expression in the facial expression library corresponds to its own set of expression animations, and the expression material can refer to the expression map of different expressions in the expression sprite map. The creator selects the target facial expression in the facial expression library, that is, selects the expression sprite map of the target facial expression, such as Fig.15 As shown, the creator chooses to add a facial expression named "chicken" to the character object in the character editing interface, and thus selects the expression sprite image corresponding to the facial expression named "chicken" as the expression material corresponding to the expression animation.
[0198] The expression animation logic data can be used to describe the animation logic of the expression animation added to the character object. The animation logic of the expression animation refers to the logic that controls the switching of expression stickers of different expressions over time. For example, the expression sticker of a happy expression is displayed at the first moment, the expression sticker of a normal state is displayed at the second moment, and the expression sticker of a happy expression is displayed at the third moment. By switching the expression stickers at different moments, the effect of the expression animation is formed.
[0199] Based on the above introduction to body animation material data and body animation logic data, the process of adding body animation data to a character object may include:
[0200] In one implementation, when a target facial expression provided in a facial expression library is added to a character object, expression animation preview information of multiple expression animations supported by the target facial expression can be output in the character animation adding interface, and each expression animation supported by the target facial expression corresponds to its own expression animation data; then, in response to an expression animation selection operation, target expression animation data can be added to the character object; wherein the target expression animation data is the expression animation data corresponding to the target expression animation preview information selected by the expression animation selection operation.
[0201] In another implementation method, when a customized target facial expression is added to a character object, expression animation materials and expression animation logic of the target expression animation corresponding to the target facial expression can be added to the character object. It should be noted that the expression animation materials and expression animation logic can be uploaded together when the target facial expression is uploaded; then, expression animation data of the target expression animation can be generated based on the added expression animation materials and expression animation logic.
[0202] The above steps S1404 to S1405 introduce the process of adding body animation data (including body animation material data and body animation logic data) and expression animation data (including expression animation material data and expression animation logic data) to the character object. The following is a more detailed introduction to the addition of animation data from the perspectives of technology and visualization:
[0203] From a technical perspective, the nodes that record animation information in the template skeleton data are skins nodes and animations nodes. The skins node provides a description of the animation material information, and the animations node provides a description of the animation logic information. Compared with the skeleton-related nodes (which can include skeleton nodes, bones nodes, and slots nodes), they are relatively independent and have certain versatility and reusability. Therefore, the skins node and animations node can be separated from the template skeleton data. On this basis, the body animation material data in the body animation data and the expression animation material data in the expression animation data can be added to the node data of the skins node, such as Fig.16 The node data of the skins node after adding the expression animation material data is shown. The expression animation material of the eyes and mouth and the display information of the expression animation material (for example, display size information (weight and height) and display offset information (x and y)) are added to the node data of the skins node. The added expression animation material data is filled with gray. The body animation logic data in the body animation data and the expression animation logic data in the expression animation data can be added to the node data of the animations node, such as Fig.17The node data of the animations node after adding the expression animation logic data is shown. The expression animation logic data of the eyes (eye) and the mouth (mouth) are added to the node data of the animations node. The added expression animation logic data is filled with gray.
[0204] From a visualization perspective, Fig.18 The character animation adding interface shown may include a character animation adding window, and the character animation adding window may include expression animation preview information (specifically, expression animation preview images) of multiple expression animations and body animation preview information (specifically, body animation preview images) of multiple body animations. When the creator does not trigger the animation preview information (including body animation preview information or expression animation preview information), the animation preview information may be displayed as a template figurine thumbnail, and the template figurine thumbnail is marked by a download prompt (e.g., an arrow symbol in the upper right corner of the template figurine thumbnail). After the animation preview information is triggered, the animation preview effect of the character object being added with the selected animation may be displayed in the character animation adding interface, and the animation preview information may be displayed as a thumbnail of the character object with the selected animation. The expression animation and / or body animation animation preview information added for the character object may be selected in the character animation adding interface, and the animation data corresponding to the selected animation preview information may be added for the character object.
[0205] Based on the contents of steps S1401 to S1405, the method for creating an animation character can be summarized as follows: Fig.19 , the embodiment of the present application designs multiple sets of skeletons, corresponding to the multiple reference skeleton data mentioned above, any skeleton can be reused by multiple characters, the characters need to adapt to the skeleton, and there are differences in the skin layer between different characters; and, the embodiment of the present application designs a universal body animation for each set of skeletons, and the facial expressions can be separated from the characters. The embodiment of the present application provides multiple facial expressions, each facial expression corresponds to its own set of facial expression animations, and the creator can choose to freely combine body animation and expression animation to create a character object with animation capabilities, that is, an animated character. In addition, for the situation where the creator customizes the addition of bone points in the skeleton of the character object, the creator also needs to upload the body animation material data and body animation logic data of the newly added bone points, so that the incremental animation in the body animation library can be created, thereby enriching the animation performance of the animated character created by the character object.
[0206] In addition, the animation character creation client can also provide creators with Fig. 20The character additional information adding interface shown in the figure, in which you can add character additional information such as character cover, character name, character timbre, character speaking speed, etc. for the character object; and in the character additional information adding interface, you can also choose whether to contribute the created animation character. Submission means contributing the created animation character as a public character. If the animation character is successfully contributed as a public character, then all registrants of the animation character creation client can use the animation character. If the animation character is not contributed or the contribution fails, then the created animation character is the creator's private character and can only be used by the creator.
[0207] It should be added that Fig.21 As shown, after adding facial expressions, animation data, additional character information, etc. to the character object, click the character creation control (for example Fig.21 ), you can create an animated character corresponding to the character object, and the created animated character is added to "My Character" in the character creation interface. Fig.21 Some retry interaction methods are also provided to prevent character creation failure or character submission failure. For example, when character creation fails, you can choose to cancel the creation of the animation character or retry the creation of the animation character. When character submission fails, you can choose to cancel the submission or retry the submission.
[0208] It should also be added that if Fig.21 As shown, by triggering the icon of the created animation character, the editing panel of the animation character can be called up. In the editing panel, if you do not choose to contribute to the animation character when creating the animation character, you can trigger the contribution of the animation character in the editing panel, such as Fig. 22 As shown, you can also trigger the update of the character's attached data in the editing panel. If the animation character has been successfully submitted, the animation character whose attached data is updated needs to be submitted again. Fig.23 As shown, the successfully created animated character can be used in animation video editing.
[0209] S1406, creating an animation character corresponding to the character object according to the character image, matching skeleton data and animation data (including body animation data and / or expression animation data).
[0210] Here is an introduction to the technical implementation of creating an animated character: after adding animation data to a character object, you can create an animated character corresponding to the character object based on the character image, matching skeleton data and animation data (including body animation data and / or expression animation data), which can specifically refer to binding the character object, matching skeleton data and animation data. If character accessory data is also added to the character object, you need to bind the character object, matching skeleton data, animation data and character accessory data.
[0211] Specifically:
[0212] After the creation process of the animation character from step S1401 to step S1406, the matching skeleton data, the split animation material data (including body animation material data and expression animation material data) and the animation logic data (including body animation logic data and expression animation logic data) are obtained. The specific resource files are as follows: Fig.24 As shown: a single skeleton resource file (skeleton.zip) contains the matching skeleton data (skeleton.json) of the character object, which is generated based on the custom character image uploaded by the creator and the template skeleton data after adaptation, and also contains the expression adjustment data corresponding to the expression adjustment operation (such as move operation, rotation operation and scaling operation) of the facial expression added by the creator to the character object. A single role resource file (role.zip) includes the expression sprite image (emotion.png and emotion.atlas.txt) of the facial expression, which describes the skin resource corresponding to the creator's selection of facial expression; the role resource file can also include the body sprite image (role.png and role.atlas.txt), which is obtained by splitting the body parts of the character image uploaded by the creator; the role resource file can also include animation material data (skin.json, including body animation material data and expression animation material data). Multiple animation resource files (animation.zip) include multiple animation logic data (animation.json), which are the expression animation logic data or body animation logic data added by the creator to the character object.
[0213] like Fig.25 The class diagram shown describes the relationship between the role object, the skeleton resource file (skeleton.zip) and the role resource file (role.zip), where the role object class.skeleton.resource.resource address (Role.skeleton.common.packageUrl) is the link of the skeleton resource file (skeleton.zip) uploaded to the server, and the role object class.resource.resource address (Role.common.packageUrl) is the link of the role resource file (role.zip) uploaded to the server. The timbre, speaking rate, role name and role cover of the role object are represented by Role.timberId, speakingRate, demo and wholeBodyThumbUrl respectively.
[0214] After creating the animation role corresponding to the role object, you can use the server interface (RolePost) to bind the selected animation data to the role, such as Fig.26 As shown, the server interface.RolePost.role is the created animation role, the server interface.skeleton identifier (RolePost.skeletonId) is the identifier of the template skeleton data used to create the role, the server interface.facial expression identifier (RolePost.facialFeatureId) is the identifier of the facial expression selected for the created role, the server interface.animation list (RolePost.animationList) is the animation data selected by the creator, and the animation.resource.resource address (Animation.common.packageUrl) is the server link of the above animation resource file (animation.zip). In particular, the animation.resource.thumbnail address (Animation.common.thumbUrl) is the animation thumbnail captured in real time based on the creator's customized role image and animation. In addition, the creator's ability to "contribute to the public role" when creating a role is achieved by modifying the value of the server interface.contribute (RolePost.contributePos t).
[0215] After the process of creating an animated character is completed, the backend will conduct further review based on whether the current creator has submitted the created animated character to the public role after receiving the RolePost data. The process is as follows Fig. 27 As shown, if the created animated character is not contributed to the public characters, the created animated character is added as the creator's private character (i.e. "My Character"). The creator's private character refers to the animated character that is allowed to be used by the creator and is not allowed to be used by other objects except the creator; if the created animated character is contributed to the public characters, the animated character needs to be reviewed. After the review is passed, the animated character is successfully contributed to the public characters.
[0216] In an embodiment of the present application, when it is necessary to create an animated character corresponding to a character object, a character image and template skeleton data containing the character object can be obtained. The template skeleton data can be created based on the template character and can be used to describe the skeleton attribute information of the template character; then, the template skeleton data can be adjusted based on the size difference between the character object and the template character to obtain matching skeleton data that matches the character object. After adding animation data to the character object, the animated character corresponding to the character object can be created based on the character image, matching skeleton data, and animation data. In other words, the embodiment of the present application can automatically create an animated character corresponding to a character object based on a character image containing the character object, without the need to additionally produce action images of different actions of the character object, which can reduce the creation cost of the animated character and improve the creation efficiency of the animated character.
[0217] The method of the embodiment of the present application is described in detail above. In order to facilitate better implementation of the above scheme of the embodiment of the present application, the device of the embodiment of the present application is provided below accordingly.
[0218] See also Fig.28 , Fig.28 : is a schematic diagram of the structure of a device for creating an animated character provided in an embodiment of the present application. The device for creating an animated character may include the following units:
[0219] The acquisition unit 2801 is used to acquire a character image; the character image contains a character object for which a corresponding animation character needs to be created, and the animation character corresponding to the character object has animation capability;
[0220] The acquisition unit 2801 is further used to acquire template skeleton data; the template skeleton data is created based on the template character, and the template skeleton data is used to describe skeleton attribute information of the template character;
[0221] The processing unit 2802 is used to adjust the template skeleton data based on the size difference between the character object and the template character to obtain matching skeleton data that matches the character object; the matching skeleton data is used to describe the skeleton attribute information of the character object;
[0222] The processing unit 2802 is further used to add animation data to the character object, and create an animation character corresponding to the character object according to the character image, matching skeleton data and animation data.
[0223] In one implementation, the template skeleton data includes skeleton-associated body data of the template character, and the skeleton-associated body data of the template character is used to describe the character body information of the template character;
[0224] The processing unit 2802 is used to adjust the template skeleton data based on the size difference between the character object and the template character, and to obtain matching skeleton data that matches the character object, specifically to perform the following steps:
[0225] Based on the size difference between the character object and the template character, the skeleton-associated body data of the template character in the template skeleton data is modified into the skeleton-associated body data of the character object to obtain matching skeleton data;
[0226] The skeleton-associated body data of the character object is used to describe the character body information of the character object.
[0227] In one implementation, the processing unit 2802 is used to modify the skeleton-associated body data of the template character in the template skeleton data into the skeleton-associated body data of the character object based on the size difference between the character object and the template character, and when the matching skeleton data is obtained, specifically to perform the following steps:
[0228] Determine a body transformation coefficient based on the size difference between the character object and the template character;
[0229] Get the raw body data of the character object;
[0230] According to the body transformation coefficient, the original body data of the character object is transformed to obtain the skeleton-related body data of the character object;
[0231] The skeleton-associated body data of the template character in the template skeleton data is modified into the skeleton-associated body data of the character object to obtain matching skeleton data.
[0232] In one implementation, the skeleton-associated body data of the template character includes: the body size data of the template character, the body offset data of the template character, and the body scale transformation data of the template character; the skeleton-associated body data of the character object includes: the body size data of the character object, the body offset data of the character object, and the body scale transformation data of the character object; the original body data of the character object includes: the original size data, the original offset data, and the original scale transformation data of the character object's body;
[0233] The processing unit 2802 is used to transform the original body data of the character object according to the body transformation coefficient to obtain the skeleton-associated body data of the character object, and specifically to perform the following steps:
[0234] According to the body transformation coefficient, the original size data of the character object's body is transformed to obtain the body size data of the character object;
[0235] According to the body transformation coefficient, the original offset data of the character object's body is transformed to obtain the body offset data of the character object;
[0236] According to the body transformation coefficient, the original scale transformation data of the character object's body is transformed to obtain the body scale transformation data of the character object.
[0237] In one implementation, the processing unit 2802 is used to determine the body transformation coefficient according to the size difference between the character object and the template character, and is specifically used to perform the following steps:
[0238] Determine the diagonal length information of the character object according to the width information and the height information of the character object;
[0239] Determine the diagonal length information of the template character according to the width information of the template character and the height information of the template character;
[0240] The body transformation coefficient is determined based on the ratio between the diagonal length information of the template character and the diagonal length information of the character object.
[0241] In one implementation, the processing unit 2802 is used to perform the following steps before creating an animation character corresponding to the character object according to the character image, matching skeleton data and animation data:
[0242] Output the character object and the skeleton of the character object, the skeleton of the character object includes bones;
[0243] In response to a bone adjustment operation on a bone in a skeleton of a character object, the bone adjustment data corresponding to the bone adjustment operation is updated into the matching skeleton data.
[0244] In one implementation, the character object in the character image does not include facial expressions; the processing unit 2802 is used to perform the following steps before creating an animated character corresponding to the character object based on the character image, matching skeleton data and animation data:
[0245] Add target facial expressions to character objects;
[0246] In response to an expression adjustment operation on a target facial expression, updating expression adjustment data corresponding to the expression adjustment operation into the matching skeleton data;
[0247] Among them, the expression adjustment operation is used to adjust the target facial expression to match the character object.
[0248] In one implementation, the processing unit 2802 is used to perform the following steps when adding animation data to the character object:
[0249] Add body animation data to the character object; wherein the body animation data is used to describe the body animation added to the character object, and the body animation data includes body animation material data and body animation logic data; the body animation material data is used to describe the body material corresponding to the body animation added to the character object, and the body animation logic data is used to describe the animation logic of the body animation added to the character object;
[0250] When facial expressions are added to the character object in the character image, the processing unit 2802, when adding animation data to the character object, is further configured to perform the following steps:
[0251] Add expression animation data to the character object; wherein the expression animation data is used to describe the expression animation added for the character object, and the expression animation data includes expression animation material data and expression animation logic data; the expression animation material data is used to describe the expression material corresponding to the expression animation added to the character object, and the expression animation logic data is used to describe the animation logic of the expression animation added to the character object.
[0252] In one implementation, the processing unit 2802 is used to perform the following steps when adding body animation data to the character object:
[0253] Outputting body animation preview information of multiple body animations supported by the template skeleton data, each body animation supported by the template skeleton data corresponds to respective body animation data;
[0254] In response to the body animation selection operation, adding target body animation data to the character object;
[0255] The target body animation data is the body animation data corresponding to the target body animation preview information selected by the body animation selection operation.
[0256] In one implementation, when the character object in the character image is added with the target facial expression provided by the facial expression library, the processing unit 2802 is used to add the facial expression animation data for the character object, specifically to perform the following steps:
[0257] Outputting expression animation preview information of multiple expression animations supported by the target facial expression, each expression animation supported by the target facial expression corresponding to respective expression animation data;
[0258] In response to the expression animation selection operation, adding target expression animation data to the character object;
[0259] The target facial expression animation data is facial expression animation data corresponding to the target facial expression animation preview information selected by the facial expression animation selection operation.
[0260] In one implementation, when a customized target facial expression is added to a character object in a character image, the processing unit 2802 is used to add expression animation data to the character object, specifically to perform the following steps:
[0261] Add expression animation materials and expression animation logic of the target expression animation corresponding to the target facial expression to the character object;
[0262] Generate expression animation data of the target expression animation according to the added expression animation material and expression animation logic;
[0263] Add the expression animation data of the target expression animation to the character object.
[0264] In one implementation, the processing unit 2802 is used to adjust the template skeleton data based on the size difference between the character object and the template character to obtain matching skeleton data that matches the character object, and is also used to perform the following steps:
[0265] Checking the character image with respect to the format conditions for creation;
[0266] If the image format of the character image does not meet the creation format condition, preprocessing the character image to obtain a preprocessed character image;
[0267] The processing unit 2802 is used to adjust the template skeleton data based on the size difference between the character object and the template character, and to obtain matching skeleton data that matches the character object, specifically to perform the following steps:
[0268] Based on the size difference between the character object in the preprocessed character image and the template character, the template skeleton data is adjusted to obtain matching skeleton data that matches the character object in the preprocessed character image.
[0269] In one implementation, the image format of the character image does not meet the creation format condition means that the image format of the character image is an image format other than the target image format; the processing unit 2802 is used to pre-process the character image to obtain the pre-processed character image, specifically to perform the following steps:
[0270] Convert the character image into a format to obtain the character image in a target image format;
[0271] Get the channel image of the transparency channel from the character image in the target image format;
[0272] Count the number of transparent pixels in the channel image of the transparency channel to obtain the transparent pixel ratio;
[0273] If the transparency pixel ratio is less than or equal to the ratio threshold, background subtraction processing is performed on the character image in the target image format to obtain a preprocessed character image.
[0274] In one implementation, the acquiring unit 2801 is used to acquire the template skeleton data by performing the following steps:
[0275] Acquire template skeleton data from a plurality of reference skeleton data included in the skeleton library;
[0276] Among them, among the multiple reference skeleton data included in the skeleton library, one reference skeleton data corresponds to one character type; any reference skeleton data is skeleton data created based on the reference character under the corresponding character type, and any reference skeleton data is used to describe the skeleton attribute characteristics of the reference character under the corresponding character type.
[0277] In one implementation, the acquiring unit 2801 is used to acquire the template skeleton data from the multiple reference skeleton data included in the skeleton library, and is specifically used to perform the following steps:
[0278] Identify the role type of the role object in the role image to obtain the target role type;
[0279] From the multiple reference skeleton data included in the skeleton library, reference skeleton data matching the target character type is obtained as template skeleton data.
[0280] In one implementation, the acquiring unit 2801 is used to acquire the template skeleton data from the multiple reference skeleton data included in the skeleton library, and is specifically used to perform the following steps:
[0281] Output the skeleton morphology preview information corresponding to each reference skeleton data in the skeleton library;
[0282] In response to the skeleton selection operation, the reference skeleton data corresponding to the skeleton morphology preview information selected by the skeleton selection operation is acquired from a plurality of reference skeleton data included in the skeleton library as template skeleton data.
[0283] According to another embodiment of the present application, Fig.28The various units in the creation device of the animated character shown can be separately or completely combined into one or several other units to constitute, or one (some) of the units can also be split into multiple smaller units in function to constitute, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In practical applications, the functions of one unit can also be realized by multiple units, or the functions of multiple units can be realized by one unit. In other embodiments of the present application, the creation device of the animated character can also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.
[0284] According to another embodiment of the present application, the program can be executed by running on a general computing device such as a computer including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 2 or Fig.14 A computer program (including program code) for each step involved in part or all of the method shown in the figure is used to construct a computer program (including program code) for each step involved in part or all of the method shown in the figure. Fig.28 The device for creating an animated character shown in the embodiment of the present application and the method for creating an animated character are provided. The computer program can be recorded on a computer-readable storage medium, for example, and loaded into the computing device through the computer-readable storage medium and run therein.
[0285] In an embodiment of the present application, when it is necessary to create an animated character corresponding to a character object, a character image and template skeleton data containing the character object can be obtained. The template skeleton data can be created based on the template character and can be used to describe the skeleton attribute information of the template character; then, the template skeleton data can be adjusted based on the size difference between the character object and the template character to obtain matching skeleton data that matches the character object. After adding animation data to the character object, the animated character corresponding to the character object can be created based on the character image, matching skeleton data, and animation data. In other words, the embodiment of the present application can automatically create an animated character corresponding to a character object based on a character image containing the character object, without the need to additionally produce action images of different actions of the character object, which can reduce the creation cost of the animated character and improve the creation efficiency of the animated character.
[0286] Based on the above method and device embodiments, the present application embodiment provides a computer device. Fig.29 , Fig.29 It is a structural diagram of a computer device provided in an embodiment of the present application. Fig.29The computer device shown includes at least a processor 2901, an input interface 2902, an output interface 2903, and a computer-readable storage medium 2904. The processor 2901, the input interface 2902, the output interface 2903, and the computer-readable storage medium 2904 may be connected via a bus or other means.
[0287] The computer-readable storage medium 2904 can be stored in the memory of the computer device. The computer-readable storage medium 2904 is used to store a computer program. The computer program includes computer instructions. The processor 2901 is used to execute the program instructions stored in the computer-readable storage medium 2904. The processor 2901 (or CPU (Central Processing Unit)) is the computing core and control core of the computer device, which is suitable for implementing one or more computer instructions, and is specifically suitable for loading and executing one or more computer instructions to implement the corresponding method flow or corresponding function.
[0288] The embodiment of the present application also provides a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It is understandable that the computer-readable storage medium here can include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The computer-readable storage medium provides a storage space that stores the operating system of the computer device. In addition, one or more computer instructions suitable for being loaded and executed by the processor are also stored in the storage space. These computer instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory, or a non-volatile memory (Non-VolatileMemory), such as at least one disk storage; optionally, it can also be at least one computer-readable storage medium located away from the aforementioned processor.
[0289] In some embodiments, the computer device may be a terminal or a server, and the processor 2901 may load and execute one or more computer instructions stored in the computer-readable storage medium 2904 to implement the above-mentioned Figure 2 or Fig.14 In a specific implementation, the computer instructions in the computer-readable storage medium 2904 are loaded by the processor 2901 and the method for creating an animated character provided in the embodiment of the present application is executed.
[0290] In an embodiment of the present application, when it is necessary to create an animated character corresponding to a character object, a character image and template skeleton data containing the character object can be obtained. The template skeleton data can be created based on the template character and can be used to describe the skeleton attribute information of the template character; then, the template skeleton data can be adjusted based on the size difference between the character object and the template character to obtain matching skeleton data that matches the character object. After adding animation data to the character object, the animated character corresponding to the character object can be created based on the character image, matching skeleton data, and animation data. In other words, the embodiment of the present application can automatically create an animated character corresponding to a character object based on a character image containing the character object, without the need to additionally produce action images of different actions of the character object, which can reduce the creation cost of the animated character and improve the creation efficiency of the animated character.
[0291] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method for creating an animation character provided in the above-mentioned various optional manners.
[0292] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for creating an animation character, characterized in that: include: Acquire a character image; the character image contains a character object for which a corresponding animation character needs to be created, and the animation character corresponding to the character object has animation capabilities; Acquire template skeleton data; the template skeleton data is created based on the template character, and the template skeleton data is used to describe skeleton attribute information of the template character; Based on the size difference between the character object and the template character, the template skeleton data is adjusted to obtain matching skeleton data that matches the character object; The matching skeleton data is used to describe the skeleton attribute information of the character object; Animation data is added to the character object, and an animation character corresponding to the character object is created according to the character image, the matching skeleton data and the animation data.
2. The method according to claim 1, characterized in that The template skeleton data includes skeleton-associated body data of the template character, and the skeleton-associated body data of the template character is used to describe the character body information of the template character; The step of adjusting the template skeleton data based on the size difference between the character object and the template character to obtain matching skeleton data that matches the character object includes: Based on the size difference between the character object and the template character, modify the skeleton-associated body data of the template character in the template skeleton data to the skeleton-associated body data of the character object to obtain the matching skeleton data; The skeleton-associated body data of the character object is used to describe the character body information of the character object.
3. The method according to claim 2, characterized in that The step of modifying the skeleton-associated body data of the template character in the template skeleton data into the skeleton-associated body data of the character object based on the size difference between the character object and the template character to obtain the matching skeleton data includes: Determining a body transformation coefficient according to a size difference between the character object and the template character; Obtaining original body data of the character object; transforming the original body data of the character object according to the body transformation coefficient to obtain the skeleton-associated body data of the character object; The skeleton-associated body data of the template character in the template skeleton data is modified into the skeleton-associated body data of the character object to obtain the matching skeleton data.
4. The method according to claim 3, characterized in that The skeleton-associated body data of the template character includes: the body size data of the template character, the body offset data of the template character and the body scale transformation data of the template character; the skeleton-associated body data of the character object includes: the body size data of the character object, the body offset data of the character object and the body scale transformation data of the character object; the original body data of the character object includes: the original size data, the original offset data and the original scale transformation data of the body of the character object; The step of transforming the original body data of the character object according to the body transformation coefficient to obtain the skeleton-associated body data of the character object includes: According to the body transformation coefficient, the original size data of the character object's body is transformed to obtain the body size data of the character object; According to the body transformation coefficient, the original offset data of the character object's body is transformed to obtain the body offset data of the character object; The original scale transformation data of the character object's body is transformed according to the body transformation coefficient to obtain the body scale transformation data of the character object.
5. The method according to claim 3, characterized in that The step of determining a body transformation coefficient according to a size difference between the character object and the template character comprises: Determine the diagonal length information of the character object according to the width information of the character object and the height information of the character object; Determine the diagonal length information of the template character according to the width information of the template character and the height information of the template character; The body transformation coefficient is determined according to the ratio between the diagonal length information of the template character and the diagonal length information of the character object.
6. The method according to claim 1, characterized in that Before creating the animation character corresponding to the character object according to the character image, the matching skeleton data and the animation data, the method further comprises: Outputting the character object and the skeleton of the character object, wherein the skeleton of the character object includes bones; In response to a bone adjustment operation on a bone in the skeleton of the character object, the bone adjustment data corresponding to the bone adjustment operation is updated into the matching skeleton data.
7. The method according to claim 1, characterized in that The character object in the character image does not include facial expressions; before creating an animation character corresponding to the character object according to the character image, the matching skeleton data and the animation data, the method further includes: adding a target facial expression to the character object; In response to an expression adjustment operation on the target facial expression, updating expression adjustment data corresponding to the expression adjustment operation into the matching skeleton data; The expression adjustment operation is used to adjust the target facial expression to match the character object.
8. The method according to claim 1, characterized in that The adding animation data to the character object comprises: Add body animation data to the character object; wherein the body animation data is used to describe the body animation added to the character object, and the body animation data includes body animation material data and body animation logic data; the body animation material data is used to describe the body material corresponding to the body animation added to the character object, and the body animation logic data is used to describe the animation logic of the body animation added to the character object; When facial expressions are added to the character object in the character image, adding animation data to the character object further includes: Add facial expression animation data to the character object; wherein the facial expression animation data is used to describe the facial expression animation added for the character object, and the facial expression animation data includes facial expression animation material data and facial expression animation logic data; the facial expression animation material data is used to describe the facial expression material corresponding to the facial animation added to the character object, and the facial expression animation logic data is used to describe the animation logic of the facial expression animation added to the character object.
9. The method according to claim 8, characterized in that The adding body animation data to the character object comprises: Outputting body animation preview information of a plurality of body animations supported by the template skeleton data, each body animation supported by the template skeleton data corresponding to respective body animation data; In response to the body animation selection operation, adding target body animation data for the character object; The target body animation data is the body animation data corresponding to the target body animation preview information selected by the body animation selection operation.
10. The method according to claim 8, characterized in that When the target facial expression provided by the facial expression library is added to the character object in the character image, adding expression animation data to the character object includes: Outputting expression animation preview information of a plurality of expression animations supported by the target facial expression, each expression animation supported by the target facial expression corresponding to respective expression animation data; In response to the expression animation selection operation, adding target expression animation data to the character object; The target facial expression animation data is facial expression animation data corresponding to the target facial expression animation preview information selected by the facial expression animation selection operation.
11. The method according to claim 8, characterized in that When a customized target facial expression is added to the character object in the character image, adding expression animation data to the character object includes: Adding expression animation material and expression animation logic of a target expression animation corresponding to the target facial expression to the character object; Generate expression animation data of the target expression animation according to the added expression animation material and the expression animation logic; Add the facial expression animation data of the target facial expression animation to the character object.
12. The method according to claim 1, characterized in that Before adjusting the template skeleton data based on the size difference between the character object and the template character to obtain matching skeleton data that matches the character object, the method further includes: Checking the character image for creation format conditions; If the image format of the character image does not satisfy the creation format condition, preprocessing the character image to obtain the preprocessed character image; The step of adjusting the template skeleton data based on the size difference between the character object and the template character to obtain matching skeleton data that matches the character object includes: Based on the size difference between the character object in the preprocessed character image and the template character, the template skeleton data is adjusted to obtain matching skeleton data that matches the character object in the preprocessed character image.
13. The method according to claim 12, characterized in that The image format of the character image does not satisfy the creation format condition means that the image format of the character image is an image format other than the target image format; and the preprocessing of the character image to obtain the preprocessed character image includes: Performing format conversion on the character image to obtain the character image in the target image format; Acquire a channel image of a transparency channel from the character image in the target image format; Counting the number of transparent pixels in the channel image of the transparency channel to obtain a transparent pixel ratio; If the transparency pixel ratio is less than or equal to the ratio threshold, background subtraction processing is performed on the character image in the target image format to obtain the pre-processed character image.
14. The method according to claim 1, wherein: The step of obtaining template skeleton data includes: Acquire the template skeleton data from a plurality of reference skeleton data included in the skeleton library; Among them, among the multiple reference skeleton data included in the skeleton library, one reference skeleton data corresponds to a character type; any one of the reference skeleton data is skeleton data created based on a reference character under the corresponding character type, and any one of the reference skeleton data is used to describe the skeleton attribute characteristics of the reference character under the corresponding character type.
15. The method according to claim 14, characterized in that The step of acquiring the template skeleton data from a plurality of reference skeleton data included in a skeleton library comprises: Identifying the role type of the role object in the role image to obtain a target role type; From the plurality of reference skeleton data included in the skeleton library, reference skeleton data matching the target character type is acquired as the template skeleton data.
16. The method according to claim 14, characterized in that The step of acquiring the template skeleton data from a plurality of reference skeleton data included in a skeleton library comprises: Outputting skeleton morphology preview information corresponding to each reference skeleton data in the skeleton library; In response to a skeleton selection operation, reference skeleton data corresponding to the skeleton morphology preview information selected by the skeleton selection operation is acquired from a plurality of reference skeleton data included in the skeleton library as the template skeleton data.
17. A device for creating an animation character, characterized in that: include: An acquisition unit is used to acquire a character image; the character image contains a character object for which a corresponding animation character needs to be created, and the animation character corresponding to the character object has animation capability; The acquisition unit is further used to acquire template skeleton data; the template skeleton data is created based on the template character, and the template skeleton data is used to describe skeleton attribute information of the template character; A processing unit, configured to adjust the template skeleton data based on the size difference between the character object and the template character, to obtain matching skeleton data that matches the character object; The matching skeleton data is used to describe the skeleton attribute information of the character object; The processing unit is further used to add animation data to the character object, and create an animation character corresponding to the character object according to the character image, the matching skeleton data and the animation data.
18. A computer device, characterized in that: The computer device comprises: a processor suitable for implementing a computer program; A computer-readable storage medium storing a computer program, wherein the computer program is suitable for being loaded by the processor and executing the method for creating an animated character according to any one of claims 1 to 16.
19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor and executing the method for creating an animated character according to any one of claims 1 to 16.
20. A computer program product, characterized in that The computer program product comprises computer instructions, and when the computer instructions are executed by a processor, the method for creating an animated character according to any one of claims 1 to 16 is implemented.
Citation Information
Cited By
Programs and Systems
JP7917209B1
Animation generation method, electronic device, and computer program product
WO2026152714A1
