CN118537455A - Animation editing method, playing method, medium, electronic device, and program product - Google Patents
Animation editing method, playing method, medium, electronic device, and program product Download PDFInfo
- Publication number
- CN118537455A CN118537455A CN202410813830.XA CN202410813830A CN118537455A CN 118537455 A CN118537455 A CN 118537455A CN 202410813830 A CN202410813830 A CN 202410813830A CN 118537455 A CN118537455 A CN 118537455A
- Authority
- CN
- China
- Prior art keywords
- animation
- target
- position information
- frame
- node
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T13/00—Animation
- G06T13/20—3D [Three Dimensional] animation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/005—General purpose rendering architectures
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T19/00—Manipulating 3D models or images for computer graphics
- G06T19/20—Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2219/00—Indexing scheme for manipulating 3D models or images for computer graphics
- G06T2219/20—Indexing scheme for editing of 3D models
- G06T2219/2016—Rotation, translation, scaling
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Graphics (AREA)
- Architecture (AREA)
- Computer Hardware Design (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Processing Or Creating Images (AREA)
Abstract
本公开涉及一种动画编辑方法、播放方法、介质、电子设备及程序产品,涉及计算机技术领域,该方法通过获取原始动画数据,根据原始动画数据,在动画编辑场景中显示关键帧的初始位置信息对应的控制节点以及由控制节点构成的动画对象的运动轨迹,并响应于针对控制节点的第一调整操作,对控制节点对应的关键帧的初始位置信息进行调整,获得目标动画数据,可以直观地查看到动画对象的运动轨迹,并通过调整控制节点的方式,对动画对象的运动轨迹进行调整,以直观且快速地对动画数据进行编辑,提高动画制作的效率。
The present disclosure relates to an animation editing method, a playback method, a medium, an electronic device and a program product, and relates to the field of computer technology. The method obtains original animation data, and according to the original animation data, displays control nodes corresponding to initial position information of key frames and motion trajectories of animation objects formed by the control nodes in an animation editing scene, and in response to a first adjustment operation on the control nodes, adjusts the initial position information of the key frames corresponding to the control nodes to obtain target animation data, so that 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 as to intuitively and quickly edit the animation data and improve the efficiency of animation production.
Description
技术领域Technical Field
本公开涉及计算机技术领域,具体地,涉及一种动画编辑方法、播放方法、介质、电子设备及程序产品。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
一般情况下,在动画制作过程中,动画制作人员根据制作需求,编程实现对动画对象的运动轨迹的设定,从而向用户呈现动态效果。但是,在相关技术中,动画对象在每一时刻的运动状态,均需要动画制作人员逐帧设置对应的运动属性参数,导致动画制作效率极低。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 animators to set the corresponding motion attribute parameters frame by frame, resulting in extremely low animation production efficiency.
发明内容Summary of the invention
提供该发明内容部分以便以简要的形式介绍构思,这些构思将在后面的具体实施方式部分被详细描述。该发明内容部分并不旨在标识要求保护的技术方案的关键特征或必要特征,也不旨在用于限制所要求的保护的技术方案的范围。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.
第一方面,本公开提供一种动画编辑方法,包括:In a first aspect, the present disclosure provides an animation editing method, comprising:
获取原始动画数据,其中,所述原始动画数据包括多帧关键帧,所述关键帧用于记录动画对象在该关键帧处的初始位置信息;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.
第二方面,本公开提供一种动画播放方法,包括:In a second aspect, the present disclosure provides an animation playing method, comprising:
根据第一方面所述的动画编辑方法,确定目标动画数据,其中,所述目标动画数据包括多帧关键帧,所述关键帧用于记录动画对象在该关键帧处的目标位置信息;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;
根据所述目标动画数据,获得所述多帧关键帧对应的目标位置信息构成的运动轨迹;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.
第三方面,本公开提供一种计算机可读介质,其上存储有计算机程序,该计算机程序被处理装置执行时实现第一方面所述的方法的步骤,或者,实现第二方面所述的方法的步骤。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.
第四方面,本公开提供一种电子设备,包括:In a fourth aspect, the present disclosure provides an electronic device, including:
存储装置,其上存储有计算机程序;a storage device having a computer program stored thereon;
处理装置,用于执行所述存储装置中的所述计算机程序,以实现第一方面所述的方法的步骤,或者,实现第二方面所述的方法的步骤。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.
第五方面,本公开提供一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现第一方面所述的方法的步骤,或者,实现第二方面所述的方法的步骤。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.
基于上述技术方案,通过获取原始动画数据,根据原始动画数据,在动画编辑场景中显示关键帧的初始位置信息对应的控制节点以及由控制节点构成的动画对象的运动轨迹,并响应于针对控制节点的第一调整操作,对控制节点对应的关键帧的初始位置信息进行调整,获得目标动画数据,可以直观地查看到动画对象的运动轨迹,并通过调整控制节点的方式,对动画对象的运动轨迹进行调整,以直观且快速地对动画数据进行编辑,提高动画制作的效率。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.
本公开的其他特征和优点将在随后的具体实施方式部分予以详细说明。Other features and advantages of the present disclosure will be described in detail in the following detailed description.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
结合附图并参考以下具体实施方式,本公开各实施例的上述和其他特征、优点及方面将变得更加明显。贯穿附图中,相同或相似的附图标记表示相同或相似的元素。应当理解附图是示意性的,原件和元素不一定按照比例绘制。在附图中: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:
图1是根据一些实施例示出的一种动画编辑方法的流程图。FIG. 1 is a flow chart of an animation editing method according to some embodiments.
图2是根据一些实施例示出的动画编辑场景的示意图。FIG. 2 is a schematic diagram of an animation editing scene according to some embodiments.
图3是根据一些实施例示出的获得目标动画数据的示意图。FIG. 3 is a schematic diagram showing a method of obtaining target animation data according to some embodiments.
图4是根据一些实施例示出的一种动画播放方法的流程图。FIG. 4 is a flow chart of an animation playing method according to some embodiments.
图5是图4所示步骤420的详细流程图。FIG. 5 is a detailed flow chart of step 420 shown in FIG. 4 .
图6是根据一些实施例示出的运动轨迹的示意图。FIG. 6 is a schematic diagram showing a motion trajectory according to some embodiments.
图7是根据又一些实施例示出的运动轨迹的示意图。FIG. 7 is a schematic diagram showing motion trajectories according to yet some other embodiments.
图8是根据一些实施例示出的动画播放的流程图。FIG. 8 is a flowchart showing animation playback according to some embodiments.
图9是根据一些实施例示出的动画的示意图。FIG. 9 is a schematic diagram illustrating an animation according to some embodiments.
图10是根据另一些实施例示出的动画的示意图。FIG. 10 is a schematic diagram of an animation according to some other embodiments.
图11是图4所示步骤430的详细流程图。FIG. 11 is a detailed flow chart of step 430 shown in FIG. 4 .
图12是根据一些实施例示出的动画效果的示意图。FIG. 12 is a schematic diagram showing animation effects according to some embodiments.
图13是图11所示步骤1150的详细流程图。FIG. 13 is a detailed flow chart of step 1150 shown in FIG. 11 .
图14是根据一些实施例示出的渲染动画帧的流程图。FIG. 14 is a flowchart illustrating rendering animation frames according to some embodiments.
图15是根据一些实施例示出的动画播放系统的示意图。FIG. 15 is a schematic diagram of an animation playing system according to some embodiments.
图16是根据一些实施例示出的一种动画编辑装置的结构示意图。FIG. 16 is a schematic diagram of the structure of an animation editing device according to some embodiments.
图17是根据一些实施例示出的一种动画播放装置的结构示意图。FIG. 17 is a schematic diagram of the structure of an animation playing device according to some embodiments.
图18是根据一些实施例示出的电子设备的结构示意图。FIG18 is a schematic diagram of the structure of an electronic device according to some embodiments.
具体实施方式DETAILED DESCRIPTION
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。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.
应当理解,本公开的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本公开的范围在此方面不受限制。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.
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。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.
需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。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.
需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。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".
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。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.
图1是根据一些实施例示出的一种动画编辑方法的流程图。如图1所示,本公开实施例提供一种动画编辑方法,该方法可以通过电子设备执行,具体可以是通过一种动画编辑装置来执行,该装置可以由软件和/或硬件的方式实现,配置于电子设备中。如图1所示,该方法可以包括以下步骤。FIG1 is a flow chart of an animation editing method according to some embodiments. As shown in FIG1 , the present disclosure provides an animation editing method, which can be performed 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. As shown in FIG1 , the method may include the following steps.
在步骤110中,获取原始动画数据,其中,原始动画数据包括多帧关键帧,关键帧用于记录动画对象在该关键帧处的初始位置信息。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.
这里,原始动画数据可以为需要进行再次编辑的动画对应的动画数据。例如,当需要修改一个已经制作完成的动画的运动轨迹,则该动画对应的动画数据为原始动画数据。其中,原始动画数据包括多帧关键帧,关键帧用于记录动画对象在该关键帧处的初始位置信息。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.
动画数据是用于管理动画的所有信息和资源。在本公开实施例中,原始动画数据包括多帧关键帧,每一关键帧用于记录动画对象在该关键帧处的初始位置信息(position)。例如,若一个关键帧的时间点为00:02,且该关键帧对应的初始位置信息为(x,y,z),则表示动画对象在00:02的时间点的位置为(x,y,z)。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).
需要注意的是,初始位置信息可以是三维空间中的一个坐标点,也可以是二维空间中的一个坐标点,具体取决于动画播放的虚拟场景。如果播放动画的虚拟场景为三维空间,则对应的初始位置信息为三维坐标,如果播放动画的虚拟场景为二维空间,则对应的初始位置信息为二维坐标。也就是说,本公开实施例提供的动画编辑方法既可以用于对三维动画进行编辑,也可以用于对二维动画进行编辑。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.
其中,关键帧(Keyframe)是一种特殊的帧,关键帧用于记录动画对象在某个时间点上的状态,该状态可以包括动画对象的位置、旋转、缩放、颜色、透明度等属性。动画对象(Animated Object)是指任何需要进行动画处理的游戏元素或三维模型。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.
在本公开实施例中,原始动画数据可以是任意的携带有多帧关键帧的动画数据。例如,原始动画数据可以是通过Unity引擎编辑得到的动画数据。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.
应当理解的是,原始动画数据可以是预先通过动画编辑器编辑好的动画数据。示例性地,可以从动画编辑器或者动画数据的存储区域中获取原始动画数据。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.
在步骤120中,根据原始动画数据,在动画编辑场景中显示关键帧的初始位置信息对应的控制节点以及由控制节点构成的动画对象的运动轨迹。In step 120, according to 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.
这里,动画编辑场景可以是动画编辑器中的场景,也就是说,通过动画编辑器显示控制节点以及运动轨迹。在动画编辑场景中,在何处显示关键帧对应的控制节点取决于关键帧对应的初始位置信息,当显示的控制节点的位置发生变化,则关键帧记录的动画对象在该关键帧处的初始位置信息也会发生变化。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.
在获得原始动画数据之后,可以在动画编辑场景对应的世界坐标系中显示关键帧对应的控制节点以及由控制节点构成的运动轨迹,以使用户能够根据显示的运动轨迹、控制节点直观地对动画对象的运动轨迹进行调整。After obtaining the original animation data, the control nodes corresponding to the key frames and the motion trajectory 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 trajectory of the animation object according to the displayed motion trajectory and control nodes.
每一帧关键帧对应一个控制节点,该控制节点在动画编辑场景中的位置信息为对应的初始位置信息。由控制节点构成的运动轨迹可以是指由多帧关键帧对应的控制节点构成的线条。示例性地,该线条可以为样条线、贝塞尔曲线等等。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.
应当理解的是,显示的由控制节点构成的运动轨迹,可以是通过对多帧关键帧对应的初始位置信息进行插值获得的。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.
由于原始动画数据中的每一帧关键帧记录了动画对象在该关键帧处的初始位置信息,相应地,可以在多帧关键帧之间,通过插值算法计算两两关键帧之间的中间帧的位置信息,从而获得多帧关键帧对应的初始位置信息构成的运动轨迹。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.
也就是说,将多帧关键帧对应的初始位置信息以及插值得到的中间帧的位置信息进行连接,即可形成动画对象对应的运动轨迹,表示动画对象随时间轴的运动。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.
需要注意的是,在本公开实施例中,使用的插值算法可以根据需求确定。示例性地,插值算法可以是线性插值算法、样条插值算法以及贝塞尔曲线插值算法等等。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.
图2是根据一些实施例示出的动画编辑场景的示意图。如图2所示,在动画编辑场景200中,通过时间轴210显示第一关键帧211、第二关键帧212、第三关键帧213、第四关键帧214、第五关键帧215、第六关键帧216。以及在动画编辑场景200中,显示动画对象207、第一控制节点201、第二控制节点202、第三控制节点203、第四控制节点204、第五控制节点205、第六控制节点206,以及显示由第一控制节点201、第二控制节点202、第三控制节点203、第四控制节点204、第五控制节点205、第六控制节点206形成的运动轨迹217。其中,第一控制节点201为第一关键帧211对应的控制节点、第二控制节点202为第二关键帧212对应的控制节点、第三控制节点203为第三关键帧213对应的控制节点、第四控制节点204为第四关键帧214对应的控制节点、第五控制节点205为第五关键帧215对应的控制节点、第六控制节点206为第六关键帧216对应的控制节点。Fig. 2 is a schematic diagram of an animation editing scene according to some embodiments. As shown in Fig. 2, in the animation editing scene 200, a first key frame 211, a second key frame 212, a third key frame 213, a fourth key frame 214, a fifth key frame 215, and a sixth key frame 216 are displayed through a timeline 210. Also, in the animation editing scene 200, an animation object 207, a first control node 201, a second control node 202, a third control node 203, a fourth control node 204, a fifth control node 205, and a sixth control node 206 are displayed, and a 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 is 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.
需要注意的是,在动画编辑场景200中,还可以显示对应的虚拟场景209以及显示虚拟场景209中的元素节点映射在动画编辑场景200中的虚拟节点208。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.
在步骤130中,响应于针对控制节点的第一调整操作,对控制节点对应的关键帧的初始位置信息进行调整,获得目标动画数据。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.
这里,针对控制节点的第一调整操作,用于对控制节点对应的初始位置信息进行调整。通过调整控制节点,控制节点的位置信息从初始位置信息变更调整后的目标位置信息。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.
示例性地,第一调整操作可以是针对控制节点的拖动操作。用户可以通过拖动需要调整的控制节点,对对应的初始位置信息进行调整,以对动画对象的运动轨迹进行调整。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.
例如,用户可以通过拖动图2所示的第一控制节点201,对第一关键帧211对应的初始位置信息进行调整。For example, the user may adjust the initial position information corresponding to the first key frame 211 by dragging the first control node 201 shown in FIG. 2 .
应当理解的是,如果运动轨迹为贝塞尔曲线,则控制节点由两个贝塞尔曲线的操作点进行控制,用户则可以通过拖动操作点来调整对应的控制节点。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.
值得说明的是,通过上述第一调整操作对原始动画数据进行调整之后,可以获得目标动画数据。在获得目标动画数据之后,目标动画数据可以覆盖原始动画数据进行存储,以通过目标动画数据进行动画播放。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.
由此,通过获取原始动画数据,根据原始动画数据,在动画编辑场景中显示关键帧的初始位置信息对应的控制节点以及由控制节点构成的动画对象的运动轨迹,并响应于针对控制节点的第一调整操作,对控制节点对应的关键帧的初始位置信息进行调整,获得目标动画数据,可以直观地查看到动画对象的运动轨迹,并通过调整控制节点的方式,对动画对象的运动轨迹进行调整,以直观且快速地对动画数据进行编辑,提高动画制作的效率。基于此,可以将原始动画数据渲染为由控制节点构成的运动轨迹,并通过在动画编辑场景中拖动运动轨迹的控制节点的方式,对动画对象的运动轨迹进行调整,从而直观、清楚以及便捷地调整动画的动画效果,不仅能够极大提高动画制作的效率,而且无需动画制作人员花费较大的学习成本。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 the animation production personnel to spend a large learning cost.
在一些可以实现的实施方式中,还可以在动画编辑场景中,显示关键帧以及动画对象,以及响应于针对关键帧的第二调整操作,对关键帧对应的时间点进行调整,获得目标动画数据。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.
这里,如图2所示,可以在动画编辑场景200中,通过时间轴210显示第一关键帧211、第二关键帧212、第三关键帧213、第四关键帧214、第五关键帧215、第六关键帧216。以及,在动画编辑场景200中,显示动画对象207,以向用户展示动画对象207在动画编辑场景中的位置。Here, as shown in FIG2 , in the animation editing scene 200, a first key frame 211, a second key frame 212, a third key frame 213, a fourth key frame 214, a fifth key frame 215, and a sixth key frame 216 can be displayed through a timeline 210. Also, in the animation editing scene 200, an animation object 207 is displayed to show the user the position of the animation object 207 in the animation editing scene.
针对关键帧的第二调整操作,用于对关键帧对应的时间点进行调整。示例性地,第二调整操作可以是针对关键帧的拖动操作,用户可以通过拖动需要调整的关键帧,对需要调整的关键帧的时间点进行调整。例如,用户可以通过拖动图2所示的第一关键帧211,以调整第一关键帧211对应的时间点。The second adjustment operation for the key frame is used to adjust the time point corresponding to the key frame. Exemplarily, 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. For example, the user can adjust the time point corresponding to the first key frame 211 by dragging the first key frame 211 shown in FIG. 2.
需要注意的是,通过第二调整操作对关键帧的时间点进行调整,变更的是该关键帧对应的时间点,该关键帧对应的初始位置信息并不会发生变化。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.
值得说明的是,通过上述第二调整操作对原始动画数据进行调整之后,可以获得目标动画数据。在获得目标动画数据之后,目标动画数据可以覆盖原始动画数据进行存储,以通过目标动画数据进行动画播放。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.
需要注意的是,在一次动画编辑过程中,用户既可以对关键帧对应的时间点进行调整,也可以对关键帧对应的初始位置信息进行调整,获得目标动画数据。也就是说,调整关键帧的时间点的操作以及调整控制点的操作可以是在一个动画编辑过程中单独进行的,也可以是同时进行的。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.
由此,通过上述第二调整操作,可以直观地查看到动画对象的运动轨迹,并通过调整关键帧的时间点的方式,对动画效果进行调整。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.
图3是根据一些实施例示出的获得目标动画数据的示意图。如图3所示,可以获取原始动画数据,渲染原始动画数据包括的关键帧以及运动轨迹,对关键帧和/或控制节点进行调整,并判断是否修改控制节点的初始位置信息,如果未修改,则运动轨迹以及控制节点保持不变,如果修改,则更新原始动画数据,获得目标动画数据。Fig. 3 is a schematic diagram of obtaining target animation data according to some embodiments. As shown in Fig. 3, 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, the motion trajectory and the control node remain unchanged. If modified, the original animation data is updated to obtain the target animation data.
在一些可以实现的实施方式中,原始动画数据还可以包括用于指示至少一帧关键帧对应的初始位置信息与虚拟场景中的元素节点之间的相对位置为目标相对位置的指示信息。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.
其中,虚拟场景中的元素节点可以是虚拟场景中的一个元素。例如,如果虚拟场景为游戏场景,则元素节点可以是游戏场景中的游戏角色、角色头像等等元素。又例如,如果虚拟场景为页面(如直播间页面),则元素节点可以是页面中的头像、图形、文本等等元素。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.
在原始动画数据包括指示信息的情况下,表示至少一帧关键帧与虚拟场景中的元素节点绑定,且该至少一帧关键帧与元素节点之间的相对位置为目标相对位置。当虚拟场景中的元素节点的位置发生变化时,需要对应调整与该元素节点绑定的至少一帧关键帧的位置信息,以使元素节点与至少一帧关键帧之间的相对位置保持为目标相对位置。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.
应当理解的是,用户可以通过动画编辑器,指示关键帧需要绑定的元素节点,并通过在动画编辑器中调整元素节点与绑定的关键帧对应的控制节点之间的相对位置来确定目标相对位置。在动画编辑器输出动画数据时,通过上述指示信息来描述至少一帧关键帧与绑定的元素节点之间的目标相对位置。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.
示例性地,虚拟场景中的每一个元素节点可以具有对应的唯一标识符,可以将与至少一帧关键帧绑定的元素节点对应的唯一标识符存储在动画数据的一个字段中。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.
需要注意的是,在本公开实施例中,动画数据中的不同关键帧可以分别绑定不同的元素节点。例如,在虚拟场景中具有多个头像,如果需要实现动画对象分别围绕多个头像旋转的动画效果,则可以使得每一个头像分别绑定不同的关键帧,以使最终形成的运动轨迹能够围绕不同的头像进行旋转。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.
相应地,在一些可以实现的实施方式中,可以在动画编辑场景中,显示元素节点映射在动画编辑场景中的虚拟节点,并响应于针对虚拟节点的第三调整操作,根据虚拟节点调整后的位置信息以及目标相对位置,对虚拟节点关联的至少一帧关键帧对应的初始位置信息进行调整,获得目标动画数据。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.
这里,元素节点映射在动画编辑场景中的虚拟节点,可以是指虚拟场景中的元素节点映射在动画编辑场景中的节点。如图2所示,可以在动画编辑场景200中显示虚拟场景209以及显示对应的虚拟节点208,该虚拟节点208实际上是虚拟场景209中的一个节点元素的指代。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. As shown in FIG. 2 , a virtual scene 209 and a corresponding virtual node 208 may be displayed in the animation editing scene 200 , and the virtual node 208 is actually a reference to a node element in the virtual scene 209 .
在一些实施例中,在动画编辑场景中,显示元素节点映射在动画编辑场景中的虚拟节点时,可以突出显示虚拟节点关联的至少一帧关键帧。例如,可以通过不同颜色来表示虚拟节点关联的至少一帧关键帧,以使动画制作人员能够快速了解与虚拟节点绑定的关键帧。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.
需要注意的是,在动画编辑场景中,虚拟节点的显示位置可以与元素节点在虚拟场景中的位置信息相关。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.
其中,与虚拟节点关联的至少一帧关键帧对应的控制节点与虚拟节点的相对位置为目标相对位置。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.
也就是说,在动画编辑场景中显示的各个控制节点中与虚拟节点绑定的控制节点与虚拟节点的位置为目标相对位置。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.
针对虚拟节点的第三调整操作可以是针对虚拟节点的拖动操作。用户可以通过在动画编辑场景中拖动虚拟节点,以调整虚拟节点的位置。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.
由于上述指示信息实际上用于指示至少一帧关键帧对应的控制节点与虚拟节点绑定,且绑定之后的该控制节点与该虚拟节点之间相对位置始终保持为目标相对位置,在虚拟节点的位置信息发生变化时,可以对虚拟节点关联的至少一帧关键帧对应的初始位置信息进行调整,以使调整后的控制节点与虚拟节点之间的相对位置保持为目标相对位置。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.
例如,如图2所示,第二控制节点202、第三控制节点203、第四控制节点204、第五控制节点205、第六控制节点206均与虚拟节点208绑定,也就是说,第二控制节点202、第三控制节点203、第四控制节点204、第五控制节点205、第六控制节点206与虚拟节点208之间的相对位置始终保持为目标相对位置。在拖动虚拟节点208时,第二控制节点202、第三控制节点203、第四控制节点204、第五控制节点205、第六控制节点206的位置也相应变化,从而使得第二控制节点202、第三控制节点203、第四控制节点204、第五控制节点205、第六控制节点206对应的关键帧的初始位置信息发生变化。For example, as shown in FIG2 , 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.
由此,通过上述实施方式,可以通过调整虚拟节点的方式来对与该虚拟节点关联的关键帧的初始位置信息进行调整,以快速地对动画对象的运动轨迹进行调整。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.
值得说明的是,上述实施例描述的原始动画数据可以是用户通过动画编辑器编辑获得的。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.
在一些可以实现的实施方式中,可以响应于动画编辑指令,在动画编辑场景中创建多帧关键帧,并为各关键帧配置对应的初始位置信息,以及在动画编辑场景中显示已创建的关键帧对应的控制节点和由该控制节点形成的运动轨迹,然后基于多帧关键帧,获得原始动画数据。In some achievable 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.
这里,动画编辑指令用于指示在动画编辑场景中创建多帧关键帧,并为各关键帧配置对应的初始位置信息。在动画编辑器的动画编辑场景中,用户可以通过动画编辑指令配置所需的动画的关键帧的时间点以及该关键帧对应的初始位置信息,以编辑形成动画对象的运动轨迹,实现对应的动画效果。Here, the animation editing instruction is used to instruct the creation of multiple keyframes in the animation editing scene and configure the corresponding initial position information for each keyframe. In the animation editing scene of the animation editor, the user can use the animation editing instruction to configure the time point of the required animation keyframe and the initial position information corresponding to the keyframe to edit the motion trajectory of the animation object and achieve the corresponding animation effect.
如图2所示,可以通过动画编辑场景200中的时间轴210来创建多帧关键帧,并为各关键帧配置对应的初始位置信息,以指示动画对象对应的运动轨迹。As shown in FIG. 2 , multiple key frames may be created through a timeline 210 in an animation editing scene 200 , and corresponding initial position information may be configured for each key frame to indicate a corresponding motion trajectory of the animation object.
需要注意的是,在配置各关键帧配置对应的初始位置信息时,针对每一个已配置完成的关键帧,可以在动画编辑场景中显示已创建的关键帧对应的控制节点和由控制节点形成的运动轨迹,以使用户能够直观查看到其所绘制的动画对象的运动轨迹。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.
然后,可以基于所创建的关键帧,获得原始动画数据。应当理解的是,该关键帧记录有对应的初始位置信息,以指示动画对象在该关键帧对应的时间的位置。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.
由此,通过上述实施方式,用户在创建动画数据时,能够直观查看到所创建的动画对象的运动轨迹,从而帮助用户编辑更加符合需求的动画效果。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.
在一些可以实现的实施方式中,原始动画数据还包括用于指示至少一帧关键帧对应的初始位置信息与虚拟场景中的元素节点之间的相对位置为目标相对位置的指示信息。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.
相应地,可以在动画编辑场景中创建虚拟节点,响应于节点关联操作,将多帧关键帧中的至少一帧关键帧与虚拟节点进行关联,获得指示信息,并根据多帧关键帧以及指示信息,获得原始动画数据。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.
这里,虚拟节点为虚拟场景中的元素节点映射在动画编辑场景中的节点。在动画编辑场景中创建的虚拟节点,用户可以通过唯一标识符来指示虚拟节点对应虚拟场景中的某一个元素节点。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, a user can indicate that the virtual node corresponds to a certain element node in the virtual scene through a unique identifier.
节点关联操作用于指示至少一帧关键帧与虚拟节点进行关联。也就是说,指示多帧关键帧中的至少一帧关键帧与虚拟节点进行绑定。值得说明的是,在至少一帧关键帧与虚拟节点进行关联之后,至少一帧关键帧对应的控制节点与虚拟节点之间的相对位置维持为关联时的相对位置。如图2所示,如果将第二控制节点202、第三控制节点203、第四控制节点204、第五控制节点205、第六控制节点206与虚拟节点208进行绑定,则第二控制节点202、第三控制节点203、第四控制节点204、第五控制节点205、第六控制节点206与虚拟节点208之间的相对位置均保持为如图2所示的相对位置。The node association operation is used to indicate that at least one key frame is associated with a virtual node. That is to say, at least one key frame in a plurality of key frames is indicated to be 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 at least one key frame and the virtual node is maintained as the relative position when associated. As shown in Figure 2, if 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 bound to the virtual node 208, 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 all maintained as the relative positions shown in Figure 2.
当然,需要注意的是,在控制节点与虚拟节点进行绑定之后,可以通过对控制节点的第一调整操作来修改控制节点与虚拟节点之间的相对位置。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.
由此,通过上述实施方式,用户在动画编辑器中指示至少一帧关键帧与虚拟节点进行绑定,从而使得在播放动画时,根据虚拟节点对应的元素节点的实时位置变更动画对象的运动轨迹,以实现通过一个动画数据实现多种不同的运动轨迹的动画效果。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.
在一些可以实现的实施方式中,目标动画数据还包括用于控制动画对象进行旋转的旋转参数,旋转参数包括动画对象的期望向上方向、动画对象的初始朝向方向以及动画对象的期望朝向方向。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.
这里,旋转参数是用于对动画对象进行旋转控制的参数,其决定了动画对象在沿着运动轨迹进行运动时的旋转角度。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.
动画对象的期望向上方向(desiredUpInWorld)是指动画对象在垂直方向上期望的对齐方向。期望向上方向用于控制动画对象在进行旋转或方向变换时,其“上”方向与期望的方向一致,有助于维持动画对象在空间中的正确姿态。一般来说,期望向上方向可以是重力方向。The desired up direction (desiredUpInWorld) of an animated object refers to the desired vertical alignment direction of the animated object. The desired up direction is used to control the "up" direction of the animated object to be consistent with the desired direction when the animated object is rotated or transformed, which helps to maintain the correct posture of the animated object in space. Generally speaking, the desired up direction can be the direction of gravity.
动画对象的初始朝向方向(Initial Direction)是指在动画播放前,动画对象的实际朝向。初始朝向方向可以理解为是在动画对象的美术制作过程中,动画对象的初始朝向。例如,动画对象的初始朝向方向可以为朝向屏幕外。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.
动画对象的期望朝向方向(initial desired direction)是指动画开始前,希望动画对象朝向的特定方向。例如,动画对象的初始朝向方向为朝向屏幕外,期望朝向方向则可以是希望动画对象从朝向屏幕外向朝向屏幕里进行运动。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.
需要注意的是,动画对象的初始朝向方向是动画帧序列的起点,动画对象的期望朝向方向则是动画帧序列开始时的目标方向。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.
示例性地,用户可以通过在动画编辑器中为动画对象添加自动旋转组件,并通过自动旋转组件配置动画对象的期望向上方向、动画对象的初始朝向方向以及动画对象的期望朝向方向的旋转参数,以指示动画对象在沿着运动轨迹进行运动的过程中,通过期望向上方向、初始朝向方向以及期望朝向方向对动画对象执行旋转操作。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.
相应地,可以响应于旋转设置操作,在动画编辑场景中配置动画对象对应的期望向上方向、初始朝向方向以及期望朝向方向,基于多帧关键帧、期望向上方向、初始朝向方向以及期望朝向方向,获得原始动画数据。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.
这里,旋转设置操作用于配置动画对象的旋转参数(包括期望向上方向、初始朝向方向以及期望朝向方向),以指示在播放动画时,通过旋转参数,对动画对象执行旋转操作,获得更加自然真实的动画效果。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.
示例性地,可以通过动画编辑器来向动画对象添加自动旋转组件,并在自动旋转组件中配置动画对象对应的期望向上方向、初始朝向方向以及期望朝向方向。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.
然后,基于关键帧、期望向上方向、初始朝向方向以及期望朝向方向,获得原始动画数据。Then, original animation data is obtained based on the key frame, the desired upward direction, the initial facing direction, and the desired facing direction.
由此,通过上述实施方式,通过旋转设置操作,即可实现动画对象在运动时能随着运动轨迹的运动方向随时调整旋转角度,无需用户手动调节动画对象在每个时间点的旋转朝向,极大提高了动画编辑的效率。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.
图4是根据一些实施例示出的一种动画播放方法的流程图。如图4所示,本公开实施例提供一种动画播放方法,该方法可以通过电子设备执行,具体可以是通过一种动画播放装置来执行,该装置可以由软件和/或硬件的方式实现,配置于电子设备中。如图4所示,该方法可以包括以下步骤。FIG4 is a flow chart of an animation playback method according to some embodiments. As shown in FIG4 , the present disclosure provides an animation playback method, which can be performed 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. As shown in FIG4 , the method can include the following steps.
在步骤410中,根据如上述实施例所示的动画编辑方法,确定目标动画数据,其中,目标动画数据包括多帧关键帧,关键帧用于记录动画对象在该关键帧处的目标位置信息。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.
这里,目标动画数据与上述实施例的原始动画数据的概念一致,均是用于管理动画的所有信息和资源。在本公开实施例中,目标动画数据包括多帧关键帧,每一关键帧用于记录动画对象在该关键帧处的目标位置信息。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.
需要注意的是,目标位置信息与上述实施例描述的初始位置信息的概念是一致的,在此不再赘述。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.
应当理解的是,目标动画数据可以是预先通过动画编辑器编辑好的动画数据,在触发播放动画时,从对应的存储区域中获取目标动画数据。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.
在步骤420中,根据目标动画数据,获得多帧关键帧对应的目标位置信息构成的运动轨迹。In step 420, a motion trajectory consisting of target position information corresponding to multiple key frames is obtained according to the target animation data.
这里,由于目标动画数据中的每一帧关键帧记录了动画对象在该关键帧处的目标位置信息,相应地,可以在多帧关键帧之间,通过插值算法计算两两关键帧之间的中间帧的位置信息,从而获得目标动画数据包括的多帧关键帧对应的目标位置信息构成的运动轨迹。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.
也就是说,将多帧关键帧对应的目标位置信息以及插值得到的中间帧的位置信息进行连接,即可形成动画对象对应的运动轨迹,表示动画对象随时间轴的运动。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.
需要注意的是,在本公开实施例中,使用的插值算法可以根据需求确定。示例性地,插值算法可以是线性插值算法、样条插值算法以及贝塞尔曲线插值算法等等。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.
在步骤430中,根据运动轨迹以及动画对象,渲染获得多帧动画帧。In step 430, multiple animation frames are rendered according to the motion trajectory and the animation object.
这里,动画对象可以是需要进行动态特效的对象,用户可以根据业务需求配置对应的动画对象。示例性地,在直播场景中,动画对象可以为送出的虚拟礼物。也就是说,在用户送出虚拟礼物之后,可以通过动画数据来控制虚拟礼物展示对应的动画效果。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.
可以通过将运动轨迹应用于动画对象,以控制动画对象沿着该运动轨迹进行运动,获得多帧动画帧。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.
其中,多帧动画帧用于描述动画对象沿着运动轨迹进行运动。也就是说,在用户视觉中,通过连续的多帧动画帧,动画对象沿着多帧关键帧形成的运动轨迹进行运动。Among them, the multiple animation frames are used to describe the movement of the animation object along the motion track. That is, in the user's vision, through the continuous multiple animation frames, the animation object moves along the motion track formed by the multiple key frames.
值得说明的是,在渲染生成动画帧的过程中,针对每一帧动画帧,可以通过运动轨迹确定动画对象在该帧动画帧处对应的目标位置信息,然后更新动画对象在该帧动画帧的当前状态,以确保动画对象沿着运动轨迹平滑移动。进而,根据动画对象的当前状态,执行渲染操作,获得对应的动画帧。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.
在步骤440中,显示多帧动画帧。In step 440 , a plurality of animation frames are displayed.
这里,在渲染生成动画帧之后,显示该动画帧,以展示动画对象沿着运动轨迹进行运动的动画效果。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.
需要注意的是,在渲染获得一帧动画帧时,即可显示该帧动画帧,也就是说,每渲染生成一帧动画帧,可以马上显示该动画帧,以保证动画的实时性。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.
由此,通过根据如上述实施例所示的动画编辑方法,确定目标动画数据,以及根据目标动画数据,获得多帧关键帧对应的目标位置信息构成的运动轨迹,根据运动轨迹以及动画对象,渲染获得多帧动画帧,并显示多帧动画帧,可以通过多帧关键帧来指示动画对象的运动轨迹,从而实时渲染得到对应的动画效果。而且,通过目标动画数据来渲染生成动画帧,用户可以根据需求动态调整目标动画数据中的关键帧对应的目标位置信息,以修改动画对象的运动轨迹,获得符合需求的动画效果。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.
在一些可以实现的实施方式中,目标动画数据还包括用于指示至少一帧关键帧对应的目标位置信息与虚拟场景中的元素节点之间的相对位置为目标相对位置的指示信息。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.
其中,关于指示信息的相关描述可以参照上述动画编辑方法的相关描述,在此不再赘述。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.
图5是图4所示步骤420的详细流程图。如图5所示,相应地,在一些可以实现的实施方式中,步骤420可以包括以下步骤。Fig. 5 is a detailed flow chart of step 420 shown in Fig. 4. As shown in Fig. 5, accordingly, in some practicable implementations, step 420 may include the following steps.
在步骤421中,响应于目标动画数据包括指示信息,获取元素节点在虚拟场景中的节点位置信息。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 obtained.
这里,在目标动画数据包括上述指示信息的情况下,表示目标动画数据中的多帧关键帧存在至少一帧关键帧与虚拟场景中的元素节点绑定,且该至少一帧关键帧与虚拟场景中的元素节点之间的相对位置为目标相对位置。由于目标相对位置不变,在虚拟场景中的元素节点的位置发生变化的情况下,与该元素节点关联的至少一帧关键帧的目标位置信息也会发生变化,相应地,动画对象的运动轨迹也会发现变化。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 the 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.
因此,在目标动画数据包括指示信息的情况下,可以获取元素节点在虚拟场景中的节点位置信息。该节点位置信息为元素节点在虚拟场景中的坐标信息。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.
示例性地,可以根据与至少一帧关键帧绑定的元素节点对应的唯一标识符,查找得到该元素节点对应的节点位置信息。Exemplarily, the node position information corresponding to the element node may be found out according to the unique identifier corresponding to the element node bound to at least one key frame.
在步骤422中,根据节点位置信息以及目标相对位置,对至少一帧关键帧对应的目标位置信息进行调整,获得调整后的目标位置信息。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.
这里,由于与元素节点绑定的至少一帧关键帧对应的控制节点与虚拟场景中的元素节点之间的相对位置保持为目标相对位置,在已知元素节点的节点位置信息且目标相对位置的情况下,可以对至少一帧关键帧对应的目标位置信息进行调整,获得调整后的目标位置信息。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.
其中,调整后的目标位置信息用于使得调整后的目标位置信息与元素节点的相对位置为目标相对位置。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.
也就是说,由于与元素节点绑定的至少一帧关键帧对应的控制节点与虚拟场景中的元素节点之间的相对位置保持为目标相对位置,在目标相对位置保持不变的情况下,如果虚拟场景中的元素节点的节点位置信息发生变化,则可以对应调整控制节点的目标位置信息,以使控制节点与元素节点始终之间的相对位置始终保持为目标相对位置。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.
在步骤423中,基于调整后的目标位置信息,获得运动轨迹。In step 423, a motion trajectory is obtained based on the adjusted target position information.
这里,获得调整后的目标位置信息可以理解为获得新的目标动画数据,然后基于新的目标动画数据中的各帧关键帧,生成动画对象对应的运动轨迹,进而通过该运动轨迹生成多帧动画帧。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.
图6是根据一些实施例示出的运动轨迹的示意图。如图6所示,动画对象608的运动轨迹由第一控制节点601、第二控制节点602、第三控制节点603、第四控制节点604、第五控制节点605以及第六控制节点606形成,第二控制节点602、第三控制节点603、第四控制节点604、第五控制节点605以及第六控制节点606与元素节点607关联(即第二控制节点602、第三控制节点603、第四控制节点604、第五控制节点605、第六控制节点606与元素节点607之间的相对位置如图6所示)。Fig. 6 is a schematic diagram of a motion trajectory according to some embodiments. As shown in Fig. 6, 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 (i.e., 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 shown in Fig. 6).
图7是根据又一些实施例示出的运动轨迹的示意图。如图7所示,当元素节点607的位置发生变化时(由图6的位置变化至图7的位置),由于第二控制节点602、第三控制节点603、第四控制节点604、第五控制节点605、第六控制节点606与元素节点607之间的相对位置保持为目标相对位置,则需要将第二控制节点602、第三控制节点603、第四控制节点604、第五控制节点605、第六控制节点606的位置信息从图6调整为图7所示,第一控制节点601的位置信息保持不变。相应地,动画对象608的运动轨迹发生变更(由图6的运动轨迹变更为图7所示的运动轨迹)。Fig. 7 is a schematic diagram of a motion trajectory according to some other embodiments. As shown in Fig. 7, when the position of the element node 607 changes (from the position of Fig. 6 to the position of Fig. 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, and the sixth control node 606 and the element node 607 are maintained as the target relative positions, it is necessary to adjust the position information of 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 from Fig. 6 to that shown in Fig. 7, and the position information of the first control node 601 remains unchanged. Accordingly, the motion trajectory of the animation object 608 changes (from the motion trajectory of Fig. 6 to the motion trajectory shown in Fig. 7).
由此,通过上述步骤421至步骤423,可以使得动画对象根据虚拟场景中的元素节点实时的元素节点位置,变更动画对象运动轨迹,从而在无需用户手动编辑目标动画数据中的关键帧的目标位置信息的情况下,即可实现实时的动态轨迹变化。例如,在虚拟直播间中,不同用户送出虚拟礼物,由于不同用户的头像在直播间页面中的位置不一样,则可以根据不同用户的头像的实时位置,变更动画对象的运动轨迹,以实现动画对象围绕用户的头像进行旋转的动画效果。也就是说,在播放动画时,可以通过元素节点的节点位置信息来动态调整动画对象的运动轨迹,灵活度更高。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.
图8是根据一些实施例示出的动画播放的流程图。如图8所示,响应于接收到动画播放指令,加载目标动画数据,判断目标动画数据中是否存在关联元素节点的关键帧,在未存在关联元素节点的关键帧的情况下,基于加载的目标动画数据播放动画帧。在存在关联元素节点的关键帧的情况下,获取元素节点对应的节点位置信息,并根据获取到的节点位置信息调整关联的关键帧的目标位置信息,生成新的目标动画数据,然后基于新的目标动画数据播放动画帧。而且,在播放动画帧时,动态检测元素节点是否发生移动,如果发生移动,则重新加载目标动画数据并获取新的节点位置信息。FIG8 is a flowchart of animation playback according to some embodiments. As shown in FIG8 , in response to receiving an animation playback instruction, the target animation data is loaded, and it is determined whether there is a key frame of an associated element node in the target animation data. If there is no key frame of an associated element node, the animation frame is played based on the loaded target animation data. In the case where there is a key frame of an 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.
在一些实施例中,虚拟场景可以包括直播间页面,元素节点可以包括直播间页面中的目标账户的头像。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.
其中,目标账户为送出虚拟礼物的第一账户或者接受虚拟礼物的第二账户。也就是说,元素节点可以为直播间页面中送出虚拟礼物的第一账户对应的头像或者为直播间页面中接受虚拟礼物的第二账户。相应地,动画对象可以为该虚拟礼物,当然,动画对象也可以是其他动画元素,如三维模型。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.
通过上述实施方式,动画对象的运动轨迹能够与送出虚拟礼物的第一账户的头像或者与接受虚拟礼物的第二账户的头像相关联,从而动态生成同一轨迹的不同相对运行,让动画对象沿着不同的头像进行移动旋转。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.
图9是根据一些实施例示出的动画的示意图。如图9所示,在直播间页面中,元素节点901位于第一位置,动画对象902围绕元素节点901进行移动以及旋转。图10是根据另一些实施例示出的动画的示意图。如图10所示,元素节点901从图9所示的第一位置移动至图10所示的第二位置,相应地,动画对象902的运动轨迹发生变化。FIG9 is a schematic diagram of an animation according to some embodiments. As shown in FIG9 , in the live broadcast room page, the element node 901 is located at a first position, and the animation object 902 moves and rotates around the element node 901. FIG10 is a schematic diagram of an animation according to other embodiments. As shown in FIG10 , the element node 901 moves from the first position shown in FIG9 to the second position shown in FIG10 , and accordingly, the motion trajectory of the animation object 902 changes.
在本公开实施例中,可以根据虚拟场景中的元素节点对应的节点位置信息以及目标动画数据,获得动画对象的运动轨迹,进而响应于动画播放指令,基于动画对象的运动轨迹,渲染生成多帧动画帧,并显示多帧动画帧,其中,多帧动画帧用于描述动画对象沿着运动轨迹进行运动。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.
示例性地,可以获取虚拟场景中的元素节点对应的节点位置信息,其中,元素节点为虚拟场景中与目标动画数据中的至少一帧关键帧相关联的元素,进而根据节点位置信息,对目标动画数据中的与元素节点相关联的至少一帧关键帧的目标位置信息进行调整,获得调整后的目标动画数据,然后基于调整后的目标动画数据,获得动画对象对应的运动轨迹,基于运动轨迹以及动画对象,渲染获得多帧动画帧,并显示多帧动画帧。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.
在一些可以实现的实施方式中,可以从虚拟场景中获取元素节点,并根据运动轨迹、元素节点以及动画对象,渲染得到多帧动画帧,进而通过叠加在虚拟场景上层的动画播放层,显示多帧动画帧。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.
这里,从虚拟场景中获取元素节点可以是获取元素节点对应的实时图像,然后基于运动轨迹、元素节点以及动画对象,渲染得到多帧动画帧。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.
动画播放层可以是叠加在虚拟场景上层的一个视频播放层,通过动画播放层显示动画帧,实际上是在虚拟场景上叠加显示一层包括多帧动画帧的动画效果。The animation play layer may be a video play layer superimposed on the upper layer of the virtual scene. Displaying the animation frames through the animation play layer is actually to superimpose and display a layer of animation effects including multiple animation frames on the virtual scene.
如图9所示,动画播放层叠加在直播间页面的上层,可以获取直播间页面中的元素节点901的实时图像,并通过运动轨迹、元素节点901的实时图像以及动画对象902,得到动画帧,然后将动画帧叠加显示在直播间页面的上层,实现在直播间页面上播放动画,且动画能够与直播间页面中的元素节点进行交互。As shown in Figure 9, the animation playback layer is superimposed on the upper layer of the live broadcast room page. The real-time image of the element node 901 in the live broadcast room page can be obtained, and the animation frame can be obtained through the motion trajectory, the real-time image of the element node 901 and the animation object 902. The animation frame is then 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.
在一些可以实现的实施方式中,目标动画数据还包括用于控制动画对象进行旋转的旋转参数,旋转参数包括动画对象的期望向上方向、动画对象的初始朝向方向以及动画对象的期望朝向方向。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.
需要注意的是,关于旋转参数的详细描述,可以参见上述实施例的相关描述,在此不再赘述。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.
图11是图4所示步骤430的详细流程图。如图11所示,步骤430可以包括以下步骤。Fig. 11 is a detailed flow chart of step 430 shown in Fig. 4. As shown in Fig. 11, step 430 may include the following steps.
在步骤1110中,在当前渲染的动画帧为第一动画帧的情况下,根据运动轨迹,获得动画对象在第一动画帧处的第一位置信息。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.
这里,第一动画帧为目标动画数据对应的第一帧的动画帧。也就是说,第一动画帧为多帧动画帧的序列中的第一帧动画帧。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.
在渲染第一动画帧时,可以通过运动轨迹确定动画对象在第一动画帧时的第一位置信息。其中,运动轨迹反映了动画对象在不同时间点对应的位置信息,通过运动轨迹即可获得动画对象在第一动画帧对应的时间点的第一位置信息。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.
在步骤1120中,根据第一位置信息以及动画对象,渲染得到第一帧动画帧。In step 1120, a first animation frame is rendered according to the first position information and the animation object.
这里,可以通过第一位置信息对动画对象进行渲染,获得第一帧动画帧。其中,第一帧动画帧对应的动画效果可以理解为动画对象出现在第一位置信息对应的空间位置中。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.
在步骤1130中,在当前渲染的动画帧为第二动画帧的情况下,根据运动轨迹,获得动画对象在第二动画帧处的第二位置信息。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.
这里,第二动画帧为目标动画数据中除第一帧的动画帧之外的动画帧。也就是说,第二动画帧是多帧动画帧的序列中的除第一帧动画帧之外的其他动画帧。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.
在渲染第二动画帧时,可以通过运动轨迹确定动画对象在第二动画帧时的第二位置信息。其中,运动轨迹反映了动画对象在不同时间点对应的位置信息,通过运动轨迹即可获得动画对象在第二动画帧对应的时间点的第二位置信息。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.
在步骤1140中,根据第二动画帧对应的第二位置信息以及上一帧动画帧对应的第三位置信息,获得动画对象的当前运动方向。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.
这里,上一帧动画帧是指第二动画帧的上一帧动画帧,例如,第二帧动画帧的上一帧动画帧为第一帧动画帧。上一帧动画帧对应的第三位置信息可以是在渲染上一帧动画帧时通过运动轨迹获得的。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.
示例性地,可以根据第二位置信息与第三位置信息之间的差值,获得动画对象的当前运动方向。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.
其中,该动画对象的当前运动方向(forwardInWorld)为一个方向向量,表示动画对象相对于上一帧动画帧的运动方向的变化,从而体现动画对象的前进方向。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.
在步骤1150中,根据当前运动方向、期望向上方向、初始朝向方向以及期望朝向方向,获得目标旋转角度。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.
这里,目标旋转角度可以理解为是一个旋转四元数(Quaternion)。其中,目标旋转角度用于使得动画对象能够朝向期望朝向方向以及保持期望向上方向进行移动。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.
例如,在角色动画中,可以需要角色朝向一个特定方向(期望朝向方向),同时保持其头部或上半身的垂直对齐(期望向上方向),以实现自然和逼真的动作,目标旋转角度则可以使得角色在向当前运动方向进行运动的过程中,朝向期望朝向方向并保持期望向上方向。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 movement direction.
可以通过当前运动方向、期望向上方向、初始朝向方向以及期望朝向方向,计算得到一个目标旋转角度,该目标旋转角度被应用于动画对象之后,可以使得动画对象能够朝向期望朝向方向以及保持期望向上方向进行移动。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.
在步骤1160中,根据第二位置信息、目标旋转角度以及动画对象,渲染得到第二动画帧。In step 1160, a second animation frame is rendered according to the second position information, the target rotation angle, and the animation object.
这里,在获得第二位置信息以及目标旋转角度之后,将第二位置信息以及目标旋转角度应用于动画对象,渲染生成对应的第二动画帧。其中,第二帧动画帧对应的动画效果可以理解为动画对象出现在第二位置信息对应的空间位置,并按照目标旋转角度进行旋转。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.
在一些实施例中,可以根据相邻两帧动画帧之间的时间间隔,对第二动画帧的目标旋转角度以及上一帧动画帧对应的目标旋转角度进行插值,获得多个旋转角度,然后基于第二位置信息、多个旋转角度以及动画对象,渲染得到动画帧。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.
其中,相邻两帧动画帧之间的时间间隔可以根据动画的帧速率(Frame Rate)来确定。通过在相邻两帧动画帧之间的时间间隔上,对第二动画帧的目标旋转角度以及上一帧动画帧对应的目标旋转角度进行插值,可以插值得到多个旋转角度。然后再将插值得到的多个旋转角度应用在动画对象上,以使动画对象在帧与帧之间的旋转更加自然、顺滑。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.
由此,通过上述步骤1110至步骤1160,可以使得动画对象在沿着运动轨迹进行运动的过程中,能够朝向期望朝向方向以及保持期望向上方向进行移动,从而使得动画对象的姿态更加真实自然,获得视觉效果更佳的动画效果。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.
需要说明的是,在动画对象沿着运动轨迹进行运动时,由于动画对象不会随着运动轨迹而动态旋转,从而导致动画效果缺乏动态感觉。例如,人在正常奔跑时,人的正面始终是朝着前方运动。在相关的动画制作过程中,往往需要开发人员手动设置动画对象在不同时间点上的旋转朝向,以使动画对象能够随着运动轨迹的变化面朝前方。但是这种动画制作方式相对繁琐,导致动画成本剧增。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.
通过本公开实施例提供的动画编辑方法,动画制作人员可以配置对应的旋转参数。通过本公开实施例提供的动画播放方法,动画对象在运动过程中,通过动画对象在每一帧动画帧中的位置、指定的期望向上方向、指定的初始朝向方向以及期望朝向方向,计算得到动画对象在该动画帧中的目标旋转角度,并将计算得到的目标旋转角度应用在动画对象上,能够随着运动轨迹的变化而随时调整旋转角度,使得动画对象的朝向方向能够始终面朝前方,并且保持期望向上方向。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.
图12是根据一些实施例示出的动画效果的示意图。如图12所示,动画对象1201在围绕元素节点1202进行旋转的过程中,能够始终保持与真实世界一致的姿态,从而使得动画效果更加自然、真实。Fig. 12 is a schematic diagram of an animation effect according to some embodiments. As shown in Fig. 12, the animation object 1201 can always maintain a posture consistent with the real world during the process of rotating around the element node 1202, so that the animation effect is more natural and realistic.
图13是图11所示步骤1150的详细流程图。如图13所示,步骤1150可以包括以下步骤。Fig. 13 is a detailed flow chart of step 1150 shown in Fig. 11. As shown in Fig. 13, step 1150 may include the following steps.
在步骤1151中,根据当前运动方向以及期望向上方向,获得初始旋转角度。In step 1151, an initial rotation angle is obtained according to the current movement direction and the desired upward direction.
这里,初始旋转角度用于使得动画对象在朝向期望朝向方向进行运动到的过程中,同时保持期望向上方向。Here, the initial rotation angle is used to enable the animation object to maintain the desired upward direction while moving toward the desired direction.
在一些实施例中,可以根据世界坐标系中的默认朝向向量以及当前运动方向,确定用于将默认朝向向量旋转至当前运动方向的第一旋转四元数,根据当前运动方向与期望向上方向的叉积,获得右侧向量,根据右侧向量与当前运动方向的叉积,获得新的期望向上方向,根据第一旋转四元数以及世界坐标系中的默认向上向量,获得旋转后的向上向量,根据旋转后的向上向量以及新的期望向上方向,获得第二旋转四元数,进而根据第一旋转四元数以及第二旋转四元数,获得初始旋转角度。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.
其中,世界坐标系可以是指虚拟场景中的坐标系,世界坐标系中的默认朝向向量是指在世界坐标系中的表示朝向的向量,一般情况下,在三维空间之中,默认朝向向量可以为(0,0,1)。第一旋转四元数是用于将默认朝向向量旋转至当前运动方向所需的旋转四元数。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.
示例性地,可以通过函数const rotateForwardToDesiredForward=newQuaternion().setFromUnitVectors(UpVector.FORWARD,forwardInWorld)计算得到第一旋转四元数。其中,rotateForwardToDesiredForward为第一旋转四元数,UpVector.FORWARD为默认朝向向量,forwardInWorld为当前运动方向。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.
通过计算当前运动方向与期望向上方向的叉积,获得右侧向量(rightInWorld),右侧向量实际上是一个垂直于当前运动方向和期望向上方向的向量。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.
通过右侧向量与当前运动方向的叉积获得的新的期望向上方向,相当于是在当前运动方向的平面上的垂直向量。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.
世界坐标系中的默认向上向量是指世界坐标系中的表示向上方向的向量,一般情况下,在三维空间中的默认向上向量可以表示为(0,1,0)。通过将第一旋转四元数应用于世界坐标系中的默认向上向量,可以对世界坐标系中的默认向上向量进行旋转,获得旋转后的向上向量。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.
第二旋转四元数是从旋转后的向上向量旋转至新的期望向上方向所需的旋转四元数。The second rotation quaternion is the rotation quaternion needed to rotate from the rotated up vector to the new desired up direction.
进而通过第一旋转四元数以及第二旋转四元数,计算得到初始旋转角度。其中,该初始旋转角度表示动画对象能够朝向给定的当前运动方向以及期望向上方向进行旋转。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.
示例性地,可以根据第一旋转四元数与第二旋转四元数之间的乘积,获得初始旋转角度。该初始旋转角度也可以理解为是一个旋转四元数。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.
基于此,可以准确计算得到动画对象的初始旋转角度,从而对动画对象在运动过程中的姿态进行精准控制,实现自然、真实的动画效果。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.
在步骤1152中,根据初始朝向方向以及期望朝向方向,获得初始旋转偏移量。In step 1152, an initial rotation offset is obtained according to the initial orientation direction and the desired orientation direction.
这里,初始旋转偏移量是用于将初始朝向方向旋转至期望朝向方向的旋转角度。例如,假设动画对象的初始朝向方向为正面朝向屏幕外,期望朝向方向为动画对象的正面朝向屏幕里,初始旋转偏移量则用于将动画对象从正面朝向屏幕外旋转至正面朝向屏幕里。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.
需要注意的是,针对每一帧动画帧,其对应的初始旋转偏移量是不变的,均可以通过初始朝向方向以及期望朝向方向计算得到。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.
在步骤1153中,根据初始旋转角度以及初始旋转偏移量,获得目标旋转角度。In step 1153, a target rotation angle is obtained according to the initial rotation angle and the initial rotation offset.
这里,可以将初始旋转角度与初始旋转偏移量进行叠加,获得目标旋转角度。Here, the initial rotation angle and the initial rotation offset may be superimposed to obtain the target rotation angle.
值得说明的是,通过叠加初始旋转偏移量,可以使得动画对象朝向指定的期望朝向方向进行运动。It is worth noting that by superimposing the initial rotation offset, the animation object can be moved in the specified desired direction.
由此,通过上述步骤1151至步骤1153,可以准确计算得到动画对象的目标旋转角度,使得动画对象能够朝向期望朝向方向以及保持期望向上方向进行移动,实现更加真实、自然的动画效果。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.
图14是根据一些实施例示出的渲染动画帧的流程图。如图14所示,在播放动画时,通过检测目标动画数据是否指示对动画对象进行旋转来检测是否开启旋转,在未开启旋转的情况下,直接通过上述实施例进行动画帧渲染以及显示动画帧。在开启旋转的情况下,进一步判断渲染的当前动画帧是否为第一帧动画帧,在确定是第一帧动画帧的情况下,记录动画对象的原始旋转角度,并记录当前帧的第二位置信息作为下一帧的上一帧的第三位置信息。其中,动画对象的原始旋转角度是指动画对象在原始状态下的旋转角度,如原始旋转角度可以为0。通过记录动画对象的原始旋转角度,可以在动画播放结束之后,通过动画对象的原始旋转角度重置动画对象,以准备下一次的动画播放。FIG14 is a flowchart of rendering animation frames according to some embodiments. As shown in FIG14 , when playing an animation, whether rotation is turned on is detected by detecting whether the target animation data indicates that the animation object is rotated. If rotation is not turned on, the animation frame rendering and display of the animation frame are performed directly through the above embodiment. When rotation is turned on, it is further determined whether the current animation frame rendered is the first animation frame. If it is determined to be 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 ends to prepare for the next animation playback.
在确定当前帧不是第一帧动画帧的情况下,获取当前帧的第二位置信息以及上一帧的第三位置信息,第二位置信息与第三位置信息相减,获得当前运动方向,根据当前运动方向和期望向上方向,计算初始旋转角度,根据初始朝向方向以及期望朝向方向,计算初始旋转偏移量,初始旋转角度与初始旋转偏移量叠加,获得目标旋转角度。然后,对上一帧的目标旋转角度和当前帧的目标旋转角度进行插值,并将插值结果赋值至动画对象,渲染生成当前动画帧。接着,记录当前帧的第二位置信息作为下一帧的上一帧的第三位置信息,并判断动画是否结束,如果动画未结束,则继续渲染动画帧,如果动画结束,则完成整个动画播放流程。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.
图15是根据一些实施例示出的动画播放系统的示意图。如图15所示,动画编辑器(Editor)启动时,从CombineAnimation组件中获取动画数据(AnimationData),并创建动画数据的数据副本(AnimationDataTemp)。动画编辑器实例化一个新的动画播放器(Engine),并将数据副本传入至动画播放器的播放器实例中。当拖拽Timeline的时间轴时,时间更改被传入至动画播放器实例,触发reRender(重新渲染)更改场景动画。FIG15 is a schematic diagram of an animation playback system according to some embodiments. As shown in FIG15 , when the animation editor (Editor) is started, the animation data (AnimationData) is obtained from the CombineAnimation component, and a data copy of the animation data (AnimationDataTemp) is created. The animation editor instantiates a new animation player (Engine) and passes the data copy to the player instance of the animation player. When the timeline is dragged, the time change is passed to the animation player instance, triggering reRender (re-rendering) to change the scene animation.
每一次AnimationDataTemp的数据修改会传递给TrackSystem(轨迹展示系统),在动画编辑场景中生成动画对象的运动轨迹。当操作TrackSystem渲染出来的控制节点时,会同步修改AnimationDataTemp,使得动画对象的运动轨迹更新。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.
需要注意的是,Effect(效果)通常指的是添加到动画中的各种视觉和听觉元素,以增强动画的吸引力和表现力。这些效果可能包括粒子效果(如火焰、烟雾)、光影效果、动态模糊、颜色调整等。animationJson指的是使用JSON(JavaScript Object Notation)格式存储的动画数据。JSON可以用于描述关键帧数据、动画曲线、时间线信息等。CombinedAnimation System(组合动画系统)是用于管理和控制多个动画元素或动画层的系统。RotationAnimation(旋转动画)指的是专门用于控制动画对象旋转的动画模块。在动画编辑器中,Store指的是存储或保存动画数据的地方,可以是一个数据库或文件系统,用于保存动画项目、资源、预设等。NodeList指的是一个包含多个节点(Node)的列表。在动画和图形编程中,节点可以代表场景中的物体、骨骼、控制器等,NodeList用于管理和访问这些节点。CurveArea指的是在动画编辑器中用于编辑和查看动画曲线的区域。EditArea指的是动画编辑器中用于编辑动画的主要工作区域。在这个区域,动画师可以查看动画的预览,调整时间线,编辑关键帧,以及进行其他动画相关的编辑操作。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.
图16是根据一些实施例示出的一种动画编辑装置的结构示意图。如图16所示,本公开实施例提供一种动画编辑装置1600,该动画编辑装置1600可以包括:FIG16 is a schematic diagram of the structure of an animation editing device according to some embodiments. As shown in FIG16 , the present disclosure embodiment provides an animation editing device 1600, and the animation editing device 1600 may include:
获取模块1601,被配置为获取原始动画数据,其中,所述原始动画数据包括多帧关键帧,所述关键帧用于记录动画对象在该关键帧处的初始位置信息;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 the initial position information of the animation object at the key frames;
第一显示模块1602,被配置为根据所述原始动画数据,在动画编辑场景中显示所述关键帧的初始位置信息对应的控制节点以及由所述控制节点构成的所述动画对象的运动轨迹;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;
第一调整模块1603,被配置为响应于针对所述控制节点的第一调整操作,对所述控制节点对应的关键帧的初始位置信息进行调整,获得目标动画数据。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.
可选地,所述动画编辑装置1600还包括:Optionally, the animation editing device 1600 further includes:
第二显示模块,被配置为在所述动画编辑场景中,显示所述关键帧以及所述动画对象;A second display module is configured to display the key frame and the animation object in the animation editing scene;
第二调整模块,被配置为响应于针对所述关键帧的第二调整操作,对所述关键帧对应的时间点进行调整,获得目标动画数据。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.
可选地,所述原始动画数据还包括用于指示至少一帧关键帧对应的初始位置信息与虚拟场景中的元素节点之间的相对位置为目标相对位置的指示信息;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;
所述动画编辑装置1600还包括:The animation editing device 1600 further includes:
第三显示模块,被配置为在所述动画编辑场景中,显示所述元素节点映射在所述动画编辑场景中的虚拟节点,其中,与所述虚拟节点关联的所述至少一帧关键帧对应的控制节点与所述虚拟节点的相对位置为所述目标相对位置;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;
第三调整模块,被配置为响应于针对所述虚拟节点的第三调整操作,根据所述虚拟节点调整后的位置信息以及所述目标相对位置,对所述虚拟节点关联的所述至少一帧关键帧对应的初始位置信息进行调整,获得目标动画数据。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.
可选地,所述获取模块1601包括:Optionally, the acquisition module 1601 includes:
创建单元,被配置为响应于动画编辑指令,在动画编辑场景中创建多帧关键帧,并为各所述关键帧配置对应的初始位置信息,以及在所述动画编辑场景中显示已创建的所述关键帧对应的控制节点和由该控制节点形成的运动轨迹;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;
数据获得单元,被配置为基于所述多帧关键帧,获得所述原始动画数据。The data obtaining unit is configured to obtain the original animation data based on the multiple key frames.
可选地,所述原始动画数据还包括用于指示至少一帧关键帧对应的初始位置信息与虚拟场景中的元素节点之间的相对位置为目标相对位置的指示信息;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;
所述数据获得单元具体被配置为:The data acquisition unit is specifically configured as follows:
在所述动画编辑场景中创建虚拟节点,其中,所述虚拟节点为虚拟场景中的元素节点映射在所述动画编辑场景中的节点;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.
可选地,所述目标动画数据还包括用于控制所述动画对象进行旋转的旋转参数,所述旋转参数包括所述动画对象的期望向上方向、所述动画对象的初始朝向方向以及所述动画对象的期望朝向方向;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;
响应于旋转设置操作,在所述动画编辑场景中配置所述动画对象对应的所述期望向上方向、所述初始朝向方向以及所述期望朝向方向;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.
关于上述动画编辑装置1600中的各个功能模块执行的方法的逻辑可以参照上述实施例相关的方法的部分,在此不再赘述。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.
图17是根据一些实施例示出的一种动画播放装置的结构示意图。如图17所示,本公开实施例提供一种动画播放装置1700,该动画播放装置1700可以包括:FIG17 is a schematic diagram of a structure of an animation playback device according to some embodiments. As shown in FIG17 , the present disclosure embodiment provides an animation playback device 1700, and the animation playback device 1700 may include:
确定模块1701,被配置为根据如上述实施例所述的动画编辑装置,确定目标动画数据,其中,所述目标动画数据包括多帧关键帧,所述关键帧用于记录动画对象在该关键帧处的目标位置信息;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;
获得模块1702,被配置为根据所述目标动画数据,获得所述多帧关键帧对应的目标位置信息构成的运动轨迹;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;
渲染模块1703,被配置为根据所述运动轨迹以及动画对象,渲染获得多帧动画帧,其中,所述多帧动画帧用于描述所述动画对象沿着所述运动轨迹进行运动;A rendering module 1703 is configured to render and obtain multiple animation frames according to the motion trajectory and the animation object, wherein the multiple animation frames are used to describe the motion of the animation object along the motion trajectory;
第四显示模块1704,被配置为显示所述多帧动画帧。The fourth display module 1704 is configured to display the multiple animation frames.
可选地,所述目标动画数据还包括用于指示至少一帧关键帧对应的目标位置信息与虚拟场景中的元素节点之间的相对位置为目标相对位置的指示信息;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;
所述获得模块1702包括:The obtaining module 1702 includes:
位置获取单元,被配置为响应于所述目标动画数据包括所述指示信息,获取所述元素节点在所述虚拟场景中的节点位置信息;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;
第一获得单元,被配置为根据所述节点位置信息以及所述目标相对位置,对所述至少一帧关键帧对应的目标位置信息进行调整,获得调整后的目标位置信息,其中,所述调整后的目标位置信息用于使得所述调整后的目标位置信息与所述元素节点的相对位置为所述目标相对位置;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, and 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;
第二获得单元,被配置为基于所述调整后的目标位置信息,获得所述运动轨迹。The second obtaining unit is configured to obtain the motion trajectory based on the adjusted target position information.
可选地,所述虚拟场景包括直播间页面,所述元素节点包括所述直播间页面中的目标账户的头像,所述目标账户为送出虚拟礼物的第一账户或者接受虚拟礼物的第二账户。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.
可选地,所述目标动画数据还包括用于控制所述动画对象进行旋转的旋转参数,所述旋转参数包括所述动画对象的期望向上方向、所述动画对象的初始朝向方向以及所述动画对象的期望朝向方向;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;
所述渲染模块1703具体被配置为:The rendering module 1703 is specifically configured as follows:
在当前渲染的动画帧为第一动画帧的情况下,根据所述运动轨迹,获得所述动画对象在所述第一动画帧处的第一位置信息,其中,所述第一动画帧为所述目标动画数据对应的第一帧的动画帧;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.
关于上述动画播放装置1700中的各个功能模块执行的方法的逻辑可以参照上述实施例相关的方法的部分,在此不再赘述。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.
下面参考图18,其示出了适于用来实现本公开实施例的电子设备(例如终端设备或服务器)1800的结构示意图。本公开实施例中的终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图18示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。Reference is made to FIG18, which shows a schematic diagram of the structure of an electronic device (e.g., a terminal device or a server) 1800 suitable for implementing an embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. The electronic device shown in FIG18 is only an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.
如图18所示,电子设备1800可以包括处理装置(例如中央处理器、图形处理器等)1801,其可以根据存储在只读存储器(ROM)1802中的程序或者从存储装置1808加载到随机访问存储器(RAM)1803中的程序而执行各种适当的动作和处理。在RAM 1803中,还存储有电子设备1800操作所需的各种程序和数据。处理装置1801、ROM 1802以及RAM 1803通过总线1804彼此相连。输入/输出(I/O)接口1805也连接至总线1804。As shown in FIG18 , 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 into 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.
通常,以下装置可以连接至I/O接口1805:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置1806;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置1807;包括例如磁带、硬盘等的存储装置1808;以及通信装置1809。通信装置1809可以允许电子设备1800与其他设备进行无线或有线通信以交换数据。虽然图18示出了具有各种装置的电子设备1800,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。Typically, the following devices may be connected to the I/O interface 1805: input devices 1806 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 1807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1808 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1809. The communication device 1809 may allow the electronic device 1800 to communicate wirelessly or wired with other devices to exchange data. Although FIG. 18 shows an electronic device 1800 with various devices, it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have alternatively.
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置1809从网络上被下载和安装,或者从存储装置1808被安装,或者从ROM 1802被安装。在该计算机程序被处理装置1801执行时,执行本公开实施例的方法中限定的上述功能。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.
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。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.
在一些实施方式中,电子设备可以利用诸如HTTP(HyperText TransferProtocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。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.
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:获取原始动画数据,其中,所述原始动画数据包括多帧关键帧,所述关键帧用于记录动画对象在该关键帧处的初始位置信息;根据所述原始动画数据,在动画编辑场景中显示所述关键帧的初始位置信息对应的控制节点以及由所述控制节点构成的所述动画对象的运动轨迹;响应于针对所述控制节点的第一调整操作,对所述控制节点对应的关键帧的初始位置信息进行调整,获得目标动画数据。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.
或者,上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:根据如上述实施例所述的动画编辑方法,确定目标动画数据,其中,所述目标动画数据包括多帧关键帧,所述关键帧用于记录动画对象在该关键帧处的目标位置信息;根据所述目标动画数据,获得所述多帧关键帧对应的目标位置信息构成的运动轨迹;根据所述运动轨迹以及动画对象,渲染获得多帧动画帧,其中,所述多帧动画帧用于描述所述动画对象沿着所述运动轨迹进行运动;显示所述多帧动画帧。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.
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言——诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)——连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。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).
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。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.
描述于本公开实施例中所涉及到的模块可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,模块的名称在某种情况下并不构成对该模块本身的限定。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, constitute a limitation on the module itself.
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。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 chip (SOCs), complex programmable logic devices (CPLDs), and the like.
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。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.
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。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.
此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。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.
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。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 (13)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410813830.XA CN118537455A (en) | 2024-06-21 | 2024-06-21 | Animation editing method, playing method, medium, electronic device, and program product |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410813830.XA CN118537455A (en) | 2024-06-21 | 2024-06-21 | Animation editing method, playing method, medium, electronic device, and program product |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118537455A true CN118537455A (en) | 2024-08-23 |
Family
ID=92387867
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410813830.XA Pending CN118537455A (en) | 2024-06-21 | 2024-06-21 | Animation editing method, playing method, medium, electronic device, and program product |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118537455A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119027549A (en) * | 2024-10-10 | 2024-11-26 | 广东咏声动漫股份有限公司 | Animation shot sequence processing method and system |
-
2024
- 2024-06-21 CN CN202410813830.XA patent/CN118537455A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119027549A (en) * | 2024-10-10 | 2024-11-26 | 广东咏声动漫股份有限公司 | Animation shot sequence processing method and system |
CN119027549B (en) * | 2024-10-10 | 2025-03-28 | 广东咏声动漫股份有限公司 | Animation shot sequence processing method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP7422876B2 (en) | Display method and device based on augmented reality, and storage medium | |
JP7604669B2 (en) | Special effects display method, device, equipment and medium | |
CN114677386B (en) | Special effects image processing method, device, electronic device and storage medium | |
JP7300563B2 (en) | Display method, device, and storage medium based on augmented reality | |
WO2022170958A1 (en) | Augmented reality-based display method and device, storage medium, and program product | |
US11238657B2 (en) | Augmented video prototyping | |
US11948257B2 (en) | Systems and methods for augmented reality video generation | |
KR20210030384A (en) | 3D transition | |
CN116958344A (en) | Animation generation method and device for virtual image, computer equipment and storage medium | |
CN114419213A (en) | Image processing method, apparatus, device and storage medium | |
CN118537455A (en) | Animation editing method, playing method, medium, electronic device, and program product | |
KR20230130748A (en) | Image processing methods and apparatus, devices and media | |
CN118710779A (en) | Animation playback method, device, medium, electronic equipment and program product | |
US8363055B1 (en) | Multiple time scales in computer graphics | |
US20180165877A1 (en) | Method and apparatus for virtual reality animation | |
WO2023246302A9 (en) | Subtitle display method and apparatus, device and medium | |
CN116016986A (en) | Rendering method and device for virtual human interaction video | |
CN111862273B (en) | Animation processing method, device, electronic device and storage medium | |
US9396574B2 (en) | Choreography of animated crowds | |
US8462163B2 (en) | Computer system and motion control method | |
CN109636917B (en) | Three-dimensional model generation method, device and hardware device | |
CN117788647A (en) | Method, apparatus and computer readable medium for producing track animation | |
WO2023134537A1 (en) | Split-screen special effect prop generating method and apparatus, device, and medium | |
KR102561903B1 (en) | AI-based XR content service method using cloud server | |
JP7427786B2 (en) | Display methods, devices, storage media and program products based on augmented reality |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |