A data processing method and device
By receiving virtual character attribute data and combining it with skeleton animation in the action database, constructing action sequences and generating a diverse skeleton animation database, the problem of insufficient skeleton animation generation in virtual character action design is solved, and design efficiency and performance effect are improved.
Patent Information
- Application Number
- CN202011120133.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-19
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2040-10-19
AI Technical Summary
In the prior art, there is a lack of a skeleton animation generating action database in the process of virtual character action design, resulting in limited number of action designs, poor performance effects, and a large amount of manpower is required to participate in the design and operation.
By receiving the virtual image and attribute data of the target character, combining the corresponding skeleton animations in the action database, the action sequence is constructed, and the skeleton animation is constructed by obtaining the key node parameters of the sample virtual character, generating the action database, and reducing the workload of human design.
It realizes the accurate extraction of skeleton animations that meet the target characters from the action database, reduces the demand for human labor design, improves the efficiency and diversity of action design, and avoids the situation where skeleton animations are inconsistent with virtual images.
Smart Images

Figure CN112215930B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a data processing method and device. Background Art
[0002] In film and television works, virtual characters have many different attributes, such as personality, age, etc. Virtual characters with different attributes contain many different actions. With the development of the film and television industry, the demand for action design of virtual characters is increasing.
[0003] In current technology, when designing the actions of virtual characters, it is basically a process of designing a few basic actions in advance, and then splicing, fine-tuning and transforming these actions to obtain the final action. The action design and generation methods of the existing technology can only display a few actions, and the number of actions designed is also limited, which ultimately leads to poor performance of virtual characters. If the performance of virtual characters is to be improved, it is bound to involve the use of a large amount of manpower to carry out the design and calculation of virtual character actions.
[0004] In the prior art, there is a lack of a method for simplifying the design process by acquiring a skeletal animation to generate an action database. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a data processing method and apparatus, a computing device, and a computer-readable storage medium to solve the technical defects existing in the prior art.
[0006] This embodiment discloses a data processing method, which includes:
[0007] Receiving a virtual image of a target character to be generated and target character attribute data;
[0008] According to the target character attribute data, determining the skeletal animation corresponding to the target character attribute data in the action database;
[0009] Combining the virtual image of the target character with the skeletal animation, an action sequence is constructed for the target character.
[0010] Optionally, determining, in an action database, a skeletal animation corresponding to the target character attribute data according to the target character attribute data includes:
[0011] A target skeletal animation is determined in the action database, wherein the tag content carried by the target skeletal animation corresponds to the target character attribute.
[0012] Optionally, a new action of the target character is generated by combining the virtual image of the target character with the skeletal animation, including:
[0013] generating at least one target image for the avatar;
[0014] Extracting action key frames from the skeletal animation;
[0015] The target image is used to replace the virtual character image in the action key frame to obtain the action sequence of the target character.
[0016] This embodiment discloses a method for generating an action database, the method comprising:
[0017] Acquire a sample virtual character, and determine virtual character attribute data of the sample virtual character;
[0018] Determine key nodes of the sample virtual character's body parts, and obtain action parameters of the key nodes;
[0019] Constructing a skeletal animation of a sample virtual character according to the action parameters of the key nodes, and adding corresponding tags to the skeletal animation in combination with the attribute data of the virtual character;
[0020] The skeletal animation and the corresponding tags are stored in a preset action database.
[0021] Optionally, the sample virtual character includes facial features and body features;
[0022] Determining virtual character attribute data of the sample virtual character includes:
[0023] The virtual character attribute data of the sample virtual character is determined according to the facial features and body features of the sample virtual character, wherein the virtual character attribute data includes the age, personality, gender of the sample virtual character and the current emotion and action of the sample virtual character.
[0024] Optionally, the motion parameters of the key nodes include rotation rate, rotation angle, motion direction and motion trajectory;
[0025] Determining key nodes of the sample virtual character's body parts and obtaining action parameters of the key nodes includes:
[0026] Detect the body parts of the sample virtual character, locate the key nodes according to the body parts of the sample virtual character, and obtain the rotation rate, rotation angle, movement direction and movement trajectory of the key nodes.
[0027] Optionally, the key nodes are located according to the body parts of the virtual character, and the rotation rate, rotation angle, movement direction and movement trajectory of the key nodes are obtained, including:
[0028] Determine whether the source data of the key node can be obtained, and if so, obtain the source data of the key node, and extract the action source data related to the action from the source data of the key node, and extract the rotation rate, rotation angle, movement direction and movement trajectory of the key node from the action source data, wherein the action source data includes the rotation rate, rotation angle, movement direction and movement trajectory of the key node;
[0029] If not, obtain video data of the virtual character within a preset time length, determine the body parts of the sample virtual character based on the video data of the sample virtual character, locate key nodes based on the body parts of the sample virtual character, and obtain the rotation rate, rotation angle, movement direction and movement trajectory of the key nodes of the sample virtual character based on the key nodes.
[0030] Optionally, in combination with the virtual character attribute data, a corresponding label is added to the skeletal animation, including:
[0031] Adding the virtual character attribute data as tags to the skeletal animation.
[0032] Optionally, before storing the skeletal animation and the corresponding label in a preset action database, the method further includes:
[0033] The tag is detected, and if the tag is repeated with a tag of a skeletal animation stored in an action database, the skeletal animation and the corresponding tag are deleted.
[0034] A data processing device, comprising:
[0035] A receiving module, configured to receive a virtual image of a target character to be generated and target character attribute data;
[0036] A determination module, configured to determine the skeletal animation corresponding to the target character attribute data in the action database according to the target character attribute data;
[0037] The generation module is configured to combine the virtual image of the target character with the skeletal animation to construct an action sequence for the target character.
[0038] An action database generating device, the device comprising:
[0039] A sample acquisition module is configured to acquire a sample virtual character and determine virtual character attribute data of the sample virtual character;
[0040] A node module is configured to determine key nodes of the sample virtual character's body parts and obtain action parameters of the key nodes;
[0041] A label adding module is configured to construct a skeletal animation of a sample virtual character according to the action parameters of the key nodes, and add a corresponding label to the skeletal animation in combination with the attribute data of the virtual character;
[0042] The storage module is configured to store the skeletal animation and the corresponding tags into a preset action database.
[0043] The present invention provides a data processing method and device, which constructs an action sequence for a target character by combining a virtual image of the target character in an action database with a skeletal animation, thereby overcoming the defect in the prior art that an action database cannot be generated by acquiring skeletal animation, and the saved skeletal animation cannot be extracted from the action database and combined with the virtual image of the target character to generate the action sequence of the target character, thereby ensuring that the workload of action design using manpower can be reduced.
[0044] Secondly, receiving the virtual image of the target character to be generated and the target character attribute data can ensure that the skeletal animation that matches the target character attributes is accurately extracted from the action database, avoiding the situation where the skeletal animation does not match the virtual image of the target character.
[0045] Thirdly, by combining the virtual image of the target character with the skeletal animation, an action sequence is constructed for the target character, ensuring that manpower is no longer needed to individually design the actions of the target character, thereby ensuring that the workload of manpower for action design can be reduced.
[0046] In addition, by obtaining the key nodes of the sample virtual character, constructing the skeletal animation of the sample virtual character based on the key nodes, and generating an action database according to the skeletal animation of the sample virtual character, the diversity of the skeletal animation used as a sample is ensured, ensuring that the workload of using manpower for action design can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 is a schematic diagram of the structure of a computing device according to an example of the present invention;
[0048] Figure 2 is a flow chart of a data processing method according to an embodiment of the present invention;
[0049] Figure 3 is a flow chart of a data processing method according to an embodiment of the present invention;
[0050] Figure 4 is a flow chart of a method for generating an action database according to an embodiment of the present invention;
[0051] Figure 5 is a schematic diagram of a human joint node in an embodiment of the present invention;
[0052] Figure 6 is a flow chart of a method for generating an action database according to an embodiment of the present invention;
[0053] Figure 7 is a module schematic diagram of a data processing device according to an embodiment of the present invention;
[0054] Figure 8 It is a module diagram of an action database generating device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0055] Many specific details are set forth in the following description to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present invention, so the present invention is not limited to the specific implementation disclosed below.
[0056] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0057] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0058] First, the terms involved in one or more embodiments of the present invention are explained.
[0059] Unity model: It is a multi-platform comprehensive game development tool for creating interactive content such as 3D video games, architectural visualization, real-time 3D animation, etc. It is a fully integrated professional game engine.
[0060] LineRender component: The line component in the Unity model, mainly used for processing nodes and lines.
[0061] Update function: The update function in the Unity model, mainly used for parameter export, calculation and update.
[0062] Skeletal animation: The model has a skeleton structure composed of interconnected "bones" (bones are composed of key nodes and connecting lines between nodes), and animation is generated for the model by changing the orientation and position of the bones.
[0063] Figure 1 1 is a block diagram showing a structure of a computing device 100 according to an embodiment of the present specification. The components of the computing device 100 include but are not limited to a memory 110 and a processor 120. The processor 120 is connected to the memory 110 via a bus 130, and a database 150 is used to store data.
[0064] The computing device 100 also includes an access device 140 that enables the computing device 100 to communicate via one or more networks 160. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 140 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0065] In one embodiment of the present specification, the above components of the computing device 100 and Figure 1 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 1 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0066] The computing device 100 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 100 may also be a mobile or stationary server.
[0067] The processor 120 may execute Figure 2 Steps in the method shown. Figure 2 It is a schematic flow chart showing a method for generating character actions according to an embodiment of the present invention, including steps S201 to S203.
[0068] Step S201: receiving a virtual image of a target character to be generated and target character attribute data.
[0069] The target character to be generated is an artificially created character, the virtual image is a film and television image of the character, and the target character attribute data includes the target character's age, personality, gender and current emotion.
[0070] Specifically, for example, an animation character is artificially created and named A, and the film and television image of A in the animation is the virtual image. The target character attribute data of A includes: age: 18, gender: male, personality: cheerful, current emotion: calm.
[0071] The target character and virtual image to be generated can be confirmed by receiving the name of the target character and the target character attribute data in the form of a character string and receiving the virtual image in the form of a picture.
[0072] Specifically, taking the above-mentioned animated character A as an example, the character image of the animated character is confirmed by receiving the name of the animated character: A, receiving a picture containing the virtual image of the animated character, receiving A's age: 18, gender: male, personality: cheerful, and current emotion: calm.
[0073] Receiving the virtual image of the target character to be generated and the target character attribute data can ensure that the skeletal animation that matches the target character attributes is accurately extracted from the action database, avoiding the situation where the skeletal animation does not match the virtual image of the target character.
[0074] Step S202: According to the target character attribute data, determine the skeletal animation corresponding to the target character attribute data in the action database.
[0075] Furthermore, a target skeletal animation is determined in the action database, and the tag content carried by the target skeletal animation corresponds to the target character attribute.
[0076] Specifically, taking the above-mentioned animated character A as an example, if you want to construct an action sequence for animated character A, the action database needs to receive the target character attribute data of animated character A, and extract the label that matches the target character attribute data of animated character A in the action database, and then extract the skeletal animation corresponding to the label based on the label.
[0077] For example, the target character attribute data of animated character A, age: 18, gender: male, personality: cheerful, current emotion: calm, are compared with the label content in the action database, and the label with the closest label content is extracted from the skeletal animation corresponding to the label. Among them, the label content may have a small deviation. For example, if there is no label content in the action database that is exactly the same as the target character attribute information of animated character A, the label content closest to the target character attribute information of A is extracted.
[0078] Specifically, if the action database does not contain the label content: age: 18, gender: male, personality: cheerful, current emotion: calm, then the label content: age: 19, gender: male, personality: cheerful, current emotion: calm and the skeletal animation corresponding to the label are extracted, and the skeletal animation is numbered as A1.
[0079] According to the target character attribute data, the skeletal animation corresponding to the target character attribute data is determined in the action database, ensuring that the skeletal animation that meets the requirements can be accurately extracted from the action database, avoiding the situation where the skeletal animation is inconsistent with the virtual image of the target character to be generated.
[0080] Step S203: Combining the virtual image and skeletal animation of the target character, constructing an action sequence for the target character.
[0081] Further, generating at least one target image for the virtual image;
[0082] Extracting action key frames from the skeletal animation;
[0083] The target image is used to replace the skeleton image in the action key frame to obtain the action sequence of the target character.
[0084] Specifically, taking the above-mentioned animated character A as an example, assuming that the target image of animated character A is: running in a certain venue, and extracting the action key frames in A1, the target image of animated character A is used to replace the skeleton image in the action key frames, thereby obtaining the action sequence of animated character A: A's running action sequence in a certain venue.
[0085] By combining the virtual image of the target character with the skeletal animation, an action sequence is constructed for the target character, ensuring that human labor is no longer needed to individually design the actions of the target character, thereby ensuring that the workload of human labor for action design can be reduced.
[0086] This embodiment discloses a data processing method, such as Figure 3 As shown, steps S301 to S305 are included:
[0087] Step S301: receiving a virtual image of a target character to be generated and target character attribute data.
[0088] Specifically, for example, an animation character is artificially created and named B, and the film and television image of B in the animation is the virtual image. The target character attribute data of A includes: age: 22, gender: female, personality: introverted, current emotion: sad.
[0089] Receiving the virtual image of the target character to be generated and the target character attribute data can ensure that the skeletal animation that matches the target character attributes is accurately extracted from the action database, avoiding the situation where the skeletal animation does not match the virtual image of the target character.
[0090] Step S302: determining a target skeletal animation in an action database, wherein the tag content carried by the target skeletal animation corresponds to the target character attribute.
[0091] Taking the above-mentioned animated character B as an example, the target character attribute data of animated character B, age: 22, gender: female, personality: introverted, current emotion: sad, are compared with the label content in the action database, and the label with the closest label content and the skeletal animation corresponding to the label are extracted from the action database, and the skeletal animation is numbered B1 here.
[0092] According to the target character attribute data, the skeletal animation corresponding to the target character attribute data is determined in the action database, ensuring that the skeletal animation that meets the requirements can be accurately extracted from the action database, avoiding the situation where the skeletal animation is inconsistent with the virtual image of the target character to be generated.
[0093] Step S303: Generate at least one target image for the virtual image.
[0094] Step S304: extracting action key frames from the skeletal animation.
[0095] Step S305: replacing the skeleton image in the action key frame with the target image to obtain the action sequence of the target character.
[0096] Specifically, taking the above-mentioned animated character B as an example, assuming that the target image of animated character B is: sitting on a chair, and extracting the action key frames in B1, the target image of animated character B is used to replace the skeleton image in the action key frames, thereby obtaining the action sequence of animated character B: the action sequence of B sitting on a chair.
[0097] By combining the virtual image of the target character with the skeletal animation, an action sequence is constructed for the target character, ensuring that human labor is no longer needed to individually design the actions of the target character, thereby ensuring that the workload of human labor for action design can be reduced.
[0098] This embodiment discloses a method for generating an action database. Figure 4 As shown, it includes steps S401 to S404:
[0099] Step S401: Acquire a sample virtual character and determine the virtual character attribute data of the sample virtual character.
[0100] Furthermore, the sample virtual character includes facial features and body features.
[0101] Furthermore, virtual character attribute data of the sample virtual character is determined based on the facial features and body features of the sample virtual character, wherein the virtual character attribute data includes the age, personality, gender of the sample virtual character and the current emotion and action of the sample virtual character.
[0102] Specifically, assuming that the sample virtual character is a human being, denoted as C, the facial features of the sample virtual character are a fair and full face, a smiling expression, a slim body shape, wearing a long skirt, and a standing action. Based on the facial features and body shape features, it is inferred that C is 25 years old, has a cheerful personality, is female, and has a current emotion of happiness.
[0103] By acquiring sample virtual characters and determining the virtual character attribute data of the sample virtual characters, it can be ensured that the sample virtual characters have specific categories and accurate classification methods.
[0104] Step S402: Determine the key nodes of the body parts of the sample virtual character, and obtain the action parameters of the key nodes.
[0105] Furthermore, the body parts of the sample virtual character are detected, key nodes are located according to the body parts of the sample virtual character, and the rotation rate, rotation angle, movement direction and movement trajectory of the key nodes are obtained.
[0106] Further, it is determined whether the source data of the key node can be obtained, and if so, the source data of the key node is obtained, and the action source data related to the action is extracted from the source data of the key node, and the rotation rate, rotation angle, movement direction and movement trajectory of the key node are extracted from the action source data, wherein the action source data includes the rotation rate, rotation angle, movement direction and movement trajectory of the key node;
[0107] If not, obtain video data of the virtual character within a preset time length, determine the body parts of the sample virtual character based on the video data of the sample virtual character, locate key nodes based on the body parts of the sample virtual character, and obtain the rotation rate, rotation angle, movement direction and movement trajectory of the key nodes of the sample virtual character based on the key nodes.
[0108] Specifically, taking the above-mentioned sample virtual character C as an example, first determine whether the source code of C can be obtained. If the source code of C can be obtained, extract the action source code related to the action in the source code, and then extract the rotation rate, rotation angle, movement direction and movement trajectory of the key nodes contained in the action source code, and use the rotation rate, rotation angle, movement direction and movement trajectory of the key nodes as action parameters.
[0109] If the source code cannot be directly obtained, the body parts of the sample virtual character C are determined according to the video data, including the head, facial features, neck, arms, torso and legs.
[0110] Furthermore, if Figure 5 As shown, according to the body parts of the sample virtual character C, the key nodes contained in each body part are located. There are 21 key nodes in total, and the specific positions are: top of the head 501, left ear 502, right ear 503, left eye 504, right eye 505, nose 506, left corner of the mouth 507, right corner of the mouth 508, neck 509, left shoulder 510, right shoulder 511, left elbow 512, right elbow 513, left wrist 514, right wrist 515, left hip 516, right hip 517, left knee 518, right knee 519, left ankle 520, and right ankle 521.
[0111] Furthermore, the video data and the key nodes are combined to obtain the rotation rate, rotation angle, movement direction and movement trajectory of each key node.
[0112] By determining the key nodes of the sample virtual character's body parts and obtaining the action parameters of the key nodes, it is ensured that the body parts of the sample virtual character in the video can be accurately identified and that the obtained action parameters can accurately describe the actions of the sample virtual character.
[0113] Step S403: constructing a skeletal animation of a sample virtual character according to the action parameters of the key nodes, and adding corresponding tags to the skeletal animation in combination with the virtual character attribute data.
[0114] Furthermore, the age, personality, gender of the sample virtual character contained in the virtual character attribute data and the current emotion and action of the sample virtual character are added to the skeletal animation as tags.
[0115] Specifically, taking the above-mentioned sample virtual character C as an example, after obtaining the key nodes and action parameters of the sample virtual character C, the key nodes and action parameters are imported into the Unity model, and the Linerender component is used to connect adjacent key nodes to generate the skeleton of the sample virtual character C. Based on the skeleton of the sample virtual character C, the Update function is used to derive the rotation rate, rotation angle, movement direction and movement trajectory of each key node to generate an action sequence of the sample virtual character C. The action sequence is used as a skeletal animation, and the skeletal animation is recorded as C1. The sample virtual character attribute information of 25 years old, cheerful personality, female gender, current emotion happy, and standing action obtained in step S401 is added as a label to the skeletal animation.
[0116] The skeletal animation of the sample virtual character is constructed according to the action parameters of the key nodes, which ensures that the constructed skeletal animation can accurately restore the action of the sample virtual character and reduces the workload of manpower for action design; in combination with the virtual character attribute data, corresponding tags are added to the skeletal animation, which ensures that each constructed skeletal animation has corresponding identification information and ensures accuracy when using the skeletal animation.
[0117] Step S404: storing the skeletal animation and the corresponding label in a preset action database.
[0118] Furthermore, before storing the skeletal animation and the corresponding tag in a preset action database, the tag is detected, and if the tag is repeated with the tag of the skeletal animation stored in the action database, the skeletal animation and the corresponding tag are deleted.
[0119] Specifically, taking the above-mentioned sample virtual character C as an example, when the skeletal animation of the sample virtual character C is stored in the action database, it is necessary to detect the label of the skeletal animation of the sample virtual character C. If there is already a label in the action database with the content: 25 years old, cheerful personality, female gender, current emotion is happy, and action is standing, and the corresponding skeletal animation, then delete the skeletal animation C1 and the corresponding label to be stored.
[0120] By detecting the label, if the label is repeated with the label of the skeletal animation stored in the action database, the skeletal animation and the corresponding label are deleted, thereby ensuring that there is no repeated skeletal animation in the action database, ensuring the uniqueness of the skeletal animation in the action database, avoiding the situation where the same skeletal animation is extracted from the action database, and ensuring that the generated action sequence of the target character will not be repeated.
[0121] This embodiment discloses a method for generating an action database. Figure 6 As shown, steps S601 to S606 are included:
[0122] Step S601: Acquire a sample virtual character and determine the virtual character attribute data of the sample virtual character.
[0123] Specifically, assuming that the sample virtual character is a cat, denoted as D, the facial features of the sample virtual character are a sallow and thin face, a calm expression, a thin body feature, and an action of running. Based on the facial features and body features, it is inferred that D is a cat that is 5 years old, introverted, male, and currently emotionally sad.
[0124] By acquiring sample virtual characters and determining the virtual character attribute data of the sample virtual characters, it can be ensured that the sample virtual characters have specific categories and accurate classification methods.
[0125] Step S602: Determine the key nodes of the body parts of the sample virtual character, and obtain the action parameters of the key nodes.
[0126] Specifically, taking the above-mentioned sample virtual character D as an example, first determine whether the source data of the key node can be obtained. If not, obtain the video data of the virtual character within a preset time length. In this embodiment, obtain the video data of the sample virtual character D as an example.
[0127] After obtaining the video data of the sample virtual character D, the body parts of the sample virtual character C are determined according to the video data, including the head, facial features, neck, arms, torso and legs.
[0128] Furthermore, the key nodes contained in each body part are located according to the body parts of the sample virtual character D. There are 21 key nodes in total, and their specific positions are: top of the head, left ear, right ear, left eye, right eye, nose, left corner of the mouth, right corner of the mouth, neck, left shoulder, right shoulder, left front joint, right front joint, left rear joint, right rear joint, left hip, right hip, left claw, right claw, left claw joint, and right claw joint.
[0129] Furthermore, the video data and the key nodes are combined to obtain the rotation rate, rotation angle, movement direction and movement trajectory of each key node.
[0130] By determining the key nodes of the sample virtual character's body parts and obtaining the action parameters of the key nodes, it is ensured that the body parts of the sample virtual character in the video can be accurately identified and that the obtained action parameters can accurately describe the actions of the sample virtual character.
[0131] Step S603: constructing the skeletal animation of the sample virtual character according to the action parameters of the key nodes.
[0132] Specifically, taking the above-mentioned sample virtual character D as an example, after obtaining the key nodes and action parameters of the sample virtual character D, the key nodes and action parameters are imported into the Unity model, and the Linerender component is used to connect adjacent key nodes to generate the skeleton of the sample virtual character D. Based on the skeleton of the sample virtual character D, the Update function is used to derive the rotation rate, rotation angle, movement direction and movement trajectory of each key node to generate an action sequence of the sample virtual character D. The action sequence is used as a skeletal animation, and the skeletal animation is recorded as D1.
[0133] The skeletal animation of the sample virtual character is constructed according to the action parameters of the key nodes, which ensures that the constructed skeletal animation can accurately restore the action of the sample virtual character, reduces the workload of manpower for action design, and ensures that the constructed skeletal animation is not limited to human actions, but can also be applied to animals.
[0134] Step S604: adding corresponding tags to the skeletal animation in combination with the virtual character attribute data.
[0135] Step S605: storing the skeletal animation and the corresponding label in a preset action database.
[0136] Step S606: Detect the tag. If the tag is repeated with the tag of the skeletal animation stored in the action database, delete the skeletal animation and the corresponding tag.
[0137] Specifically, taking the above sample virtual character D as an example, the sample virtual character attribute information of a cat of 5 years old, introverted personality, male gender, and current emotion of sadness obtained in step S601 is added as a label to the skeletal animation D1.
[0138] Before storing the skeletal animation D1 in the action database, a detection is performed in the action database according to the label content corresponding to the skeletal animation D1: a cat of age 5, introverted personality, male gender, and current emotion of sadness. When the detection result shows that there is no identical label, the skeletal animation D1 and the corresponding label are stored in the action database.
[0139] In combination with the virtual character attribute data, corresponding tags are added to the skeletal animation, ensuring that each constructed skeletal animation has corresponding identification information, thereby ensuring the accuracy of extracting and using the skeletal animation.
[0140] By detecting the label, if the label is repeated with the label of the skeletal animation stored in the action database, the skeletal animation and the corresponding label are deleted, thereby ensuring that there is no repeated skeletal animation in the action database, and also ensuring the uniqueness of the skeletal animation in the action database, avoiding the situation where the same skeletal animation is extracted from the action database, and also ensuring that the generated action sequence of the target character will not be repeated.
[0141] This embodiment discloses a data processing device, such as Figure 7 As shown, the device comprises:
[0142] The receiving module 701 is configured to receive the virtual image of the target character to be generated and the target character attribute data;
[0143] A determination module 702 is configured to determine a skeletal animation corresponding to the target character attribute data in an action database according to the target character attribute data;
[0144] The generation module 703 is configured to combine the virtual image of the target character with the skeletal animation to construct an action sequence for the target character.
[0145] Further, the determination module 702 is specifically configured to:
[0146] A target skeletal animation is determined in the action database, wherein the tag content carried by the target skeletal animation corresponds to the target character attribute.
[0147] According to the target character attribute data, the skeletal animation corresponding to the target character attribute data is determined in the action database, ensuring that the skeletal animation that meets the requirements can be accurately extracted from the action database, avoiding the situation where the skeletal animation is inconsistent with the virtual image of the target character to be generated.
[0148] Furthermore, the generation module 703 is specifically configured as follows:
[0149] generating at least one target image for the avatar;
[0150] Extracting action key frames from the skeletal animation;
[0151] The target image is used to replace the skeleton image in the action key frame to obtain the action sequence of the target character.
[0152] By combining the virtual image of the target character with the skeletal animation, an action sequence is constructed for the target character, ensuring that human labor is no longer needed to individually design the actions of the target character, thereby ensuring that the workload of human labor for action design can be reduced.
[0153] This embodiment discloses a device for generating an action database. Figure 8 As shown, the device comprises
[0154] The sample acquisition module 801 is configured to acquire a sample virtual character and determine virtual character attribute data of the sample virtual character;
[0155] The node module 802 is configured to determine the key nodes of the body parts of the sample virtual character and obtain the action parameters of the key nodes;
[0156] The label adding module 803 is configured to construct the skeleton animation of the sample virtual character according to the action parameters of the key nodes, and add corresponding labels to the skeleton animation in combination with the attribute data of the virtual character;
[0157] The storage module 804 is configured to store the skeletal animation and the corresponding label into a preset action database.
[0158] Furthermore, the acquisition module 801 is specifically configured as follows:
[0159] Determine virtual character attribute data of the sample virtual character based on the facial features and body features of the sample virtual character, wherein the virtual character attribute data includes the age, personality, gender, and current emotions and actions of the sample virtual character, wherein the sample virtual character includes facial features and body features.
[0160] Furthermore, the node module 802 is specifically configured as follows:
[0161] Detect body parts of the sample virtual character, locate key nodes according to the body parts of the sample virtual character, and obtain the rotation rate, rotation angle, movement direction and movement trajectory of the key nodes, wherein the action parameters of the key nodes include rotation rate, rotation angle, movement direction and movement trajectory.
[0162] The node module 802 is further configured to:
[0163] Determine whether the source data of the key node can be obtained, and if so, obtain the source data of the key node, and extract the action source data related to the action from the source data of the key node, and extract the rotation rate, rotation angle, movement direction and movement trajectory of the key node from the action source data, wherein the action source data includes the rotation rate, rotation angle, movement direction and movement trajectory of the key node;
[0164] If not, obtain video data of the virtual character within a preset time length, determine the body parts of the sample virtual character based on the video data of the sample virtual character, locate key nodes based on the body parts of the sample virtual character, and obtain the rotation rate, rotation angle, movement direction and movement trajectory of the key nodes of the sample virtual character based on the key nodes.
[0165] Furthermore, the tag adding module 803 is specifically configured as follows:
[0166] Adding the virtual character attribute data as tags to the skeletal animation.
[0167] Furthermore, the device also includes a detection module 805 .
[0168] The detection module 805 is specifically configured as follows:
[0169] The tag is detected, and if the tag is repeated with a tag of a skeletal animation stored in an action database, the skeletal animation and the corresponding tag are deleted.
[0170] An embodiment of the present invention provides an action database generating device, which obtains key nodes of a sample virtual character, constructs a skeletal animation of the sample virtual character based on the key nodes, and generates an action database according to the skeletal animation of the sample virtual character, thereby ensuring the diversity of the skeletal animation used as a sample and reducing the workload of using manpower for action design.
[0171] This embodiment also provides a computer-readable storage medium storing computer instructions, which implement the steps of a data processing method as described above when executed by a processor.
[0172] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned character action generation method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned character action generation method.
[0173] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0174] It should be noted that, for the convenience of description, the aforementioned method embodiments are all described as a series of action combinations, but those skilled in the art should be aware that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0175] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0176] The preferred embodiments of the present invention disclosed above are only used to help illustrate the present invention. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.
Claims
1. A data processing method, characterized in that: The method comprises: Receiving a virtual image of a target character to be generated and target character attribute data; According to the target character attribute data, determining the skeletal animation corresponding to the target character attribute data in the action database, comprising: extracting the skeletal animation corresponding to the target character attribute data of the target character in the action database according to the label of the target character skeletal animation, wherein the action database contains the target character skeletal animation corresponding to the label of multiple attribute data, and the skeletal animation in the action database is obtained according to the body parts of the sample virtual character; Combining the virtual image of the target character with the skeletal animation, an action sequence is constructed for the target character.
2. The method according to claim 1, characterized in that Determining the skeletal animation corresponding to the target character attribute data in the action database according to the target character attribute data includes: Determining the target skeletal animation in the action database includes: extracting the skeletal animation corresponding to the target character in the action database according to the label of the skeletal animation of the target character, and the label content carried by the target skeletal animation corresponds to the attribute of the target character.
3. The method according to claim 1, characterized in that Combining the virtual image of the target character with the skeletal animation, constructing an action sequence for the target character, including: generating at least one target image for the avatar; Extracting action key frames from the skeletal animation; The target image is used to replace the skeleton image in the action key frame to obtain the action sequence of the target character.
4. A method for generating an action database, characterized in that: The method comprises: Acquire a sample virtual character, and determine virtual character attribute data of the sample virtual character; Determine key nodes of the sample virtual character's body parts, and obtain action parameters of the key nodes; Constructing a skeletal animation of a sample virtual character according to the action parameters of the key nodes, and adding corresponding tags to the skeletal animation in combination with the attribute data of the virtual character; The skeletal animation and the corresponding label are stored in a preset action database, wherein the action database contains the target character skeletal animation corresponding to the labels of various attribute data, and the skeletal animation in the action database is obtained according to the body parts of the sample virtual character.
5. The method according to claim 4, characterized in that The sample virtual character includes facial features and body features; Determining virtual character attribute data of the sample virtual character includes: The virtual character attribute data of the sample virtual character is determined according to the facial features and body features of the sample virtual character, wherein the virtual character attribute data includes the age, personality, gender of the sample virtual character and the current emotion and action of the sample virtual character.
6. The method according to claim 4, characterized in that The motion parameters of the key nodes include rotation rate, rotation angle, motion direction and motion trajectory; Determining key nodes of the sample virtual character's body parts and obtaining action parameters of the key nodes includes: Detect the body parts of the sample virtual character, locate the key nodes according to the body parts of the sample virtual character, and obtain the rotation rate, rotation angle, movement direction and movement trajectory of the key nodes.
7. The method according to claim 6, characterized in that Locate key nodes according to the body parts of the sample virtual character, and obtain the rotation rate, rotation angle, movement direction and movement trajectory of the key nodes, including: Determine whether the source data of the key node can be obtained, and if so, obtain the source data of the key node, and extract the action source data related to the action from the source data of the key node, and extract the rotation rate, rotation angle, movement direction and movement trajectory of the key node from the action source data, wherein the action source data includes the rotation rate, rotation angle, movement direction and movement trajectory of the key node; If not, obtain video data of the virtual character within a preset time length, determine the body parts of the sample virtual character based on the video data of the sample virtual character, locate key nodes based on the body parts of the sample virtual character, and obtain the rotation rate, rotation angle, movement direction and movement trajectory of the key nodes of the sample virtual character based on the key nodes.
8. The method according to claim 4, characterized in that In combination with the virtual character attribute data, a corresponding label is added to the skeletal animation, including: The age, personality, gender of the sample virtual character contained in the virtual character attribute data and the current emotion and action of the sample virtual character are added to the skeletal animation as tags.
9. The method according to claim 4, characterized in that Before storing the skeletal animation and the corresponding label in a preset action database, the method further includes: The tag is detected, and if the tag is repeated with a tag of a skeletal animation stored in an action database, the skeletal animation and the corresponding tag are deleted.
10. A data processing device, characterized in that: The device comprises: A receiving module, configured to receive a virtual image of a target character to be generated and target character attribute data; A determination module is configured to determine the skeletal animation corresponding to the target character attribute data in the action database according to the target character attribute data, including: extracting the skeletal animation corresponding to the target character attribute data in the action database according to the label of the target character skeletal animation, wherein the action database contains the target character skeletal animation corresponding to the label of multiple attribute data, and the skeletal animation in the action database is obtained according to the body part of the sample virtual character; The generation module is configured to combine the virtual image of the target character with the skeletal animation to construct an action sequence for the target character.
11. An action database generating device, characterized in that: The device comprises: A sample acquisition module is configured to acquire a sample virtual character and determine virtual character attribute data of the sample virtual character; A node module is configured to determine key nodes of the sample virtual character's body parts and obtain action parameters of the key nodes; A label adding module is configured to construct a skeletal animation of a sample virtual character according to the action parameters of the key nodes, and add a corresponding label to the skeletal animation in combination with the attribute data of the virtual character; The storage module is configured to store the skeletal animation and the corresponding label into a preset action database, wherein the action database contains the target character skeletal animation corresponding to the label of multiple attribute data, and the skeletal animation in the action database is obtained according to the body parts of the sample virtual character.
12. A computing device comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, characterized in that: When the processor executes the instructions, the steps of the method described in any one of claims 1-3 or claims 4-9 are implemented.
13. A computer-readable storage medium storing computer instructions, characterized in that: When the instruction is executed by a processor, the steps of the method described in any one of claims 1 to 3 or claims 4 to 9 are implemented.
14. A computer program product, characterized in that The method comprises computer instructions which, when executed by a processor, implement the steps of the method described in any one of claims 1 to 3 or claims 4 to 9.
