Animation processing method and apparatus, electronic device, computer-readable storage medium and computer program product
By adding bone slots to the skeleton of a virtual object, the skeleton of the second virtual object can be controlled to follow the skeleton of the first virtual object, which solves the problems of poor virtual object mounting animation effects and high production costs, and achieves more realistic and diverse mounting animation effects.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2024-09-10
- Publication Date
- 2026-06-04
Smart Images

Figure CN2024118016_04062026_PF_FP_ABST
Abstract
Description
Animation processing methods, apparatuses, electronic devices, computer-readable storage media, and computer program products
[0001] Cross-references to related applications
[0002] This application is based on and claims priority to Chinese Patent Application No. 2023116385056, filed on November 30, 2023, the entire contents of which are incorporated herein by reference. Technical Field
[0003] This application relates to the field of computer technology, and in particular to an animation processing method, apparatus, electronic device, computer-readable storage medium, and computer program product. Background Technology
[0004] In film and television animation and virtual scenes (such as games), there is often a virtual object (i.e., the object being mounted) that is mounted on another virtual object (i.e., the carrier object) to achieve the animation effect of the two virtual objects moving together, such as one virtual object riding another virtual object. In related technologies, (1) different animation assets and animation logic are made for the carrier object and the object being mounted, which can achieve a variety of different mounting postures, but the production cost is very high; (2) only one set of animation assets and animation logic is made for the carrier object and the object being mounted, but this makes the mounting posture highly uniform and the animation effect is very poor.
[0005] Summary of the Invention
[0006] This application provides an animation processing method, apparatus, electronic device, computer-readable storage medium, and computer program product, which can improve animation effects and reduce animation production costs.
[0007] The technical solution of this application embodiment is implemented as follows:
[0008] This application provides an animation processing method applied to an electronic device, including:
[0009] Obtain the first animation file of the first virtual object and the second animation file of the second virtual object;
[0010] Extract the first object skeleton of the first virtual object from the first animation file, and extract the second object skeleton of the second virtual object from the second animation file;
[0011] Add a bone slot to the first bone of the first object skeleton;
[0012] The second bone of the second object skeleton is attached to the bone slot;
[0013] When the mounting animation is played and the mounting animation is used to show that the second virtual object is mounted on the first virtual object, the second bone is controlled to move with the first bone based on the bone slot. During the process of the second bone moving with the first bone, the object part of the second virtual object that is bound to the second bone moves with the object part of the first virtual object that is bound to the first bone.
[0014] This application embodiment also provides an animation processing apparatus, including:
[0015] The acquisition module is configured to acquire the first animation file of the first virtual object and the second animation file of the second virtual object;
[0016] The extraction module is configured to extract the first object skeleton of the first virtual object from the first animation file, and extract the second object skeleton of the second virtual object from the second animation file;
[0017] Add a module and configure it to add a bone slot to the first bone of the first object skeleton;
[0018] The mounting module is configured to mount the second bone of the second object skeleton to the bone slot;
[0019] The playback module is configured to control the second bone to follow the first bone when playing a mounting animation that is used to display the second virtual object being mounted on the first virtual object, based on the bone slot. During the process of the second bone following the first bone, the object portion of the second virtual object that is bound to the second bone also follows the object portion of the first virtual object that is bound to the first bone.
[0020] This application also provides an electronic device, including:
[0021] Memory, configured to store computer-executable instructions;
[0022] When a processor is configured to execute computer-executable instructions stored in the memory, it implements the animation processing method provided in the embodiments of this application.
[0023] This application also provides a computer-readable storage medium storing computer-executable instructions or computer programs, which, when executed by a processor, implement the animation processing method provided in this application.
[0024] This application also provides a computer program product, including computer-executable instructions or a computer program, which, when executed by a processor, implements the animation processing method provided in this application.
[0025] The embodiments of this application have the following beneficial effects:
[0026] Applying the above embodiments of this application, firstly, a first animation file of the first virtual object and a second animation file of the second virtual object are obtained; then, the first object skeleton of the first virtual object is extracted from the first animation file, and the second object skeleton of the second virtual object is extracted from the second animation file; then, a bone slot is added to the first bone of the first object skeleton, and the second bone of the second object skeleton is attached to the bone slot; thus, when playing the mounting animation for displaying the second virtual object attached to the first virtual object, the second bone is controlled to move with the first bone based on the bone slot, so that the object part of the second virtual object bound to the second bone moves with the object part of the first virtual object bound to the first bone.
[0027] Here, (1) the second bone of the second virtual object is based on the bone slot and can move with the first bone of the first virtual object, so that the object part of the second virtual object bound to the second bone moves with the object part of the first virtual object bound to the first bone. In this way, the animation effect of the second virtual object being mounted on the first virtual object to move together can be improved, making the animation effect of the second virtual object being mounted on the first virtual object to move together more realistic; (2) since the second virtual object is mounted on the first virtual object to follow the movement is achieved by adding bone slots, it is only necessary to adjust the addition position (first bone) or mounting position (second bone) of the bone slots to achieve different postures of mounting through bone slots, which increases the diversity of mounting postures, and there is no need to make different mounting posture animation assets and animation logic for each virtual object separately, which reduces the animation production cost and improves the animation production efficiency. Attached Figure Description
[0028] Figure 1 is a schematic diagram of the architecture of the animation processing system provided in an embodiment of this application;
[0029] Figure 2 is a schematic diagram of the structure of the electronic device provided in an embodiment of this application;
[0030] Figure 3 is a first flowchart of the animation processing method provided in an embodiment of this application;
[0031] Figure 4A is a first display schematic diagram of the mounting animation provided in an embodiment of this application;
[0032] Figure 4B is a second schematic diagram of the mounting animation provided in an embodiment of this application;
[0033] Figure 4C is a third display diagram of the mounting animation provided in the embodiment of this application;
[0034] Figure 5 is a second flowchart of the animation processing method provided in the embodiment of this application;
[0035] Figure 6 is a schematic diagram of the second object skeleton of the second virtual object provided in the embodiments of this application;
[0036] Figure 7A is a schematic diagram of the first creation process of mounting animation blueprints provided in an embodiment of this application;
[0037] Figure 7B is a schematic diagram of the second creation process of mounting animation blueprints provided in an embodiment of this application;
[0038] Figure 8A is a schematic diagram of the first creation process of the second animation blueprint provided in the embodiment of this application;
[0039] Figure 8B is a schematic diagram of the second creation process of the second animation blueprint provided in the embodiments of this application;
[0040] Figure 8C is a schematic diagram of the third creation process of the second animation blueprint provided in the embodiments of this application;
[0041] Figure 8D is a schematic diagram of the fourth creation process of the second animation blueprint provided in the embodiments of this application;
[0042] Figure 8E is a schematic diagram of the fifth creation process of the second animation blueprint provided in the embodiments of this application;
[0043] Figure 8F is a schematic diagram of the sixth creation process of the second animation blueprint provided in the embodiments of this application;
[0044] Figure 8G is a schematic diagram of the seventh creation process of the second animation blueprint provided in the embodiments of this application;
[0045] Figure 9A is a schematic diagram of the first logical editing process of the second animation blueprint provided in an embodiment of this application;
[0046] Figure 9B is a schematic diagram of the second logical editing process of the second animation blueprint provided in the embodiment of this application;
[0047] Figure 9C is a schematic diagram of the third logic editing process of the second animation blueprint provided in the embodiments of this application;
[0048] Figure 9D is a schematic diagram of the fourth logic editing process of the second animation blueprint provided in the embodiment of this application;
[0049] Figure 9E is a schematic diagram of the fifth logical editing process of the second animation blueprint provided in the embodiments of this application;
[0050] Figure 10A is a schematic diagram of the first creation process of the first animation blueprint provided in the embodiment of this application;
[0051] Figure 10B is a schematic diagram of the second creation process of the first animation blueprint provided in the embodiment of this application;
[0052] Figure 10C is a schematic diagram of the third creation process of the first animation blueprint provided in the embodiments of this application;
[0053] Figure 10D is a schematic diagram of the fourth creation process of the first animation blueprint provided in the embodiments of this application;
[0054] Figure 11A is a schematic diagram of the first creation process of mounting animation blueprints provided in an embodiment of this application;
[0055] Figure 11B is a schematic diagram of the second creation process of mounting animation blueprints provided in an embodiment of this application;
[0056] Figure 11C is a schematic diagram of the third creation process of mounting animation blueprints provided in the embodiments of this application.
[0057] It should be noted that the terms "first" and "second" mentioned above are only used to distinguish between different options and do not represent the degree of superiority or inferiority of the options or their priority in the implementation process. Detailed Implementation
[0058] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0059] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0060] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0061] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0062] Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in the embodiments of this application is for the purpose of describing the embodiments of this application only and is not intended to limit this application.
[0063] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.
[0064] 1) Client: An application running in the terminal that provides various services, such as a client that supports animation processing.
[0065] 2) Responding to: used to indicate the conditions or states on which the operation is performed. When the conditions or states on which the operation is performed are met, one or more operations may be performed in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations are performed.
[0066] 3) Riding: refers to the purpose of enhancing one's own mobility by riding on a vehicle, animal or other carrier.
[0067] 4) Digital Content Creation (DCC) software: A general term for software used in the production of animated characters, including 3D Studio Max, Maya, Blender, Houdini, etc. Among them, 3D Studio Max (abbreviated as 3ds Max or 3ds MAX) is a computer-based 3D animation rendering and production software.
[0068] 5) Skeleton: Contains bones and joints. Bones are coordinate spaces, and the bone hierarchy consists of nested coordinate spaces. Joints describe the position of a bone (i.e., the position of the bone at the origin of the bone's coordinate space) within its parent space. Rotation about a joint refers to the rotation of the bone's coordinate space (including all its subspaces) itself.
[0069] 6) Skeletal animation: Each animated character contains at least two main types of data: bones and models. In the production of game / film animation, the process of using the posture of bones to drive the model (changing the appearance of the character model) is called skeletal animation.
[0070] 7) Skinning: This refers to attaching (binding) vertices in a model (mesh) to bones, and each vertex can be controlled by multiple bones. In this way, vertices at joints change position due to the simultaneous pulling of parent and child bones, thus eliminating cracks.
[0071] 8) Blueprint: A special type of resource in Unreal Engine (UE) that provides an intuitive, node-based interface for creating new types of Actors and level script events. It provides level designers and game developers with a tool to quickly create and iterate on game playability in the Unreal Editor without writing a single line of code.
[0072] 9) Animation Blueprint: Performs animation blending, directly controls the skeleton's bones, or sets the logic that will ultimately define the final animation pose of the skeletal mesh objects to be used for each frame of animation.
[0073] 10) Slot (i.e., bone slot): This is the term used in Unreal Engine. It works similarly to a bone and can be added to a skeleton mesh to serve as a locator for attachment points of virtual props, effects, etc.
[0074] 11) ControlRig: An animation tool provided by Unreal Engine that allows users to equip and animate animated characters directly within Unreal Engine, known as "Control Rig". Using Control Rig bypasses the need for external tools for equipment and animation creation, allowing users to create animations directly within the Unreal Editor.
[0075] 12) Full Body Inverse Kinematics (FBIK): Utilizing the FBIK functionality within the Control Rig, this approach allows for the construction of highly controllable and flexible rigs. The overall solver method is built upon a position-based IK framework, enabling faster rig performance, per-bone settings, preferred angles, compression, and stretching. FBIK is designed to act as a procedural adjustment tool within the Control Rig, such as for ground alignment or arm extension behavior.
[0076] Based on the foregoing description of the nouns and terms used in the embodiments of this application, the embodiments of this application will be described in detail below. The embodiments of this application provide an animation processing method, apparatus, electronic device, computer-readable storage medium, and computer program product, which can improve animation effects and reduce animation production costs.
[0077] It should be noted that the data collection and processing described in this application should be strictly in accordance with the requirements of relevant laws and regulations, obtaining the informed consent or separate consent of the personal information subject, and conducting subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.
[0078] The animation processing system provided in this application embodiment is described below. Referring to Figure 1, Figure 1 is a schematic diagram of the architecture of the animation processing system provided in this application embodiment. To support an exemplary application, the animation processing system 100 includes: a server 200, a network 300, and a terminal 400. The terminal 400 is connected to the server 200 through the network 300. The network 300 can be a wide area network (WAN), a local area network (LAN), or a combination of both, using wireless or wired links to achieve data transmission.
[0079] Here, terminal 400 (e.g., running a client that supports animation processing) responds to an animation processing instruction by sending an animation retrieval request to server 200. This animation retrieval request instructs the retrieval of a first animation file of a first virtual object and a second animation file of a second virtual object. Server 200 receives the animation retrieval request from terminal 400. In response to the animation retrieval request, server 200 returns the first animation file of the first virtual object and the second animation file of the second virtual object to terminal 400. Terminal 400 receives the first animation file of the first virtual object and the second animation file of the second virtual object returned by server 200. From the first animation file, it extracts the first object skeleton of the first virtual object and from the second animation file, it extracts the second object skeleton of the second virtual object. It adds a bone slot to the first bone of the first object skeleton. It mounts the second bone of the second object skeleton to the bone slot. When the mounting animation is played and is used to display the second virtual object mounted on the first virtual object, based on the bone slot, it controls the second bone to move with the first bone. During the movement of the second bone with the first bone, the object portion of the second virtual object bound to the second bone moves with the object portion of the first virtual object bound to the first bone. This improves the animation effect of the second virtual object being attached to the first virtual object and moving together, making the animation effect of the second virtual object being attached to the first virtual object and moving together more realistic.
[0080] In some embodiments, the animation processing method provided in this application is implemented by an electronic device. For example, it can be implemented by a terminal alone, by a server alone, or by a terminal and a server working together. This application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving, video, instant messaging, games, and the metaverse.
[0081] In some embodiments, the electronic device implementing the animation processing method provided in this application can be various types of terminals or servers. The server (e.g., server 200) can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The terminal (e.g., terminal 400) can be a laptop, tablet, desktop computer, smartphone, smart voice interaction device (e.g., smart speaker), smart home appliance (e.g., smart TV), smartwatch, in-vehicle terminal, wearable device, virtual reality (VR) device, aircraft, etc., but is not limited thereto. The terminal and server can be directly or indirectly connected via wired or wireless communication, and this application does not impose any limitations on this.
[0082] In some embodiments, the terminal or server can implement the animation processing method provided in this application by running various computer-executable instructions or computer programs. For example, computer-executable instructions can be microprogram-level commands, machine instructions, or software instructions. Computer programs can be native programs or software modules in an operating system; they can be native applications (APPs), i.e., programs that need to be installed in the operating system to run; or they can be applets that can be embedded in any APP, i.e., programs that only need to be downloaded to a browser environment to run. In summary, the aforementioned computer-executable instructions can be any form of instruction, and the aforementioned computer programs can be any form of application, module, or plugin.
[0083] The following describes an electronic device implementing the animation processing method provided in an embodiment of this application. Referring to Figure 2, which is a schematic diagram of the structure of the electronic device provided in an embodiment of this application, the electronic device 500 provided in this embodiment can be a terminal or a server. As shown in Figure 2, the electronic device 500 includes: at least one processor 510, a memory 550, at least one network interface 520, and a user interface 530. The various components in the electronic device 500 are coupled together through a bus system 540. It is understood that the bus system 540 is used to realize the connection and communication between these components. In addition to a data bus, the bus system 540 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as bus system 540 in Figure 2.
[0084] In some embodiments, the animation processing apparatus provided in this application can be implemented in software. FIG2 shows the animation processing apparatus 555 stored in the memory 550, which can be software in the form of programs and plug-ins, including the following software modules: acquisition module 5551, extraction module 5552, addition module 5553, mounting module 5554 and playback module 5555. These modules are logical, so they can be arbitrarily combined or further split according to the functions they implement. The functions of each module will be described below.
[0085] The animation processing method provided in the embodiments of this application is described below. As mentioned above, the animation processing method provided in the embodiments of this application is implemented by an electronic device, such as by a server or terminal alone, or by a server and terminal working together. Therefore, the executing entity of each step will not be described again below. Referring to Figure 3, Figure 3 is a flowchart illustrating the animation processing method provided in the embodiments of this application. The animation processing method provided in the embodiments of this application includes:
[0086] Step 101: Obtain the first animation file of the first virtual object and the second animation file of the second virtual object.
[0087] In step 101, the user can trigger an animation processing command on the electronic device. The electronic device responds to this command by acquiring a first animation file for the first virtual object and a second animation file for the second virtual object. These first and second animation files can be pre-created manually (e.g., created in an application that supports animation file creation) or automatically generated based on artificial intelligence. When needed, the first and second animation files can be imported into a client that supports animation processing. The first and second virtual objects can be automatically generated virtual objects based on artificial intelligence (such as virtual characters or virtual animals) or virtual objects designed and created by the user. They can be virtual objects in animated videos (such as film and television animations or cartoons) or virtual objects in virtual scenes (such as game scenes). The first and second virtual objects can be the same or different.
[0088] In some embodiments, the first animation file of the first virtual object and the second animation file of the second virtual object can be obtained by performing the following steps: obtaining the first standby animation file and the motion animation file of the first virtual object, and using the first standby animation file and the motion animation file as the first animation file; obtaining the second standby animation file of the second virtual object, and using the second standby animation file as the second animation file; wherein, the second virtual object in the second standby animation file is a target pose, and the target pose is the pose adopted by the second virtual object when it is attached to the first virtual object.
[0089] Here, the first animation file of the first virtual object includes a first idle animation file and a motion animation file. The first idle animation file is a pre-made animation file of the first virtual object in a specific posture (e.g., standing still), and includes at least one animation frame (at least one animation frame forms a first idle animation sequence). The motion animation file is a pre-made animation file demonstrating the movement of the first virtual object (e.g., running, flying, jumping, crawling, etc.), and includes multiple animation frames (multiple animation frames form a motion animation sequence). The second animation file of the second virtual object is the second idle animation file of the second virtual object. The second idle animation file is a pre-made animation file of the second virtual object in a target posture, and includes at least one animation frame (at least one animation frame forms a second idle animation sequence); wherein, the target posture can be the posture adopted by the second virtual object when it is attached to the first virtual object, such as the posture of the second virtual object riding on the first virtual object, the posture of the second virtual object lying on the first virtual object, etc., thereby facilitating the attachment of the second virtual object to the first virtual object in the target posture. In this way, by pre-creating the first standby animation file and motion animation file of the first virtual object, and the second standby animation file of the second virtual object, it is possible to realize subsequent mounting animations that support multiple different mounting postures. There is no need to create different animation assets and animation logic for the first virtual object and the second virtual object for different mounting postures, which reduces the implementation cost of mounting animations and improves the production efficiency of mounting animations.
[0090] It should be noted that the mounting animation is used to demonstrate the process of a second virtual object being mounted on a first virtual object to achieve joint movement. That is, in the mounting animation, the second virtual object can be mounted on the first virtual object in a target pose, and the second virtual object moves along with the first virtual object. Through the bone slots added in this embodiment, the second bone of the second virtual object will follow the first bone of the first virtual object, thereby causing the portion of the second virtual object bound to the second bone to move along with the portion of the first virtual object bound to the first bone. This improves the animation effect of the second virtual object being mounted on the first virtual object to move together, making the animation effect more realistic.
[0091] Step 102: Extract the first object skeleton of the first virtual object from the first animation file, and extract the second object skeleton of the second virtual object from the second animation file.
[0092] In step 102, after obtaining the first animation file and the second animation file, the first animation file and the second animation file are parsed respectively, thereby extracting the first object skeleton of the first virtual object from the first animation file, and the second object skeleton of the second virtual object from the second animation file. Here, the first object skeleton includes multiple bones and bone joints between any two bones, and the second object skeleton also includes multiple bones and bone joints between any two bones.
[0093] In some embodiments, the first animation file includes, in addition to the first object skeleton, an animation sequence of the first virtual object (specifically including the aforementioned first standby animation sequence and motion animation sequence) and a skeletal mesh (which can also be understood as the three-dimensional object model of the first virtual object). Similarly, the second animation file includes, in addition to the second object skeleton, an animation sequence of the second virtual object (specifically the aforementioned second standby animation sequence) and a skeletal mesh (which can also be understood as the three-dimensional object model of the second virtual object).
[0094] Step 103: Add a bone slot to the first bone of the first object skeleton.
[0095] In step 103, for the extracted first object skeleton of the first virtual object, the first bone to which the bone slot is to be added is determined from the first object skeleton. Here, the first bone can be any bone in the first object skeleton that is pre-set according to the animation requirements of the mounting animation (such as the requirements of the mounting posture), such as the pelvic bone, shoulder bone, etc. of the first object skeleton. After determining the first bone to which the bone slot is to be added, the bone slot is added to the first bone. The bone slot is used to mount the second bone of the second object skeleton of the second virtual object. The second bone can also be any bone in the second object skeleton that is pre-set according to the animation requirements of the mounting animation (such as the requirements of the mounting posture), such as the thigh bone, shoulder bone, limb bone, etc. of the second object skeleton. It can be understood that there can be one or more first bones; similarly, there can be one or more second bones. The bone slot is used to set the mounting position of the second virtual object relative to the first virtual object, and to constrain the second bone of the second virtual object; there can be one or more bone slots; each first bone can have one or more bone slots added; each bone slot can be used to mount one or more second bones; the bone slot may include a first bone slot indicating the direct mounting position of the second virtual object relative to the first virtual object, and a second bone slot indicating the direct mounting position of the second virtual object relative to the first virtual object.
[0096] In some embodiments, a bone slot can be added to a first bone of a first object skeleton by performing the following steps: adding a first bone slot to a first sub-bone of the first object skeleton, the first bone slot indicating the direct mounting position of the second virtual object relative to the first virtual object; adding a second bone slot to a second sub-bone of the first object skeleton, the second bone slot indicating the indirect mounting position of the second virtual object relative to the first virtual object, the second bone slot being used to constrain the movement of the target bone in the second bone; wherein, the first bone includes a first sub-bone and a second sub-bone, and the bone slot includes a first bone slot and a second bone slot.
[0097] Here, a first bone slot is first added to the first sub-bone of the first object's skeleton. This first bone slot actually indicates the direct mounting position of the second virtual object relative to the first virtual object; that is, the second virtual object is mounted on the first virtual object through this first bone slot, which is the direct contact position between the two virtual objects. It can be understood that if the first sub-bone corresponding to the first bone slot is different, then the position where the second virtual object is mounted on the first virtual object will be different. Continuing, a second bone slot is added to the second sub-bone of the first object's skeleton. This second bone slot actually indicates the indirect mounting position of the second virtual object relative to the first virtual object; that is, the second virtual object is not in direct contact with the first virtual object at the position of this second bone slot. However, the second sub-bone of the first virtual object can constrain the movement of the target bone in the second virtual object through the second bone slot, so that the target bone of the second virtual object moves with the second sub-bone of the first virtual object.
[0098] In this way, the first bone slot allows the second virtual object to be attached to the first virtual object, and the bones of the second virtual object directly attached to the first bone slot move with the first sub-bone; the second bone slot allows the bones of the second virtual object, which are not in direct contact with the first virtual object, to also move with the bones of the first virtual object; thus, the first and second virtual objects can interact at both direct and indirect contact positions (e.g., the direct contact position "pelvic bone position", the indirect contact position "limbs and head"), making the attachment animation more realistic; and further increasing the diversity of attachment postures, allowing the second virtual object to be attached to the first virtual object through more attachment postures, improving the animation effect of the attachment animation.
[0099] Step 104: Attach the second bone of the second object skeleton to the bone slot.
[0100] In step 104, after adding a bone slot to the first bone of the first object skeleton, the second bone of the second object skeleton can be attached to the bone slot, thereby attaching the second virtual object to the first virtual object. This second bone can be any bone in the second object skeleton pre-set according to the animation requirements of the attachment animation (such as the attachment posture requirements), for example, it can be the head bone, hip bone, limb bones, etc. of the second object skeleton. The attachment animation of the second virtual object to the first virtual object is used to demonstrate that the second virtual object is attached to the first virtual object, and the second virtual object moves along with the first virtual object. It can be understood that by using the bone slot, the second bone of the second virtual object is controlled to move along with the first bone of the first virtual object, thereby causing the object portion of the second virtual object bound to the second bone to move along with the object portion of the first virtual object bound to the first bone.
[0101] In some embodiments, before attaching the second bone of the second object skeleton to the bone slot, the following steps are performed: creating a mounting animation blueprint for the mounting animation, creating a first animation blueprint for the first virtual object, and creating a second animation blueprint for the second virtual object; adding a first bone mesh and a second bone mesh to the mounting animation blueprint, wherein the first bone mesh and the second bone mesh have a hierarchical relationship, and the first bone mesh is the parent of the second bone mesh; obtaining the first object model of the first virtual object, and placing the first object model and the first animation blueprint on the first bone mesh to obtain a third bone mesh including the first object skeleton; obtaining the second object model of the second virtual object, and placing the second object model and the second animation blueprint on the second bone mesh to obtain a fourth bone mesh including the second object skeleton.
[0102] Here, firstly, a mount animation blueprint is created for the mount animation, a first animation blueprint for the first virtual object, and a second animation blueprint for the second virtual object. For example, within an application that supports animation, the mount animation blueprint, the first animation blueprint, and the second animation blueprint can be created; wherein, the mount animation blueprint is used to play the mount animation, the first animation blueprint is used to play the animation of the first virtual object, and the second animation blueprint is used to play the animation of the second virtual object, constraining the second virtual object to the bone slot of the first virtual object, enabling the second virtual object to interact with the first virtual object.
[0103] Second, in the mounting animation blueprint, add a first skeletal mesh corresponding to the first virtual object and a second skeletal mesh corresponding to the second virtual object. The first skeletal mesh is used for displaying the first virtual object, and the second skeletal mesh is used for displaying the second virtual object. The first and second skeletal meshes have a hierarchical relationship, with the first skeletal mesh being the parent of the second skeletal mesh and the second skeletal mesh being the child of the first skeletal mesh. This ensures that the second virtual object located in the second skeletal mesh is mounted on the first virtual object located in the first skeletal mesh, and that the second virtual object located in the second skeletal mesh is constrained by the bone slots of the first virtual object located in the first skeletal mesh, thus achieving the purpose of mounting animation.
[0104] Third, obtain the first object model of the first virtual object and the second object model of the second virtual object. The first object model can be a 3D object model of the first virtual object, obtained by skinning the skeleton of the first object; the second object model can be a 3D object model of the second virtual object, obtained by skinning the skeleton of the second object. Fourth, place the first object model and the first animation blueprint in the first bone mesh to achieve the purpose of displaying the first virtual object in the mounting animation blueprint, obtaining the third bone mesh, which is used to display the first virtual object in the mounting animation blueprint; and place the second object model and the second animation blueprint in the second bone mesh to achieve the purpose of displaying the second virtual object in the mounting animation blueprint, obtaining the fourth bone mesh, which is used to display the second virtual object in the mounting animation blueprint. In this way, it can be ensured that the second virtual object is mounted on the first virtual object and that the second virtual object is constrained by the bone slot of the first virtual object, realizing the mounting animation; and the addition and display of the first and second virtual objects are realized in the mounting animation blueprint, thereby realizing the playback of the mounting animation.
[0105] In some embodiments, the third bone mesh includes a first object skeleton, and the fourth bone mesh includes a second object skeleton; thus, the second bone of the second object skeleton can be mounted to a bone slot by performing the following steps: creating a blueprint node in the mounting animation blueprint, the blueprint node including a slot pin, a first pin indicating the mounted object, and a second pin indicating the mounted object; controlling the third bone mesh to connect to the first pin, controlling the fourth bone mesh to connect to the second pin, and controlling the slot pin to indicate the bone slot, thereby mounting the second bone of the second object skeleton to the bone slot.
[0106] Here, since the first object model is obtained by skinning the first object skeleton, the third bone mesh includes the first object skeleton; similarly, the second object model is obtained by skinning the second object skeleton, so the fourth bone mesh includes the second object skeleton. Based on this, after obtaining the third and fourth bone meshes, blueprint nodes can be created in the mounting animation blueprint. These created blueprint nodes include slot pins, a first pin indicating the mounted object (i.e., the carrier), and a second pin indicating the mounted object. Thus, the third bone mesh (corresponding to the first virtual object) can be controlled to connect to the first pin, the fourth bone mesh (corresponding to the second virtual object) can be controlled to connect to the second pin, and the slot pins can be controlled to indicate bone slots (e.g., associating the slot pins with the slot names of bone slots) to mount the second bone of the second object skeleton to the bone slots. In this way, the mounting of the second bone to the bone slots is achieved in the mounting animation blueprint, thereby realizing the mounting animation in the mounting animation blueprint.
[0107] In some embodiments, an animation run control node can be created in the mounted animation blueprint, and then the animation run control node can be connected to the blueprint node. This ensures that when the mounted animation blueprint is run under the control of the animation run control node, the second virtual object is mounted to the bone slot of the first virtual object. This allows the second bone to follow the first bone based on the bone slot, so that the portion of the second virtual object bound to the second bone moves along with the portion of the first virtual object bound to the first bone. Thus, the playback of the mounted animation can be controlled through the animation run control node, facilitating operation and improving interaction efficiency.
[0108] In some embodiments, the first virtual object can have multiple movement postures, such as walking on land, running, swimming, floating, flying, surfing, etc. Therefore, different mounting postures can be used to mount the second virtual object onto the first virtual object for different movement postures of the first virtual object. Specifically, the movement posture of the first virtual object can be obtained first; then, a mounting posture of the second virtual object that matches the movement posture can be determined; and then, based on the movement posture and the mounting posture, the first bone in the skeleton of the first object to which the bone slot is to be added, and the second bone in the skeleton of the second object to which the bone slot is to be mounted can be determined.
[0109] Here, for different motion postures, matching mounting postures can be set, i.e., a matching relationship can be established between motion postures and mounting postures. Different motion postures are matched with different mounting postures. After obtaining the motion posture of the first virtual object, a mounting posture matching that motion posture can be determined based on the set matching relationship. This mounting posture is the mounting posture of the second virtual object. For different motion postures of the first virtual object and different mounting postures of the second virtual object, the determined first and second bones can be different. Therefore, when mounting the second virtual object to the first virtual object, the mounting posture and the bone constraint method based on the bone slot can also be different. Based on this, by adding bone slots to the first bone determined based on the motion posture and the mounting posture matching the motion posture, and by mounting the second bone determined based on the motion posture and the mounting posture matching the motion posture to the bone slot, the second virtual object can be mounted to the first virtual object with a mounting posture adapted to the motion posture. This increases the diversity of mounting postures in the mounting animation, making the mounting posture more suitable for the motion posture of the first virtual object, and the animation effect more realistic.
[0110] For example, in a virtual scene (such as a game scene), if a second virtual object is attached to the first virtual object using different attachment postures for different movement postures of the first virtual object, then during the switching of the first virtual object's movement posture in the virtual scene, the attachment posture will also switch accordingly based on the change in the first virtual object's movement posture. For instance, if the first virtual object switches from a first movement posture (such as running) to a second movement posture (such as swimming), then the second virtual object can be attached to the first virtual object's attachment posture, switching from the first attachment posture (such as riding) to the second attachment posture (such as lying down). The first attachment posture is adapted to the first movement posture; the first bone added to the bone slot and the second bone attached to the bone slot are both determined based on the first movement posture. Similarly, the second attachment posture is adapted to the second movement posture; the first bone added to the bone slot and the second bone attached to the bone slot are both determined based on the second movement posture. This improves the animation effects and the overall experience of the virtual scene.
[0111] Step 105: When the mounting animation is played and the mounting animation is used to show that the second virtual object is mounted on the first virtual object, control the second bone to follow the first bone to move based on the bone slot.
[0112] Specifically, during the process of the second bone moving along with the first bone, the part of the second virtual object bound to the second bone moves along with the part of the first virtual object bound to the first bone.
[0113] In step 105, when playing the animation showing the second virtual object being attached to the first virtual object, the second bone of the second virtual object can be controlled to move along with the first bone of the first virtual object based on the bone slots. This allows the object portion of the second virtual object bound to the second bone to move along with the object portion of the first virtual object bound to the first bone. It should be noted that the object portion is obtained by skinning the model vertices of the corresponding bone to the bone of that object portion. Specifically, when the first bone includes a first sub-bone and a second sub-bone, and the first sub-bone has a first bone slot and the second sub-bone has a second bone slot, the first bone slot allows control to attach the second virtual object to the first virtual object, and the bones of the second virtual object directly attached to the first bone slot to move along with the first sub-bone; the second bone slot allows control to make the bones of the second virtual object, which are not in direct contact with the first virtual object, also move along with the bones of the first virtual object. In this way, the first and second virtual objects can interact at both direct and indirect contact points (e.g., the direct contact point "pelvic bone position", and the indirect contact point "limbs and head"), making the animation effect of the mounting animation more realistic and improving the animation effect of the mounting animation.
[0114] In this way, the bone slot is added to the first bone of the first object skeleton, and the second bone of the second object skeleton is attached to the bone slot. It can be understood that the first bone can be any bone of the first object skeleton, and the second bone can be any bone of the second object skeleton. Therefore, only by adjusting the addition position or attachment position of the bone slot (i.e., which first bone of the first object skeleton to add to, and which second bone of the second object skeleton to use for attachment), different postures can be achieved through the bone slot. There is no need to create animation assets and animation logic for different attachment postures, which reduces the animation production cost.
[0115] In some embodiments, when a mounted animation is played through an application that supports animation creation, a playback command for the mounted animation can be triggered by triggering a run command for the mounted animation blueprint. In some embodiments, the mounted animation can be a portion of an animation to be played (such as film or animation). In some embodiments, the mounted animation can be a portion of an animation in a virtual scene (such as a game scene).
[0116] In some embodiments, a first animation blueprint for a first virtual object can be created by performing the following steps: creating a first animation blueprint file for the first virtual object based on the first object skeleton; displaying a blueprint editing interface for the first animation blueprint file in response to a file open operation on the first animation blueprint file; receiving first editing information for an event chart and second editing information for an animation chart in the first animation blueprint file based on the blueprint editing interface; and generating the first animation blueprint based on the first and second editing information. The process of receiving the first editing information for the event chart and the second editing information for the animation chart based on the blueprint editing interface will be described below and can be implemented using the relevant implementation method for S7 described below. The event chart is used to set the object to which the first animation blueprint is used, i.e., to mount the animation blueprint; the animation chart is used to set the animation playback logic of the first animation file to place the first animation file (including the aforementioned first standby animation file and the aforementioned motion animation file), thereby controlling the playback of the first standby animation file or the motion animation file. In this way, by setting up event charts and animation charts, it is ensured that when the mount animation blueprint is run to play the mount animation, the first animation blueprint can be called to play the animation of the first virtual object included in the first animation file, so as to realize the playback of the animation of the first virtual object in the mount animation.
[0117] In some embodiments, a second animation blueprint for a second virtual object can be created by performing the following steps: creating a second animation blueprint file for the second virtual object based on the skeleton of the second object; displaying a blueprint editing interface for the second animation blueprint file in response to a file open operation on the second animation blueprint file; receiving third editing information for the event graph and fourth editing information for the animation graph in the second animation blueprint file based on the blueprint editing interface; and generating the second animation blueprint based on the third and fourth editing information. The process of receiving the third editing information for the event graph and the fourth editing information for the animation graph based on the blueprint editing interface will be described below and can be implemented using the relevant implementation method for S6 described below. The event graph is used to set the object to which the second animation blueprint is used, i.e., to mount the animation blueprint; the animation graph is used to set the animation playback logic of the second animation file to place the second animation file (including the aforementioned second standby animation file), thereby controlling the playback of the second standby animation file. In this way, by setting up event charts and animation charts, it is ensured that when the mount animation blueprint is run to play the mount animation, the second animation blueprint can be called to play the animation of the second virtual object included in the second animation file, so as to realize the playback of the animation of the second virtual object in the mount animation.
[0118] In some embodiments, based on the bone slot, the second bone can be controlled to follow the movement of the first bone by performing the following steps: acquiring the rotation and displacement information of the bone slot during the movement of the first bone; determining the bone rotation angle of the second bone based on the rotation and displacement information; and adjusting the bone position and bone direction of the second bone based on the bone rotation angle to control the second bone to follow the movement of the first bone.
[0119] Here, the rotation and displacement information of the bone slots during the movement of the first bone are first obtained. Specifically, as described in the previous embodiment, the first virtual object is located in the first animation blueprint. The first animation blueprint records the rotation and displacement information of the bone slots of the first virtual object and passes this information to the second animation blueprint where the second virtual object is located for storage. Then, based on the rotation and displacement information, the bone rotation angle of the second bone during the movement of the first bone is determined. Based on the bone rotation angle, the bone position and bone direction of the second bone are adjusted through bone transformation to control the second bone to follow the movement of the first bone. Specifically, the initial bone position and initial bone direction of the second bone are determined, and the bone transformation matrix corresponding to the bone rotation angle is determined. Then, based on the bone transformation matrix, the initial bone position and initial bone direction are transformed to obtain the target bone position and target bone direction of the second bone. Finally, the bone position and bone direction of the second bone are adjusted to the target bone position and the target bone direction. In this way, the second bone moves with the first bone, so that the part of the second virtual object bound to the second bone moves with the part of the first virtual object bound to the first bone. This improves the animation effect of the second virtual object being attached to the first virtual object and moving together, making the animation effect of the second virtual object being attached to the first virtual object and moving together more realistic.
[0120] In some embodiments, based on the bone slot, the second bone can also be controlled to follow the movement of the first bone by performing the following steps: obtaining the rotation and displacement information of the bone slot during the movement of the first bone; determining the bone point position of each bone point on the second bone using inverse kinematics based on the rotation and displacement information; and adjusting the bone position of the second bone based on the position of each bone point on the second bone to control the second bone to follow the movement of the first bone.
[0121] Here, the rotation and displacement information of the bone slots during the movement of the first bone are first obtained. Specifically, as described in the previous embodiment, the first virtual object is located in the first animation blueprint. The first animation blueprint records the rotation and displacement information of the bone slots of the first virtual object and passes this information to the second animation blueprint where the second virtual object is located for storage. After obtaining the rotation and displacement information, the bone point positions of each bone point on the second bone are determined using inverse kinematics. Specifically, the bone slot can be considered as a bone point. Based on the rotation and displacement information of the bone slot during the movement of the first bone, the bone point positions of each bone point on the second bone associated with this bone point (i.e., the bone slot) are determined using inverse kinematics principles (e.g., the FullbodyIK algorithm). Thus, based on the bone point positions of each bone point on the second bone, the bone position of the second bone is determined, thereby adjusting the position of the second bone to control it to follow the movement of the first bone. Specifically, firstly, the initial bone point positions of each bone point on the second bone are determined. Then, based on rotation and displacement information, inverse kinematics is used to determine the target bone point positions of each bone point on the second bone, thereby adjusting the bone point positions of each bone point on the second bone to the target bone point positions. This enables the second bone to move along with the first bone, allowing the portion of the second virtual object bound to the second bone to move along with the portion of the first virtual object bound to the first bone. This improves the animation effect of the second virtual object being attached to the first virtual object and moving together, making the animation effect more realistic.
[0122] In some embodiments, the second virtual object with the attached animation is attached to the first virtual object using a first attachment pose; correspondingly, the following steps may also be performed: receiving a attachment pose adjustment instruction, the attachment pose adjustment instruction including at least one of the following instructions: a first instruction to adjust the bone slot from the first bone to the third bone of the first object skeleton, and a second instruction to adjust the second bone to the fourth bone of the second object skeleton; in response to the attachment pose adjustment instruction, controlling the second virtual object to be attached to the first virtual object using a second attachment pose, the second attachment pose being different from the first attachment pose.
[0123] Specifically, (1) when the mounting posture adjustment instruction is the first instruction, in response to the mounting posture adjustment instruction, the bone slot is adjusted from the first bone to the third bone; by mounting the second bone to the bone slot located in the third bone, the second virtual object is controlled to be mounted to the first virtual object in the second mounting posture; (2) when the mounting posture adjustment instruction is the second instruction, in response to the mounting posture adjustment instruction, by mounting the fourth bone to the bone slot, the second virtual object is controlled to be mounted to the first virtual object in the second mounting posture; (3) when the mounting posture adjustment instruction includes both the first and second instructions, in response to the mounting posture adjustment instruction, the bone slot is adjusted from the first bone to the third bone; by mounting the fourth bone to the bone slot located in the third bone, the second virtual object is controlled to be mounted to the first virtual object in the second mounting posture. In this way, the mounting posture can be customized according to the needs, increasing the diversity of mounting postures; and only the position of the bone slot in the first virtual object needs to be adjusted, and / or only the mounting position of the second virtual object in the bone slot needs to be adjusted, which is simple to implement and improves the production efficiency of mounting animation.
[0124] Applying the above embodiments of this application, firstly, a first animation file of the first virtual object and a second animation file of the second virtual object are obtained; then, the first object skeleton of the first virtual object is extracted from the first animation file, and the second object skeleton of the second virtual object is extracted from the second animation file; then, a bone slot is added to the first bone of the first object skeleton, and the second bone of the second object skeleton is attached to the bone slot; thus, when playing the mounting animation for displaying the second virtual object attached to the first virtual object, the second bone is controlled to move with the first bone based on the bone slot, so that the object part of the second virtual object bound to the second bone moves with the object part of the first virtual object bound to the first bone.
[0125] Here, (1) the second bone of the second virtual object is based on the bone slot and can move with the first bone of the first virtual object, so that the object part of the second virtual object bound to the second bone moves with the object part of the first virtual object bound to the first bone. In this way, the animation effect of the second virtual object being mounted on the first virtual object to move together can be improved, making the animation effect of the second virtual object being mounted on the first virtual object to move together more realistic; (2) since the second virtual object is mounted on the first virtual object to follow the movement is achieved by adding bone slots, it is only necessary to adjust the addition position (first bone) or mounting position (second bone) of the bone slots to achieve different postures of mounting through bone slots, which increases the diversity of mounting postures, and there is no need to make different mounting posture animation assets and animation logic for each virtual object separately, which reduces the animation production cost and improves the animation production efficiency.
[0126] The following describes an exemplary application of the embodiments of this application in a real-world application scenario. In related technologies, (1) different animation assets and animation logic are created separately for the carrier object and the mounted object. Although this can achieve a variety of different mounting postures, the production cost is very high; (2) only one set of animation assets and animation logic is created for the carrier object and the mounted object. However, this makes the mounting posture highly uniform and the animation effect very poor.
[0127] Based on this, embodiments of this application provide an animation processing method to at least solve the aforementioned problems. In embodiments of this application, a general logic is provided to achieve the effect of a second virtual object (i.e., the mounted object) and a first virtual object (i.e., the carrier object) moving in the same direction. Specifically, through hierarchical constraints, a mounting relationship is formed between the first and second virtual objects. Using only one animation asset, combined with FullBodyIK and slots added to the skeleton of the first virtual object, the mounted object is mounted on the carrier object in a reasonable posture (customization is supported). This also enables the linkage between the limbs, head, and other parts of the second virtual object and the body parts of the first virtual object. Furthermore, the debugging cost for a single first virtual object is very low; only the position of the slot needs to be adjusted. Thus, 1) only one animation asset needs to be created for the second virtual object, resulting in very low production costs; 2) each first virtual object can have its movement speed, turning speed, and other parameters adjusted independently, giving each first virtual object independent movement characteristics; 3) it has extremely high scalability when applied to virtual scenes (such as games), bringing more possibilities to designing effects where the second virtual object travels alongside the first virtual object (e.g., the second virtual object rides the first virtual object, or the second virtual object lies on top of the first virtual object); 4) if a new first virtual object needs to be added for mounting, only the position of the slot and movement parameters need to be adjusted, saving production costs; 5) using FullBodyIK allows the limbs, head, and other parts of the second virtual object to interact with the first virtual object, making the mounting animation effect more realistic; 6) the mounting posture supports personalized customization, requiring only the adjustment of the slot position. A detailed explanation follows.
[0128] The following describes the embodiments of this application from the product side. Since the second skeleton of the second virtual object is attached to the first skeleton of the first virtual object through a slot, it is possible to define which skeleton of the second virtual object follows which skeleton of the first virtual object. The actual movement effect brought about by the skeleton following will be very vivid. As shown in Figure 4A (1) and (2), the process of the second virtual object (such as the player's virtual object) riding the first virtual object (such as the virtual sprite in the game) to move, the second virtual object will also have a corresponding skeleton movement effect when the first virtual object moves. The embodiments of this application also have the advantage of versatility. The second virtual object can perfectly adapt to the riding of the first virtual object of any size in a variety of action postures. As shown in Figure 4B (1) and (2), the riding posture of the second virtual object is different for different first virtual objects. In addition to being applied to the second virtual object riding the first virtual object, the embodiments of this application can also be applied to the situation where the second virtual object (such as the virtual sprite) lies on the first virtual object (such as the player's virtual object), that is, "riding together". As shown in Figure 4C (1) and (2), when the first virtual object moves, the second virtual object lying on the body of the first virtual object will also move (such as the tail of the second virtual object moving up and down).
[0129] The embodiments of this application are described below from a technical perspective. The flowchart of an embodiment of this application is shown in Figure 5:
[0130] 1. Create animation files. This includes creating the first animation file for the first virtual object and the second animation file for the second virtual object. In 3ds Max, create the first idle animation file and motion animation file for the first virtual object, and the second idle animation file for the second virtual object in the target pose (e.g., a riding pose).
[0131] 2. Export animation files. In 3ds Max, export the first idle animation file and motion animation file of the first virtual object, and the second idle animation file of the second virtual object. Denote the first idle animation file of the first virtual object as file A, the motion animation file of the first virtual object as file B, and the second idle animation file of the second virtual object as file C.
[0132] 3. Import animation files. Import animation files A, B, and C into UE4. After importing the animation files, you will get the following seven files, in order:
[0133] The skeletal mesh file of the first virtual object (i.e., the first object model mentioned above) is denoted as "SKM_PET";
[0134] The first skeleton file of the first virtual object (i.e., the skeleton of the first object mentioned above) is denoted as "SK_Pet";
[0135] The first standby animation sequence of the first virtual object is denoted as "Pet__Anim_Idle";
[0136] The motion animation sequence of the first virtual object is denoted as "Pet__Anim_Run";
[0137] The skeletal mesh file of the second virtual object (i.e., the second object model mentioned above) is denoted as "SKM_PC1";
[0138] The second skeleton file of the second virtual object (i.e., the skeleton of the second object mentioned above) is denoted as "SK_PC1";
[0139] The second standby animation sequence of the second virtual object is denoted as "PC1__Anim_Ride".
[0140] 5. Create the first animation blueprint for the first virtual object. Create the first animation blueprint based on "SK_Pet", denoted as "ABP_Pet", which will be used to play the animations "Pet__Anim_Idle" and "Pet__Anim_Run".
[0141] 6. Add slots to the bones of the first virtual object (i.e., the bone slots mentioned above). Add slots in "SK_Pet". These slots are used to 1) set the mounting position of the second virtual object relative to the first virtual object; and 2) constrain the target bones of the second virtual object (e.g., bones of limbs, head, etc.). For example, the name of the slot used to constrain the target bones could be as follows:
[0142] The slot that constrains the head skeleton of the second virtual object is denoted as "Socket_Head";
[0143] The slot that constrains the left-hand bone of the second virtual object is denoted as "Socket_Hand_L";
[0144] The slot that constrains the right-hand bone of the second virtual object is denoted as "Socket_Hand_R";
[0145] The slot that constrains the left foot bone of the second virtual object is denoted as "Socket_Foot_L";
[0146] The slot that constrains the right foot bone of the second virtual object is denoted as "Socket_Foot_R";
[0147] Mounting slot, denoted as "Ride".
[0148] 7. Create a second animation blueprint for the second virtual object. Based on "SK_PC1", create a second animation blueprint, denoted as "ABP_PC1", to play the animation "PC1__Anim_Ride" of the second virtual object and to constrain the second virtual object to the slot of the first virtual object, enabling interaction between them. Specifically, obtain the "slot position and rotation data" from the animation of the first virtual object; then assign the obtained "slot position and rotation data" to FBIK; FBIK will constrain the target skeleton of the second virtual object to the slot position of the first virtual object based on the input "slot position and rotation data".
[0149] 8. Create a mount animation blueprint. Create a blueprint for a moving component with a second virtual object, then add two skeletal mesh components, denoted as "Component A (corresponding to the first virtual object, i.e., the first skeletal mesh mentioned above)" and "Component B (corresponding to the second virtual object, i.e., the second skeletal mesh mentioned above)". Component A contains "SKM_Pet" and "ABP_Pet"; Component B contains "SKM_PC1" and "ABP_PC1". Set the hierarchy of Component B to be a child of Component A, making Component B a child of Component A, and Component B is constrained by the slot "Ride" in "SKM_PET" contained in Component A.
[0150] First, explain how to create the animation file (i.e., the second idle animation file of the second virtual object in the target pose (e.g., riding pose). 1. Open 3ds Max; 2. Open the second skeleton file of the second virtual object; 3. Rotate the bones and control the rotation and displacement of the bones (such as the pelvis, arms, thighs, etc.) so that the bones are in the target pose (the riding pose shown in Figure 6); 4. Export the bones of the target pose as an FBX animation file, which is called the second idle animation file of the second virtual object.
[0151] Second, explain the logic of mounting the second virtual object to the first virtual object through UE4, including:
[0152] S1, Run UE4.
[0153] S2. As shown in Figure 7A. In the blank space of the "Content Browser" in the Engine Assets panel, click to display the shortcut menu and select "Blueprint Class" from the shortcut menu; in the newly popped-up "Select Parent Class" window, select "Role". At this time, a new blueprint file will be created in the "Content Browser", named "BP_RideAll". In this way, the mount animation blueprint "BP_RideAll" is created, which can play the mount animation of the second virtual object being mounted on the first virtual object.
[0154] S3. In the "Content Browser", open "BP_RideAll" by clicking.
[0155] S4. As shown in Figure 7B(1), in the "Components" tab in the upper left corner of the "BP_RideAll" window, select "Mesh (CharacterMesh0) (Inheritance)". In this way, the first skeleton mesh (CharacterMesh0) is added to the mounting animation blueprint for the display of the first virtual object. As shown in Figure 7B(2), click the "Add Component" button and select "SkeletalMesh Component (SkeletalMesh)" in the newly popped-up tab. In this way, the second skeleton mesh (SkeletalMesh) is added to the mounting animation blueprint for the display of the second virtual object.
[0156] S5. Check whether the "SkeletalMesh Component" is below the hierarchy of "CharacterMesh0 (inherited)". Specifically, check if there is a triangle symbol in front of the name "CharacterMesh0 (inherited)", as shown in Figure 7B (3). If there is a triangle symbol, it means that the "SkeletalMesh Component" and "CharacterMesh0 (inherited)" form a hierarchical constraint, and the "SkeletalMesh Component" is below the hierarchy of "CharacterMesh0 (inherited)".
[0157] S6. The creation of the second animation blueprint for the second virtual object follows the process as follows:
[0158] 6.1 Import the second standby animation file of the second virtual object.
[0159] 6.2 Creating the Second Animation Blueprint for the Second Virtual Object. As shown in Figure 8A, in the Content Browser, click the second skeleton file of the second virtual object. In the displayed shortcut menu, select "Create" and then "Animation Blueprint". A new animation blueprint, named "ABP_PC1_RideAll", will be created in the Content Browser. Here, the second animation blueprint is used to call the second standby animation file of the second virtual object.
[0160] 6.3 Write the logic for the event chart in the second animation blueprint.
[0161] 6.3.1 As shown in Figure 8B (1), open "ABP_PC1_RideAll". In the newly popped-up window, find the "My Blueprints" tab in the lower left corner and double-click "Event Chart". You can see the "Event Chart" tab opened in the middle of the window. This step is to find and open the event chart, because the logic will be written in the event chart next.
[0162] 6.3.2 In the blank area of the event graph, click to trigger the display of the text box shown in Figure 8B (2). Enter "try get pawn" in the text box, and click "Try to get Pawn owner" in the search results to create the rightmost blueprint node "Try to get Pawn owner" as shown in Figure 8B (2). This step is to create the blueprint node "Try to get Pawn owner" to get the user "BP_RideAll" who uses the second animation blueprint.
[0163] 6.3.3 As shown in Figure 8C (1), click the "Return Value" pin in the Blueprint node "Attempt to Get Pawn Owner" without releasing it, then move it to a blank area and release it. In the pop-up search box, enter "BP_RideALL". In the search results, select "Type to BP_RideAll" to create the Blueprint node "Type to BP_RideAll". This step is to create the Blueprint node "Type to BP_RideAll", which is used to obtain "BP_RideAll".
[0164] 6.3.4 As shown in Figure 8C (2), connect the blueprint nodes that have been created in the second animation blueprint, and link "Event Blueprint Update Animation" to "BP_RideALL" so that the rotation and displacement information of the slot can be obtained from "BP_RideALL" in real time when the engine is running.
[0165] 6.3.5 As shown in Figure 8D (1), click the "As BP Ride All" pin in the Blueprint node "Type to BP_RideAll" without releasing it, move it to a blank area and then release it. Enter "get socket rotation" in the search box and select "Get socket rotation (Mesh)" in the search results. This step is to create the Blueprint node "get socket rotation" to obtain the socket rotation information from "BP_RideALL".
[0166] 6.3.6 As shown in Figure 8D (2), click the "As BP Ride All" pin in the Blueprint node "Type to BP_RideAll" without releasing it, move it to a blank area, and then release it. Enter "get socket location" in the search box, and select "Get socket location (Mesh)" in the search results. This step is to create the "get socket location" Blueprint node to obtain the displacement information of the socket.
[0167] Example 6.3.7 shows that you can create 6 "get socket rotation" blueprint nodes and 5 "get socket location" blueprint nodes, which can be created by copying.
[0168] In the "In Socket Name" text boxes of the six "get socket rotation" blueprint nodes, enter the following in sequence: "Root", "Socket_Head", "Socket_Hand_L", "Socket_Hand_R", "Socket_Foot_L", and "Socket_Foot_R". Similarly, in the "In Socket Name" text boxes of the five "get socket location" nodes, enter the following in sequence: "Socket_Head", "Socket_Hand_L", "Socket_Hand_R", "Socket_Foot_L", and "Socket_Foot_R".
[0169] The "Socket_Head", "Socket_Hand_L", "Socket_Hand_R", "Socket_Foot_L", and "Socket_Foot_R" mentioned above are the names of the slots that need to be added to the skeleton of the first virtual object, and they also represent the positions where the limbs of the second virtual object interact with the body of the first virtual object. After creating the above blueprint nodes and filling in the information as described above, a schematic diagram of the blueprint nodes is obtained as shown in Figure 8E.
[0170] For each of these 11 blueprint nodes, click the "Return Value" pin and select "Promote to Variable" (as shown in Figure 8G) to create a variable. This variable will be used to store rotation or displacement information for that blueprint node. Create the variables needed for these 11 blueprint nodes in sequence, rename them according to their information content, and connect them as shown in the diagram in Figure 8F.
[0171] Step 6.3.7 is to obtain the rotation and displacement information of the slots in the skeleton of the first virtual object and store it in the variables of the second animation blueprint of the second virtual object.
[0172] 6.4 Write the logic for the animation charts in the second animation blueprint.
[0173] 6.4.1 As shown in Figure 9A (1), open the second skeleton file of the second virtual object, click the root bone named "Root", and select "Add Bone" in the pop-up shortcut menu. For example, enter and add the following in the search box: "Bip001-L-Hand", "Bip001-R-Hand", "Bip001-Head", "Bip001-L-Calf", and "Bip001-R-Calf". The five bones created in this step will be used by fullbodyik for interaction between the second virtual object and the first virtual object.
[0174] 6.4.2 As shown in Figure 9A (2), return to the animation chart of the second animation blueprint, click on the blank area of the animation chart, enter "transform bone" in the pop-up search box, and select "transform (modify) bone" in the search results. This step is to create the "transform (modify) bone" node, which is used to modify the rotation and displacement information of the bones of the second virtual object.
[0175] 6.4.3 Since the above example creates a total of 5 bones, 5 "Transform (Modify) Bones" also need to be created here. The translation and rotation modes of each bone are the same: the translation mode is "Replace Existing Item", the translation space is "World Scene", and the pins are all set to public, as shown in Figure 9B (1). In this step: the public pins are so that the blueprint node can be assigned values using variables; because the slot position of the first virtual object needs to be assigned 100% to the bone of the second virtual object attached, the translation mode and rotation are both "Replace Existing Item"; in 6.3.7, the rotation and displacement of the slot are obtained from the scene component, so in this step, the rotation space and translation space are both set to "World Scene Space".
[0176] 6.4.4 Change the "Bone to be Modified" in each of the five "Transform (Modify) Bones" nodes to the added bones; then, in the "My Blueprints" tab, drag and drop the corresponding variables to the "Transform (Modify) Bones" nodes; drag the imported second virtual object's idle animation file from the Content Browser into this animation graph. This step uses the created single-frame animation file as a base, and then modifies the position and rotation information of the bones by connecting blueprint nodes based on this animation file.
[0177] 6.4.5 Click the second skeleton file of the second virtual object, and select "Create Binding Control" in the pop-up shortcut menu to create the "Create Binding Control" file, named "CtrlRig_PC1_RideAll", as shown in Figure 9B (2). This step is to create the file required for using fullbodyik: the controlrig file.
[0178] 6.4.6 Open the "CtrlRig_PC1_RideAll" file. In the newly popped-up window, right-click in the blank space of the "RigGraph" graph and search to add the "fullbodyik" node, and set it as shown in Figure 9C. This step is to link the position of the bone with the position of the skinned bone, using the "bone of the second virtual object" which is already controlled by the "slot of the first virtual object" to constrain the "skinned bone of the second virtual object".
[0179] 6.4.7 As shown in Figure 9D, return to the animation chart of the second animation blueprint "ABP_PC1_RideAll" window for the second virtual object. Click in a blank area of the chart, enter "controlrig" in the pop-up search box, and select "Binding Control" from the search results. Select the "Binding Control" node, and in the "Details" tab, mount the ControlRig file you just created: "CtrlRig_PC1_RideAll". This step is to create the "Binding Control" animation blueprint node to mount the controlrig file, enabling the constraints of the second virtual object's limbs through the slots of the first virtual object.
[0180] The final connection of the animated chart is shown in Figure 9E. 6.4.8
[0181] S7. The creation of the first animation blueprint for the first virtual object follows the process as follows:
[0182] 7.1 Create the first animation blueprint for the first virtual object. As shown in Figure 10A, in the Content Browser, click the skeleton file of the first virtual object. In the newly popped-up shortcut menu, select "Create" and then "Animation Blueprint". A new animation blueprint, named "ABP_Pet_001", will be created in the Content Browser. Here, the first animation blueprint is used to call the first animation file of the first virtual object.
[0183] 7.2 Logic writing for the first animation blueprint of the first virtual object.
[0184] 7.2.1 As shown in Figure 10B(1), open “ABP_Pet_001”. In the newly popped-up window, find the “My Blueprints” tab in the lower left corner and double-click “Event Chart”. You can see that the “Event Chart” tab has been opened in the middle of the window. In the blank space of the event chart, click to trigger the display of the text box shown in Figure 10B(2). Enter “try get pawn” in the text box and click “Try to get Pawn owner” in the search results to create the blueprint node “Try to get Pawn owner” on the far right as shown in Figure 10B(2). This step creates the blueprint node to get the user “BP_RideAll” who uses the first animation blueprint.
[0185] 7.2.2 As shown in Figure 10C (1), click the “Return Value” pin in the “Try to get Pawn Owner” node without releasing it, then move it to a blank space and release it. Enter “get velocity” in the pop-up search box, and select “Get Velocity” in the search results to create the blueprint node “Get Velocity”.
[0186] As shown in Figure 10C (2), click the “Return Value” pin in the “Get Speed” node without releasing it, then move it to a blank area and release it. Enter “length” in the pop-up search box, and select “Vector Length” in the search results to create the blueprint node “Vector Length”.
[0187] As shown in Figure 10C (3), click the "Return Value" pin in the "Vector Length" node, select "Promote to Variable" in the pop-up shortcut menu, and rename the newly created variable to "Speed". This step is to create the Speed variable to obtain the movement speed of the first virtual object.
[0188] 7.2.3 As shown in Figure 10D (1), click the "Return Value" pin in the "Speed" variable node without releasing it, then move it to a blank area and release it. In the pop-up search box, enter ">", select "Floating Point > Floating Point" in the search results, and in the newly created "Floating Point > Floating Point" node, enter "Specific Value (e.g., 10)" in the second text box. This step is to compare the speed variable of the first virtual object with the specific value (e.g., 10) to determine whether the current speed is greater than 10cm / s.
[0189] 7.2.4 As shown in Figure 10D (2), click the pin in the "Floating Point > Floating Point" node, select "Promote to Variable" in the pop-up shortcut menu, and rename the newly created variable to "isMoving". This step is to create the isMoving variable to detect whether the first virtual object is in a moving state. For example, if the speed is greater than 10cm / s, it is in a moving state, and the value of this Boolean variable is True; otherwise, it is False.
[0190] 7.2.5 As shown in Figure 10D (3), in the "My Blueprints" tab on the left side of the current window, double-click "AnimGraph" to open the animation graph. Right-click in the blank area of the animation graph, enter "blend poses by bool" in the pop-up search box, and select "blend poses by bool" in the search results. This step is to create the "blend poses by bool" node, which is used to select whether to play a standby animation or a motion animation based on the movement state of the first virtual object.
[0191] 7.2.6 In the "Asset Browser" tab, drag the idle animation file and motion animation file into the animation graph, and connect the animations to the "blend poses by bool" node. Connect the motion animation file to the True pin and the idle animation file to the False pin. In the "My Blueprints" tab, click and hold the ismoving variable, drag it to the "Active Value" pin of the "blend poses by bool" node, and then connect the output pin of the "blend poses by bool" node to the "Output Pose" node. This step connects the animation file of the first virtual object to the "blend poses by bool" node. If the ismoving variable is True, the motion animation file will play; otherwise, the idle animation file will play.
[0192] S8. Logic for mounting the animation blueprint "BP_RideAll".
[0193] 8.1 Open "BP_RideAll".
[0194] 8.2 In the "Components" tab at the top left, select "Mesh (CharacterMesh0) Inheritance". In the Details panel, select the "Skeleton Mesh" corresponding to the first virtual object in the Skeleton Mesh category, and select the created first animation blueprint "ABP_Pet_001" in the Animation class, as shown in Figure 11A. This step is to place the first object model and the first animation blueprint of the first virtual object in the Skeleton Mesh. This operation allows the first virtual object to "run".
[0195] 8.3 In the "Components" tab at the top left, select "SkeletalMesh". In the Details panel, select the "Skeletal Mesh" of the second virtual object in the Skeletal Mesh category, and select the created second animation blueprint "ABP_PC1_RideAll" in the Animation class, as shown in Figure 11B. This step is to place the second object model and the second animation blueprint of the second virtual object in the Skeletal Mesh.
[0196] 8.4 In the blank space of the event graph, click to trigger the display of the search box shown in Figure 11C (1). Enter "attach component to component" in the pop-up search box and select "attach component to component (Mesh)" in the search results. The blueprint node created in this step is to allow the skeletal mesh "SkeletalMesh" used by the second virtual object to be attached to a slot on the skeletal mesh "CharacterMesh0 inheritance" used by the first virtual object.
[0197] 8.5 In the "Components" tab at the top left, drag the "CharacterMesh0 Inheritance" component to the "Parent" pin of the "Attach Component to Component" node. Similarly, in the "Components" tab, drag the "SkeletalMesh" component to the "Target" pin of the "Attach Component to Component" node. Then, enter "Ride" in the "Socket Name" text box, and connect the "Event Start Run" event's run node to the "Attach Component to Component" node. This step is to ensure that when the mounting animation blueprint starts running, the second virtual object's skeletal mesh component "SkeletalMesh" is mounted on the "Ride" slot of the first virtual object's skeletal mesh component "CharacterMesh0 Inheritance". The specific connection diagram is shown in Figure 11C (2).
[0198] S9. Add slots to the skeleton of the first virtual object.
[0199] 9.1 Open the first skeleton file of the first virtual object.
[0200] 9.2. Observe the motion animation of the first virtual object. Taking the second virtual object riding the first virtual object as an example, it can be found that most skeletons can be driven by the pelvis. Since the first virtual object drives the second virtual object, a "Ride" slot can be added to the pelvic bone of the first virtual object. The operation steps are as follows: Click "Bip001" (pelvic bone), select "Add Slot" in the pop-up shortcut menu, and rename it to "Ride". This step is to create the "Ride" slot, which will allow the skeleton mesh component of the second virtual object to be attached to the "Ride" slot so that it moves with the pelvic bone of the first virtual object.
[0201] 9.3 Continue observing the motion animation of the first virtual object and add slots to appropriate bones, such as "Socket_Head", "Socket_Hand_L", "Socket_Hand_R", "Socket_Foot_L", and "Socket_Foot_R". This step is to add slots to appropriate bones of the first virtual object. For example, if the positions of these slots correspond to the movement of the limbs and head of the second virtual object, these slots will move with a bone of the first virtual object, so the limbs and head of the second virtual object will also move with those bones of the first virtual object.
[0202] It should be noted that it is not limited to 3ds Max and UE4 engines. Other DCC software or engines that can create animations and implement mounting interaction logic are also acceptable. FullBodyIK is a collection of IK algorithms. Any software that can implement mounting interaction using the IK algorithm is also acceptable.
[0203] Applying the above embodiments of this application, 1) only one animation asset needs to be created for the second virtual object, resulting in very low production costs; 2) each first virtual object can have its movement speed, turning speed, and other parameters adjusted individually, giving each first virtual object independent movement characteristics; 3) it has extremely high scalability when applied to virtual scenes (such as games), bringing more possibilities for designing effects where the second virtual object travels alongside the first virtual object (such as the second virtual object riding the first virtual object, or the second virtual object lying on top of the first virtual object); 4) if a new first virtual object needs to be added for mounting, only the position of the slot and movement parameters need to be adjusted, saving production costs; 5) using FullBodyIK allows the limbs, head, and other parts of the second virtual object to interact with the first virtual object, making the mounting animation effect more realistic; 6) the mounting posture supports personalized customization, requiring only the adjustment of the slot position.
[0204] The following description further illustrates the exemplary structure of the animation processing device 555 provided in this application embodiment as a software module. In some embodiments, as shown in FIG2, the software module stored in the animation processing device 555 in the memory 550 may include: an acquisition module 5551 configured to acquire a first animation file of a first virtual object and a second animation file of a second virtual object; an extraction module 5552 configured to extract a first object skeleton of the first virtual object from the first animation file and extract a second object skeleton of the second virtual object from the second animation file; an addition module 5553 configured to add a bone slot to the first bone of the first object skeleton; a mounting module 5554 configured to mount the second bone of the second object skeleton to the bone slot; and a playback module 5555 configured to control the second bone to move with the first bone based on the bone slot when the mounting animation is played and the mounting animation is used to show the second virtual object mounted on the first virtual object. During the process of the second bone moving with the first bone, the object part of the second virtual object bound to the second bone moves with the object part of the first virtual object bound to the first bone.
[0205] In some embodiments, the acquisition module 5551 is further configured to acquire a first standby animation file and a motion animation file of the first virtual object, and use the first standby animation file and the motion animation file as the first animation file; acquire a second standby animation file of the second virtual object, and use the second standby animation file as the second animation file; wherein, the second virtual object in the second standby animation file is a target pose, and the target pose is the pose adopted by the second virtual object when it is attached to the first virtual object.
[0206] In some embodiments, the adding module 5553 is further configured to add a first bone slot to a first sub-bone of the first object skeleton, the first bone slot indicating the direct mounting position of the second virtual object relative to the first virtual object; and to add a second bone slot to a second sub-bone of the first object skeleton, the second bone slot indicating the indirect mounting position of the second virtual object relative to the first virtual object, the second bone slot being used to constrain the movement of the target bone in the second bone; wherein the first bone includes the first sub-bone and the second sub-bone, and the bone slot includes the first bone slot and the second bone slot.
[0207] In some embodiments, the mounting module 5554 is further configured to: create a mounting animation blueprint for the mounting animation, create a first animation blueprint for the first virtual object, and create a second animation blueprint for the second virtual object before mounting the second bone of the second object skeleton to the bone slot; add a first bone mesh and a second bone mesh to the mounting animation blueprint, wherein the first bone mesh and the second bone mesh have a hierarchical relationship, and the first bone mesh is the parent of the second bone mesh; obtain a first object model of the first virtual object, and place the first object model and the first animation blueprint on the first bone mesh to obtain a third bone mesh including the first object skeleton; obtain a second object model of the second virtual object, and place the second object model and the second animation blueprint on the second bone mesh to obtain a fourth bone mesh including the second object skeleton.
[0208] In some embodiments, the mounting module 5554 is further configured to create a blueprint node in the mounting animation blueprint, the blueprint node including a slot pin, a first pin indicating the mounted object, and a second pin indicating the mounted object; control the third bone mesh to connect to the first pin, control the fourth bone mesh to connect to the second pin, and control the slot pin to indicate the bone slot.
[0209] In some embodiments, the mounting module 5554 is further configured to: create a first animation blueprint file for the first virtual object based on the first object skeleton; display a blueprint editing interface for the first animation blueprint file in response to a file open operation on the first animation blueprint file; receive first editing information for an event chart in the first animation blueprint file and second editing information for an animation chart in the first animation blueprint file based on the blueprint editing interface; and generate the first animation blueprint based on the first editing information and the second editing information.
[0210] In some embodiments, the mounting module 5554 is further configured to: create a second animation blueprint file for the second virtual object based on the second object skeleton; display a blueprint editing interface for the second animation blueprint file in response to a file open operation on the second animation blueprint file; receive third editing information for an event chart in the second animation blueprint file and fourth editing information for an animation chart in the second animation blueprint file based on the blueprint editing interface; and generate the second animation blueprint based on the third editing information and the fourth editing information.
[0211] In some embodiments, the playback module 5555 is further configured to acquire rotation information and displacement information of the bone slot during the movement of the first bone; determine the bone rotation angle of the second bone based on the rotation information and displacement information; and adjust the bone position and bone direction of the second bone based on the bone rotation angle.
[0212] In some embodiments, the playback module 5555 is further configured to acquire rotation and displacement information of the bone slot during the movement of the first bone; determine the bone point position of each bone point on the second bone using inverse kinematics based on the rotation and displacement information; and adjust the bone position of the second bone based on the position of each bone point on the second bone.
[0213] In some embodiments, in the mounting animation, the second virtual object is mounted to the first virtual object using a first mounting posture; the mounting module 5554 is further configured to receive a mounting posture adjustment instruction, the mounting posture adjustment instruction including at least one of the following instructions: a first instruction to adjust the bone slot from the first bone to the third bone of the first object skeleton, and a second instruction to adjust the second bone to the fourth bone of the second object skeleton; in response to the mounting posture adjustment instruction, controlling the second virtual object to be mounted to the first virtual object using a second mounting posture, the second mounting posture being different from the first mounting posture.
[0214] In some embodiments, the mounting module 5554 is further configured to: when the mounting posture adjustment instruction is the first instruction, in response to the mounting posture adjustment instruction, adjust the bone slot from the first bone to the third bone; control the second virtual object to be mounted to the first virtual object in a second mounting posture by mounting the second bone to the bone slot located in the third bone; when the mounting posture adjustment instruction is the second instruction, in response to the mounting posture adjustment instruction, control the second virtual object to be mounted to the first virtual object in a second mounting posture by mounting the fourth bone to the bone slot; when the mounting posture adjustment instruction includes both the first instruction and the second instruction, in response to the mounting posture adjustment instruction, adjust the bone slot from the first bone to the third bone; control the second virtual object to be mounted to the first virtual object in a second mounting posture by mounting the fourth bone to the bone slot located in the third bone.
[0215] In some embodiments, the adding module 5553 is further configured to: obtain the motion posture of the first virtual object before adding a bone slot to the first bone of the first object skeleton; determine the mounting posture of the second virtual object that is adapted to the motion posture; and determine the first bone in the first object skeleton to which the bone slot is to be added and the second bone in the second object skeleton to which the bone slot is to be mounted based on the motion posture and the mounting posture.
[0216] It should be noted that the description of the device embodiments in this application is similar to the description of the method embodiments described above, and has similar beneficial effects as the method embodiments, so it will not be repeated here. Any technical details not covered in the animation processing device provided in the embodiments of this application can be understood based on the description of the technical details in the above method embodiments.
[0217] This application also provides a computer program product, which includes computer-executable instructions or a computer program stored in a computer-readable storage medium. The processor of an electronic device reads the computer-executable instructions or computer program from the computer-readable storage medium and executes the computer-executable instructions or computer program, causing the electronic device to perform the animation processing method provided in this application.
[0218] This application also provides a computer-readable storage medium storing computer-executable instructions or computer programs. When the computer-executable instructions or computer programs are executed by a processor, the processor will execute the animation processing method provided in this application.
[0219] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.
[0220] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.
[0221] As an example, computer-executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., files that store one or more modules, subroutines, or code sections).
[0222] As an example, computer-executable instructions can be deployed to execute on a single electronic device, or on multiple electronic devices located in one location, or on multiple electronic devices distributed across multiple locations and interconnected via a communication network.
[0223] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.
Claims
1. An animation processing method applied to an electronic device, the method comprising: Obtain the first animation file of the first virtual object and the second animation file of the second virtual object; Extract the first object skeleton of the first virtual object from the first animation file, and extract the second object skeleton of the second virtual object from the second animation file; Add a bone slot to the first bone of the first object skeleton; The second bone of the second object skeleton is attached to the bone slot; When the mounting animation is played and the mounting animation is used to show that the second virtual object is mounted on the first virtual object, the second bone is controlled to move with the first bone based on the bone slot. During the process of the second bone moving with the first bone, the object part of the second virtual object that is bound to the second bone moves with the object part of the first virtual object that is bound to the first bone.
2. The method as described in claim 1, wherein, The step of obtaining the first animation file of the first virtual object and the second animation file of the second virtual object includes: Obtain the first standby animation file and the motion animation file of the first virtual object, and use the first standby animation file and the motion animation file as the first animation file; Obtain the second standby animation file of the second virtual object, and use the second standby animation file as the second animation file; In the second standby animation file, the second virtual object is the target pose, which is the pose adopted by the second virtual object when it is attached to the first virtual object.
3. The method as described in any one of claims 1-2, wherein, Adding a bone slot to the first bone of the first object skeleton includes: Add a first bone slot to the first sub-bone of the first object skeleton, the first bone slot indicating the direct mounting position of the second virtual object relative to the first virtual object; A second bone slot is added to the second sub-bone of the first object skeleton. The second bone slot indicates the indirect mounting position of the second virtual object relative to the first virtual object. The second bone slot is used to constrain the movement of the target bone in the second bone. The first bone includes a first sub-bone and a second sub-bone, and the bone slot includes a first bone slot and a second bone slot.
4. The method according to any one of claims 1-3, wherein, Before attaching the second bone of the second object skeleton to the bone slot, the method further includes: Create the mount animation blueprint for the mount animation, create the first animation blueprint for the first virtual object, and create the second animation blueprint for the second virtual object; Add a first skeletal mesh and a second skeletal mesh to the mounting animation blueprint. The first skeletal mesh and the second skeletal mesh have a hierarchical relationship, and the first skeletal mesh is the parent of the second skeletal mesh. Obtain the first object model of the first virtual object, and place the first object model and the first animation blueprint on the first skeletal mesh to obtain a third skeletal mesh including the skeleton of the first object; Obtain the second object model of the second virtual object, and place the second object model and the second animation blueprint on the second skeletal mesh to obtain a fourth skeletal mesh that includes the skeleton of the second object.
5. The method of claim 4, wherein, The step of attaching the second bone of the second object skeleton to the bone slot includes: Create a blueprint node in the mount animation blueprint. The blueprint node includes a slot pin, a first pin indicating the mount object, and a second pin indicating the mount object. Control the third bone mesh to connect to the first pin, control the fourth bone mesh to connect to the second pin, and control the slot pin to indicate the bone slot.
6. The method of claim 4, wherein, The first animation blueprint for creating the first virtual object includes: Based on the skeleton of the first object, create the first animation blueprint file of the first virtual object; In response to a file open operation on the first animation blueprint file, the blueprint editing interface of the first animation blueprint file is displayed; Based on the blueprint editing interface, the system receives first editing information for the event chart in the first animation blueprint file and second editing information for the animation chart in the first animation blueprint file. The first animation blueprint is generated based on the first editing information and the second editing information.
7. The method of claim 4, wherein, The second animation blueprint for creating the second virtual object includes: Based on the skeleton of the second object, create a second animation blueprint file for the second virtual object; In response to a file open operation on the second animation blueprint file, the blueprint editing interface of the second animation blueprint file is displayed; Based on the blueprint editing interface, third editing information for the event chart in the second animation blueprint file and fourth editing information for the animation chart in the second animation blueprint file are received; The second animation blueprint is generated based on the third and fourth editing information.
8. The method according to any one of claims 1-7, wherein, The step of controlling the second bone to follow the movement of the first bone based on the bone slot includes: Obtain the rotation and displacement information of the bone slot during the movement of the first bone; Based on the rotation and displacement information, the bone rotation angle of the second bone is determined; Based on the bone rotation angle, adjust the bone position and bone orientation of the second bone.
9. The method according to any one of claims 1-7, wherein, The step of controlling the second bone to follow the movement of the first bone based on the bone slot includes: Obtain the rotation and displacement information of the bone slot during the movement of the first bone; Based on the rotation and displacement information, the bone point positions of each bone point on the second bone are determined by inverse kinematics. Adjust the bone position of the second bone based on the position of each bone point on the second bone.
10. The method according to any one of claims 1-9, wherein, In the mounting animation, the second virtual object is mounted on the first virtual object using a first mounting posture; The method further includes: Upon receiving a mounting posture adjustment instruction, the mounting posture adjustment instruction includes at least one of the following instructions: a first instruction to adjust the bone slot from the first bone to the third bone of the first object skeleton, and a second instruction to adjust the second bone to the fourth bone of the second object skeleton; In response to the mounting posture adjustment command, the second virtual object is controlled to be mounted on the first virtual object using a second mounting posture, which is different from the first mounting posture.
11. The method of claim 10, wherein, When the mounting posture adjustment command is the first command, the step of responding to the mounting posture adjustment command by controlling the second virtual object to be mounted on the first virtual object using the second mounting posture includes: In response to the mounting posture adjustment command, the bone slot is adjusted from the first bone to the third bone; by mounting the second bone to the bone slot located on the third bone, the second virtual object is controlled to be mounted on the first virtual object in a second mounting posture; When the mounting posture adjustment command is the second command, the step of responding to the mounting posture adjustment command by controlling the second virtual object to be mounted on the first virtual object using the second mounting posture includes: In response to the mounting posture adjustment command, by mounting the fourth bone to the bone slot, the second virtual object is controlled to be mounted on the first virtual object in a second mounting posture; When the mounting posture adjustment command includes the first command and the second command, the step of controlling the second virtual object to be mounted on the first virtual object using the second mounting posture in response to the mounting posture adjustment command includes: In response to the mounting posture adjustment command, the bone slot is adjusted from the first bone to the third bone; by mounting the fourth bone to the bone slot located on the third bone, the second virtual object is controlled to be mounted on the first virtual object in a second mounting posture.
12. The method according to any one of claims 1-11, wherein, Before adding a bone slot to the first bone of the first object skeleton, the method further includes: Obtain the motion posture of the first virtual object; Determine the mounting posture of the second virtual object that is adapted to the motion posture; Based on the movement posture and the mounting posture, the first bone in the first object skeleton to be added to the bone slot and the second bone in the second object skeleton to be mounted to the bone slot are determined.
13. An animation processing apparatus, the apparatus comprising: The acquisition module is configured to acquire the first animation file of the first virtual object and the second animation file of the second virtual object; The extraction module is configured to extract the first object skeleton of the first virtual object from the first animation file, and extract the second object skeleton of the second virtual object from the second animation file; Add a module and configure it to add a bone slot to the first bone of the first object skeleton; The mounting module is configured to mount the second bone of the second object skeleton to the bone slot; The playback module is configured to control the second bone to follow the first bone when playing a mounting animation that is used to display the second virtual object being mounted on the first virtual object, based on the bone slot. During the process of the second bone following the first bone, the object portion of the second virtual object that is bound to the second bone also follows the object portion of the first virtual object that is bound to the first bone.
14. An electronic device, the electronic device comprising: Memory, configured to store computer-executable instructions; The processor, configured to execute computer-executable instructions stored in the memory, implements the animation processing method according to any one of claims 1 to 12.
15. A computer-readable storage medium storing computer-executable instructions or a computer program, wherein when executed by a processor, the computer-executable instructions or the computer program implement the animation processing method according to any one of claims 1 to 12.
16. A computer program product comprising computer-executable instructions or a computer program, wherein when executed by a processor, the computer-executable instructions or the computer program implement the animation processing method according to any one of claims 1 to 12.