Animation editing method, playing method, medium, electronic equipment and program product
By obtaining and adjusting key frame information in animation data, displaying and editing the motion trajectories of animated objects, it solves the problem of low efficiency in setting motion attribute parameters frame by frame in animation production, and achieves fast and intuitive animation editing.
Patent Information
- Application Number
- CN202410813830.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-08-23
AI Technical Summary
During the animation production process, the motion state of the animated object requires setting motion attribute parameters frame by frame, resulting in extremely low animation production efficiency.
By obtaining the original animation data, display the initial position information and motion trajectory of the keyframe, and generate target animation data in response to the adjustment operation, so that the motion trajectory of the animated object can be edited intuitively and quickly.
It improves the efficiency of animation production, makes animation editing more intuitive and faster, and reduces the learning cost of animation production personnel.
Smart Images

Figure CN118537455A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to an animation editing method, a playback method, a medium, an electronic device, and a program product. Background Art
[0002] Generally, in the animation production process, animators program the motion trajectory of the animation object according to production requirements, so as to present dynamic effects to users. However, in the related art, the motion state of the animation object at each moment requires the animator to set the corresponding motion attribute parameters frame by frame, resulting in extremely low animation production efficiency. 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 editing method, comprising:
[0005] 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;
[0006] 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;
[0007] 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.
[0008] In a second aspect, the present disclosure provides an animation playing method, comprising:
[0009] According to the animation editing method of the first aspect, 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;
[0010] According to the target animation data, a motion trajectory consisting of target position information corresponding to the multiple key frames is obtained;
[0011] 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;
[0012] The plurality of animation frames are displayed.
[0013] 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, or implements the steps of the method described in the second aspect.
[0014] In a fourth aspect, the present disclosure provides an electronic device, including:
[0015] a storage device having a computer program stored thereon;
[0016] 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, or to implement the steps of the method described in the second aspect.
[0017] In a fifth aspect, the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the method described in the first aspect, or implements the steps of the method described in the second aspect.
[0018] Based on the above technical solution, by acquiring the original animation data, the control nodes corresponding to the initial position information of the key frames and the motion trajectory of the animation object composed of the control nodes are displayed in the animation editing scene according to the original animation data, and in response to the first adjustment operation on the control nodes, the initial position information of the key frames corresponding to the control nodes are adjusted to obtain the target animation data. The motion trajectory of the animation object can be intuitively viewed, and the motion trajectory of the animation object can be adjusted by adjusting the control nodes, so that the animation data can be edited intuitively and quickly, thereby improving the efficiency of animation production.
[0019] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] 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:
[0021] Figure 1 is a flowchart of an animation editing method according to some embodiments.
[0022] Figure 2 is a schematic diagram of an animation editing scene according to some embodiments.
[0023] Figure 3is a schematic diagram showing how to obtain target animation data according to some embodiments.
[0024] Figure 4 is a flow chart of an animation playing method according to some embodiments.
[0025] Figure 5 yes Figure 4 A detailed flow chart of step 420 is shown.
[0026] Figure 6 is a schematic diagram of a motion trajectory according to some embodiments.
[0027] Figure 7 is a schematic diagram of motion trajectories according to some further embodiments.
[0028] Figure 8 is a flowchart of animation playback according to some embodiments.
[0029] Fig. 9 is a schematic diagram of an animation shown according to some embodiments.
[0030] Fig.10 is a schematic diagram of animation according to some other embodiments.
[0031] Fig.11 yes Figure 4 A detailed flow chart of step 430 is shown.
[0032] Fig.12 is a schematic diagram showing animation effects according to some embodiments.
[0033] Fig.13 yes Fig.11 A detailed flow chart of step 1150 is shown.
[0034] Fig.14 is a flowchart illustrating rendering animation frames according to some embodiments.
[0035] Fig.15 is a schematic diagram of an animation playing system according to some embodiments.
[0036] Fig.16 It is a structural schematic diagram of an animation editing device according to some embodiments.
[0037] Fig.17 It is a structural schematic diagram of an animation playback device according to some embodiments.
[0038] Fig.18 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 editing method according to some embodiments. Figure 1 As shown, the embodiment of the present disclosure provides an animation editing method, which can be executed by an electronic device, specifically, by an animation editing 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, original animation data is obtained, 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.
[0047] Here, the original animation data may be the animation data corresponding to the animation that needs to be edited again. For example, when the motion trajectory of an already produced animation needs to be modified, the animation data corresponding to the animation is the original animation data. 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.
[0048] Animation data is used to manage all information and resources of animation. In the disclosed embodiment, the original animation data includes multiple keyframes, each keyframe is used to record the initial position information (position) of the animation object at the keyframe. For example, if the time point of a keyframe is 00:02, and the initial position information corresponding to the keyframe is (x, y, z), it means that the position of the animation object at the time point of 00:02 is (x, y, z).
[0049] It should be noted that the initial position information can be a coordinate point in three-dimensional space or a coordinate point in 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 three-dimensional space, the corresponding initial position information is three-dimensional coordinates; if the virtual scene in which the animation is played is two-dimensional space, the corresponding initial position information is two-dimensional coordinates. In other words, the animation editing method provided in the embodiments of the present disclosure can be used to edit both three-dimensional animations and two-dimensional animations.
[0050] 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.
[0051] 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.
[0052] It should be understood that the original animation data may be animation data pre-edited by an animation editor. Exemplarily, the original animation data may be obtained from the animation editor or a storage area of the animation data.
[0053] In step 120, 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.
[0054] 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.
[0055] 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.
[0056] 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.
[0057] 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.
[0058] 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.
[0059] 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.
[0060] 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.
[0061] Figure 2 FIG. 1 is a schematic diagram of an animation editing scene according to some embodiments. Figure 2As shown, in the animation editing scene 200, the first key frame 211, the second key frame 212, the third key frame 213, the fourth key frame 214, the fifth key frame 215, and the sixth key frame 216 are displayed through the timeline 210. And in the animation editing scene 200, the animation object 207, the first control node 201, the second control node 202, the third control node 203, the fourth control node 204, the fifth control node 205, and the sixth control node 206 are displayed, and the motion track 217 formed by the first control node 201, the second control node 202, the third control node 203, the fourth control node 204, the fifth control node 205, and the sixth control node 206 are displayed. Among them, the first control node 201 is the control node corresponding to the first key frame 211, the second control node 202 is the control node corresponding to the second key frame 212, the third control node 203 is the control node corresponding to the third key frame 213, the fourth control node 204 is the control node corresponding to the fourth key frame 214, the fifth control node 205 is the control node corresponding to the fifth key frame 215, and the sixth control node 206 is the control node corresponding to the sixth key frame 216.
[0062] It should be noted that, in the animation editing scene 200 , the corresponding virtual scene 209 and the virtual nodes 208 in the animation editing scene 200 mapped to the element nodes in the virtual scene 209 can also be displayed.
[0063] In step 130, 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.
[0064] Here, 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.
[0065] 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.
[0066] For example, the user can drag Figure 2 The first control node 201 shown adjusts the initial position information corresponding to the first key frame 211 .
[0067] 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.
[0068] 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.
[0069] 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.
[0070] 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.
[0071] Here, if Figure 2 As shown, in the animation editing scene 200, the first key frame 211, the second key frame 212, the third key frame 213, the fourth key frame 214, the fifth key frame 215, and the sixth key frame 216 can be displayed through the timeline 210. In addition, in the animation editing scene 200, the animation object 207 is displayed to show the user the position of the animation object 207 in the animation editing scene.
[0072] 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. Figure 2 The first key frame 211 is shown to adjust the time point corresponding to the first key frame 211.
[0073] 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.
[0074] 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.
[0075] 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.
[0076] 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.
[0077] Figure 3 FIG. 1 is a schematic diagram showing how to obtain target animation data according to some embodiments. Figure 3 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 node. If not modified, the motion trajectory and the control node remain unchanged. If modified, the original animation data is updated to obtain the target animation data.
[0078] 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.
[0079] 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.
[0080] In the case where the original animation data includes indication information, it indicates that at least one key frame 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 a target relative position. When the position of the element node in the virtual scene changes, the 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 at the target relative position.
[0081] It should be understood that the user can indicate the element node to which the 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 control node corresponding to the bound key frame in the animation editor. When the animation editor outputs animation data, the target relative position between at least one key frame and the bound element node is described through the above indication information.
[0082] 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 animation data.
[0083] It should be noted that in the embodiments of the present disclosure, different key frames in the animation data can be bound to different element nodes. For example, if there are multiple avatars in a virtual scene, and 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, so that the resulting motion trajectory can rotate around different avatars.
[0084] Accordingly, in some achievable implementations, a virtual node mapped to an element node in the animation editing scene can be displayed 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 can be adjusted according to the adjusted position information of the virtual node and the target relative position to obtain the target animation data.
[0085] 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. Figure 2 As shown, a virtual scene 209 and a corresponding virtual node 208 may be displayed in the animation editing scene 200 . The virtual node 208 is actually a reference to a node element in the virtual scene 209 .
[0086] 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.
[0087] 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.
[0088] The relative position between the control node and the virtual node corresponding to at least one key frame associated with the virtual node is the target relative position.
[0089] That is, the positions of the control nodes bound to the virtual nodes among the control nodes displayed in the animation editing scene and the virtual nodes are the target relative positions.
[0090] 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.
[0091] 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.
[0092] For example, Figure 2 As shown, the second control node 202, the third control node 203, the fourth control node 204, the fifth control node 205, and the sixth control node 206 are all bound to the virtual node 208, that is, the relative positions between the second control node 202, the third control node 203, the fourth control node 204, the fifth control node 205, and the sixth control node 206 and the virtual node 208 are always maintained as the target relative position. When the virtual node 208 is dragged, the positions of the second control node 202, the third control node 203, the fourth control node 204, the fifth control node 205, and the sixth control node 206 also change accordingly, so that the initial position information of the key frames corresponding to the second control node 202, the third control node 203, the fourth control node 204, the fifth control node 205, and the sixth control node 206 change.
[0093] 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.
[0094] It is worth noting that the original animation data described in the above embodiment may be obtained by the user through editing with an animation editor.
[0095] 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.
[0096] 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.
[0097] like Figure 2 As shown, multiple key frames can be created through the timeline 210 in the animation editing scene 200, and corresponding initial position information can be configured for each key frame to indicate the corresponding motion trajectory of the animation object.
[0098] 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.
[0099] Then, the original animation data can be obtained based on the created 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.
[0100] 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.
[0101] 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.
[0102] 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.
[0103] 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.
[0104] 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. Figure 2 As shown, if the second control node 202, the third control node 203, the fourth control node 204, the fifth control node 205, the sixth control node 206 are bound to the virtual node 208, the relative positions of the second control node 202, the third control node 203, the fourth control node 204, the fifth control node 205, the sixth control node 206 and the virtual node 208 are maintained as follows Figure 2 The relative positions shown.
[0105] Of course, it should be noted that after the control node and the virtual node are bound, the relative position between the control node and the virtual node can be modified by performing a first adjustment operation on the control node.
[0106] Therefore, 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.
[0107] 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.
[0108] 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.
[0109] 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.
[0110] 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. For example, the initial direction of the animation object can be toward the outside of the screen.
[0111] 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. For example, if the initial direction of the animation object is toward the outside of the screen, the desired direction may be that the animation object is expected to move from the outside of the screen to the inside of the screen.
[0112] 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.
[0113] 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.
[0114] 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.
[0115] 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.
[0116] 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.
[0117] Then, original animation data is obtained based on the key frame, the desired upward direction, the initial facing direction, and the desired facing direction.
[0118] 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.
[0119] Figure 4 FIG. 1 is a flowchart of an animation playing method according to some embodiments. Figure 4As 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 4 As shown, the method may include the following steps.
[0120] In step 410, according to the animation editing method as shown in the above embodiment, target animation data is determined, 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.
[0121] Here, the target animation data is consistent with the original animation data of the above embodiment, and is used to manage all 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 of the animation object at the key frame.
[0122] It should be noted that the concept of the target position information is consistent with the initial position information described in the above embodiment, and will not be repeated here.
[0123] 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.
[0124] In step 420, a motion track consisting of target position information corresponding to multiple key frames is obtained according to the target animation data.
[0125] 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 the multiple key frames included in the target animation data.
[0126] 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.
[0127] 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.
[0128] In step 430, multiple animation frames are rendered according to the motion trajectory and the animation object.
[0129] 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 scenario, the animation object may be a virtual gift sent. That is, after the user sends a virtual gift, the animation data may be used to control the virtual gift to display the corresponding animation effect.
[0130] 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.
[0131] 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.
[0132] 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.
[0133] In step 440 , a plurality of animation frames are displayed.
[0134] 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.
[0135] 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.
[0136] Thus, by determining the target animation data according to the animation editing method as shown in the above embodiment, and obtaining the motion trajectory consisting of the target position information corresponding to multiple key frames according to the target animation data, rendering multiple animation frames according to the motion trajectory and the animation object, and displaying the multiple animation frames, the motion trajectory of the animation object can be indicated by multiple key frames, so as to obtain the corresponding animation effect by real-time rendering. Moreover, by rendering and generating animation frames through the target animation data, the user can dynamically adjust the target position information corresponding to the key frames in the target animation data according to the needs, so as to modify the motion trajectory of the animation object and obtain the animation effect that meets the needs.
[0137] 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.
[0138] For the description of the indication information, reference may be made to the description of the animation editing method described above, which will not be repeated here.
[0139] Figure 5 yes Figure 4 Detailed flow chart of step 420 is shown. Figure 5 As shown, accordingly, in some practicable implementations, step 420 may include the following steps.
[0140] In step 421, in response to the target animation data including indication information, node position information of the element node in the virtual scene is acquired.
[0141] 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.
[0142] 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.
[0143] Exemplarily, the node position information corresponding to the element node may be searched and obtained according to the unique identifier corresponding to the element node bound to at least one key frame.
[0144] In step 422, 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 adjusted target position information.
[0145] 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.
[0146] 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.
[0147] 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.
[0148] In step 423, a motion trajectory is obtained based on the adjusted target position information.
[0149] 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.
[0150] Figure 6 is a schematic diagram showing a motion trajectory according to some embodiments. Figure 6 As shown, the motion trajectory of the animation object 608 is formed by the first control node 601, the second control node 602, the third control node 603, the fourth control node 604, the fifth control node 605 and the sixth control node 606, and the second control node 602, the third control node 603, the fourth control node 604, the fifth control node 605 and the sixth control node 606 are associated with the element node 607 (that is, the relative positions between the second control node 602, the third control node 603, the fourth control node 604, the fifth control node 605, the sixth control node 606 and the element node 607 are as shown in FIG. Figure 6 shown).
[0151] Figure 7 is a schematic diagram of a motion trajectory according to some other embodiments. Figure 7 As shown, when the position of element node 607 changes (by Figure 6 The position changes to Figure 7 Since the relative positions between the second control node 602, the third control node 603, the fourth control node 604, the fifth control node 605, the sixth control node 606 and the element node 607 are maintained as the target relative positions, it is necessary to change the position information of the second control node 602, the third control node 603, the fourth control node 604, the fifth control node 605, the sixth control node 606 from Figure 6 Adjust to Figure 7 As shown, the position information of the first control node 601 remains unchanged. Accordingly, the motion trajectory of the animation object 608 changes (by Figure 6 The motion trajectory of Figure 7 motion trajectory shown).
[0152] Thus, through the above steps 421 to 423, 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.
[0153] Figure 8 FIG. 4 is a flowchart of animation playback according to some embodiments. Figure 8 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.
[0154] 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.
[0155] 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.
[0156] 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 movements of the same trajectory, allowing the animation object to move and rotate along different avatars.
[0157] Fig. 9 is a schematic diagram of an animation according to some embodiments. Fig. 9As shown, in the live broadcast room page, the element node 901 is located at the first position, and the animation object 902 moves and rotates around the element node 901. Fig.10 is a schematic diagram of an animation according to some other embodiments. Fig.10 As shown, element node 901 is from Fig. 9 The first position shown is moved to Fig.10 The second position is shown, and accordingly, the motion trajectory of the animation object 902 changes.
[0158] 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.
[0159] 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.
[0160] 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.
[0161] 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.
[0162] 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.
[0163] like Fig. 9As 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 901 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 901 and the animation object 902, 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.
[0164] 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.
[0165] It should be noted that for a detailed description of the rotation parameters, reference may be made to the relevant description of the above embodiments, which will not be repeated here.
[0166] Fig.11 yes Figure 4 Detailed flowchart of step 430 is shown. Fig.11 As shown, step 430 may include the following steps.
[0167] In step 1110 , 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.
[0168] 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.
[0169] 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.
[0170] In step 1120, a first animation frame is rendered according to the first position information and the animation object.
[0171] 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.
[0172] In step 1130 , 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.
[0173] 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.
[0174] 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.
[0175] In step 1140, the current moving 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.
[0176] 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.
[0177] 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.
[0178] 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.
[0179] In step 1150, 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.
[0180] 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.
[0181] 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.
[0182] 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.
[0183] In step 1160, a second animation frame is rendered according to the second position information, the target rotation angle, and the animation object.
[0184] 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.
[0185] 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.
[0186] 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.
[0187] Therefore, through the above steps 1110 to 1160, 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.
[0188] 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.
[0189] Through the animation editing method provided by the embodiment of the present disclosure, animators can configure corresponding rotation parameters. Through the animation playback method provided by the embodiment of the present disclosure, during the motion of an animation object, the target rotation angle of the animation object in each animation frame 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, and 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.
[0190] Fig.12 is a schematic diagram of an animation effect according to some embodiments. Fig.12 As shown, the animation object 1201 can always maintain a posture consistent with the real world during the process of rotating around the element node 1202, thereby making the animation effect more natural and realistic.
[0191] Fig.13 yes Fig.11 Detailed flowchart of step 1150 is shown. Fig.13 As shown, step 1150 may include the following steps.
[0192] In step 1151, an initial rotation angle is obtained according to the current movement direction and the desired upward direction.
[0193] Here, the initial rotation angle is used to enable the animation object to move toward the desired direction while maintaining the desired upward direction.
[0194] 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.
[0195] 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.
[0196] 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.
[0197] 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.
[0198] 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.
[0199] 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.
[0200] The second rotation quaternion is the rotation quaternion needed to rotate from the rotated up vector to the new desired up direction.
[0201] 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.
[0202] 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.
[0203] 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.
[0204] In step 1152, an initial rotation offset is obtained according to the initial orientation direction and the desired orientation direction.
[0205] 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.
[0206] 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.
[0207] In step 1153, a target rotation angle is obtained according to the initial rotation angle and the initial rotation offset.
[0208] Here, the initial rotation angle and the initial rotation offset may be superimposed to obtain the target rotation angle.
[0209] It is worth noting that by superimposing the initial rotation offset, the animation object can be made to move in the specified desired direction.
[0210] Therefore, through the above steps 1151 to 1153, 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.
[0211] Fig.14 FIG. 4 is a flowchart of rendering an animation frame according to some embodiments. Fig.14 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.
[0212] 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.
[0213] Fig.15 is a schematic diagram of an animation playback 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.
[0214] 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.
[0215] 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.
[0216] Fig.16 FIG. 1 is a schematic diagram showing the structure of an animation editing device according to some embodiments. Fig.16 As shown, the embodiment of the present disclosure provides an animation editing device 1600, which may include:
[0217] The acquisition module 1601 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;
[0218] A first display module 1602 is configured to display the control nodes corresponding to the initial position information of the key frame and the motion track of the animation object formed by the control nodes in the animation editing scene according to the original animation data;
[0219] The first adjustment module 1603 is configured to adjust the initial position information of the key frame corresponding to the control node in response to the first adjustment operation on the control node to obtain target animation data.
[0220] Optionally, the animation editing device 1600 further includes:
[0221] A second display module is configured to display the key frame and the animation object in the animation editing scene;
[0222] The second adjustment module is configured to adjust the time point corresponding to the key frame in response to the second adjustment operation on the key frame to obtain target animation data.
[0223] Optionally, 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;
[0224] The animation editing device 1600 further includes:
[0225] A third display module is configured to display, in the animation editing scene, a virtual node mapped by the element node in the animation editing scene, wherein a relative position between the control node corresponding to the at least one key frame associated with the virtual node and the virtual node is the target relative position;
[0226] The third adjustment module is configured to respond to the third adjustment operation on the virtual node, adjust the initial position information corresponding to the at least one key frame associated with the virtual node according to the adjusted position information of the virtual node and the target relative position, and obtain target animation data.
[0227] Optionally, the acquisition module 1601 includes:
[0228] A creation unit, configured to create a plurality of key frames in the animation editing scene in response to an animation editing instruction, configure corresponding initial position information for each of the key frames, and display control nodes corresponding to the created key frames and motion tracks formed by the control nodes in the animation editing scene;
[0229] The data obtaining unit is configured to obtain the original animation data based on the multiple key frames.
[0230] Optionally, 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;
[0231] The data acquisition unit is specifically configured as follows:
[0232] Creating a virtual node in the animation editing scene, wherein the virtual node is a node in the animation editing scene mapped to an element node in the virtual scene;
[0233] In response to the node association operation, at least one key frame of the multiple key frames is associated with the virtual node to obtain the indication information;
[0234] The original animation data is obtained according to the multiple key frames and the indication information.
[0235] 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;
[0236] In response to a rotation setting operation, configuring the desired upward direction, the initial facing direction, and the desired facing direction corresponding to the animation object in the animation editing scene;
[0237] The original animation data is obtained based on the multiple key frames, the desired upward direction, the initial facing direction and the desired facing direction.
[0238] The logic of the method executed by each functional module in the animation editing device 1600 can refer to the method related to the above embodiment, and will not be repeated here.
[0239] Fig.17 FIG. 1 is a schematic diagram showing the structure of an animation playback device according to some embodiments. Fig.17 As shown, the embodiment of the present disclosure provides an animation playing device 1700, and the animation playing device 1700 may include:
[0240] The determination module 1701 is configured to determine target animation data according to the animation editing device as described in the above embodiment, 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;
[0241] An acquisition module 1702 is configured to acquire a motion track consisting of target position information corresponding to the multiple key frames according to the target animation data;
[0242] The rendering module 1703 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;
[0243] The fourth display module 1704 is configured to display the multiple animation frames.
[0244] 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;
[0245] The obtaining module 1702 includes:
[0246] a position 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;
[0247] 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;
[0248] The second obtaining unit is configured to obtain the motion trajectory based on the adjusted target position information.
[0249] 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.
[0250] 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;
[0251] The rendering module 1703 is specifically configured as follows:
[0252] 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;
[0253] Rendering to obtain the first animation frame according to the first position information and the animation object;
[0254] 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;
[0255] 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;
[0256] 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;
[0257] The second animation frame is rendered according to the second position information, the target rotation angle, and the animation object.
[0258] The logic of the method executed by each functional module in the animation playback device 1700 can refer to the method related to the above embodiment, and will not be repeated here.
[0259] Reference below Fig.18 , which shows a schematic diagram of the structure of an electronic device (such as a terminal device or a server) 1800 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.18 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.
[0260] like Fig.18 As shown, the electronic device 1800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1802 or a program loaded from a storage device 1808 to a random access memory (RAM) 1803. In the RAM 1803, various programs and data required for the operation of the electronic device 1800 are also stored. The processing device 1801, the ROM 1802, and the RAM 1803 are connected to each other via a bus 1804. An input / output (I / O) interface 1805 is also connected to the bus 1804.
[0261] Typically, the following devices may be connected to the I / O interface 1805: an input device 1806 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 1807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1808 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1809. The communication device 1809 may allow the electronic device 1800 to communicate with other devices wirelessly or by wire to exchange data. Although Fig.18 The electronic device 1800 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.
[0262] 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 1809, or installed from a storage device 1808, or installed from a ROM 1802. When the computer program is executed by the processing device 1801, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0263] 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.
[0264] 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.
[0265] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0266] 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: obtains original animation data, wherein 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; based on the original animation data, displays the control nodes corresponding to the initial position information of the key frames and the motion trajectory 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, adjusts the initial position information of the key frames corresponding to the control nodes to obtain target animation data.
[0267] Alternatively, the computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device: determines target animation data according to the animation editing method as described in the above embodiment, 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 editing method, characterized in that: include: 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.
2. The method according to claim 1, characterized in that: The method further comprises: In the animation editing scene, displaying the key frame and the animation object; In response to the second adjustment operation on the key frame, the time point corresponding to the key frame is adjusted to obtain target animation data.
3. The method according to claim 1, characterized in that The original animation data also 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; The method further comprises: In the animation editing scene, displaying a virtual node mapped by the element node in the animation editing scene, wherein the relative position between the control node corresponding to the at least one key frame associated with the virtual node and the virtual node is the target relative position; In response to the third adjustment operation on the virtual node, the initial position information corresponding to the 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 target animation data.
4. The method according to claim 1, characterized in that: The obtaining of original animation data comprises: In response to the animation editing instruction, multiple key frames are created in the animation editing scene, and corresponding initial position information is configured for each of the key frames, and control nodes corresponding to the created key frames and motion tracks formed by the control nodes are displayed in the animation editing scene; Based on the multiple key frames, the original animation data is obtained.
5. The method according to claim 4, characterized in that The original animation data also 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; The obtaining of the original animation data based on the multiple key frames includes: Creating a virtual node in the animation editing scene, wherein the virtual node is a node in the animation editing scene mapped to an element node in the virtual scene; In response to the node association operation, at least one key frame of the multiple key frames is associated with the virtual node to obtain the indication information; The original animation data is obtained according to the multiple key frames and the indication information.
6. The method according to claim 4, 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 obtaining of the original animation data based on the multiple key frames includes: In response to a rotation setting operation, configuring the desired upward direction, the initial facing direction, and the desired facing direction corresponding to the animation object in the animation editing scene; The original animation data is obtained based on the multiple key frames, the desired upward direction, the initial facing direction and the desired facing direction.
7. An animation playing method, characterized in that: include: Determine target animation data according to the animation editing method according to any one of claims 1 to 6, 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.
8. The method according to claim 7, 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.
9. The method according to claim 8, 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.
10. The method according to claim 7, 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.
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 computer program implements the steps of the method according to any one of claims 1 to 6, or implements the steps of the method according to any one of claims 7 to 10.
12. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, used to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 6, or to implement the steps of the method according to any one of claims 7 to 10.
13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the steps of the method according to any one of claims 1 to 6, or implements the steps of the method according to any one of claims 7 to 10.
Citation Information
Cited By
Animation lens sequence processing method and system
CN119027549A
Animation shot sequence processing method and system
CN119027549B
Interaction method and device in virtual space, equipment and storage medium
CN120508206A
