Animation playing method and device, medium, electronic equipment and program product

By calculating and rendering motion trajectories in animation data, it solves the problem that animation resources cannot be adjusted in real time in complex scenes, realizes dynamic movement and effect adjustment of animation objects, and meets real-time rendering requirements.

CN118710779APending Publication Date: 2024-09-27BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410814627.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

Existing technology is difficult to meet the needs of real-time animation in complex scenes, and pre-produced animation resources cannot be dynamically adjusted to adapt to scene changes.

Method used

By determining the multi-frame key frames in the target animation data, calculating the motion trajectory, and rendering the animation frames according to the trajectory, real-time rendering and dynamic adjustment of the animation object moving along the trajectory are achieved.

Benefits of technology

It realizes the dynamic adjustment of animation effects in complex scenes, meets the needs of real-time rendering, and improves the flexibility and real-time performance of animation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118710779A
    Figure CN118710779A
Patent Text Reader

Abstract

The invention relates to an animation playing method and device, a medium, electronic equipment and a program product, and relates to the technical field of computers, and the method comprises the steps: determining target animation data which comprises a plurality of key frames, and obtaining a motion track formed by target position information corresponding to the plurality of key frames according to the target animation data; according to the motion trail and the animation object, multiple animation frames are obtained through rendering, the multiple animation frames are used for describing the motion of the animation object along the motion trail and displaying the multiple animation frames, the motion trail of the animation object can be indicated through multiple key frames, and therefore the corresponding animation effect can be obtained through real-time rendering. Moreover, the animation frame is rendered and generated through the target animation data, and the user can dynamically adjust the target position information in the key frame according to the requirement so as to modify the motion track of the animation object and obtain the animation effect meeting the requirement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular, to an animation playing method, device, medium, electronic device and program product. Background Art

[0002] In the related art, animation special effects are generally produced by animation production personnel in advance according to the needs. When the scene triggers the animation, the pre-produced animation resources are played in the scene. However, due to the complexity and changeability of the scene, the pre-produced animation resources cannot meet the needs of real-time scenes. Summary of the invention

[0003] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0004] In a first aspect, the present disclosure provides an animation playing method, comprising:

[0005] Determine target animation data, wherein the target animation data includes a plurality of key frames, and the key frames are used to record target position information of the animation object at the key frames;

[0006] According to the target animation data, a motion trajectory consisting of target position information corresponding to the multiple key frames is obtained;

[0007] Rendering to obtain a plurality of animation frames according to the motion trajectory and the animation object, wherein the plurality of animation frames are used to describe the motion of the animation object along the motion trajectory;

[0008] The plurality of animation frames are displayed.

[0009] In a second aspect, the present disclosure provides an animation playback device, comprising:

[0010] A determination module is configured to determine target animation data, wherein the target animation data includes a plurality of key frames, and the key frames are used to record target position information of the animation object at the key frames;

[0011] An acquisition module is configured to acquire, according to the target animation data, a motion trajectory formed by target position information corresponding to the multiple key frames;

[0012] A rendering module is configured to render and obtain a plurality of animation frames according to the motion trajectory and the animation object, wherein the plurality of animation frames are used to describe the motion of the animation object along the motion trajectory;

[0013] The display module is configured to display the multiple animation frames.

[0014] In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method described in the first aspect.

[0015] In a fourth aspect, the present disclosure provides an electronic device, including:

[0016] a storage device having a computer program stored thereon;

[0017] A processing device is used to execute the computer program in the storage device to implement the steps of the method described in the first aspect.

[0018] In a fifth aspect, the present disclosure provides a computer program product, including a computer program, which implements the steps of the method described in the first aspect when executed by a processor.

[0019] Based on the above technical solution, by determining the target animation data, wherein the target animation data includes multiple keyframes, the keyframes are used to record the target position information of the animation object at the keyframes, and according to the target animation data, a motion trajectory consisting of the target position information corresponding to the multiple keyframes is obtained, and according to the motion trajectory and the animation object, multiple animation frames are rendered to obtain multiple animation frames, wherein the multiple animation frames are used to describe the movement of the animation object along the motion trajectory, and multiple animation frames are displayed, and the motion trajectory of the animation object can be indicated by the multiple keyframes, so as to obtain the corresponding animation effect in real time. Moreover, by rendering and generating animation frames through the target animation data, the user can dynamically adjust the target position information in the keyframes according to the needs to modify the motion trajectory of the animation object and obtain the animation effect that meets the needs.

[0020] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings:

[0022] Figure 1 is a flow chart of an animation playing method according to some embodiments.

[0023] Figure 2 yes Figure 1 A detailed flow chart of step 120 is shown.

[0024] Figure 3 is a schematic diagram of a motion trajectory according to some embodiments.

[0025] Figure 4 is a schematic diagram of motion trajectories according to some further embodiments.

[0026] Figure 5 is a flowchart of animation playback according to some embodiments.

[0027] Figure 6 is a schematic diagram of an animation shown according to some embodiments.

[0028] Figure 7 is a schematic diagram of animation according to some other embodiments.

[0029] Figure 8 yes Figure 1 A detailed flow chart of step 130 is shown.

[0030] Fig. 9 is a schematic diagram showing animation effects according to some embodiments.

[0031] Fig.10 yes Figure 8 A detailed flow chart of step 850 is shown.

[0032] Fig.11 is a flowchart illustrating rendering animation frames according to some embodiments.

[0033] Fig.12 is a flowchart of obtaining target animation data according to some embodiments.

[0034] Fig.13 is a schematic diagram of an animation editing scene according to some embodiments.

[0035] Fig.14 is a schematic diagram showing how to obtain target animation data according to some embodiments.

[0036] Fig.15 is a schematic diagram of an animation playing system according to some embodiments.

[0037] Fig.16 It is a structural schematic diagram of an animation playback device according to some embodiments.

[0038] Fig.17 is a schematic diagram of the structure of an electronic device according to some embodiments. DETAILED DESCRIPTION

[0039] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0040] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0041] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0042] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0043] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0044] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0045] Figure 1 FIG. 1 is a flowchart of an animation playing method according to some embodiments. Figure 1 As shown, the embodiment of the present disclosure provides an animation playback method, which can be executed by an electronic device, specifically, by an animation playback device, which can be implemented by software and / or hardware and configured in the electronic device. Figure 1 As shown, the method may include the following steps.

[0046] In step 110, target animation data is determined, wherein the target animation data includes a plurality of key frames, and the key frames are used to record target position information of the animation object at the key frames.

[0047] Here, the target animation data is used to manage all the information and resources of the animation. In the disclosed embodiment, the target animation data includes multiple key frames, each key frame is used to record the target position information (position) of the animation object at the key frame. For example, if the time point of a key frame is 00:02, and the target position information corresponding to the key frame is (x, y, z), it means that the position of the animation object at the time point of 00:02 is (x, y, z).

[0048] It should be noted that the target position information can be a coordinate point in a three-dimensional space or a coordinate point in a two-dimensional space, depending on the virtual scene in which the animation is played. If the virtual scene in which the animation is played is a three-dimensional space, the corresponding target position information is a three-dimensional coordinate; if the virtual scene in which the animation is played is a two-dimensional space, the corresponding target position information is a two-dimensional coordinate. In other words, the animation playing method provided in the embodiments of the present disclosure can be used to play animations in a three-dimensional space or in a two-dimensional space.

[0049] Among them, a keyframe is a special frame that is used to record the state of an animation object at a certain point in time. The state may include the position, rotation, scale, color, transparency and other properties of the animation object. Animated Object refers to any game element or 3D model that needs to be animated.

[0050] It should be understood that the target animation data may be animation data pre-edited by an animation editor, and when the animation is triggered to play, the target animation data is obtained from the corresponding storage area.

[0051] In step 120, a motion trajectory consisting of target position information corresponding to multiple key frames is obtained according to the target animation data.

[0052] Here, since each key frame in the target animation data records the target position information of the animation object at that key frame, correspondingly, the position information of the intermediate frames between each pair of key frames can be calculated through an interpolation algorithm between multiple key frames, thereby obtaining a motion trajectory consisting of the target position information corresponding to multiple key frames.

[0053] That is to say, by connecting the target position information corresponding to multiple key frames and the position information of the intermediate frames obtained by interpolation, a motion trajectory corresponding to the animation object can be formed, indicating the movement of the animation object along the time axis.

[0054] It should be noted that in the embodiments of the present disclosure, the interpolation algorithm used can be determined according to the requirements. For example, the interpolation algorithm can be a linear interpolation algorithm, a spline interpolation algorithm, a Bezier curve interpolation algorithm, and the like.

[0055] In step 130, multiple animation frames are rendered according to the motion trajectory and the animation object.

[0056] Here, the animation object may be an object that needs to be dynamic, and the user may configure the corresponding animation object according to business needs. For example, in a live broadcast scene, the animation object may be a virtual gift sent. That is, after the user sends a virtual gift, the virtual gift may be controlled to display the corresponding animation effect.

[0057] The motion track can be applied to the animation object to control the animation object to move along the motion track to obtain multiple animation frames.

[0058] Among them, the multiple animation frames are used to describe the motion of the animation object along the motion trajectory. That is, in the user's vision, through the continuous multiple animation frames, the animation object moves along the motion trajectory formed by the multiple key frames.

[0059] It is worth noting that in the process of rendering and generating animation frames, for each animation frame, the target position information corresponding to the animation object at the animation frame can be determined through the motion trajectory, and then the current state of the animation object at the animation frame is updated to ensure that the animation object moves smoothly along the motion trajectory. Then, according to the current state of the animation object, the rendering operation is performed to obtain the corresponding animation frame.

[0060] In step 140 , a plurality of animation frames are displayed.

[0061] Here, after rendering and generating the animation frame, the animation frame is displayed to show the animation effect of the animation object moving along the motion trajectory.

[0062] It should be noted that when a frame of animation is obtained by rendering, the frame of animation can be displayed. That is to say, each frame of animation generated by rendering can be displayed immediately to ensure the real-time performance of the animation.

[0063] Thus, by determining the target animation data, wherein the target animation data includes multiple keyframes, the keyframes are used to record the target position information of the animation object at the keyframes, and according to the target animation data, a motion trajectory consisting of the target position information corresponding to the multiple keyframes is obtained, and according to the motion trajectory and the animation object, multiple animation frames are rendered to obtain multiple animation frames, wherein the multiple animation frames are used to describe the movement of the animation object along the motion trajectory, and multiple animation frames are displayed, and the motion trajectory of the animation object can be indicated by the multiple keyframes, so as to obtain the corresponding animation effect in real time. Moreover, by rendering and generating animation frames through the target animation data, the user can dynamically adjust the target position information in the keyframes according to the needs to modify the motion trajectory of the animation object and obtain the animation effect that meets the needs.

[0064] In some feasible implementations, the target animation data further includes indication information for indicating that the relative position between the target position information corresponding to at least one key frame and the element node in the virtual scene is the target relative position.

[0065] The element node in the virtual scene may be an element in the virtual scene. For example, if the virtual scene is a game scene, the element node may be a game character, a character avatar, or other element in the game scene. For another example, if the virtual scene is a page (such as a live broadcast page), the element node may be an avatar, a graphic, a text, or other element in the page.

[0066] In the case where the target animation data includes indication information, it indicates that at least one key frame among the multiple key frames in the target animation data is bound to an element node in the virtual scene, and the relative position between the at least one key frame and the element node is the target relative position. When the position of the element node in the virtual scene changes, the target position information of the at least one key frame bound to the element node needs to be adjusted accordingly, so that the relative position between the element node and the at least one key frame remains the target relative position.

[0067] It should be understood that the user can indicate the element node to which at least one key frame needs to be bound through the animation editor, and determine the target relative position by adjusting the relative position between the element node and the bound key frame in the animation editor. When the animation editor outputs the target animation data, the target relative position between the at least one key frame and the bound element node is described through the above indication information.

[0068] Exemplarily, each element node in the virtual scene may have a corresponding unique identifier, and the unique identifier corresponding to the element node bound to at least one key frame may be stored in a field of the target animation data.

[0069] It should be noted that in the disclosed embodiment, different key frames in the target animation data can be bound to different element nodes. For example, if there are multiple avatars in a virtual scene, if it is necessary to realize an animation effect in which the animation object rotates around the multiple avatars, each avatar can be bound to a different key frame.

[0070] Figure 2 yes Figure 1 Detailed flow chart of step 120 is shown. Figure 2 As shown, accordingly, in some practicable implementations, step 120 may include the following steps.

[0071] In step 121, in response to the target animation data including indication information, node position information of the element node in the virtual scene is obtained.

[0072] Here, when the target animation data includes the above-mentioned indication information, it means that there is at least one key frame among the multiple key frames in the target animation data that is bound to an element node in the virtual scene, and the relative position between the at least one key frame and the element node in the virtual scene is the target relative position. Since the target relative position remains unchanged, when the position of the element node in the virtual scene changes, the target position information of at least one key frame associated with the element node will also change, and accordingly, the motion trajectory of the animation object will also be found to change.

[0073] Therefore, when the target animation data includes indication information, the node position information of the element node in the virtual scene can be obtained. The node position information is the coordinate information of the element node in the virtual scene. It should be noted that the node position information of the element node in the virtual scene can be dynamically changed.

[0074] Exemplarily, the node position information corresponding to the element node may be found out according to the unique identifier corresponding to the element node bound to at least one key frame.

[0075] In step 122, the target position information corresponding to at least one key frame is adjusted according to the node position information and the target relative position to obtain the adjusted target position information.

[0076] Here, since the relative position between the control node corresponding to at least one key frame bound to the element node and the element node in the virtual scene is maintained as the target relative position, when the node position information of the element node and the target relative position are known, the target position information corresponding to at least one key frame can be adjusted to obtain the adjusted target position information.

[0077] The adjusted target position information is used to make the relative position between the adjusted target position information and the element node be the target relative position.

[0078] That is to say, since the relative position between the control node corresponding to at least one key frame bound to the element node and the element node in the virtual scene is maintained as the target relative position, if the node position information of the element node in the virtual scene changes while the target relative position remains unchanged, the target position information of the control node can be adjusted accordingly to ensure that the relative position between the control node and the element node always remains at the target relative position.

[0079] In step 123, a motion trajectory is obtained based on the adjusted target position information.

[0080] Here, obtaining the adjusted target position information can be understood as obtaining new target animation data, and then generating a motion trajectory corresponding to the animation object based on each key frame in the new target animation data, and then generating multiple animation frames through the motion trajectory.

[0081] Figure 3 is a schematic diagram showing a motion trajectory according to some embodiments. Figure 3 As shown, the motion trajectory of the animation object 308 is formed by the first control node 301, the second control node 302, the third control node 303, the fourth control node 304, the fifth control node 305 and the sixth control node 306, and the second control node 302, the third control node 303, the fourth control node 304, the fifth control node 305 and the sixth control node 306 are associated with the element node 307 (that is, the relative positions between the second control node 302, the third control node 303, the fourth control node 304, the fifth control node 305, the sixth control node 306 and the element node 307 are as shown in FIG. Figure 3 shown).

[0082] Figure 4 is a schematic diagram of a motion trajectory according to some other embodiments. Figure 4 As shown, when the position of element node 307 changes (by Figure 3 The position changes to Figure 4 Since the relative positions between the second control node 302, the third control node 303, the fourth control node 304, the fifth control node 305, the sixth control node 306 and the element node 307 are maintained as the target relative positions, the position information of the second control node 302, the third control node 303, the fourth control node 304, the fifth control node 305, the sixth control node 306 needs to be changed from Figure 3 Adjust to Figure 4 As shown, the position information of the first control node 301 remains unchanged. Accordingly, the motion trajectory of the animation object 308 changes (by Figure 3 The motion trajectory of Figure 4 motion trajectory shown).

[0083] Thus, through the above steps 121 to 123, the motion trajectory of the animation object can be changed according to the real-time element node position of the element node in the virtual scene, so that real-time dynamic trajectory changes can be achieved without the user manually editing the target position information of the key frame in the target animation data. For example, in a virtual live broadcast room, different users send virtual gifts. Since the positions of different users' avatars in the live broadcast room page are different, the motion trajectory of the animation object can be changed according to the real-time positions of different users' avatars to achieve the animation effect of the animation object rotating around the user's avatar. In other words, when playing the animation, the motion trajectory of the animation object can be dynamically adjusted through the node position information of the element node, which is more flexible.

[0084] Figure 5 FIG. 4 is a flowchart of animation playback according to some embodiments. Figure 5 As shown, in response to receiving an animation play instruction, the target animation data is loaded, and it is determined whether there is a key frame of the associated element node in the target animation data. If there is no key frame of the associated element node, the animation frame is played based on the loaded target animation data. In the case of a key frame of the associated element node, the node position information corresponding to the element node is obtained, and the target position information of the associated key frame is adjusted according to the obtained node position information, new target animation data is generated, and then the animation frame is played based on the new target animation data. Moreover, when playing the animation frame, it is dynamically detected whether the element node moves. If it moves, the target animation data is reloaded and the new node position information is obtained.

[0085] In some embodiments, the virtual scene may include a live broadcast room page, and the element node may include an avatar of the target account in the live broadcast room page.

[0086] The target account is the first account that sends the virtual gift or the second account that receives the virtual gift. In other words, the element node can be the avatar corresponding to the first account that sends the virtual gift in the live broadcast room page or the second account that receives the virtual gift in the live broadcast room page. Correspondingly, the animation object can be the virtual gift. Of course, the animation object can also be other animation elements, such as a three-dimensional model.

[0087] Through the above implementation, the motion trajectory of the animation object can be associated with the avatar of the first account that sends the virtual gift or the avatar of the second account that receives the virtual gift, thereby dynamically generating different relative runs of the same trajectory, allowing the animation object to move and rotate along different avatars.

[0088] Figure 6 is a schematic diagram of an animation according to some embodiments. Figure 6As shown, in the live broadcast room page, the element node 601 is located at the first position, and the animation object 602 moves and rotates around the element node 601. Figure 7 is a schematic diagram of an animation according to some other embodiments. Figure 7 As shown, element node 601 is from Figure 6 The first position shown is moved to Figure 7 The second position is shown, and accordingly, the motion trajectory of the animation object 602 changes.

[0089] In the disclosed embodiment, the motion trajectory of the animation object can be obtained based on the node position information corresponding to the element nodes in the virtual scene and the target animation data, and then in response to the animation playback instruction, multiple animation frames are rendered and generated based on the motion trajectory of the animation object, and the multiple animation frames are displayed, wherein the multiple animation frames are used to describe the movement of the animation object along the motion trajectory.

[0090] Exemplarily, node position information corresponding to an element node in a virtual scene can be obtained, wherein the element node is an element in the virtual scene associated with at least one key frame in the target animation data, and then based on the node position information, the target position information of at least one key frame associated with the element node in the target animation data is adjusted to obtain the adjusted target animation data, and then based on the adjusted target animation data, the motion trajectory corresponding to the animation object is obtained, and based on the motion trajectory and the animation object, multiple animation frames are rendered to obtain, and the multiple animation frames are displayed.

[0091] In some feasible implementations, element nodes can be obtained from a virtual scene, and multiple animation frames can be rendered according to motion trajectories, element nodes, and animation objects, and then multiple animation frames can be displayed by superimposing an animation playback layer on the upper layer of the virtual scene.

[0092] Here, obtaining the element node from the virtual scene may be obtaining a real-time image corresponding to the element node, and then rendering to obtain multiple animation frames based on the motion trajectory, the element node, and the animation object.

[0093] The animation playback layer may be a video playback layer superimposed on the upper layer of the virtual scene. Displaying the animation frames through the animation playback layer is actually to superimpose and display a layer of animation effects including multiple animation frames on the virtual scene.

[0094] like Figure 6As shown, the animation playback layer is superimposed on the upper layer of the live broadcast room page, and the real-time image of the element node 601 in the live broadcast room page can be obtained, and the animation frame is obtained through the motion trajectory, the real-time image of the element node 601 and the animation object 602, and then the animation frame is superimposed and displayed on the upper layer of the live broadcast room page, so as to realize the animation playback on the live broadcast room page, and the animation can interact with the element nodes in the live broadcast room page.

[0095] In some practicable implementations, the target animation data may further include rotation parameters for controlling the rotation of the animation object, and the rotation parameters may include the desired upward direction of the animation object, the initial facing direction of the animation object, and the desired facing direction of the animation object.

[0096] Here, the rotation parameter is a parameter used to control the rotation of the animation object, which determines the rotation angle of the animation object when it moves along the motion trajectory.

[0097] The desired UpInWorld of an animated object is the desired vertical alignment of the object. The desired UpInWorld is used to control the "up" direction of the animated object to be consistent with the desired direction when the object is rotated or transformed, which helps to maintain the correct posture of the animated object in space. Generally speaking, the desired UpInWorld can be the direction of gravity.

[0098] The initial direction of the animation object refers to the actual direction of the animation object before the animation is played. The initial direction can be understood as the initial direction of the animation object during the art production process of the animation object. Figure 3 As shown, the initial direction of the animation object 308 is toward the outside of the screen.

[0099] The initial desired direction of the animation object refers to the specific direction that the animation object is expected to face before the animation starts. Figure 3 As shown, the initial direction of the animation object 308 is toward the outside of the screen, and the expected direction may be that the animation object 308 is expected to move from the outside of the screen to the inside of the screen.

[0100] It should be noted that the initial orientation direction of the animation object is the starting point of the animation frame sequence, and the desired orientation direction of the animation object is the target direction at the beginning of the animation frame sequence.

[0101] Exemplarily, a user can add an automatic rotation component to an animation object in an animation editor, and configure the rotation parameters of the animation object's desired upward direction, the animation object's initial facing direction, and the animation object's desired facing direction through the automatic rotation component, so as to instruct the animation object to perform a rotation operation on the animation object through the desired upward direction, the initial facing direction, and the desired facing direction while the animation object moves along the motion trajectory.

[0102] Figure 8 yes Figure 1 Detailed flow chart of step 130 is shown. Figure 8 As shown, step 130 may include the following steps.

[0103] In step 810, when the currently rendered animation frame is the first animation frame, first position information of the animation object at the first animation frame is obtained according to the motion trajectory.

[0104] Here, the first animation frame is the first animation frame corresponding to the target animation data, that is, the first animation frame is the first animation frame in a sequence of multiple animation frames.

[0105] When rendering the first animation frame, the first position information of the animation object in the first animation frame can be determined through the motion trajectory. The motion trajectory reflects the position information of the animation object at different time points, and the first position information of the animation object at the time point corresponding to the first animation frame can be obtained through the motion trajectory.

[0106] In step 820, a first animation frame is rendered according to the first position information and the animation object.

[0107] Here, the animation object may be rendered according to the first position information to obtain a first animation frame, wherein the animation effect corresponding to the first animation frame may be understood as the animation object appearing in the spatial position corresponding to the first position information.

[0108] In step 830, when the currently rendered animation frame is the second animation frame, second position information of the animation object at the second animation frame is obtained according to the motion trajectory.

[0109] Here, the second animation frame is an animation frame other than the first animation frame in the target animation data. In other words, the second animation frame is an animation frame other than the first animation frame in a sequence of multiple animation frames.

[0110] When rendering the second animation frame, the second position information of the animation object in the second animation frame can be determined through the motion trajectory. The motion trajectory reflects the position information of the animation object at different time points, and the second position information of the animation object at the time point corresponding to the second animation frame can be obtained through the motion trajectory.

[0111] In step 840, the current movement direction of the animation object is obtained according to the second position information corresponding to the second animation frame and the third position information corresponding to the previous animation frame.

[0112] Here, the previous animation frame refers to the previous animation frame of the second animation frame, for example, the previous animation frame of the second animation frame is the first animation frame. The third position information corresponding to the previous animation frame can be obtained through the motion trajectory when rendering the previous animation frame.

[0113] Exemplarily, the current moving direction of the animation object may be obtained according to the difference between the second position information and the third position information.

[0114] The current movement direction (forwardInWorld) of the animation object is a direction vector, which indicates the change of the movement direction of the animation object relative to the previous animation frame, thereby reflecting the forward direction of the animation object.

[0115] In step 850, a target rotation angle is obtained according to the current movement direction, the desired upward direction, the initial facing direction, and the desired facing direction.

[0116] Here, the target rotation angle can be understood as a rotation quaternion. The target rotation angle is used to enable the animation object to move toward the desired direction and maintain the desired upward direction.

[0117] For example, in character animation, the character may be required to face a specific direction (desired facing direction) while maintaining vertical alignment of its head or upper body (desired upward direction) to achieve natural and realistic movements. The target rotation angle can make the character face the desired facing direction and maintain the desired upward direction while moving in the current direction of movement.

[0118] A target rotation angle can be calculated by the current movement direction, the desired upward direction, the initial facing direction and the desired facing direction. After the target rotation angle is applied to the animation object, the animation object can move toward the desired facing direction and maintain the desired upward direction.

[0119] In step 860, a second animation frame is rendered according to the second position information, the target rotation angle, and the animation object.

[0120] Here, after obtaining the second position information and the target rotation angle, the second position information and the target rotation angle are applied to the animation object, and the corresponding second animation frame is rendered and generated. The animation effect corresponding to the second animation frame can be understood as the animation object appears at the spatial position corresponding to the second position information and rotates according to the target rotation angle.

[0121] In some embodiments, the target rotation angle of the second animation frame and the target rotation angle corresponding to the previous animation frame can be interpolated according to the time interval between two adjacent animation frames to obtain multiple rotation angles, and then the animation frame is rendered based on the second position information, multiple rotation angles and the animation object.

[0122] The time interval between two adjacent animation frames can be determined according to the frame rate of the animation. By interpolating the target rotation angle of the second animation frame and the target rotation angle corresponding to the previous animation frame in the time interval between two adjacent animation frames, multiple rotation angles can be interpolated. Then, the multiple rotation angles obtained by interpolation are applied to the animation object to make the rotation of the animation object between frames more natural and smooth.

[0123] Therefore, through the above steps 810 to 860, the animation object can move in the desired direction and maintain the desired upward direction while moving along the motion trajectory, thereby making the posture of the animation object more realistic and natural, and obtaining an animation effect with better visual effects.

[0124] It should be noted that when the animation object moves along the motion trajectory, the animation object will not rotate dynamically along the motion trajectory, resulting in a lack of dynamic feeling in the animation effect. For example, when a person is running normally, the front of the person is always moving forward. In the relevant animation production process, developers are often required to manually set the rotation direction of the animation object at different time points so that the animation object can face forward as the motion trajectory changes. However, this animation production method is relatively cumbersome, resulting in a sharp increase in animation costs.

[0125] Through the animation playback method provided by the embodiment of the present disclosure, during the movement of the animation object, the target rotation angle of the animation object in each frame of the animation is calculated through the position of the animation object in the animation frame, the specified desired upward direction, the specified initial direction and the desired direction, and the calculated target rotation angle is applied to the animation object. The rotation angle can be adjusted at any time as the motion trajectory changes, so that the direction of the animation object can always face forward and maintain the desired upward direction.

[0126] Fig. 9is a schematic diagram of an animation effect according to some embodiments. Fig. 9 As shown, the animation object 901 can always maintain a posture consistent with the real world during the process of rotating around the element node 902, so that the animation effect is more natural and realistic.

[0127] Fig.10 yes Figure 8 Detailed flowchart of step 850 is shown. Fig.10 As shown, step 850 may include the following steps.

[0128] In step 851, an initial rotation angle is obtained according to the current movement direction and the desired upward direction.

[0129] Here, the initial rotation angle is used to enable the animation object to maintain the desired upward direction while moving toward the desired direction.

[0130] In some embodiments, a first rotation quaternion for rotating a default heading vector to the current direction of movement can be determined based on a default heading vector in a world coordinate system and a current direction of movement, a right side vector can be obtained based on a cross product of the current direction of movement and a desired upward direction, a new desired upward direction can be obtained based on a cross product of the right side vector and the current direction of movement, a rotated upward vector can be obtained based on the first rotation quaternion and the default upward vector in the world coordinate system, a second rotation quaternion can be obtained based on the rotated upward vector and the new desired upward direction, and then an initial rotation angle can be obtained based on the first rotation quaternion and the second rotation quaternion.

[0131] The world coordinate system may refer to a coordinate system in a virtual scene, and the default heading vector in the world coordinate system refers to a vector indicating a heading in the world coordinate system. Generally, in a three-dimensional space, the default heading vector may be (0, 0, 1). The first rotation quaternion is a rotation quaternion required to rotate the default heading vector to the current direction of motion.

[0132] For example, the first rotation quaternion can be calculated by the function const rotateForwardToDesiredForward=newQuaternion().setFromUnitVectors(UpVector.FORWARD, forwardInWorld), wherein rotateForwardToDesiredForward is the first rotation quaternion, UpVector.FORWARD is the default orientation vector, and forwardInWorld is the current movement direction.

[0133] By calculating the cross product of the current moving direction and the desired upward direction, the right vector (rightInWorld) is obtained. The right vector is actually a vector perpendicular to the current moving direction and the desired upward direction.

[0134] The new desired upward direction obtained by the cross product of the right vector and the current direction of motion is equivalent to a vertical vector on the plane of the current direction of motion.

[0135] The default up vector in the world coordinate system refers to a vector indicating the upward direction in the world coordinate system. Generally, the default up vector in three-dimensional space can be represented as (0, 1, 0). By applying the first rotation quaternion to the default up vector in the world coordinate system, the default up vector in the world coordinate system can be rotated to obtain the rotated up vector.

[0136] The second rotation quaternion is the rotation quaternion needed to rotate from the rotated up vector to the new desired up direction.

[0137] Then, an initial rotation angle is calculated by using the first rotation quaternion and the second rotation quaternion, wherein the initial rotation angle indicates that the animation object can rotate toward a given current motion direction and a desired upward direction.

[0138] For example, the initial rotation angle may be obtained according to the product of the first rotation quaternion and the second rotation quaternion. The initial rotation angle may also be understood as a rotation quaternion.

[0139] Based on this, the initial rotation angle of the animation object can be accurately calculated, so as to accurately control the posture of the animation object during movement and achieve natural and realistic animation effects.

[0140] In step 852, an initial rotation offset is obtained according to the initial orientation direction and the desired orientation direction.

[0141] Here, the initial rotation offset is the rotation angle used to rotate the initial orientation to the desired orientation. For example, assuming that the initial orientation of the animation object is the front facing out of the screen, and the desired orientation is the front facing in of the animation object, the initial rotation offset is used to rotate the animation object from the front facing out of the screen to the front facing in of the screen.

[0142] It should be noted that for each animation frame, the corresponding initial rotation offset is unchanged and can be calculated through the initial orientation direction and the desired orientation direction.

[0143] In step 853, a target rotation angle is obtained according to the initial rotation angle and the initial rotation offset.

[0144] Here, the initial rotation angle and the initial rotation offset may be superimposed to obtain the target rotation angle.

[0145] It is worth noting that by superimposing the initial rotation offset, the animation object can be made to move in the specified desired direction.

[0146] Therefore, through the above steps 851 to 853, the target rotation angle of the animation object can be accurately calculated, so that the animation object can move towards the desired direction and maintain the desired upward direction, achieving a more realistic and natural animation effect.

[0147] Fig.11 FIG. 4 is a flowchart of rendering an animation frame according to some embodiments. Fig.11 As shown, when playing the animation, whether the rotation is turned on is detected by detecting whether the target animation data indicates that the animation object is rotated. If the rotation is not turned on, the animation frame rendering and display of the animation frame are directly performed through the above embodiment. When the rotation is turned on, it is further determined whether the current animation frame rendered is the first animation frame. When it is determined that it is the first animation frame, the original rotation angle of the animation object is recorded, and the second position information of the current frame is recorded as the third position information of the previous frame of the next frame. Among them, the original rotation angle of the animation object refers to the rotation angle of the animation object in the original state, such as the original rotation angle can be 0. By recording the original rotation angle of the animation object, the animation object can be reset by the original rotation angle of the animation object after the animation playback is finished, in preparation for the next animation playback.

[0148] When it is determined that the current frame is not the first animation frame, the second position information of the current frame and the third position information of the previous frame are obtained, the second position information is subtracted from the third position information to obtain the current direction of movement, the initial rotation angle is calculated according to the current direction of movement and the expected upward direction, the initial rotation offset is calculated according to the initial facing direction and the expected facing direction, the initial rotation angle is superimposed with the initial rotation offset to obtain the target rotation angle. Then, the target rotation angle of the previous frame and the target rotation angle of the current frame are interpolated, and the interpolation result is assigned to the animation object, and the current animation frame is rendered and generated. Next, the second position information of the current frame is recorded as the third position information of the previous frame of the next frame, and it is determined whether the animation is over. If the animation is not over, the animation frame is continued to be rendered. If the animation is over, the entire animation playback process is completed.

[0149] Fig.12 FIG. 4 is a flowchart of obtaining target animation data according to some embodiments. Fig.12 As shown, in some practicable implementations, the target animation data may be obtained through the following steps.

[0150] In step 1210, original animation data is obtained.

[0151] Here, the original animation data includes multiple key frames, and the key frames are used to record the initial position information of the animation object at the key frames. Exemplarily, the original animation data can be obtained from an animation editor or a storage area of ​​animation data.

[0152] It should be noted that the concepts of original animation data and target animation data are consistent. When the target position information of a key frame in target animation data needs to be adjusted, the target animation data is equivalent to the original animation data. Of course, the original animation data can be the animation data corresponding to the animation that needs to be edited again. For example, when the motion trajectory of an animation that has been produced needs to be modified, the animation data corresponding to the animation is the original animation data.

[0153] In the embodiment of the present disclosure, the original animation data may be any animation data carrying multiple key frames. For example, the original animation data may be animation data edited by the Unity engine.

[0154] In step 1220, based on the original animation data, the control nodes corresponding to the initial position information of the key frames and the motion tracks of the animation objects formed by the control nodes are displayed in the animation editing scene.

[0155] Here, the animation editing scene can be a scene in an animation editor, that is, the control node and the motion track are displayed through the animation editor. In the animation editing scene, where the control node corresponding to the key frame is displayed depends on the initial position information corresponding to the key frame. When the position of the displayed control node changes, the initial position information of the animation object recorded by the key frame at the key frame will also change.

[0156] After obtaining the original animation data, the control nodes corresponding to the key frames and the motion tracks formed by the control nodes can be displayed in the world coordinate system corresponding to the animation editing scene, so that the user can intuitively adjust the motion track of the animation object according to the displayed motion track and control nodes.

[0157] Each key frame corresponds to a control node, and the position information of the control node in the animation editing scene is the corresponding initial position information. The motion trajectory formed by the control nodes can refer to a line formed by the control nodes corresponding to multiple key frames. For example, the line can be a spline, a Bezier curve, etc.

[0158] It should be understood that the displayed motion trajectory formed by the control nodes can be obtained by interpolating the initial position information corresponding to multiple key frames.

[0159] Since each key frame in the original animation data records the initial position information of the animation object at the key frame, the position information of the intermediate frames between each key frame can be calculated through an interpolation algorithm between multiple key frames, thereby obtaining the motion trajectory composed of the initial position information corresponding to the multiple key frames.

[0160] That is to say, by connecting the initial position information corresponding to multiple key frames and the position information of the intermediate frames obtained by interpolation, a motion trajectory corresponding to the animation object can be formed, indicating the movement of the animation object along the time axis.

[0161] It should be noted that in the embodiments of the present disclosure, the interpolation algorithm used can be determined according to the requirements. For example, the interpolation algorithm can be a linear interpolation algorithm, a spline interpolation algorithm, a Bezier curve interpolation algorithm, and the like.

[0162] Fig.13 FIG. 1 is a schematic diagram of an animation editing scene according to some embodiments. Fig.13 As shown, in the animation editing scene 1300, the first key frame 1311, the second key frame 1312, the fourth key frame 1313, the fourth key frame 1314, the fifth key frame 1315, and the sixth key frame 1316 are displayed through the timeline 1310. And in the animation editing scene 1300, the animation object 1307, the first control node 1301, the second control node 1302, the third control node 1303, the fourth control node 1304, the fifth control node 1305, and the sixth control node 1306 are displayed, and the motion track 1317 formed by the first control node 1301, the second control node 1302, the third control node 1303, the fourth control node 1304, the fifth control node 1305, and the sixth control node 1306 are displayed. Among them, the first control node 1301 is the control node corresponding to the first key frame 1311, the second control node 1302 is the control node corresponding to the second key frame 1312, the third control node 1303 is the control node corresponding to the third key frame 1313, the fourth control node 1304 is the control node corresponding to the fourth key frame 1314, the fifth control node 1305 is the control node corresponding to the fifth key frame 1315, and the sixth control node 1306 is the control node corresponding to the sixth key frame 1316.

[0163] It should be noted that, in the animation editing scene 1300 , the corresponding virtual scene 1309 and the virtual nodes 1308 in the animation editing scene 1300 mapped to the element nodes in the virtual scene 1309 can also be displayed.

[0164] In step 1230, in response to the first adjustment operation on the control node, the initial position information of the key frame corresponding to the control node is adjusted to obtain target animation data.

[0165] here,

[0166] The first adjustment operation for the control node is used to adjust the initial position information corresponding to the control node. By adjusting the control node, the position information of the control node is changed from the initial position information to the adjusted target position information.

[0167] Exemplarily, the first adjustment operation may be a drag operation on a control node. The user may adjust the corresponding initial position information by dragging the control node to be adjusted, so as to adjust the motion trajectory of the animation object.

[0168] For example, the user can drag Fig.13 The first control node 1301 shown adjusts the initial position information corresponding to the first key frame 1311 .

[0169] It should be understood that if the motion trajectory is a Bezier curve, the control node is controlled by two operating points of the Bezier curve, and the user can adjust the corresponding control node by dragging the operating point.

[0170] It is worth noting that after adjusting the original animation data through the above first adjustment operation, the target animation data can be obtained. After the target animation data is obtained, the target animation data can be stored over the original animation data so as to play the animation through the target animation data.

[0171] Thus, by acquiring the original animation data, displaying the control nodes corresponding to the initial position information of the key frames and the motion trajectory of the animation objects formed by the control nodes in the animation editing scene according to the original animation data, and adjusting the initial position information of the key frames corresponding to the control nodes in response to the first adjustment operation on the control nodes, the target animation data is obtained, the motion trajectory of the animation objects can be viewed intuitively, and the motion trajectory of the animation objects can be adjusted by adjusting the control nodes, so as to edit the animation data intuitively and quickly and improve the efficiency of animation production. Based on this, the original animation data can be rendered as the motion trajectory formed by the control nodes, and the motion trajectory of the animation objects can be adjusted by dragging the control nodes of the motion trajectory in the animation editing scene, so as to intuitively, clearly and conveniently adjust the animation effect of the animation, which can not only greatly improve the efficiency of animation production, but also does not require animators to spend a large learning cost.

[0172] In some feasible implementations, key frames and animation objects may be displayed in the animation editing scene, and in response to a second adjustment operation on the key frames, the time points corresponding to the key frames may be adjusted to obtain target animation data.

[0173] Here, if Fig.13 As shown, in the animation editing scene 1300, the first key frame 1311, the second key frame 1312, the third key frame 1313, the fourth key frame 1314, the fifth key frame 1315, and the sixth key frame 1316 can be displayed through the timeline 1310. In addition, in the animation editing scene 1300, the animation object 1307 is displayed to show the user the position of the animation object 1307 in the animation editing scene.

[0174] The second adjustment operation for the key frame is used to adjust the time point corresponding to the key frame. For example, the second adjustment operation can be a drag operation for the key frame, and the user can adjust the time point of the key frame to be adjusted by dragging the key frame to be adjusted. Fig.13 The first key frame 1311 is shown to adjust the time point corresponding to the first key frame 1311.

[0175] It should be noted that, when the time point of a key frame is adjusted through the second adjustment operation, what is changed is the time point corresponding to the key frame, and the initial position information corresponding to the key frame does not change.

[0176] It is worth noting that after adjusting the original animation data through the second adjustment operation, the target animation data can be obtained. After the target animation data is obtained, the target animation data can be stored over the original animation data so as to play the animation through the target animation data.

[0177] It should be noted that during an animation editing process, the user can adjust the time point corresponding to the key frame, or adjust the initial position information corresponding to the key frame to obtain the target animation data. In other words, the operation of adjusting the time point of the key frame and the operation of adjusting the control point can be performed separately or simultaneously during an animation editing process.

[0178] Therefore, through the above second adjustment operation, the motion trajectory of the animation object can be intuitively viewed, and the animation effect can be adjusted by adjusting the time point of the key frame.

[0179] Fig.14 FIG. 1 is a schematic diagram showing how to obtain target animation data according to some embodiments. Fig.14 As shown, the original animation data can be obtained, the key frames and motion trajectories included in the original animation data can be rendered, the key frames and / or control nodes can be adjusted, and it can be determined whether to modify the initial position information of the control nodes. If not modified, the motion trajectory and the control nodes remain unchanged. If modified, the original animation data is updated.

[0180] In some feasible implementations, the original animation data may further include indication information for indicating that the relative position between the initial position information corresponding to at least one key frame and the element node in the virtual scene is the target relative position.

[0181] Here, the conceptual meaning of the indication information included in the original animation data is consistent with the indication information in the target animation data described in the above embodiment. Please refer to the relevant description of the above embodiment, and no further details will be given here.

[0182] Accordingly,

[0183] In the animation editing scene, the element node can be mapped to a virtual node in the animation editing scene, and in response to a third adjustment operation on the virtual node, the initial position information corresponding to at least one key frame associated with the virtual node is adjusted according to the adjusted position information of the virtual node and the target relative position to obtain the target animation data.

[0184] Here, the virtual node mapped to the element node in the animation editing scene may refer to the node mapped to the element node in the virtual scene in the animation editing scene. Fig.13 As shown, a virtual scene 1309 and corresponding virtual nodes 1308 may be displayed in the animation editing scene 1300 .

[0185] In some embodiments, in an animation editing scene, when displaying a virtual node mapped to an element node in the animation editing scene, at least one key frame associated with the virtual node may be highlighted. For example, at least one key frame associated with the virtual node may be represented by different colors so that animators can quickly understand the key frames bound to the virtual node.

[0186] It should be noted that, in the animation editing scene, the display position of the virtual node may be related to the position information of the element node in the virtual scene.

[0187] Accordingly, in response to the third adjustment operation on the virtual node, the initial position information corresponding to at least one key frame associated with the virtual node may be adjusted according to the adjusted position information of the virtual node and the target relative position to obtain target animation data.

[0188] The third adjustment operation for the virtual node may be a drag operation for the virtual node. The user may adjust the position of the virtual node by dragging the virtual node in the animation editing scene.

[0189] Since the above-mentioned indication information is actually used to indicate that the control node corresponding to at least one key frame is bound to the virtual node, and the relative position between the control node and the virtual node after binding always remains at the target relative position, when the position information of the virtual node changes, the initial position information corresponding to at least one key frame associated with the virtual node can be adjusted so that the relative position between the adjusted control node and the virtual node remains at the target relative position.

[0190] For example, Fig.13 As shown, the second control node 1302, the third control node 1303, the fourth control node 1304, the fifth control node 1305, and the sixth control node 1306 are all bound to the virtual node 1308, that is, the relative positions between the second control node 1302, the third control node 1303, the fourth control node 1304, the fifth control node 1305, and the sixth control node 1306 and the virtual node 1308 are always maintained as the target relative position. When the virtual node 1308 is dragged, the positions of the second control node 1302, the third control node 1303, the fourth control node 1304, the fifth control node 1305, and the sixth control node 1306 also change accordingly, so that the initial position information of the key frames corresponding to the second control node 1302, the third control node 1303, the fourth control node 1304, the fifth control node 1305, and the sixth control node 1306 change.

[0191] Therefore, through the above implementation, the initial position information of the key frame associated with the virtual node can be adjusted by adjusting the virtual node, so as to quickly adjust the motion trajectory of the animation object.

[0192] It should be noted that the original animation data described in the above embodiment may be obtained by the user through editing with an animation editor.

[0193] In some feasible implementations, multiple keyframes can be created in an animation editing scene in response to animation editing instructions, and corresponding initial position information can be configured for each keyframe. The control nodes corresponding to the created keyframes and the motion trajectories formed by the control nodes can be displayed in the animation editing scene, and then the original animation data can be obtained based on the multiple keyframes.

[0194] Here, the animation editing instruction is used to instruct the creation of multiple key frames in the animation editing scene and configure the corresponding initial position information for each key frame. In the animation editing scene of the animation editor, the user can use the animation editing instruction to configure the time point of the key frame of the required animation and the initial position information corresponding to the key frame to edit the motion trajectory of the animation object and achieve the corresponding animation effect.

[0195] like Fig.13 As shown, multiple key frames can be created through the timeline 1310 in the animation editing scene 1300, and corresponding initial position information can be configured for each key frame to indicate the corresponding motion trajectory of the animation object.

[0196] It should be noted that when configuring the initial position information corresponding to each key frame configuration, for each configured key frame, the control node corresponding to the created key frame and the motion trajectory formed by the control node can be displayed in the animation editing scene, so that the user can intuitively view the motion trajectory of the animation object they drew.

[0197] Then, the original animation data can be obtained based on the key frame. It should be understood that the key frame records the corresponding initial position information to indicate the position of the animation object at the time corresponding to the key frame.

[0198] Therefore, through the above implementation, when creating animation data, the user can intuitively view the motion trajectory of the created animation object, thereby helping the user to edit an animation effect that better meets the needs.

[0199] In some feasible implementations, the original animation data further includes indication information for indicating that the relative position between the initial position information corresponding to at least one key frame and the element node in the virtual scene is the target relative position.

[0200] Accordingly, a virtual node can be created in the animation editing scene, and in response to a node association operation, at least one key frame in multiple key frames can be associated with the virtual node to obtain indication information, and original animation data can be obtained based on the multiple key frames and the indication information.

[0201] Here, the virtual node is a node in the animation editing scene mapped to an element node in the virtual scene. For a virtual node created in the animation editing scene, the user can indicate that the virtual node corresponds to a certain element node in the virtual scene through a unique identifier.

[0202] The node association operation is used to indicate that at least one key frame is associated with a virtual node. In other words, it indicates that at least one key frame among multiple key frames is bound to a virtual node. It is worth noting that after at least one key frame is associated with a virtual node, the relative position between the control node corresponding to the at least one key frame and the virtual node is maintained as the relative position at the time of association. Fig.13As shown, if the second control node 1302, the third control node 1303, the fourth control node 1304, the fifth control node 1305, the sixth control node 1306 are bound to the virtual node 1308, the relative positions of the second control node 1302, the third control node 1303, the fourth control node 1304, the fifth control node 1305, the sixth control node 1306 and the virtual node 1308 are maintained as follows Fig.13 The relative position of the target is shown.

[0203] Of course, it should be noted that after the control node and the virtual node are bound, the target relative position between the control node and the virtual node can be modified by performing a first adjustment operation on the control node.

[0204] thus,

[0205] Through the above implementation, the user indicates in the animation editor that at least one key frame is bound to a virtual node, so that when the animation is played, the motion trajectory of the animation object is changed according to the real-time position of the element node corresponding to the virtual node, so as to achieve animation effects of multiple different motion trajectories through one animation data.

[0206] In some practicable implementations, the target animation data further includes rotation parameters for controlling the rotation of the animation object, the rotation parameters including the desired upward direction of the animation object, the initial facing direction of the animation object, and the desired facing direction of the animation object.

[0207] Here, the rotation parameter is a parameter used to control the rotation of the animation object, which determines the rotation angle of the animation object when it moves along the motion trajectory.

[0208] It should be understood that the detailed description of the expected upward direction of the animation object, the initial orientation direction of the animation object and the expected orientation direction of the animation object can refer to the relevant description of the above embodiments, which will not be repeated here.

[0209] Accordingly, in response to the rotation setting operation, the desired upward direction, initial facing direction and desired facing direction corresponding to the animation object can be configured in the animation editing scene, and the original animation data can be obtained based on multiple key frames, the desired upward direction, initial facing direction and desired facing direction.

[0210] Here, the rotation setting operation is used to configure the rotation parameters of the animation object (including the desired upward direction, the initial direction and the desired direction) to indicate that when playing the animation, the animation object is rotated by the rotation parameters to obtain a more natural and realistic animation effect.

[0211] Exemplarily, an automatic rotation component may be added to the animation object through an animation editor, and the desired upward direction, initial facing direction, and desired facing direction corresponding to the animation object may be configured in the automatic rotation component.

[0212] Then, original animation data is obtained based on the key frame, the desired upward direction, the initial facing direction, and the desired facing direction.

[0213] Therefore, through the above implementation, through the rotation setting operation, the animation object can be adjusted at any time according to the movement direction of the motion trajectory during movement, without the need for the user to manually adjust the rotation direction of the animation object at each time point, thereby greatly improving the efficiency of animation editing.

[0214] Fig.15 FIG. 1 is a schematic diagram of an animation playing system according to some embodiments. Fig.15 As shown in the figure, when the animation editor (Editor) starts, it obtains the animation data (AnimationData) from the CombineAnimation component and creates a data copy of the animation data (AnimationDataTemp). The animation editor instantiates a new animation player (Engine) and passes the data copy to the player instance of the animation player. When dragging the timeline, the time change is passed to the animation player instance, triggering reRender (re-rendering) to change the scene animation.

[0215] Each time the data of AnimationDataTemp is modified, it will be passed to TrackSystem (track display system) to generate the motion track of the animation object in the animation editing scene. When operating the control node rendered by TrackSystem, AnimationDataTemp will be modified synchronously to update the motion track of the animation object.

[0216] It should be noted that Effect usually refers to various visual and auditory elements added to animation to enhance the appeal and expressiveness of animation. These effects may include particle effects (such as fire, smoke), light and shadow effects, motion blur, color adjustment, etc. animationJson refers to animation data stored in JSON (JavaScript Object Notation) format. JSON can be used to describe keyframe data, animation curves, timeline information, etc. CombinedAnimation System is a system for managing and controlling multiple animation elements or animation layers. RotationAnimation refers to an animation module specifically used to control the rotation of animated objects. In the animation editor, Store refers to a place where animation data is stored or saved, which can be a database or file system for saving animation projects, resources, presets, etc. NodeList refers to a list of multiple nodes. In animation and graphics programming, nodes can represent objects, bones, controllers, etc. in the scene, and NodeList is used to manage and access these nodes. CurveArea refers to the area used to edit and view animation curves in the animation editor. EditArea refers to the main working area in the animation editor for editing animations. In this area, animators can view a preview of the animation, adjust the timeline, edit keyframes, and perform other animation-related editing operations.

[0217] Fig.16 FIG. 1 is a schematic diagram showing the structure of an animation playback device according to some embodiments. Fig.16 As shown, the embodiment of the present disclosure provides an animation playing device 1600, and the animation playing device 1600 may include:

[0218] The determination module 1601 is configured to determine target animation data, wherein the target animation data includes a plurality of key frames, and the key frames are used to record target position information of the animation object at the key frames;

[0219] An acquisition module 1602 is configured to acquire a motion track consisting of target position information corresponding to the multiple key frames according to the target animation data;

[0220] The rendering module 1603 is configured to render and obtain multiple animation frames according to the motion trajectory and the animation object, wherein the multiple animation frames are used to describe the motion of the animation object along the motion trajectory;

[0221] The display module 1604 is configured to display the multiple animation frames.

[0222] Optionally, the target animation data further includes indication information for indicating that the relative position between the target position information corresponding to at least one key frame and the element node in the virtual scene is the target relative position;

[0223] The obtaining module 1602 includes:

[0224] an acquisition unit, configured to acquire node position information of the element node in the virtual scene in response to the target animation data including the indication information;

[0225] A first obtaining unit is configured to adjust the target position information corresponding to the at least one key frame according to the node position information and the target relative position to obtain adjusted target position information, wherein the adjusted target position information is used to make the relative position of the adjusted target position information and the element node be the target relative position;

[0226] The second obtaining unit is configured to obtain the motion trajectory based on the adjusted target position information.

[0227] Optionally, the rendering module 1603 is specifically configured to:

[0228] Acquire the element node from the virtual scene;

[0229] Rendering to obtain the plurality of animation frames according to the motion trajectory, the element node and the animation object;

[0230] The display module 1604 is specifically configured as follows:

[0231] The multiple animation frames are displayed by superimposing the animation playing layer on the virtual scene.

[0232] Optionally, the virtual scene includes a live broadcast room page, and the element node includes an avatar of a target account in the live broadcast room page, and the target account is a first account that sends a virtual gift or a second account that receives a virtual gift.

[0233] Optionally, the target animation data further includes rotation parameters for controlling the animation object to rotate, the rotation parameters including a desired upward direction of the animation object, an initial facing direction of the animation object, and a desired facing direction of the animation object;

[0234] The rendering module 1603 includes:

[0235] A first determining unit is configured to obtain, when a currently rendered animation frame is a first animation frame, first position information of the animation object at the first animation frame according to the motion trajectory, wherein the first animation frame is an animation frame of a first frame corresponding to the target animation data;

[0236] A first rendering unit is configured to render the first animation frame according to the first position information and the animation object;

[0237] a second determining unit configured to obtain, when the currently rendered animation frame is a second animation frame, second position information of the animation object at the second animation frame according to the motion trajectory, wherein the second animation frame is an animation frame other than the first frame in the target animation data;

[0238] A third determining unit is configured to obtain a current moving direction of the animation object according to the second position information corresponding to the second animation frame and the third position information corresponding to the previous animation frame;

[0239] a fourth determining unit, configured to obtain a target rotation angle according to the current motion direction, the desired upward direction, the initial facing direction, and the desired facing direction, wherein the target rotation angle is used to enable the animation object to move toward the desired facing direction and maintain the desired upward direction;

[0240] The second rendering unit is configured to render the second animation frame according to the second position information, the target rotation angle and the animation object.

[0241] Optionally, the fourth determining unit includes:

[0242] A first angle obtaining unit, configured to obtain an initial rotation angle according to the current motion direction and the desired upward direction;

[0243] A second angle obtaining unit is configured to obtain an initial rotation offset according to the initial orientation direction and the desired orientation direction;

[0244] The third angle obtaining unit is configured to obtain the target rotation angle according to the initial rotation angle and the initial rotation offset.

[0245] Optionally, the first angle obtaining unit is specifically configured as follows:

[0246] Determine, according to a default orientation vector in a world coordinate system and the current direction of motion, a first rotation quaternion for rotating the default orientation vector to the current direction of motion;

[0247] Obtaining a right side vector according to a cross product of the current moving direction and the desired upward direction;

[0248] Obtaining a new desired upward direction according to the cross product of the right side vector and the current movement direction;

[0249] Obtaining a rotated upward vector according to the first rotation quaternion and a default upward vector in the world coordinate system;

[0250] Obtaining a second rotation quaternion according to the rotated upward vector and the new desired upward direction;

[0251] The initial rotation angle is obtained according to the first rotation quaternion and the second rotation quaternion.

[0252] Optionally, the second rendering unit is specifically configured to:

[0253] interpolating the target rotation angle of the second animation frame and the target rotation angle corresponding to the previous animation frame according to the time interval between two adjacent animation frames to obtain multiple rotation angles;

[0254] The animation frame is rendered based on the second position information, the multiple rotation angles, and the animation object.

[0255] Optionally, the determining module 1601 includes:

[0256] A data acquisition unit is configured to acquire original animation data, wherein the original animation data includes a plurality of key frames, and the key frames are used to record initial position information of the animation object at the key frames;

[0257] A first display unit is configured to display, in an animation editing scene, the control nodes corresponding to the initial position information of the key frames and the motion track of the animation object formed by the control nodes according to the original animation data;

[0258] The adjustment unit is configured to adjust the initial position information of the key frame corresponding to the control node in response to a first adjustment operation on the control node to obtain target animation data.

[0259] The logic of the method executed by each functional module in the animation playback device 1600 can refer to the method related to the above embodiment, and will not be repeated here.

[0260] Reference below Fig.17, which shows a schematic diagram of the structure of an electronic device (such as a terminal device or a server) 1700 suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.17 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0261] like Fig.17 As shown, the electronic device 1700 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 1701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1702 or a program loaded from a storage device 1708 to a random access memory (RAM) 1703. In the RAM 1703, various programs and data required for the operation of the electronic device 1700 are also stored. The processing device 1701, the ROM 1702, and the RAM 1703 are connected to each other via a bus 1704. An input / output (I / O) interface 1705 is also connected to the bus 1704.

[0262] Typically, the following devices may be connected to the I / O interface 1705: an input device 1706 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1709. The communication device 1709 may allow the electronic device 1700 to communicate with other devices wirelessly or by wire to exchange data. Although Fig.17 The electronic device 1700 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0263] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 1709, or installed from a storage device 1708, or installed from a ROM 1702. When the computer program is executed by the processing device 1701, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0264] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0265] In some embodiments, the electronic device can communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0266] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0267] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: determines target animation data, wherein the target animation data includes multiple key frames, and the key frames are used to record the target position information of the animation object at the key frames; obtains a motion trajectory consisting of the target position information corresponding to the multiple key frames according to the target animation data; renders multiple animation frames according to the motion trajectory and the animation object, wherein the multiple animation frames are used to describe the movement of the animation object along the motion trajectory; and displays the multiple animation frames.

[0268] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0269] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0270] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a module does not, in some cases, limit the module itself.

[0271] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0272] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0273] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0274] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0275] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

Claims

1. An animation playing method, characterized in that: include: Determine target animation data, wherein the target animation data includes a plurality of key frames, and the key frames are used to record target position information of the animation object at the key frames; According to the target animation data, a motion trajectory consisting of target position information corresponding to the multiple key frames is obtained; Rendering to obtain a plurality of animation frames according to the motion trajectory and the animation object, wherein the plurality of animation frames are used to describe the motion of the animation object along the motion trajectory; The plurality of animation frames are displayed.

2. The method according to claim 1, characterized in that The target animation data also includes indication information for indicating that the relative position between the target position information corresponding to at least one key frame and the element node in the virtual scene is the target relative position; The step of obtaining, according to the target animation data, a motion trajectory formed by target position information corresponding to the multiple key frames comprises: In response to the target animation data including the indication information, acquiring node position information of the element node in the virtual scene; According to the node position information and the target relative position, the target position information corresponding to the at least one key frame is adjusted to obtain adjusted target position information, wherein the adjusted target position information is used to make the relative position of the adjusted target position information and the element node be the target relative position; Based on the adjusted target position information, the motion trajectory is obtained.

3. The method according to claim 2, characterized in that The step of rendering to obtain multiple animation frames according to the motion trajectory and the animation object includes: Acquire the element node from the virtual scene; Rendering to obtain the plurality of animation frames according to the motion trajectory, the element node and the animation object; The displaying of the plurality of animation frames comprises: The multiple animation frames are displayed by superimposing the animation playing layer on the virtual scene.

4. The method according to claim 2, characterized in that: The virtual scene includes a live broadcast room page, and the element node includes an avatar of a target account in the live broadcast room page, and the target account is a first account that sends a virtual gift or a second account that receives a virtual gift.

5. The method according to claim 1, characterized in that The target animation data further includes rotation parameters for controlling the animation object to rotate, the rotation parameters including a desired upward direction of the animation object, an initial facing direction of the animation object, and a desired facing direction of the animation object; The step of rendering to obtain multiple animation frames according to the motion trajectory and the animation object includes: In a case where the currently rendered animation frame is a first animation frame, obtaining first position information of the animation object at the first animation frame according to the motion trajectory, wherein the first animation frame is an animation frame of a first frame corresponding to the target animation data; Rendering to obtain the first animation frame according to the first position information and the animation object; When the currently rendered animation frame is a second animation frame, obtaining second position information of the animation object at the second animation frame according to the motion trajectory, wherein the second animation frame is an animation frame other than the first frame in the target animation data; Obtaining a current moving direction of the animation object according to the second position information corresponding to the second animation frame and the third position information corresponding to the previous animation frame; Obtaining a target rotation angle according to the current movement direction, the desired upward direction, the initial facing direction, and the desired facing direction, wherein the target rotation angle is used to enable the animation object to move toward the desired facing direction and maintain the desired upward direction; The second animation frame is rendered according to the second position information, the target rotation angle, and the animation object.

6. The method according to claim 5, characterized in that The step of obtaining a target rotation angle according to the current movement direction, the expected upward direction, the initial orientation direction, and the expected orientation direction includes: Obtaining an initial rotation angle according to the current movement direction and the desired upward direction; Obtaining an initial rotation offset according to the initial orientation direction and the desired orientation direction; The target rotation angle is obtained according to the initial rotation angle and the initial rotation offset.

7. The method according to claim 6, characterized in that The obtaining of the initial rotation angle according to the current movement direction and the expected upward direction comprises: Determine, according to a default orientation vector in a world coordinate system and the current direction of motion, a first rotation quaternion for rotating the default orientation vector to the current direction of motion; Obtaining a right side vector according to a cross product of the current moving direction and the desired upward direction; Obtaining a new desired upward direction according to the cross product of the right side vector and the current movement direction; Obtaining a rotated upward vector according to the first rotation quaternion and a default upward vector in the world coordinate system; Obtaining a second rotation quaternion according to the rotated upward vector and the new desired upward direction; The initial rotation angle is obtained according to the first rotation quaternion and the second rotation quaternion.

8. The method according to claim 5, characterized in that The rendering to obtain the second animation frame according to the second position information, the target rotation angle, and the animation object includes: interpolating the target rotation angle of the second animation frame and the target rotation angle corresponding to the previous animation frame according to the time interval between two adjacent animation frames to obtain multiple rotation angles; The second animation frame is rendered based on the second position information, the multiple rotation angles, and the animation object.

9. The method according to any one of claims 1 to 8, characterized in that The step of determining target animation data comprises: Acquire original animation data, wherein the original animation data includes multiple key frames, and the key frames are used to record initial position information of the animation object at the key frames; According to the original animation data, displaying the control nodes corresponding to the initial position information of the key frames and the motion track of the animation object formed by the control nodes in the animation editing scene; In response to a first adjustment operation on the control node, initial position information of a key frame corresponding to the control node is adjusted to obtain target animation data.

10. An animation playback device, characterized in that: include: A determination module is configured to determine target animation data, wherein the target animation data includes a plurality of key frames, and the key frames are used to record target position information of the animation object at the key frames; An acquisition module is configured to acquire, according to the target animation data, a motion trajectory formed by target position information corresponding to the multiple key frames; A rendering module is configured to render and obtain a plurality of animation frames according to the motion trajectory and the animation object, wherein the plurality of animation frames are used to describe the motion of the animation object along the motion trajectory; The display module is configured to display the multiple animation frames.

11. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing device, the steps of the method according to any one of claims 1 to 9 are implemented.

12. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 9.

13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.

Citation Information

Cited By

  • Video animation intelligent generation system based on AIGC

    CN119383425A

  • An intelligent video animation generation system based on AIGC

    CN119383425B