Animation Data Processing Method, Apparatus, Device, and Computer-Readable Storage Medium
By creating custom moving attributes on the bones of the animation file and using trigonometric function calculations, the animation effects of different angles and displacement distances of virtual objects are achieved, solving the problems of high production difficulty and large package size in the existing technology, and improving the efficiency and effect of animation production.
Patent Information
- Application Number
- CN202110239749.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-04
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2041-03-04
AI Technical Summary
In the prior art, in animation production, the movement method of controlling the different movement parameters of virtual objects is very limited, the production is difficult and difficult to maintain. Especially when achieving animation effects of different angles and displacement distances, the existing methods cannot effectively reduce the volume of the package and the production cost.
By obtaining the movement information in the reference animation file, the first movement attribute, the second movement attribute and the third movement attribute are created, and the superimposed movement information of the virtual object is determined based on the interval distance, the reference displacement distance and the setting information. The rotation and displacement difference value are calculated using the plug-in and the trigonometric function, and superimposed on the animation file to achieve animation effects of different angles and displacement distances.
It reduces the difficulty of animation production, reduces the volume of packages, improves production efficiency, and can create a diverse displacement rhythm according to different body shapes and characters, improving animation performance.
Smart Images

Figure CN115006845B_ABST
Abstract
Description
Technical Field
[0001] This application relates to animation technology, and in particular, to an animation data processing method, apparatus, device, and computer-readable storage medium. Background Art
[0002] Currently, in animation production, animators usually design multiple animation clips, and then the engine mixes and switches the multiple animation clips to finally achieve the animation effect. Among them, animation is a way of expressing character behavior. Recording and playing the actions of a character object within a period of time is a complete animation clip. In the related art, when controlling a virtual object to move with different movement parameters, either in-place animation can be used and controlled by different codes, or animation files corresponding to different movement parameters can be produced. However, both of these implementation methods have great limitations, high production difficulty, and are difficult to maintain. Summary of the Invention
[0003] Embodiments of this application provide an animation data processing method, apparatus, and computer-readable storage medium, which can use one animation file to achieve the movement of a virtual object with different angles and different displacement distances, thereby reducing the package size and the production difficulty.
[0004] The technical solution of the embodiments of this application is implemented as follows:
[0005] Embodiments of this application provide an animation data processing method, including:
[0006] Obtain a reference animation file, reference movement information of a virtual object in the reference animation file, and the current destination of the virtual object, where the reference movement information includes at least a reference destination and a reference displacement distance;
[0007] Create a first movement attribute, a second movement attribute, and a third movement attribute on the skeleton of the virtual object, and obtain setting information for the first movement attribute, the second movement attribute, and the third movement attribute to obtain an updated animation file;
[0008] Import the updated animation file into the engine, and determine the superimposed movement information of the virtual object relative to the reference movement information based on the interval distance, the reference displacement distance, and the setting information between the reference destination and the current destination;
[0009] Determine the target movement information of the virtual object based on the superimposed movement information and the reference movement information, and control the virtual object to move based on the target movement information.
[0010] Embodiments of this application provide an animation data processing apparatus, including:
[0011] The first acquisition module is configured to acquire a reference animation file, reference movement information of a virtual object in the reference animation file, and a current destination of the virtual object, where the reference movement information includes at least a reference destination and a reference displacement distance;
[0012] The second acquisition module is configured to create a first movement attribute, a second movement attribute, and a third movement attribute on the skeleton of the virtual object, and acquire setting information for the first movement attribute, the second movement attribute, and the third movement attribute, so as to obtain an updated animation file;
[0013] The first determination module is configured to import the updated animation file into an engine, and determine superimposed movement information of the virtual object relative to the reference movement information based on the interval distance, the reference displacement distance, and the setting information between the reference destination and the current destination;
[0014] The second determination module is configured to determine target movement information of the virtual object based on the superimposed movement information and the reference movement information, and control the virtual object to move based on the target movement information.
[0015] In some embodiments, the second acquisition module is further configured to:
[0016] Create a first movement attribute, a second movement attribute, and a third movement attribute through a plug-in;
[0017] Acquire a first key frame corresponding to starting to depart, a second key frame corresponding to arriving at the current destination, a third key frame corresponding to starting to return, and a fourth key frame corresponding to arriving at the original position set through the plug-in;
[0018] Determine the first key frame, the second key frame, the third key frame, and the fourth key frame as the setting information.
[0019] In some embodiments, the apparatus further includes:
[0020] The third determination module is configured to import the updated animation file into an engine, and determine a first movement attribute value of a first movement curve corresponding to the first movement attribute, a second movement attribute value of a second movement curve corresponding to the second movement attribute, and a third movement attribute value of a third movement curve corresponding to the third movement attribute based on the setting information.
[0021] In some embodiments, the first determination module is configured to:
[0022] Determine an angle between a first movement trajectory and a second movement trajectory based on the interval distance and the reference displacement distance, where the first movement trajectory is a movement trajectory corresponding to the virtual object reaching the current destination, and the second movement trajectory is a movement trajectory corresponding to the virtual object reaching the reference destination;
[0023] Determine the superimposed displacement information of the skeleton of the virtual object based on the interval distance, the reference displacement distance, the first movement attribute value, and the included angle;
[0024] Obtain the reference rotation angle in the reference movement information, and determine the first superimposed rotation information of the capsule of the virtual object based on the reference rotation angle, the included angle, and the second movement attribute value;
[0025] Determine the second superimposed rotation information of the skeleton based on the first superimposed rotation information of the capsule and the third movement attribute value.
[0026] In some embodiments, the first determination module is further configured to:
[0027] Determine the ratio of the interval distance to the reference displacement distance, and the line connecting the initial position of the virtual object to the reference destination is perpendicular to the line connecting the reference destination and the current destination;
[0028] Determine the arctangent value of the ratio as the included angle between the first movement trajectory and the second movement trajectory.
[0029] In some embodiments, the first determination module is further configured to:
[0030] Determine the first length based on the product of the reference displacement distance and the cosine value of the included angle;
[0031] Determine the second length based on the reference displacement distance and the first length, where the reference displacement distance is the hypotenuse length of a right triangle, and the first length and the second length are the right side lengths;
[0032] Determine the superimposed displacement information of the skeleton in the rolling angle direction based on the reference displacement distance, the first length, and the first movement attribute value;
[0033] Determine the superimposed displacement information of the skeleton in the pitch angle direction based on the interval distance, the second length, and the first movement attribute value.
[0034] In some embodiments, the first determination module is further configured to:
[0035] Determine the difference between the interval distance and the second length;
[0036] Determine the superimposed displacement value of the skeleton in the pitch angle direction based on the difference and the first movement attribute value;
[0037] Determine the first direction coefficient corresponding to the offset direction of the current destination relative to the reference destination;
[0038] Determine the superimposed displacement information of the framework in the pitch angle direction based on the superimposed displacement value and the first direction coefficient.
[0039] In some embodiments, the first determination module is further configured to:
[0040] Combine the reference rotation angle and the included angle to obtain a combined rotation angle;
[0041] Determine a first direction coefficient corresponding to the offset direction of the current destination relative to the reference destination;
[0042] Determine the product of the combined rotation angle, the first direction coefficient, and the second movement attribute value as the first superimposed rotation information of the capsule body.
[0043] In some embodiments, the first determination module is further configured to:
[0044] Obtain a preset second direction coefficient;
[0045] Determine the product of the first superimposed rotation information, the second direction coefficient, and the third movement attribute value as the second superimposed rotation information.
[0046] In some embodiments, the apparatus further includes:
[0047] A third acquisition module, configured to acquire size information of the virtual object;
[0048] A fourth acquisition module, configured to acquire a movement speed corresponding to the size information;
[0049] Correspondingly, the second determination module further includes:
[0050] Control the virtual object to move based on the movement speed and the target movement information.
[0051] An embodiment of the present application provides an animation data processing device, including:
[0052] A memory, configured to store executable instructions;
[0053] A processor, configured to implement the method provided by the embodiment of the present application when executing the executable instructions stored in the memory.
[0054] An embodiment of the present application provides a computer-readable storage medium, storing executable instructions, which are used to cause a processor to implement the method provided by the embodiment of the present application when executed.
[0055] The embodiment of the present application has the following beneficial effects:
[0056] First, obtain a reference animation file, the reference movement information of the virtual object in the reference animation file, and the current destination of the virtual object. The reference movement information includes at least a reference destination and a reference displacement distance. Then, create a first movement attribute, a second movement attribute, and a third movement attribute on the skeleton of the virtual object in the animation file, and obtain the setting information for the first movement attribute, the second movement attribute, and the third movement attribute to obtain an updated animation file. After importing the updated animation file into the engine, determine the superimposed movement information of the virtual object relative to the reference movement information based on the interval distance, the reference displacement distance, and the setting information between the reference destination and the current destination. Finally, determine the target movement information of the virtual object based on the superimposed movement information and the reference movement information, and control the virtual object to move based on the target movement information. In this way, when different movement parameters, such as animation files with different angles and different displacement distances, need to be produced, only three movement attributes and the setting information of each movement attribute need to be added based on the reference animation file, and then the updated animation file is imported into the engine to determine the target movement information and control the movement of the virtual object, which can reduce the production difficulty, reduce the package size, and thus improve the production efficiency. Brief Description of the Drawings
[0057] Figure 1 is a schematic network architecture diagram of the animation data processing system 100 provided by an embodiment of the present application;
[0058] Figure 2 is a schematic structural diagram of the animation production terminal 400 provided by an embodiment of the present application;
[0059] Figure 3 is a schematic implementation flow diagram of an animation data processing method provided by an embodiment of the present application;
[0060] Figure 4 is another schematic implementation flow diagram of an animation data processing method provided by an embodiment of the present application;
[0061] Figure 5 is a schematic implementation flow diagram of determining the superimposed movement information of the virtual object relative to the reference movement information provided by an embodiment of the present application;
[0062] Figure 6 is still another schematic implementation flow diagram of the animation data processing method provided by an embodiment of the present application;
[0063] Figure 7 is a schematic diagram of a plug-in interface for adding custom attributes to the skeleton provided by an embodiment of the present application;
[0064] Figure 8A is a schematic diagram of a plug-in interface for setting key frames provided by an embodiment of the present application;
[0065] Figure 8B Schematic diagram of three animation curves obtained after setting key frames provided by an embodiment of the present application;
[0066] Figure 9 Schematic diagram of three actual animation curves obtained after setting key frames provided by an embodiment of the present application;
[0067] Figure 10 Schematic diagram of an animation blueprint for obtaining curve values provided by an embodiment of the present application;
[0068] Figure 11 Schematic diagram of an animation blueprint for obtaining the initial rotation information of a character / pet provided by an embodiment of the present application;
[0069] Figure 12 Schematic diagram of an animation blueprint for calculating the magnitude of the angle to be rotated provided by an embodiment of the present application;
[0070] Figure 13 Schematic diagram of the principle for calculating the magnitude of the angle to be rotated provided by an embodiment of the present application;
[0071] Figure 14 Schematic diagram of an animation blueprint for calculating the displacement value to be superimposed on the skeleton provided by an embodiment of the present application;
[0072] Figure 15 Schematic diagram of an animation blueprint for obtaining the rotation angle to be superimposed on the capsule provided by an embodiment of the present application;
[0073] Figure 16 Schematic diagram of an animation blueprint for calculating the actual displacement value to be superimposed on the skeleton provided by an embodiment of the present application;
[0074] Figure 17 Schematic diagram of an animation blueprint for calculating the actual rotation value to be superimposed on the skeleton provided by an embodiment of the present application;
[0075] Figure 18 Schematic diagram of an animation blueprint for applying the calculated displacement value and rotation value to a virtual character provided by an embodiment of the present application;
[0076] Figure 19 Schematic diagram of the interface for applying the calculated displacement value and rotation value to a virtual character provided by an embodiment of the present application;
[0077] Figure 20 Schematic diagram of the effect of normal displacement using the produced animation file;
[0078] Figure 21 Schematic diagram of the effect of realizing character movement using the animation data processing method provided by an embodiment of the present application. Detailed Implementation Modes
[0079] To make the objectives, technical solutions, and advantages of this application clearer, the following will further describe this application in detail with reference to the accompanying drawings. The described embodiments should not be construed as limitations on this application. All other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of this application.
[0080] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments. However, it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and they can be combined with each other without conflict.
[0081] In the following description, the terms "first / second / third" are merely used to distinguish similar objects and do not represent a specific order for the objects. It can be understood that "first / second / third" can, where permitted, interchange the specific order or sequence so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0082] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0083] Before further elaborating on the embodiments of this application, the nouns and terms involved in the embodiments of this application are explained. The nouns and terms involved in the embodiments of this application are subject to the following explanations.
[0084] 1) Skeleton, which includes bones and joints. Bones are coordinate spaces, and the bone hierarchy is a nested coordinate space. A joint only describes the position of a bone, that is, the origin of the bone's own coordinate space in its parent space. Rotation around a joint means the rotation of the bone coordinate space (including all sub-spaces) itself.
[0085] 2) Skin, which means attaching (binding) the vertices in a Mesh to the bones, and each vertex can be controlled by multiple bones. In this way, the vertices at the joints change their positions due to the pulling of both parent and child bones, thus eliminating cracks.
[0086] 3) Skeleton Animation, also known as bone animation, divides a 3D model into two parts, the skin for rendering the model and the skeleton for controlling the actions.
[0087] 4) An Integrated Development Environment (IDE) is an application used to provide a program development environment, generally including tools such as a code editor, compiler, debugger, and graphical user interface. It is an integrated software service suite with functions such as code writing, analysis, compilation, and debugging. Any software or software suite (group) with this characteristic can be called an integrated development environment.
[0088] 5) 3D Studio Max: Often simply referred to as 3d Max or 3ds MAX, it is a 3D animation rendering and production software based on the PC system developed by Discreet (later merged by Autodesk).
[0089] 6) Blueprint, a special type of resource in Unreal Engine, provides an intuitive, node-based interface for creating new types of Actors and level script events; it offers a tool for level designers and game developers to quickly create and iterate game playability in the Unreal Editor without writing a single line of code.
[0090] 7) Animation Blueprint performs animation blending, directly controls the bones of the skeleton, or sets the logic that will ultimately define the final animation pose of the skeletal mesh to be used for each frame.
[0091] In the application scenario where combat units on both sides in turn-based combat attack each other, move to the opponent's position, and then turn around and come back after the attack, it is first necessary to determine the displacement distance and direction of the character. In the related technologies, there are at least the following two implementation schemes:
[0092] The first scheme: Use in-place animation and control the displacement distance through code. That is to say, the animation always remains in place, which includes actions such as jumping, attacking, returning, turning around, etc. When to attack and when to jump need to be determined in advance. In the engine, according to the pre-determined time points, the animation itself moves at a uniform speed within a fixed time period.
[0093] The second scheme: Implement all using animation files. For different angles, use one animation file each, and the animation file only needs to be imported into the engine.
[0094] The first scheme cannot distinguish different rhythms according to characters of different body types, is uniform, has poor performance effects, and has great limitations. It is necessary to fix the time points: when to move, when to attack, etc.; it also cannot achieve displacements at different angles.
[0095] The number of animation files in the second solution is very large and difficult to maintain. If there are modifications or increased requirements, the production cost will be huge.
[0096] Based on this, the embodiments of the present application provide an animation data processing method. By calculating the distance using trigonometric function formulas and then multiplying by coefficients, the differences in rotation and displacement are calculated and superimposed on the default animation file, achieving the purpose of realizing different angles and displacement distances for a fixed displacement distance animation. Additionally, by adding parameters and setting parameters through plugins, there is no need for cumbersome settings within the engine, achieving the purpose of improving production efficiency and reducing production costs.
[0097] The following describes the exemplary application of the animation data processing device provided by the embodiments of the present application. The device provided by the embodiments of the present application can be implemented as various types of user terminals such as laptop computers, tablet computers, desktop computers, set-top boxes, mobile devices (e.g., mobile phones, portable music players, personal digital assistants, dedicated messaging devices, portable game devices), or can also be implemented as a server. Below, the exemplary application when the device is implemented as a terminal will be described.
[0098] See Figure 1 , Figure 1 is a schematic diagram of the network architecture of the animation data processing system 100 provided by the embodiments of the present application. As Figure 1 shown, the animation data processing system includes: an animation production terminal 400, a network 300, and a development terminal 200. The animation production terminal 400 is connected to the development terminal 200 through the network 300. The network 300 can be a wide area network, a local area network, or a combination of the two.
[0099] Artists create a reference animation file through the animation production terminal 400. In this reference animation file, the virtual object is facing the reference destination directly, and the reference displacement distance between the virtual object and the reference destination is known. Then, custom attributes are added to the bones of the virtual object in the reference animation file through a plugin, and the custom attributes are set through the plugin to obtain an updated animation file. Then, the updated animation file is imported into the engine for rendering. The engine will recognize the created custom attributes as curves and determine the curve values (i.e., custom attribute values) based on the setting information of the custom attributes. Furthermore, based on the interval distance between the reference destination and the current destination, the reference displacement distance, and each custom attribute value, the target movement information of the virtual object is determined, and then the movement of the virtual object is controlled to be different from that in the reference animation file. After obtaining the updated animation file through the animation production terminal 400, the artists can send the updated animation file to the development terminal 200 so that the developers can apply the updated animation file to the actual application scenarios as needed.
[0100] See Figure 2, Figure 2 is a schematic structural diagram of the animation production terminal 400 provided by an embodiment of the present application. Figure 2 As shown, the animation production terminal 400 includes: at least one processor 410, a memory 450, at least one network interface 420, and a user interface 430. Each component in the animation production terminal 400 is coupled together through a bus system 440. It can be understood that the bus system 440 is used to implement the connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, in Figure 2 all kinds of buses are labeled as the bus system 440.
[0101] The processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0102] The user interface 430 includes one or more output devices 431 that enable the presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, a mouse, a microphone, a touch screen display, a camera, other input buttons, and controls.
[0103] The memory 450 can be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memories, hard disk drives, optical disc drives, etc. The memory 450 optionally includes one or more storage devices that are physically located away from the processor 410.
[0104] The memory 450 includes volatile memory or non-volatile memory, and can also include both volatile and non-volatile memory. The non-volatile memory can be a read-only memory (ROM, Read Only Memory), and the volatile memory can be a random access memory (RAM, Random Access Memory). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.
[0105] In some embodiments, the memory 450 is capable of storing data to support various operations. Examples of such data include programs, modules, and data structures, or subsets or supersets thereof, which are illustrated below.
[0106] The operating system 451 includes system programs for processing various basic system services and performing hardware-related tasks, such as the framework layer, the core library layer, the driver layer, etc., for implementing various basic services and processing hardware-based tasks;
[0107] The network communication module 452 is used to reach other computing devices via one or more (wired or wireless) network interfaces 420. Exemplary network interfaces 420 include: Bluetooth, Wi-Fi (Wireless Fidelity), and USB (Universal Serial Bus), etc.;
[0108] The presentation module 453 is used to enable the presentation of information (such as a user interface for operating peripheral devices and displaying content and information) via one or more output devices 431 associated with the user interface 430 (such as a display screen, a speaker, etc.);
[0109] The input processing module 454 is used to detect and translate one or more user inputs or interactions from one of one or more input devices 432.
[0110] In some embodiments, the device provided by the embodiments of the present application can be implemented in software. Figure 2 An animation data processing device 455 stored in the memory 450 is shown. It can be software in the form of a program and a plug-in, etc., including the following software modules: a first acquisition module 4551, a second acquisition module 4552, a first determination module 4553, and a second determination module 4554. These modules are logical, so they can be combined arbitrarily or further split according to the functions to be implemented.
[0111] The functions of each module will be described below.
[0112] In other embodiments, the device provided by the embodiments of the present application can be implemented in hardware. As an example, the device provided by the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the animation data processing method provided by the embodiments of the present application. For example, a processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0113] The exemplary applications and implementations of the terminal provided in the embodiments of the present application will be combined to illustrate the animation data processing method provided in the embodiments of the present application. This animation data processing method is applied to an animation production terminal.
[0114] Refer to Figure 3 , Figure 3 which is a schematic diagram of an implementation process of the animation data processing method provided in the embodiments of the present application, and will be described in combination with the steps shown in Figure 3 it.
[0115] Step S101, obtain a reference animation file, reference movement information of a virtual object in the reference animation file, and the current destination of the virtual object.
[0116] Here, the reference movement information at least includes a reference destination and a reference displacement distance. In some embodiments, the reference movement information may further include a reference movement direction. The virtual object may be a virtual game character or a virtual pet provided in an application.
[0117] The reference animation file may be pre-produced by an artist through an animation production terminal. In the reference animation file, the virtual object may move towards the reference destination, perform a certain action after reaching the reference destination, and then return from the reference destination to the starting point, and the virtual object may be facing the reference destination directly, as Figure 20 shown. In the embodiments of the present application, different movements from the reference animation file can be achieved by setting the current destination, creating movement attributes, etc. For example, movements with different angles and / or different displacement distances can be performed. In actual implementation, the line connecting the current destination and the reference destination is perpendicular to the line connecting the starting point of the virtual object and the reference destination.
[0118] Step S102, create a first movement attribute, a second movement attribute, and a third movement attribute on the bones of the virtual object, and obtain the setting information for the first movement attribute, the second movement attribute, and the third movement attribute to obtain an updated animation file.
[0119] In implementation, the first movement attribute, the second movement attribute, and the third movement attribute can be created on the bones of the virtual object through a plug-in. The bone can be the "Root" bone at the highest level of the virtual object's skeleton or a bone at other levels of the skeleton. Creating custom movement attributes on the bone can be understood as creating or adding parameters on the bone, that is, the movement attribute can refer to the movement parameters of the bone. When setting the first movement attribute, the second movement attribute, and the third attribute, it can also be implemented through a plug-in. In some embodiments, the settings for the first movement attribute, the second movement attribute, and the third movement attribute can be achieved by setting key frames corresponding to each moment of starting, reaching the opposite side, starting to return, and reaching the original position.
[0120] Step S103: Import the updated animation file into the engine, and determine the superimposed movement information of the virtual object relative to the reference movement information based on the interval distance, the reference displacement distance, and the setting information between the reference destination and the current destination.
[0121] In some embodiments, after importing the updated animation file into the engine, the engine will respectively recognize the three created movement attributes as three curves, and determine the curve values (i.e., movement attribute values) of each curve based on the setting information of the three movement attributes, so that three curves can be presented. The abscissa of the three curves can be represented by key frames, and the ordinate is the movement attribute value corresponding to the key frame. Among them, the curve value of the first movement curve (i.e., the first movement attribute value) represents the coefficient of the displacement distance value to be superimposed and the rotation angle value of the capsule of the virtual object. The curve value of the second movement curve (i.e., the second movement attribute value) represents the coefficient of the rotation angle of the skeleton in the two intervals from "not started" to "starting" and from "reaching the original position" to "animation end" of the virtual object. The curve value of the third movement curve (i.e., the third movement attribute value) represents the coefficient of the rotation angle of the skeleton in the interval from "reaching the opposite side" to "starting to return".
[0122] When implementing step S103, the included angle between the first movement trajectory of the virtual object from the starting point to the reference destination and the second movement trajectory of the virtual object from the starting point to the current destination can be first determined, and then based on the trigonometric function and the calculated included angle, as well as the interval distance, the reference displacement distance between the reference destination and the current destination, and the movement attribute values corresponding to the above three movement attributes, the superimposed movement information of the virtual object relative to the reference movement information is determined. The superimposed movement information includes superimposed displacement information and superimposed rotation angle information.
[0123] Step S104: Determine the target movement information of the virtual object based on the superimposed movement information and the reference movement information, and control the virtual object to move based on the target movement information.
[0124] Here, the superimposed movement information and the reference movement information are superimposed and calculated to obtain the target movement information of the virtual object. Then, the virtual object is controlled to move from the starting point based on this target movement information until it reaches the current destination. After reaching the current destination, a certain action is executed, and then it returns from the current destination to the starting point, and then the animation ends. In the embodiment of the present application, the distance and direction between the current destination and the reference destination relative to the starting point of the virtual object are both different. In this way, by creating and setting some custom movement attributes on the bones of the virtual object in the reference animation file, and then through a series of calculations, the target movement parameters for the virtual object to move from the starting point to the current destination can be determined, realizing movement with different angles and displacements.
[0125] In the animation data processing method provided in the embodiment of the present application, first, a reference animation file, the reference movement information of the virtual object in the reference animation file, and the current destination of the virtual object are obtained. The reference movement information at least includes a reference destination and a reference displacement distance. Then, a first movement attribute, a second movement attribute, and a third movement attribute are created on the bones of the virtual object in the animation file, and the setting information for the first movement attribute, the second movement attribute, and the third movement attribute is obtained to obtain an updated animation file. After importing the updated animation file into the engine, the superimposed movement information of the virtual object relative to the reference movement information is determined based on the interval distance, the reference displacement distance, and the setting information between the reference destination and the current destination. Finally, the target movement information of the virtual object is determined based on the superimposed movement information and the reference movement information, and the virtual object is controlled to move based on the target movement information. In this way, when it is necessary to produce animation files with different movement parameters, such as different angles and different displacement distances, only three movement attributes and the setting information of each movement attribute need to be added on the basis of the reference animation file, and then the updated animation file is imported into the engine to determine the target movement information and control the movement of the virtual object, which can reduce the production difficulty, reduce the package size, and thus improve the production efficiency.
[0126] In some embodiments, the rhythm of the displacement, that is, the movement speed of the virtual object, can be controlled by the animation file instead of the uniform motion controlled by the code. As Figure 4 shown, before step S104, the art production staff can produce animations with different displacement rhythms for characters of different body types through the following steps:
[0127] Step S201: Obtain the size information of the virtual object.
[0128] In the embodiments of the present application, the size information of the virtual object may include information such as the height, width, and body shape of the virtual object.
[0129] Step S202: Obtain the moving speed corresponding to the size information.
[0130] When implementing step S202, a corresponding relationship between the size information and the moving speed may be established in advance, and then based on this object relationship, the moving speed corresponding to the size information of the virtual object is determined. For example, in this corresponding relationship, a virtual object with a larger body size corresponds to a lower moving speed, and a virtual object with a smaller body size corresponds to a higher moving speed. It may also be that the art personnel determine the moving speed corresponding to the size information of the virtual object based on the actual requirements of the animation. For example, the actual requirement of the animation is that a virtual object with a higher and thinner body shape corresponds to a higher moving speed, and a virtual object with a shorter and fatter body shape corresponds to a lower moving speed.
[0131] Correspondingly, as Figure 4 shown, "controlling the virtual object to move based on the target movement information" in the above step S104 may be implemented by controlling the virtual object to move based on the moving speed and the target movement information when implemented. That is to say, the art personnel can set the moving speed of the virtual object based on the size information of the virtual object, so as to control the displacement rhythm and increase the diversity of the virtual object in the animation file.
[0132] In some embodiments, Figure 3 The step S102 shown as "create a first movement attribute, a second movement attribute, and a third movement attribute on the skeleton of the virtual object, and obtain the setting information for the first movement attribute, the second movement attribute, and the third movement attribute" may be implemented through the following steps:
[0133] Step S1021: Create a first movement attribute, a second movement attribute, and a third movement attribute on the skeleton of the virtual object through a plug-in.
[0134] When implementing, it may be created on the highest-level skeleton "Root" of the virtual object through a plug-in, or it may be created on other-level skeletons of the virtual object. When creating a custom movement attribute, when implementing, movement parameters may be added to the skeleton. In the embodiments of the present application, three movement attributes may be created, that is, the first movement attribute, the second movement attribute, and the third movement attribute. In other embodiments, they may be Battle_1, Battle_2, and Battle_3 respectively.
[0135] Step S1022: Obtain the first key frame corresponding to starting the departure set through the plug-in, the second key frame corresponding to reaching the current destination, the third key frame corresponding to starting to return, and the fourth key frame corresponding to reaching the original position.
[0136] In some embodiments, the plug-in button control can be clicked at a certain key frame of the animation file. At this time, a display interface for selecting starting the departure, reaching the current destination, starting to return, and reaching the original position will be presented. As Figure 8A shown, in Figure 8A , the "3" in the upper left corner indicates the third key frame. If "starting the departure" is clicked at this time, it means that the 3rd key frame is set as the key frame for "starting the departure". Similarly, assuming that the 9th frame is the key frame corresponding to reaching the current destination, then when sliding to the 9th key frame, click or touch the button control corresponding to the plug-in and click "reaching the current destination". Similarly, the key frames corresponding to "starting to return" and "reaching the original position" can be set.
[0137] Step S1023: Determine the first key frame, the second key frame, the third key frame, and the fourth key frame as the setting information.
[0138] In the embodiments of the present application, the first key frame, the second key frame, the third key frame, and the fourth key frame are determined as the setting information for the first movement attribute, the second movement attribute, and the third movement attribute, and the movement attribute values corresponding to the first movement attribute, the second movement attribute, and the third movement attribute are determined based on this setting information.
[0139] In some embodiments, when the updated animation file is imported into the engine, the engine will recognize the first movement attribute, the second movement attribute, and the third movement attribute created in the above steps as three curves, that is, the first movement curve, the second movement curve, and the third movement curve. Then, based on the setting information, the first movement attribute value of the first movement curve corresponding to the first movement attribute, the second movement attribute value of the second movement curve corresponding to the second movement attribute, and the third movement attribute value of the third movement curve corresponding to the third movement attribute are determined.
[0140] The engine will respectively recognize the three created movement attributes as three curves, and determine the curve values (i.e., movement attribute values) of each curve based on the setting information of the three movement attributes, so that three curves can be presented. The abscissa of these three curves can be represented by key frames, and the ordinate is the movement attribute value corresponding to the key frame. Among them, the curve value of the first movement curve (i.e., the first movement attribute value) represents the coefficient of the displacement distance value to be superimposed and the rotation angle value of the capsule of the virtual object. The curve value of the second movement curve (i.e., the second movement attribute value) represents the coefficient of the rotation angle of the skeleton in two intervals: from "not started" to "starting to move" and from "arriving at the original position" to "ending the animation" for the virtual object. The curve value of the third movement curve (i.e., the third movement attribute value) represents the coefficient of the rotation angle of the skeleton in the interval from "arriving at the current destination" to "starting to return". These movement attribute values are used to calculate the displacement distance and rotation angle in subsequent steps.
[0141] In some embodiments, Figure 3 Step S103 "Determine the superimposed movement information of the virtual object relative to the reference movement information based on the interval distance, the reference displacement distance, and the setting information between the reference destination and the current destination" as shown in Figure 5 can be implemented by steps S1031 to S1034 as shown below. The following will Figure 5 describe each step.
[0142] Step S1031, determine the included angle between the first movement trajectory and the second movement trajectory based on the interval distance and the reference displacement distance.
[0143] Here, the first movement trajectory is the movement trajectory corresponding to the virtual object reaching the current destination, and the second movement trajectory is the movement trajectory corresponding to the virtual object reaching the reference destination. Taking Figure 13 as an example for illustration, the first movement trajectory is OD2, and the second movement trajectory is OD1. In the embodiments of the present application, the line connecting the current destination and the reference destination is perpendicular to the line connecting the starting point of the virtual object and the reference destination, that is, the line connecting the current destination and the reference destination is perpendicular to the second movement trajectory. The current destination, the reference destination, and the starting point of the virtual object form a right triangle, that is, Figure 13 △D1OD2 in
[0144] The distance between the current destination and the reference destination, i.e., the interval distance, and the length of the second movement trajectory, i.e., the reference displacement distance. Therefore, taking the arctangent of the ratio of the interval distance to the reference displacement distance yields the angle between the first movement trajectory and the second movement trajectory. At this time, the angle is a value between 0 and π. To obtain the angle, the angle can be multiplied by 90 degrees, resulting in an angle value between 0 and 180 degrees.
[0145] Step S1032: Determine the superimposed displacement information of the skeleton of the virtual object based on the interval distance, the reference displacement distance, the first movement attribute value, and the angle.
[0146] In this step, the angle is also Figure 13 ∠D1OD2 in
[0147] OD2 = OD1 / cosB; (1 - 1);
[0148] Cos is the cosine function. Then ED2 = OD2 - OE. Since OE = OD1, ED2 can be obtained through formula (1 - 2):
[0149] ED2 = OD1 / cosB - OD1; (1 - 2);
[0150] Then, EP can be obtained through formula (1 - 3):
[0151] EQ = ED2 * cosB = OD1 - OD1 * cosB; (1 - 3);
[0152] In some embodiments, since ∠A + ∠B = 90°, then cosB = sinA. Therefore, in some embodiments, EQ can be obtained through formula (1 - 4):
[0153] EQ = OD1 - OD1 * sinA; (1 - 4);
[0154] EP can be calculated through formula (1 - 5):
[0155] EP = ED2 * sinB = OD1 * tanB - OD1 * sinB (1 - 5);
[0156] According to Figure 13 it can be known that OD1 * tanB is also the interval distance D1D2, Therefore, in some embodiments, EP can also be It is calculated that, where LineA is OD1 * cosB.
[0157] In the embodiment of the present application, after obtaining the values of EP and EQ, by multiplying EP and EQ by the first movement attribute value respectively, the superimposed displacement information of the skeleton of the virtual object in the pitch angle direction and the superimposed displacement information in the roll angle direction are obtained.
[0158] Step S1033: Obtain the reference rotation angle in the reference movement information, and determine the first superimposed rotation information of the capsule of the virtual object based on the reference rotation angle, the included angle, and the second movement attribute value.
[0159] Here, the first superimposed rotation information is also the superimposed rotation information applied to the capsule. The capsule can also be called a capsule collider, which is composed of a cylinder with a unit length and two hemispheres with a semi-unit length. Generally, in game animations, the capsule (or other shapes) of a virtual object in a scene is driven by a controller. Then, the data of the capsule is used to drive the animation. For example, if a capsule is moving forward, then the system knows to play a running or walking animation on the character to present the effect that the character is moving by its own strength.
[0160] Step S1034: Determine the second superimposed rotation information of the skeleton based on the first superimposed rotation information of the capsule and the third movement attribute value.
[0161] The second superimposed rotation information is also the superimposed rotation information applied to the skeleton.
[0162] Through the above steps S1031 to S1034, the superimposed displacement information of the skeleton of the virtual object, the first superimposed rotation information of the capsule, and the second superimposed rotation information of the skeleton are respectively determined, that is, the superimposed movement parameter value of the virtual object in this movement is obtained, and thus the movement with different angles and / or different displacements is performed based on this superimposed movement parameter value.
[0163] The above step S1031 "Determine the included angle between the first movement trajectory and the second movement trajectory based on the interval distance and the reference displacement distance" can be implemented through the following steps:
[0164] Step S311: Determine the ratio of the interval distance to the reference displacement distance.
[0165] Here, the connection line between the initial position of the virtual object and the reference destination is perpendicular to the connection line between the reference destination and the current destination. Assuming the interval distance is 20 and the reference displacement distance is also 20, then the ratio of the interval distance to the reference displacement distance is 20 / 20 = 1.
[0166] Step S312: Determine the arctangent value of the ratio as the angle between the first movement trajectory and the second movement trajectory.
[0167] Here, since the line connecting the initial position of the virtual object and the reference destination is perpendicular to the line connecting the reference destination and the current destination, the ratio of the interval distance to the reference displacement distance is the tangent value of this angle. Taking the arctangent of this ratio gives the angle between the first movement trajectory and the second movement trajectory. After calculating the angle between the first movement trajectory and the second movement trajectory, the superimposed displacement information and the superimposed rotation information can be determined through trigonometric functions.
[0168] In some embodiments, the above step S1032, "Determine the superimposed displacement information of the skeleton of the virtual object based on the interval distance, the reference displacement distance, the first movement attribute value, and the angle", can be implemented through the following steps S321 to S324:
[0169] Step S321: Determine a first length based on the product of the reference displacement distance and the cosine value of the angle.
[0170] Here, the product of the reference displacement distance and the cosine value of this angle, that is, OD1*cosB in the above step, and the first length LineA is OD1*cosB.
[0171] Step S322: Determine a second length based on the reference displacement distance and the first length.
[0172] Here, the reference displacement distance is the hypotenuse length of the right triangle ( Figure 13 △COD1 in), the first length and the second length are the right - angled side lengths. When implementing step S322, the Pythagorean theorem can be used to determine the second length LineB, that is, formula (1 - 6):
[0173]
[0174] LineB is Figure 13 the length of CD1 in.
[0175] Step S323: Determine the superimposed displacement information of the skeleton in the rolling - angle direction based on the reference displacement distance, the first length, and the first movement attribute value.
[0176] According to the above formula (1 - 3), EQ = OD1 - OD1*cosB, that is, EQ = OD1 - LineA. Then the superimposed displacement information of this bone in the rolling - angle direction is (OD1 - LineA)*curve0, where curve0 is the first movement attribute value.
[0177] Step S324: Determine the superimposed displacement information of the skeleton in the pitch angle direction based on the interval distance, the second length, and the first movement attribute value.
[0178] Step S324 can be implemented through the following steps:
[0179] Step S3241: Determine the difference between the interval distance and the second length.
[0180] According to Figure 13 It can be known that △CED1 and △EQD1 are congruent triangles, so CD1 = QD1. Since CD1 is also lineB, there is formula (1-7):
[0181] QD2 = D1D2 - QD1 = D1D2 - LineB (1-7);
[0182] Where D1D2 is the interval distance, and LineB is the second length value, that is, step S3241 determines QD2 through formula (1-7).
[0183] Step S3242: Determine the superimposed displacement value of the skeleton in the pitch angle direction based on the difference and the first movement attribute value.
[0184] Based on formula (1-7), the superimposed displacement value of the bone in the pitch angle direction can be obtained as (D1D2 - LineB) * curve0.
[0185] Step S3243: Determine the first direction coefficient corresponding to the offset direction of the current destination relative to the reference destination.
[0186] In the embodiments of the present application, when the offset direction of the current destination relative to the reference destination is to the right, the first direction coefficient is 1; when the offset direction of the current destination relative to the reference destination is to the left, the first direction coefficient is -1.
[0187] Step S3244: Determine the superimposed displacement information of the skeleton in the pitch angle direction based on the superimposed displacement value of the skeleton in the pitch angle direction and the first direction coefficient.
[0188] When implementing step S3244, the superimposed displacement value of the skeleton in the pitch angle direction can be multiplied by the first direction coefficient to obtain the actual superimposed displacement information of the skeleton in the pitch angle direction.
[0189] In some embodiments, the above step S1033 "Determine the first superimposed rotation information of the capsule of the virtual object based on the reference rotation angle, the included angle, and the second movement attribute value" can be implemented through the following steps:
[0190] Step S331: Combine the reference rotation angle and the included angle to obtain a combined rotation angle.
[0191] Here, as Figure 15 shown, the reference rotation angle and the included angle between the first movement trajectory and the second movement trajectory can be combined through the "Combine Rotator" button on the animation blueprint to obtain the combined rotation angle.
[0192] Step S332: Determine a first direction coefficient corresponding to the offset direction of the current destination relative to the reference destination.
[0193] In the embodiments of the present application, when the offset direction of the current destination relative to the reference destination is to the right, the first direction coefficient is 1; when the offset direction of the current destination relative to the reference destination is to the left, the first direction coefficient is -1.
[0194] Step S333: Determine the product of the combined rotation angle, the first direction coefficient, and the second movement attribute value as the first superimposed rotation information of the capsule.
[0195] In some embodiments, the above step S1034 "Determine the second superimposed rotation information of the skeleton based on the first superimposed rotation information of the capsule and the third movement attribute value" can be implemented through the following steps:
[0196] Step S341: Obtain a preset second direction coefficient.
[0197] Here, since when the capsule of the virtual object rotates a certain angle and reaches the current destination, in order to ensure that the skeleton faces the current destination, the skeleton needs to be rotated in the opposite direction of the capsule. Therefore, the second direction coefficient is -1, indicating that the rotation direction of the skeleton is opposite to the rotation direction of the capsule.
[0198] Step S342: Determine the product of the first superimposed rotation information, the second direction coefficient, and the third movement attribute value as the second superimposed rotation information.
[0199] In some embodiments, after determining the superimposed rotation information, superimposed displacement information of the skeleton of the virtual object, and the first superimposed rotation information of the capsule, in the animation blueprint, the "Transform (Modify) Bones" node can be used to transform the "Root" bone, which is the highest-level bone of the skeleton. The "Translation" model of this node needs to be changed to "Add to Existing", and the "Translation Space" needs to be changed to "World Scene Space", so as to apply the superimposed displacement information and superimposed rotation information to the skeleton and the capsule, obtain the target movement information of the virtual object, and then move based on the target movement information.
[0200] Next, an exemplary application of the embodiments of the present application in an actual application scenario will be described.
[0201] In the embodiments of the present application, only an animation file including the displacement distance (i.e., the reference animation file in other embodiments) needs to be produced. The movement coefficient is generated and set through a plug-in, and then the difference between rotation and displacement is calculated through a trigonometric formula and superimposed on the animation file, so as to realize the movement of different angles and displacements.
[0202] Figure 6 It is a schematic diagram of another implementation process of the animation data processing method provided by the embodiments of the present application. As Figure 6 shown, this process includes:
[0203] Step S601, generate custom attributes (i.e., movement attributes in other embodiments) through a plug-in.
[0204] In implementation, open the produced animation file with displacement distance, add custom attributes to the skeleton. At this time, the plug-in interface as Figure 7 shown is presented. As Figure 7 shown, when using the plug-in to create custom attributes, three attributes will be automatically created, namely "Battle_1" 701, "Battle_2" 702, and "Battle_3" 703.
[0205] This operation is for when the animation file is imported into the engine, the engine will automatically recognize the custom attributes as animation curves, thereby obtaining three animation curves.
[0206] Step S602, record displacement information.
[0207] In some embodiments, after recording the displacement information, custom attributes will also be set. In the animation file, key frames are set for the custom attributes at the positions of "starting to depart", "arriving at the opposite side", "starting to return", and "arriving at the original position". This step has also been implemented in a plug-in manner. The plug-in interface is as Figure 8A shown, and the effect diagram after setting the key frames is as Figure 8B shown. The curve corresponding to battle_1 is 811, the curve corresponding to battle_2 is 812, and the curve corresponding to battle_3 is 813.
[0208] In this step, key frames are used to assign values to three animation curves respectively. The first animation curve (i.e., the first movement curve in other embodiments) is used as the coefficient of the displacement distance value to be superimposed and the rotation value of the character capsule; the second animation curve (i.e., the second movement curve in other embodiments) is used as the coefficient of the angles that the skeleton needs to rotate in two intervals from "not started" to "starting to depart" and from "arriving at the original position" to "ending the animation"; the third animation curve (i.e., the third movement curve in other embodiments) is used as the coefficient of the angles that the skeleton needs to rotate in the intervals of "arriving at the opposite side" and "starting to return".
[0209] Step S603: Obtain curve values.
[0210] In this step, the animation is imported into the engine, and the animation sequence will display Figure 9 three curves as shown, namely "Battle_1" 901, "Battle_2" 902, and "Battle_3" 903.
[0211] In actual implementation, as Figure 10 shown, the "Get Curve Value" node 1001 can be used to obtain the values of the three curves respectively, and assign them to three variables, namely "Curve_0", "Curve_1", and "Curve_2" through the "SET" node 1002. The curve values obtained in this step are prepared for subsequent calculation of the superimposed values.
[0212] Step S604: Obtain the initial rotation information of the character / pet.
[0213] As Figure 11 shown, in implementation, the initial rotation information is obtained through the "Get Scene Rotation" node 1101 and assigned to the variable "Default Rotate" through the "SET" node 1102. The initial rotation information obtained in this step is also prepared for subsequent calculation of the superimposed values.
[0214] Step S605: Calculate the rotation information and displacement information.
[0215] Assume that in the original animation file, the displacement distance is DefaultDistance (i.e., the reference displacement distance in other embodiments), and the interval between the second destination to be reached this time and the first destination reached by the original animation is Spacing (i.e., the interval distance in other embodiments). As Figure 12 shown, according to the formula: inverse tangent(Spacing / DefaultDistance), the angle size to be rotated can be calculated. It should be noted that the current value is only the value for rotating to the right.
[0216] This step is to calculate the angle between the movement trajectories of the normal animation and the offset animation. This rotation value is not the final value to be superimposed and will be further processed later to add the distinction between the left and right directions, that is, the positive and negative.
[0217] As Figure 13 shown, assume that the first destination of the original animation is D1, the second destination of the local animation is D2, DefaultDistance is Y, and Spacing is 4x. Then as Figure 14 shown, AngleA can be calculated according to formula (2-1):
[0218] AngleA = [90 - inverse tangent(Spacing / DefaultDistance)] (2-1);
[0219] As Figure 14 shown, LineA and LineB can be determined according to formula (2-2) and formula (2-3):
[0220] LineA = Sin(AngleA) * DefaultDistance (2-2);
[0221]
[0222] The value to be superimposed on the Roll axis is: (DefaultDistance – LineA) * Curve_0, and the value to be superimposed on the Pitch axis is: (Spacing – LineB) * Curve_0. At this time, the displacement value that the skeleton needs to superimpose is calculated.
[0223] Step S606, calculate the rotation value that the capsule actually needs to superimpose and apply it.
[0224] As Figure 15 shown, the rotation value calculated in step S605 and the default value are merged using the "Merge Rotator" node 1501 to obtain a new rotator variable. Multiply by an "LR" variable 1502 at the output of the Yaw axis. When "LR" = 1, it will offset to the right, and when "LR = -1, it will offset to the left. At the same time, multiply this value by the value of the second curve to obtain the value that the capsule actually needs to superimpose.
[0225] Step S607, calculate the displacement value and rotation information that actually need to be superimposed on the skeleton.
[0226] Due to the distinction between the left and right directions, the displacement value calculated in step S605 needs to be input into a new vector, and asFigure 16 As shown, a "LR" variable 1601 is multiplied at the output of the Pitch axis. When "LR" = 1, it will shift to the right, and when "LR" = -1, it will shift to the left. At this time, the value of the displacement that the skeleton actually needs to superimpose is calculated.
[0227] Since the rotation angle on the skeleton is exactly opposite to the rotation angle of the capsule body, after the capsule body rotates a certain degree, the character cannot face the target directly when reaching the destination. Therefore, the skeleton needs to be rotated back. As Figure 17 shown, the rotation value calculated in step S606 is multiplied by a value of "-1" to achieve the purpose that the rotation value of the capsule body is exactly opposite to the rotation value of the skeleton. Then this opposite value is multiplied by a coefficient, that is, multiplied by the value of the third curve (Curve2). Finally, the rotation value that the skeleton actually needs to superimpose is obtained.
[0228] After the rotation value and displacement value of the skeleton, the rotation value and displacement value need to be applied to the skeleton. As Figure 18 shown, in the animation blueprint, the "Transform (Modify Bone)" node 1801 is used to transform the "Root" bone, which is the highest-level bone of the skeleton. As Figure 19 shown, the "Translation" model of this node needs to be changed to "Add to Existing", and the "Translation Space" needs to be changed to "World Scene Space".
[0229] Figure 20 Fig. is a schematic diagram of the normal displacement effect using the produced animation file. As Figure 20 shown, in the produced animation file, the character / pet moves towards the directly facing target. Figure 21 Fig. is a schematic diagram of the effect of realizing character movement using the animation data processing method provided by the embodiment of the present application. As Figure 21 shown, the character / pet moves to the destination in its right front.
[0230] In the animation data processing method provided by the embodiment of the present application, only one animation file with a displacement distance needs to be produced to achieve different displacements at different angles and different distances, reducing the package size. When moving at different angles and different distances, parameters are added and set through a plugin, without the need for cumbersome settings in the engine, achieving the purpose of improving production efficiency and reducing production costs. And the rhythm of the displacement is controlled by the animation file, rather than the uniform motion controlled by code. The art production staff can produce animations with different displacement rhythms for characters of different body types, which can improve the animation performance.
[0231] Next, the implementation of the animation data processing device 455 provided by the embodiment of the present application as an exemplary structure of software modules will be continued. In some embodiments, as Figure 2As shown, the software modules stored in the animation data processing device 455 of the memory 440 may include:
[0232] A first acquisition module 4551, configured to acquire a reference animation file, reference movement information of a virtual object in the reference animation file, and a current destination of the virtual object, where the reference movement information includes at least a reference destination and a reference displacement distance;
[0233] A second acquisition module 4552, configured to create a first movement attribute, a second movement attribute, and a third movement attribute on the skeleton of the virtual object, and acquire setting information for the first movement attribute, the second movement attribute, and the third movement attribute, so as to obtain an updated animation file;
[0234] A first determination module 4553, configured to import the updated animation file into the engine, and determine superimposed movement information of the virtual object relative to the reference movement information based on the interval distance between the reference destination and the current destination, the reference displacement distance, and the setting information;
[0235] A second determination module 4554, configured to determine target movement information of the virtual object based on the superimposed movement information and the reference movement information, and control the virtual object to move based on the target movement information.
[0236] In some embodiments, the second acquisition module is further configured to:
[0237] Create a first movement attribute, a second movement attribute, and a third movement attribute through a plug-in;
[0238] Acquire a first key frame corresponding to the start of departure, a second key frame corresponding to arriving at the current destination, a third key frame corresponding to the start of return, and a fourth key frame corresponding to arriving at the original position set through the plug-in;
[0239] Determine the first key frame, the second key frame, the third key frame, and the fourth key frame as the setting information.
[0240] In some embodiments, the device further includes:
[0241] A third determination module, configured to import the updated animation file into the engine, and determine a first movement attribute value of a first movement curve corresponding to the first movement attribute, a second movement attribute value of a second movement curve corresponding to the second movement attribute, and a third movement attribute value of a third movement curve corresponding to the third movement attribute based on the setting information.
[0242] In some embodiments, the first determination module is configured to:
[0243] Determine the angle between the first movement trajectory and the second movement trajectory based on the interval distance and the reference displacement distance, where the first movement trajectory is the movement trajectory corresponding to the virtual object reaching the current destination, and the second movement trajectory is the movement trajectory corresponding to the virtual object reaching the reference destination;
[0244] Determine the superimposed displacement information of the skeleton of the virtual object based on the interval distance, the reference displacement distance, the first movement attribute value, and the angle;
[0245] Obtain the reference rotation angle in the reference movement information, and determine the first superimposed rotation information of the capsule of the virtual object based on the reference rotation angle, the angle, and the second movement attribute value;
[0246] Determine the second superimposed rotation information of the skeleton based on the first superimposed rotation information of the capsule and the third movement attribute value.
[0247] In some embodiments, the first determination module is further configured to:
[0248] Determine the ratio of the interval distance to the reference displacement distance, where the line connecting the initial position of the virtual object and the reference destination is perpendicular to the line connecting the reference destination and the current destination;
[0249] Determine the arctangent value of the ratio as the angle between the first movement trajectory and the second movement trajectory.
[0250] In some embodiments, the first determination module is further configured to:
[0251] Determine the first length based on the product of the reference displacement distance and the cosine value of the angle;
[0252] Determine the second length based on the reference displacement distance and the first length, where the reference displacement distance is the length of the hypotenuse of a right triangle, and the first length and the second length are the lengths of the right sides;
[0253] Determine the superimposed displacement information of the skeleton in the roll angle direction based on the reference displacement distance, the first length, and the first movement attribute value;
[0254] Determine the superimposed displacement information of the skeleton in the pitch angle direction based on the interval distance, the second length, and the first movement attribute value.
[0255] In some embodiments, the first determination module is further configured to:
[0256] Determine the difference between the interval distance and the second length;
[0257] Determine the superposition displacement value of the skeleton in the pitch angle direction based on the difference value and the first movement attribute value;
[0258] Determine a first direction coefficient corresponding to the offset direction of the current destination relative to the reference destination;
[0259] Determine the superposition displacement information of the skeleton in the pitch angle direction based on the superposition displacement value and the first direction coefficient.
[0260] In some embodiments, the first determination module is further configured to:
[0261] Combine the reference rotation angle and the included angle to obtain a combined rotation angle;
[0262] Determine a first direction coefficient corresponding to the offset direction of the current destination relative to the reference destination;
[0263] Determine the product of the combined rotation angle, the first direction coefficient, and the second movement attribute value as the first superposition rotation information of the capsule body.
[0264] In some embodiments, the first determination module is further configured to:
[0265] Obtain a preset second direction coefficient;
[0266] Determine the product of the first superposition rotation information, the second direction coefficient, and the third movement attribute value as the second superposition rotation information.
[0267] In some embodiments, the apparatus further includes:
[0268] A third acquisition module, configured to acquire the size information of the virtual object;
[0269] A fourth acquisition module, configured to acquire the movement speed corresponding to the size information;
[0270] Correspondingly, the second determination module further includes:
[0271] Control the virtual object to move based on the movement speed and the target movement information.
[0272] It should be noted here that: The description of the above embodiments of the animation data processing apparatus is similar to the above method description and has the same beneficial effects as the method embodiments. For the technical details not disclosed in the embodiments of the animation data processing apparatus of the present application, those skilled in the art may refer to the description of the method embodiments of the present application for understanding.
[0273] An embodiment of the present application provides a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the animation data processing method described above in the embodiments of the present application.
[0274] An embodiment of the present application provides a computer-readable storage medium storing executable instructions, where the executable instructions are stored. When the executable instructions are executed by a processor, the processor will be caused to execute the method provided by the embodiment of the present application. For example, as Figure 3 , Figure 4 , Figure 5 and Figure 6 shown in the method.
[0275] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disc, or CD-ROM; it may also be various devices including one or any combination of the above memories.
[0276] In some embodiments, the executable instructions may be in the form of a program, software, software module, script, or code, and may be 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 being deployed as an independent program or being deployed as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0277] As an example, the executable instructions may or may not correspond to a file in the file system, and may be stored as a part of a file that stores other programs or data. For example, they may be stored in one or more scripts in a Hypertext Markup Language (HTML) document, stored in a single file dedicated to the program being discussed, or stored in multiple cooperating files (such as files that store one or more modules, subroutines, or code portions).
[0278] As an example, the executable instructions may be deployed to execute on one computing device, or on multiple computing devices located at one location, or on multiple computing devices distributed at multiple locations and interconnected by a communication network.
[0279] As described above, the above are only embodiments of the present application and are not used to limit the protection scope of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are all included in the protection scope of the present application.
Claims
1. An animation data processing method, characterized in that, Including: Obtain a reference animation file, reference movement information of a virtual object in the reference animation file, and a current destination of the virtual object, where the reference movement information at least includes a reference destination and a reference displacement distance; Create a first movement attribute, a second movement attribute, and a third movement attribute on the skeleton of the virtual object, and obtain setting information for the first movement attribute, the second movement attribute, and the third movement attribute to obtain an updated animation file; Import the updated animation file into an engine, and determine superimposed movement information of the virtual object relative to the reference movement information based on the interval distance between the reference destination and the current destination, the reference displacement distance, and the setting information; Determine target movement information of the virtual object based on the superimposed movement information and the reference movement information, and control the virtual object to move based on the target movement information; Import the updated animation file into an engine, and determine a first movement attribute value of a first movement curve corresponding to the first movement attribute based on the setting information; the superimposed movement information includes superimposed displacement information, and determining the superimposed movement information of the virtual object relative to the reference movement information based on the interval distance between the reference destination and the current destination, the reference displacement distance, and the setting information includes: determining an angle between a first movement trajectory and a second movement trajectory based on the interval distance and the reference displacement distance, where the first movement trajectory is the movement trajectory corresponding to the virtual object reaching the current destination, and the second movement trajectory is the movement trajectory corresponding to the virtual object reaching the reference destination; determining the superimposed displacement information of the skeleton of the virtual object based on the interval distance, the reference displacement distance, the first movement attribute value, and the angle.
2. The method according to claim 1, wherein The creating a first movement attribute, a second movement attribute, and a third movement attribute on the skeleton of the virtual object, and obtaining setting information for the first movement attribute, the second movement attribute, and the third movement attribute includes: Create a first movement attribute, a second movement attribute, and a third movement attribute on the skeleton of the virtual object through a plug-in; Obtain a first key frame corresponding to starting to depart, a second key frame corresponding to reaching the current destination, a third key frame corresponding to starting to return, and a fourth key frame corresponding to reaching the original position set through the plug-in; Determine the first key frame, the second key frame, the third key frame, and the fourth key frame as the setting information.
3. The method according to claim 2, characterized in that, The method further includes: Import the updated animation file into an engine, and determine a second movement attribute value of a second movement curve corresponding to the second movement attribute and a third movement attribute value of a third movement curve corresponding to the third movement attribute based on the setting information.
4. The method according to claim 3, characterized in that, The superimposed movement information further includes first superimposed rotation information and second superimposed rotation information, and determining the superimposed movement information of the virtual object relative to the reference movement information based on the interval distance between the reference destination and the current destination, the reference displacement distance, and the setting information includes: Obtain the reference rotation angle in the reference movement information, and determine the first superimposed rotation information of the capsule of the virtual object based on the reference rotation angle, the included angle, and the second movement attribute value; Determine the second superimposed rotation information of the skeleton based on the first superimposed rotation information of the capsule and the third movement attribute value.
5. The method according to claim 4, characterized in that, The determining the included angle between the first movement trajectory and the second movement trajectory based on the interval distance and the reference displacement distance includes: Determine the ratio of the interval distance to the reference displacement distance, wherein the line connecting the initial position of the virtual object and the reference destination is perpendicular to the line connecting the reference destination and the current destination; Determine the arctangent value of the ratio as the included angle between the first movement trajectory and the second movement trajectory.
6. The method according to claim 1, wherein The determining the superimposed displacement information of the skeleton of the virtual object based on the interval distance, the reference displacement distance, the first movement attribute value, and the included angle includes: Determine the first length based on the product of the reference displacement distance and the cosine value of the included angle; Determine the second length based on the reference displacement distance and the first length, where the reference displacement distance is the length of the hypotenuse of a right triangle, and the first length and the second length are the lengths of the right sides; Determine the superimposed displacement information of the skeleton in the roll angle direction based on the reference displacement distance, the first length, and the first movement attribute value; Determine the superimposed displacement information of the skeleton in the pitch angle direction based on the interval distance, the second length, and the first movement attribute value.
7. The method according to claim 6, characterized in that, The determining the superimposed displacement information of the skeleton in the pitch angle direction based on the interval distance, the second length, and the first movement attribute value includes: Determine the difference between the interval distance and the second length; Determine the superimposed displacement value of the skeleton in the pitch angle direction based on the difference and the first movement attribute value; Determine the first direction coefficient corresponding to the offset direction of the current destination relative to the reference destination; Determine the superimposed displacement information of the skeleton in the pitch angle direction based on the superimposed displacement value and the first direction coefficient.
8. The method according to claim 4, characterized in that, The determining the first superimposed rotation information of the capsule of the virtual object based on the reference rotation angle, the included angle, and the second movement attribute value includes: Combine the reference rotation angle and the included angle to obtain a combined rotation angle; Determine the first direction coefficient corresponding to the offset direction of the current destination relative to the reference destination; Determine the product of the combined rotation angle, the first direction coefficient, and the second movement attribute value as the first superimposed rotation information of the capsule.
9. The method according to claim 4, characterized in that, The determining the second superimposed rotation information of the skeleton based on the first superimposed rotation information of the capsule and the third movement attribute value includes: Obtain a preset second direction coefficient; Determine the product of the first superimposed rotation information, the second direction coefficient, and the third movement attribute value as the second superimposed rotation information.
10. The method according to claim 1, characterized in that The method further includes: Obtain the size information of the virtual object; Obtain the movement speed corresponding to the size information; Correspondingly, controlling the virtual object to move based on the target movement information includes: Controlling the virtual object to move based on the movement speed and the target movement information shown.
11. An animation data processing device, characterized in that, Including: A first acquisition module, configured to acquire a reference animation file, reference movement information of a virtual object in the reference animation file, and the current destination of the virtual object, where the reference movement information includes at least a reference destination and a reference displacement distance; A second acquisition module, configured to create a first movement attribute, a second movement attribute, and a third movement attribute on the skeleton of the virtual object, and acquire setting information for the first movement attribute, the second movement attribute, and the third movement attribute, to obtain an updated animation file; A first determination module, configured to import the updated animation file into the engine, and determine superimposed movement information of the virtual object relative to the reference movement information based on the distance between the reference destination and the current destination, the reference displacement distance, and the setting information; A second determination module, configured to determine the target movement information of the virtual object based on the superimposed movement information and the reference movement information, and control the virtual object to move based on the target movement information; A third determination module, configured to import the updated animation file into the engine, and determine a first movement attribute value of a first movement curve corresponding to the first movement attribute based on the setting information; The superimposed movement information includes superimposed displacement information, and the first determination module is further configured to: determine an included angle between a first movement trajectory and a second movement trajectory based on the distance between the reference destination and the current destination and the reference displacement distance, where the first movement trajectory is the movement trajectory corresponding to the virtual object reaching the current destination, and the second movement trajectory is the movement trajectory corresponding to the virtual object reaching the reference destination; determine the superimposed displacement information of the skeleton of the virtual object based on the distance between the reference destination and the current destination, the reference displacement distance, the first movement attribute value, and the included angle.
12. An animation data processing device, characterized in that, Including: A memory, configured to store executable instructions; A processor, configured to implement the method according to any one of claims 1 to 10 when executing the executable instructions stored in the memory.
13. A computer-readable storage medium, characterized in that, Stored with executable instructions, configured to implement the method according to any one of claims 1 to 10 when being executed by a processor.
Citation Information
Patent Citations
Method and system of automatic animation generation
US20220080318A1