[go: up one dir, main page]

CN112667942B - Animation generation method, device and medium - Google Patents

Animation generation method, device and medium Download PDF

Info

Publication number
CN112667942B
CN112667942B CN201910983051.3A CN201910983051A CN112667942B CN 112667942 B CN112667942 B CN 112667942B CN 201910983051 A CN201910983051 A CN 201910983051A CN 112667942 B CN112667942 B CN 112667942B
Authority
CN
China
Prior art keywords
animation
edited
clip
target
event
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.)
Active
Application number
CN201910983051.3A
Other languages
Chinese (zh)
Other versions
CN112667942A (en
Inventor
邝其毅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910983051.3A priority Critical patent/CN112667942B/en
Publication of CN112667942A publication Critical patent/CN112667942A/en
Application granted granted Critical
Publication of CN112667942B publication Critical patent/CN112667942B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

The invention discloses an animation generation method, an animation generation device and a medium. The method comprises the steps of responding to animation editing instructions, obtaining at least two animation fragments to be edited, wherein each animation fragment to be edited comprises at least one page element, configuring at least one style attribute group for the page element corresponding to each animation fragment to be edited by means of a cascading style sheet, creating a corresponding playing time shaft for each animation fragment to be edited by means of the cascading style sheet, wherein the playing time shaft is used for describing playing time attributes of the page elements corresponding to different style attribute groups in the animation fragments to be edited, obtaining target animation fragments according to the playing time shaft of each animation fragment to be edited, the page element corresponding to each animation fragment to be edited and the style attribute group corresponding to the animation fragment to be edited, setting corresponding playing time sequence identifiers for each target animation fragment by means of the cascading style sheet, and generating target animation according to the playing time sequence identifiers of each target animation fragment and each target animation fragment.

Description

Animation generation method, device and medium
Technical Field
The present invention relates to the field of internet communications technologies, and in particular, to an animation generating method, device, and medium.
Background
With the development of internet communication technology, dynamic expression forms such as animation are presented besides static expression forms such as text, and the user experience of acquiring related content can be greatly improved when the dynamic expression forms are presented in the page.
In the prior art, animation is often packaged into js functions (event response functions; js: javaScript, an transliterated script language), and the animation is displayed by frequently acquiring and changing patterns of related elements inside the functions and manually setting time delays of the functions. For example, the left shift of element a is increased by 1px (pixel, a unit of relative length) every 16ms (milliseconds), moving from 100px (corresponding position) to 200px (corresponding position). The efficiency of animation development by using js function is low, and corresponding reference is needed when the style of the element is modified. Accordingly, there is a need to provide more efficient development schemes for animations.
Disclosure of Invention
In order to solve the problems of low development efficiency and the like when the prior art is applied to developing the animation, the invention provides an animation generation method, an animation generation device and a medium:
in one aspect, the present invention provides an animation generation method, the method comprising:
Responding to an animation editing instruction, and acquiring at least two animation fragments to be edited, wherein a page element set of each animation fragment to be edited comprises at least one page element;
respectively configuring at least one style attribute group for the page element corresponding to each animation fragment to be edited by using a cascading style sheet, wherein each style attribute group comprises at least one style attribute value;
creating a corresponding playing time shaft for each animation segment to be edited by using the cascading style sheet, wherein the playing time shaft is used for describing the playing time attribute of each page element corresponding to different style attribute groups in the animation segment to be edited;
Obtaining a target animation fragment according to the playing time axis of each animation fragment to be edited, the page element set of each animation fragment to be edited and the style attribute group corresponding to each page element in the corresponding page element set;
Setting a corresponding playing time sequence identifier for each target animation segment by using the cascading style sheet;
And generating a target animation according to each target animation segment and the playing time sequence identification of each target animation segment.
Another aspect provides an animation generation apparatus, the apparatus comprising:
The animation segment to be edited obtaining module is used for responding to animation editing instructions to obtain at least two animation segments to be edited, and a page element set of each animation segment to be edited comprises at least one page element;
The page element configuration module is used for configuring at least one style attribute group for the page element corresponding to each animation fragment to be edited by using a cascading style sheet, wherein each style attribute group comprises at least one style attribute value;
The play time shaft creation module is used for creating a corresponding play time shaft for each animation segment to be edited by utilizing the cascading style sheet, and the play time shaft is used for describing play time attributes of the page elements corresponding to different style attribute groups in the animation segment to be edited;
The target animation segment generation module is used for obtaining target animation segments according to the playing time axis of each animation segment to be edited, the page element set of each animation segment to be edited and the style attribute set corresponding to each page element in the corresponding page element set;
A play time sequence identifier setting module, configured to set a corresponding play time sequence identifier for each target animation segment by using the cascading style sheet;
And the target animation generation module is used for generating target animation according to each target animation segment and the playing time sequence identification of each target animation segment.
In another aspect, an electronic device is provided that includes a processor and a memory having at least one instruction, at least one program, a set of codes, or a set of instructions stored therein, the at least one instruction, the at least one program, the set of codes, or the set of instructions being loaded and executed by the processor to implement an animation generation method as described above.
Another aspect provides a computer readable storage medium having stored therein at least one instruction, at least one program, code set, or instruction set loaded and executed by a processor to implement an animation generation method as described above.
The animation generation method, the animation generation device and the animation generation medium provided by the invention have the following technical effects:
In the animation generation process, style attributes of page elements in animation fragments to be edited and playing time of page elements in the fragments are set by using a cascading style sheet to obtain target animation fragments, and corresponding playing time sequence identifiers are set for each target animation fragment by using the cascading style sheet to obtain target animation. And utilizing the cascading style sheets to carry out animation development, and processing the style attribute of the page element and the time lines inside and outside the animation fragments by the cascading style sheets, so that the development efficiency can be improved. When adjustment based on the display effect is required, the modification efficiency and the modification accuracy are also high.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions and advantages of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of an application environment provided by an embodiment of the present invention;
FIG. 2 is a flow chart of an animation generation method according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of setting at least one style attribute group for the page element corresponding to each animation segment to be edited by using a cascading style sheet according to an embodiment of the present invention;
FIG. 4 is a schematic flow chart of setting at least one style attribute group for the page element corresponding to each animation segment to be edited by using a cascading style sheet according to an embodiment of the present invention;
FIG. 5 is a schematic flow chart after setting at least one style attribute group for the page element corresponding to each animation segment to be edited by using a cascading style sheet according to an embodiment of the present invention;
FIG. 6 is a schematic flow chart of creating a corresponding playing time axis for each animation segment to be edited using the cascading style sheet according to an embodiment of the present invention;
FIG. 7 is a flowchart of an animation generation method according to an embodiment of the present invention;
FIG. 8 is a block diagram showing the constitution of an animation generating apparatus according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It is noted that the terms "comprises" and "comprising," and any variations thereof, in the description and claims of the present invention and in the foregoing figures, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or server comprising a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus.
Referring to fig. 1, fig. 1 is a schematic diagram of an application environment provided by an embodiment of the present invention, as shown in fig. 1, in the application environment, an animation in a page is obtained based on rendering corresponding data, so that a user can obtain relevant content through a dynamic representation form of the animation, the user can obtain relevant content more intuitively, and the user experience of obtaining relevant content is better. It should be noted that fig. 1 is only an example.
In the embodiment of the invention, a user can acquire the display content carried in the target page in the form of animation through a display terminal, wherein the display terminal comprises, but is not limited to, a mobile intelligent telephone, a tablet electronic device, a portable computer (such as a notebook computer and the like), a Personal Digital Assistant (PDA), a desktop computer and an intelligent wearable device.
Specifically, the display terminal may run an application client, and the target page may be a page opened based on an internal link (a page link provided by a background server of the application program, where a page resource corresponding to the internal link is provided by the background server), or may be a page opened based on an external link (a page link provided by a third party server interfacing with the application program, where a page resource corresponding to the external link is provided by the third party server). Applications include, but are not limited to, social applications (e.g., weChat applications), entertainment-enabled applications (e.g., video applications, audio applications, gaming applications, and reading software), and service-enabled applications (e.g., map navigation applications, group purchase applications). The display content of the target page is not limited.
In the following, a specific embodiment of an animation generation method according to the present invention is described, and fig. 2 is a schematic flow chart of an animation generation method according to an embodiment of the present invention, and the present specification provides the steps of the method according to the embodiment or the flowchart, but may include more or less steps based on conventional or non-inventive labor. The order of steps recited in the embodiments is merely one way of performing the order of steps and does not represent a unique order of execution. When implemented in a real system or server product, the methods illustrated in the embodiments or figures may be performed sequentially or in parallel (e.g., in a parallel processor or multithreaded environment). As shown in fig. 2, the method may include:
S201, responding to an animation editing instruction, and acquiring at least two animation fragments to be edited, wherein a page element set of each animation fragment to be edited comprises at least one page element;
In the embodiment of the invention, the animation to be generated can be composed of at least two animation segments, a certain play sequence is arranged between the animation segments, each animation segment can correspond to at least one frame of picture, and each frame of picture can be presented based on at least one corresponding page element.
Accordingly, at least two animation clips to be edited, which may be currently created, or may be created previously (such as in the case of adjusting the display effect of the generated animation), are obtained in response to the animation editing instruction. The page element set of each animation segment to be edited comprises at least one page element. For example, when an animation segment to be edited can correspond to multiple frames of pictures, each frame of picture can be displayed based on a corresponding plurality of page elements, then the page element set of the animation segment to be edited includes page elements for all frame pictures to be displayed. The page elements may include text boxes, drop-down boxes, floating windows, buttons, images, videos, and the like.
In a specific embodiment, after the obtaining at least two animation segments to be edited, the method further includes:
and determining a time sequence identifier to be played corresponding to each animation fragment to be edited. The time sequence to be played identifies the play position in the expected play sequence used to characterize the animation segment to be edited.
S202, configuring at least one style attribute group for the page element corresponding to each animation fragment to be edited by using a cascading style sheet, wherein each style attribute group comprises at least one style attribute value;
In an embodiment of the present invention, a cascading style sheet (CSS, cascading Style Sheets,) is a computer language used to represent file styles such as HTML (an application of standard universal markup language) or XML (a subset of standard universal markup language), which is a language that controls the style of a web page element style. The CSS can accurately control the typesetting of element positions in the webpage at a pixel level, supports almost all font size styles, and has the capability of editing webpage objects and model styles. The static appearance attributes of the page elements, such as positioning, fonts, word sizes, frames, colors, background colors, spacing, margin and the like, can be controlled by using the cascading style sheet, and the dynamic effect of the page elements can be realized by using the cascading style sheet through setting key frames, transition modes and the like.
The animation segment to be edited may correspond to a plurality of frames of pictures, each frame of picture may be displayed based on a corresponding plurality of page elements, and the plurality of page elements corresponding to each frame of picture may be referred to as a page element group. The union of the multiple page element groups corresponding to the same animation segment to be edited constitutes the page element set of the animation segment to be edited.
Style is the appearance of a page element. The page elements (or display objects constructed from at least one page element) may correspond to static styles or may correspond to animated styles. The animation style actually corresponds to the transition from one static style to another. The static style may be set by style attribute values of the page elements (which may correspond to the static appearance attributes described previously). The animation style may include a fade of transparency, a fade of displacement, a fade of zoom, a fade of rotation, etc. The successful configuration of the animation style requires not only the configuration of the static style but also the linking and adaptation between the static styles. And respectively configuring at least one style attribute group for the page element corresponding to each animation fragment to be edited by using a cascading style sheet. For example, the nth (N is a positive integer) frame of the animation segment a to be edited is displayed based on the page element a and the page element b, and one style property group a1 may be configured for the page element a and one style property group b1 may be configured for the page element b by using the cascading style sheet. The style attribute values included in the style property group a1 may include a style attribute value pointing to the position of the page element a, a style attribute pointing to the transparency of the page element a, and the like. The n+2th frame of the animation segment A to be edited is displayed based on the page element a and the page element c, and one style attribute group a2 can be configured for the page element a and one style attribute group c1 can be configured for the page element c by using the cascading style sheet. The style attribute values included in the style property group a2 may include a style attribute value pointing to the page element a position, a style attribute pointing to the page element a color, and the like.
In a specific embodiment, as shown in fig. 3, the setting, by using a cascading style sheet, at least one style attribute group for the page element corresponding to each animation segment to be edited includes:
S301, responding to an element configuration instruction, and determining at least one display object for constructing each animation segment to be edited and at least one page element corresponding to the display object;
For example, in response to the element configuration instruction, it is determined that the animation segment B to be edited includes a display object B1, a display object B2, a display object B3, and a display object B4. As shown in fig. 1, the display object B1 may correspond to a button element (page element) that needs to be continuously rotated in the upper right corner of the corresponding frame. The display object B2 may correspond to an arrow element (page element) that needs to be jumped and continuously displaced left and right in the corresponding frame. The display object B3 may correspond to a person object corresponding to a plurality of page elements, the person object being required to appear gradually from top to bottom of the corresponding frame, and the person object being required to make a posture change (such as being opened by both hands to being gripped by both hands) in the corresponding frame. The display object B4 may correspond to a dialog box element (page element) that needs to appear in the corresponding frame.
S302, setting the style attribute groups for the page elements corresponding to each display object by using the cascading style sheet.
The style property group may be set for the page element corresponding to each display object based on the above-mentioned requirements of "the button element needs to be continuously rotated at the upper right corner of the corresponding frame picture", "the arrow element needs to be continuously shifted left and right in the jumping of the corresponding frame picture", and the like. The cascading style sheet can be used for realizing the accurate control of the pixel level of the page element, and ensuring the realization of the display effect in the subsequent vivid target animation.
In another specific embodiment, as shown in fig. 4, the setting, by using a cascading style sheet, at least one style attribute group for the page element corresponding to each animation segment to be edited includes:
S401, when the page element sets of the at least two animation fragments to be edited contain the same associated element, setting a style attribute initial value and a style attribute increment for the associated element by utilizing the cascading style sheet;
The association element is included in the page element set of the at least two animation clips to be edited, and further, the association element may be included in a page element group corresponding to each frame of picture of each animation clip to be edited. As shown in fig. 1, for example, there are 8 animation segments to be edited, where the 8 animation segments to be edited respectively describe a corresponding scene, and the 8 scenes form an animation display content for representing forward walking of a character object. The person object moves backward, and accordingly, may be an offset of a road surface element (or a road surface object constructed by at least one road surface element) in a specific direction. The pavement element is a correlation element.
In combination with the "to-be-played time sequence identifier" recorded in step S201, the style attribute initial value indicates a style attribute of the associated element in an expected earliest playing animation segment, the expected earliest playing animation segment is the to-be-edited animation segment corresponding to the to-be-played time sequence identifier representing earliest playing, the style attribute increment indicates a style attribute difference between expected adjacent playing animation segments of the associated element, and the expected adjacent playing animation segment is the two to-be-edited animation segments corresponding to the to-be-played time sequence identifier representing adjacent playing. Taking pavement elements as an example, the initial value of the style attribute can be set to be-1110 pixels (px) and expressed by r0, and the increment value of the style attribute can be set to be-1280 pixels (px) and expressed by r 1. r0 represents a displacement attribute value of the road surface element in the 1 st scene, and r1 represents an offset of the displacement attribute value of the road surface element each time in adjacent scene switching.
S402, obtaining a style attribute value of the associated element corresponding to the animation segment to be edited according to the style attribute initial value, the style attribute increment and the time sequence identifier to be played of the animation segment to be edited;
and the 8 scenes form animation display contents for representing forward walking of the character object, and the 8 scenes correspond to the to-be-played time sequence identification of the animation fragment to be edited. The time sequence identifier to be played of the animation segment to be edited may be taken to be N (N is a positive integer, N is less than or equal to 8), for example, the time sequence identifier to be played corresponding to the 3 rd scene is 3. And in this way, the style attribute value=r0+n×r1 of the associated element corresponding to the animation segment to be edited.
According to the common attribute of the associated elements in the continuous scenes forming the animation display content, the style attribute of the associated elements can be configured by adding the style attribute value as a fixed value, the style attribute configuration of the associated elements in each scene is not needed, the style attribute configuration step can be saved, and the complexity and the workload of modification can be reduced when the associated elements are required to be subjected to related adjustment based on the display effect.
In another specific embodiment, as shown in fig. 5, after the setting at least one style attribute group for the page element corresponding to each animation segment to be edited by using a cascading style sheet, the method further includes:
S501, when the page element set of the animation segment to be edited contains interactive elements, determining a target style attribute group with a transparency attribute value of zero from at least one style attribute group of the interactive elements;
The triggering condition of the interaction element points to user interaction and other non-time factors, the interaction element is bound with the corresponding response event, and the interaction element is triggered to obtain a response result, namely a response event.
The style attribute value of the interactive element may include a case where the transparency attribute value is zero (for example, the transparency of the element changes, the element does not appear before and then suddenly appears, and in fact, may correspond to a process of transparency from 0 to 1). A target style property group including a transparency property value of zero is determined from the at least one style property group of the interactive element.
S502, setting event response attribute values in the target style attribute group to be null by using the cascading style sheet;
The event response attribute value (which may correspond to the pointer-events attribute) is set to null (none) in the target style attribute group of the interactive element. Thus, when the interactive element does not appear in a certain frame of picture (the transparency is 0), the interactive element does not respond based on a triggering condition (such as clicking by a user), and correspondingly, a response event is not triggered, so that the response event is triggered under a reasonable condition. Of course, when the transparency attribute value is other value, the response of the interactive element may be set.
In practical applications, when the pointer-events attribute cannot be changed in a key frame (@ keyframes), an event response function can be used to implement "when an interactive element does not appear in a frame picture (transparency is 0), the interactive element does not respond based on a trigger condition (such as a user click). First, a response event to which the interactive element is bound and an event object to which the response event is registered may be determined. And then updating the binding relation between the event object and the interaction element by using an event response function, namely unbinding the event object and the interaction element based on a transparency threshold. The event response function may be an animation hook (animatedhook), a callback that the animation executes when a particular event occurs.
S203, creating a corresponding playing time shaft for each animation segment to be edited by using the cascading style sheet, wherein the playing time shaft is used for describing the playing time attributes of the page elements corresponding to different style attribute groups in the animation segment to be edited;
In the embodiment of the invention, a cascading style sheet can be utilized to create a corresponding playing time axis for each animation segment to be edited, and a playing time line (timeline) of the page element inside the animation segment to be edited is set.
In a specific embodiment, in combination with the foregoing steps S301 to S302, as shown in fig. 6, the creating, by using the cascading style sheet, a corresponding play timeline for each animation segment to be edited includes:
S601, setting a display time attribute of at least one display object in the animation segment to be edited by using the cascading style sheet;
As shown in fig. 1, the display object B3 may correspond to a person object that corresponds to a plurality of page elements, that needs to appear gradually from top to bottom on the corresponding frame, and that needs to undergo a posture change on the corresponding frame (for example, open hands to grip hands). The display object B4 may correspond to a dialog box element (page element) that needs to appear in the corresponding frame. Of course, a display object B5 may be further included, and the display object B5 may correspond to a two-dimensional code element (of course, may also be other), where the two-dimensional code element needs to appear in a corresponding frame.
The display object B3, the display object B4, and the display object B5 may have a chronological order. And setting a display time attribute of the at least one display object in the animation fragment to be edited by using the cascading style sheet, wherein the display time attribute comprises an appearance time point and an appearance duration of the display object. For example, it is required that the person object appears first (for example, appears at 0 seconds), and the appearance of the person object requires 1s (second). The dialog element appears after the person object, and then the dialog element needs to appear after a delay of 1s, and the dialog element needs to appear for 0.5s. The two-dimensional code element appears after the dialog box element, and then the two-dimensional code element needs to appear after a delay of 1.5s. Thus, the appearance time point of the display object B3 is 0, the appearance time period is 1s (second), the appearance time point of the display object B4 is 1s, the appearance time period is 0.5s, and the appearance time point of the display object B5 is 1.5s. The CSS may be used to set related style attribute values of page elements corresponding to each display object, such as an animation-delay attribute value (corresponding to offset time, appearance time point), an animation-duration attribute value (corresponding to duration, appearance time period; available for a complex animation style such as rotation), a transition attribute value (corresponding to duration, appearance time period; available for a simple animation style such as displacement change, transparency change), an animation-duration-count attribute value (corresponding to the number of times of animation play), and so on.
S602, obtaining the play time axis of the animation segment to be edited according to the display time attribute of the at least one display object;
The obtained play time axis can represent the running condition of each display object in the animation segment to be edited at each moment. The timeline logic inside the animation segment to be edited is handled by a cascading style sheet where the delay associated with a display object depends on the display object in front of it, so that there is some coupling between the display objects. Relevant parameters (such as an animation-delay attribute, an animation-duration attribute and the like) are extracted, so that bug caused by relevant changes in subsequent adjustment based on requirements (coupling condition of various display objects on a time line) can be reduced as much as possible.
S204, obtaining a target animation segment according to the play time axis of each animation segment to be edited, the page element set of each animation segment to be edited and the style attribute group corresponding to each page element in the corresponding page element set;
In the embodiment of the present invention, based on the descriptions in the foregoing steps S201 to S203, a set of page elements of an animation segment to be edited is obtained, a style attribute group corresponding to each page element in the segment in each frame of picture is configured for the animation segment to be edited by using the CSS, and a play time axis corresponding to each page element of attribute groups in different styles in the segment is created for the animation segment to be edited by using the CSS, so that the relevant setting in the segment of each animation segment to be edited is completed, and accordingly, a target animation segment corresponding to the animation segment to be edited can be obtained.
S205, setting a corresponding playing time sequence identifier for each target animation segment by using the cascading style sheet;
in the embodiment of the invention, a cascading style sheet can be utilized to set a corresponding playing time sequence identifier for each target animation segment, which is equivalent to creating a corresponding playing sequence and list. The play time sequence identifies a play position in the play sequence that characterizes the target animation segment. Based on the target animation obtained later, each target animation fragment can be played according to the playing sequence.
In a specific embodiment, after the step of setting the corresponding playing time sequence identifier for each target animation segment by using the cascading style sheet, the method further includes setting class identifiers corresponding to the playing time sequence identifiers for the target animation segments by using the cascading style sheet, wherein the class identifiers corresponding to each target animation segment correspond to the same container identifier.
In practical application, as shown in fig. 1, for example, there are 8 animation segments to be edited, where the 8 animation segments to be edited respectively describe a corresponding scene, and the 8 scenes form an animation display content for representing forward walking of a character object. The user is required to click on the right arrow before the character object can advance to the screen corresponding to the next scene. The container identifier may point to a subsequently obtained target animation or a target page displaying the target animation. When the user clicks on the right arrow, a class (css selector, in the form of dots (), is added to the whole outer container, so as to select multiple page elements), and each frame of picture in the next scene can be processed by this outer class.
S206, generating a target animation according to each target animation segment and the playing time sequence identification of each target animation segment.
In the embodiment of the present invention, based on the descriptions in the foregoing steps S204 to S205, the target animation segments are obtained, and the play sequence outside the segments is created for the target animation segments by using the CSS, so that the relevant settings outside the segments of each target animation segment are equivalent to the completed settings, and accordingly, the target animation formed by the target animation segments can be obtained. The playing form of the target animation can be a carousel.
In a specific embodiment, the generating the target animation according to the target animation segments and the playing time sequence identifier of each target animation segment includes that firstly, when the page element set corresponding to the target animation segment includes an interactive element, binding the interactive element with an associated class identifier corresponding to an associated animation segment by using the cascading style sheet, where the associated animation segment is a response result obtained by triggering the interactive element. And then, generating segment switching configuration information corresponding to the target animation segment according to the binding relation between the interaction element and the association type identifier. And generating the target animation according to each target animation fragment, the playing time sequence identifier of each target animation fragment and fragment switching configuration information corresponding to the target animation fragment.
The triggering condition of the interaction element points to user interaction and other non-time factors. And binding the interactive element with the associated class identifier corresponding to the associated animation segment by using the cascading style sheet, so that the interactive element responds based on a trigger condition (such as clicking by a user), and the associated animation segment serving as a response result is displayed in a jumping manner. For example, the page element set corresponding to the target animation segment 1 includes an interactive element 1, and the target animation segment 1 corresponds to a playing time sequence identifier 1. The associated animation segment may be the target animation segment 2 (corresponding to the playing time sequence identifier 2), that is, the animation segment following the target animation segment 1 in the playing sequence. Of course, the associated animation segment may be the target animation segment 5 (corresponding to the playing time sequence identifier 5), that is, the animation segment in the playing sequence that is not played adjacent to the target animation segment 1.
As shown in fig. 7, the method further includes:
S701, when the page element set of the animation fragment to be edited contains an event callback element, determining an event callback time point and a callback event corresponding to the event callback element;
When the target picture obtained later is displayed, a certain page element is added at a certain stage (such as an ending time point) in the display process of the target animation segment corresponding to the animation segment to be edited. The page element is an event callback element, and the triggering condition of the event callback element points to a time factor. The callback event points to an event of "add event callback element". And the event callback time point points to the time point when the callback event is callback.
S702, registering the callback event in an event object by utilizing an event response function;
The event response function may be an animation hook (animated hook), a callback that the animation executes when a particular event occurs. After the event callback element is created, the callback event may be registered in an event object (document) using an animation hook. The bottom layer of the animated hook is animationend events, which can be encapsulated for observer mode.
S703, binding the event object and the animation fragment to be edited before the event callback time point by utilizing the event response function.
The event object and the animation segment to be edited can be bound based on the event callback time point. In this way, the target animation segment corresponding to the animation segment to be edited triggers the event callback time point (corresponding to the event triggering the animation executing completion event) at a certain stage (such as the ending time point) in the display process, bubbles to the event object, executes the subscribed callback event (adding the event callback element), and then the display of the target animation segment corresponding to the animation segment to be edited is ended.
The animationend event may be triggered after the CSS animation (animation generated based on the web CSS language) is completed. Of course, the case where the CSS animation is terminated before completion is not included, for example, the page element becomes invisible.
As can be seen from the technical solutions provided in the embodiments of the present disclosure, in the process of generating an animation, the embodiments of the present disclosure set style attributes of page elements in a segment of the animation to be edited and play times of page elements inside the segment by using a cascading style sheet to obtain a target animation segment, and then set corresponding play time sequence identifiers for each target animation segment by using the cascading style sheet, thereby obtaining a target animation. And utilizing the cascading style sheets to carry out animation development, and processing the style attribute of the page element and the time lines inside and outside the animation fragments by the cascading style sheets, so that the development efficiency can be improved. The animation logic is hierarchically embodied in the codes corresponding to the target animation, the style and the time line related to the animation are mainly realized by using the cascading style sheet, the related supplement is realized by using the event response function, the code corresponding to the cascading style sheet has weak coupling with the code corresponding to the event response function, and when the adjustment based on the display effect is needed, only the offset in the code corresponding to the cascading style sheet is needed to be focused, so that the efficiency and the accuracy of modification can be higher.
The embodiment of the invention also provides an animation generation device, as shown in fig. 8, which comprises:
the animation segment to be edited obtaining module 810 is configured to obtain at least two animation segments to be edited in response to an animation editing instruction, where a page element set of each animation segment to be edited includes at least one page element;
A page element configuration module 820, configured to configure at least one style attribute group for the page element corresponding to each animation segment to be edited by using a cascading style sheet, where each style attribute group includes at least one style attribute value;
A play time axis creation module 830, configured to create a corresponding play time axis for each animation segment to be edited using the cascading style sheet, where the play time axis is used to describe play time attributes of the page elements corresponding to different style attribute groups in the animation segment to be edited;
The target animation segment generation module 840 is configured to obtain a target animation segment according to the play time axis of each animation segment to be edited, the page element set of each animation segment to be edited, and the style attribute set corresponding to each page element in the corresponding page element set;
A play time sequence identifier setting module 850, configured to set a corresponding play time sequence identifier for each of the target animation clips using the cascading style sheet;
And the target animation generation module 860 is configured to generate a target animation according to each target animation segment and the playing time sequence identifier of each target animation segment.
It should be noted that the apparatus and method embodiments in the apparatus embodiments are based on the same inventive concept.
The embodiment of the invention provides an electronic device, which comprises a processor and a memory, wherein at least one instruction, at least one section of program, a code set or an instruction set is stored in the memory, and the at least one instruction, the at least one section of program, the code set or the instruction set is loaded and executed by the processor to realize the animation generation method provided by the embodiment of the method.
Further, fig. 9 shows a schematic diagram of a hardware structure of an electronic device for implementing the animation generation method provided by the embodiment of the invention, where the electronic device may participate in forming or including the animation generation device provided by the embodiment of the invention. As shown in fig. 9, the electronic device 90 may include one or more processors 902 (shown in the figures as 902a, 902b, 902 n), a memory 904 for storing data, and a transmission means 906 for communication functions (the processor 902 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA or the like). Among other things, a display, an input/output interface (I/O interface), a Universal Serial Bus (USB) port (which may be included as one of the ports of the I/O interface), a network interface, a power supply, and/or a camera may be included. It will be appreciated by those skilled in the art that the configuration shown in fig. 9 is merely illustrative and is not intended to limit the configuration of the electronic device. For example, the electronic device 90 may also include more or fewer components than shown in FIG. 9, or have a different configuration than shown in FIG. 9.
It should be noted that the one or more processors 902 and/or other data processing circuitry described above may be referred to herein generally as "data processing circuitry. The data processing circuit may be embodied in whole or in part in software, hardware, firmware, or any other combination. Further, the data processing circuitry may be a single stand-alone processing module, or incorporated, in whole or in part, into any of the other elements in the electronic device 90 (or mobile device). As referred to in embodiments of the application, the data processing circuit acts as a processor control (e.g., selection of the path of the variable resistor termination connected to the interface).
The memory 904 may be used to store software programs and modules of application software, such as program instructions/data storage devices corresponding to the methods described in embodiments of the present invention, and the processor 902 executes the software programs and modules stored in the memory 94 to perform various functional applications and data processing, i.e., to implement an animation generation method as described above. The memory 904 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 904 may further include memory remotely located relative to the processor 902, which may be connected to the electronic device 90 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission means 906 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communications provider of the electronic device 90. In one example, the transmission means 906 includes a network adapter (NetworkInterfaceController, NIC) that can be connected to other network devices through a base station to communicate with the internet. In one embodiment, the transmission device 906 may be a radio frequency (RadioFrequency, RF) module for communicating wirelessly with the internet.
The display may be, for example, a touch screen type Liquid Crystal Display (LCD) that may enable a user to interact with a user interface of the electronic device 90 (or mobile device).
Embodiments of the present invention also provide a storage medium that may be disposed in an electronic device to store at least one instruction, at least one program, a code set, or a set of instructions related to implementing an animation generation method in a method embodiment, where the at least one instruction, the at least one program, the code set, or the set of instructions are loaded and executed by the processor to implement the animation generation method provided in the method embodiment.
Alternatively, in this embodiment, the storage medium may be located in at least one network server among a plurality of network servers of the computer network. Alternatively, in the present embodiment, the storage medium may include, but is not limited to, a U disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, etc. various media that can store program codes.
It should be noted that the sequence of the embodiments of the present invention is only for description, and does not represent the advantages and disadvantages of the embodiments. And the foregoing description has been directed to specific embodiments of this specification. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the apparatus and electronic device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and references to the parts of the description of the method embodiments are only required.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The foregoing description of the preferred embodiments of the invention is not intended to limit the invention to the precise form disclosed, and any such modifications, equivalents, and alternatives falling within the spirit and scope of the invention are intended to be included within the scope of the invention.

Claims (16)

1.一种动画生成方法,其特征在于,所述方法包括:1. An animation generation method, characterized in that the method comprises: 响应于动画编辑指令,获取至少两个待编辑动画片段,每个所述待编辑动画片段的页面元素集包括至少一个页面元素;In response to the animation editing instruction, obtaining at least two animation clips to be edited, wherein the page element set of each of the animation clips to be edited includes at least one page element; 利用层叠样式表分别为每个所述待编辑动画片段对应的所述页面元素配置至少一个样式属性组,每个所述样式属性组包括至少一个样式属性值;Using a cascading style sheet, respectively configure at least one style attribute group for each page element corresponding to each animation clip to be edited, each of the style attribute groups including at least one style attribute value; 利用所述层叠样式表为每个所述待编辑动画片段创建对应的播放时间轴,所述播放时间轴用于描述所述待编辑动画片段中对应不同所述样式属性组的各个所述页面元素的播放时间属性;Using the cascading style sheet, create a corresponding play time axis for each of the animation clips to be edited, wherein the play time axis is used to describe the play time attributes of each of the page elements corresponding to different style attribute groups in the animation clips to be edited; 根据每个所述待编辑动画片段的所述播放时间轴、每个所述待编辑动画片段的所述页面元素集以及对应的所述页面元素集中各个所述页面元素对应的所述样式属性组得到至少两个目标动画片段,所述至少两个目标动画片段与所述至少两个待编辑动画片段一一对应,每一所述目标动画片段对应一个场景;At least two target animation clips are obtained according to the play time axis of each animation clip to be edited, the page element set of each animation clip to be edited, and the style attribute group corresponding to each page element in the corresponding page element set, wherein the at least two target animation clips correspond to the at least two animation clips to be edited one by one, and each target animation clip corresponds to a scene; 利用所述层叠样式表为每个所述目标动画片段设置对应的播放时间顺序标识;Using the cascading style sheet to set a corresponding play time sequence identifier for each target animation clip; 根据各个所述目标动画片段以及每个所述目标动画片段的所述播放时间顺序标识生成目标动画;Generate a target animation according to each of the target animation clips and the play time sequence identifier of each of the target animation clips; 其中,所述利用所述层叠样式表为每个所述目标动画片段设置对应的播放时间顺序标识之后,还包括:利用所述层叠样式表为所述目标动画片段设置与所述播放时间顺序标识对应的类标识,每个所述目标动画片段的所述类标识指示同一容器标识;After using the cascading style sheet to set a corresponding play time sequence identifier for each target animation segment, the method further includes: using the cascading style sheet to set a class identifier corresponding to the play time sequence identifier for the target animation segment, wherein the class identifier of each target animation segment indicates a same container identifier; 所述根据各个所述目标动画片段以及每个所述目标动画片段的所述播放时间顺序标识生成目标动画,包括:当样本动画片段对应的所述页面元素集包含交互元素时,利用所述层叠样式表将所述交互元素与关联动画片段对应的关联类标识进行绑定,所述关联动画片段为触发所述交互元素得到的响应结果,所述交互元素的触发条件为用户交互因素;根据所述交互元素与所述关联类标识之间的绑定关系生成所述样本动画片段对应的片段切换配置信息;根据各个所述目标动画片段、每个所述目标动画片段的所述播放时间顺序标识以及所述样本动画片段对应的片段切换配置信息生成所述目标动画,所述样本动画片段是所述至少两个目标动画片段中的任一动画片段,所述关联动画片段是剩余动画片段集中的任一动画片段,所述剩余动画片段集指示所述至少两个目标动画片段除所述样本动画片段之外的动画片段。The method of generating a target animation according to each of the target animation clips and the play time sequence identifier of each of the target animation clips comprises: when the page element set corresponding to the sample animation clip includes an interactive element, using the cascading style sheet to bind the interactive element to an associated class identifier corresponding to an associated animation clip, wherein the associated animation clip is a response result obtained by triggering the interactive element, and the triggering condition of the interactive element is a user interaction factor; generating the segment switching configuration information corresponding to the sample animation clip according to the binding relationship between the interactive element and the associated class identifier; generating the target animation according to each of the target animation clips, the play time sequence identifier of each of the target animation clips, and the segment switching configuration information corresponding to the sample animation clip, wherein the sample animation clip is any animation clip of the at least two target animation clips, and the associated animation clip is any animation clip of the remaining animation clip set, and the remaining animation clip set indicates the animation clips of the at least two target animation clips other than the sample animation clip. 2.根据权利要求1所述的方法,其特征在于:2. The method according to claim 1, characterized in that: 所述获取至少两个待编辑动画片段之后,还包括:After obtaining at least two animation clips to be edited, the method further includes: 确定每个所述待编辑动画片段对应的待播放时间顺序标识;Determine the time sequence identifier to be played corresponding to each of the animation clips to be edited; 所述利用层叠样式表分别为每个所述待编辑动画片段对应的所述页面元素设置至少一个样式属性组,包括:The using of cascading style sheets to respectively set at least one style attribute group for each page element corresponding to the animation clip to be edited comprises: 当所述至少两个所述待编辑动画片段的所述页面元素集包含有同一关联元素时,利用所述层叠样式表为所述关联元素设置样式属性初始值和样式属性增值;When the page element sets of the at least two animation clips to be edited include the same associated element, using the cascading style sheet to set style attribute initial values and style attribute increment values for the associated element; 根据所述样式属性初始值、所述样式属性增值以及所述待编辑动画片段的所述待播放时间顺序标识得到所述待编辑动画片段对应的所述关联元素的样式属性值;Obtaining the style attribute value of the associated element corresponding to the animation clip to be edited according to the style attribute initial value, the style attribute increment value and the to-be-played time sequence identifier of the animation clip to be edited; 其中,所述样式属性初始值指示所述关联元素在预期最早播放动画片段中的样式属性,所述预期最早播放动画片段为表征最早播放的所述待播放时间顺序标识对应的所述待编辑动画片段,所述样式属性增值指示所述关联元素在预期相邻播放动画片段之间的样式属性差异,所述预期相邻播放动画片段为表征相邻播放的所述待播放时间顺序标识对应的两个所述待编辑动画片段。Among them, the initial value of the style attribute indicates the style attribute of the associated element in the expected earliest played animation clip, the expected earliest played animation clip is the to-be-edited animation clip corresponding to the to-be-played time sequence identifier representing the earliest playback, and the style attribute increment indicates the style attribute difference of the associated element between the expected adjacent played animation clips, the expected adjacent played animation clips are the two to-be-edited animation clips corresponding to the to-be-played time sequence identifier representing the adjacent playback. 3.根据权利要求1所述的方法,其特征在于,所述方法还包括:3. The method according to claim 1, characterized in that the method further comprises: 当所述待编辑动画片段的所述页面元素集包含有事件回调元素时,确定所述事件回调元素对应的事件回调时间点和回调事件;When the page element set of the animation clip to be edited includes an event callback element, determining an event callback time point and a callback event corresponding to the event callback element; 利用事件响应函数在事件对象注册所述回调事件;Registering the callback event in the event object using the event response function; 利用所述事件响应函数在所述事件回调时间点之前绑定所述事件对象与所述待编辑动画片段。The event response function is used to bind the event object and the animation clip to be edited before the event callback time point. 4.根据权利要求1所述的方法,其特征在于,所述利用层叠样式表分别为每个所述待编辑动画片段对应的所述页面元素设置至少一个样式属性组,包括:4. The method according to claim 1, wherein the step of using a cascading style sheet to set at least one style attribute group for each page element corresponding to each animation clip to be edited comprises: 响应于元素配置指令,确定用于构建每个所述待编辑动画片段的至少一个显示对象以及所述显示对象对应的至少一个所述页面元素;In response to the element configuration instruction, determining at least one display object used to construct each of the animation clips to be edited and at least one of the page elements corresponding to the display object; 利用所述层叠样式表为每个所述显示对象对应的所述页面元素设置所述样式属性组。The style attribute group is set for the page element corresponding to each display object by using the cascading style sheet. 5.根据权利要求4所述的方法,其特征在于,所述利用所述层叠样式表为每个所述待编辑动画片段创建对应的播放时间轴,包括:5. The method according to claim 4, characterized in that the step of using the cascading style sheet to create a corresponding play time axis for each animation clip to be edited comprises: 利用所述层叠样式表设置所述待编辑动画片段中所述至少一个所述显示对象的显示时间属性;Using the cascading style sheet to set the display time attribute of at least one of the display objects in the animation clip to be edited; 根据所述至少一个所述显示对象的所述显示时间属性得到所述待编辑动画片段的所述播放时间轴;Obtaining the play time axis of the animation clip to be edited according to the display time attribute of the at least one display object; 其中,所述显示时间属性包括所述显示对象的出现时间点和出现时长。The display time attribute includes the appearance time point and appearance duration of the display object. 6.根据权利要求1所述的方法,其特征在于,所述利用层叠样式表分别为每个所述待编辑动画片段对应的所述页面元素设置至少一个样式属性组之后,还包括:6. The method according to claim 1, characterized in that after using cascading style sheets to set at least one style attribute group for each page element corresponding to each animation clip to be edited, the method further comprises: 当所述待编辑动画片段的所述页面元素集包含有交互元素时,从所述交互元素的所述至少一个所述样式属性组中确定包括透明度属性值为零的目标样式属性组;When the page element set of the animation clip to be edited includes an interactive element, determining a target style attribute group including a transparency attribute value of zero from the at least one style attribute group of the interactive element; 利用所述层叠样式表将所述目标样式属性组中的事件响应属性值设置为空;Using the cascading style sheet, setting the event response attribute value in the target style attribute group to empty; 其中,所述交互元素与对应的响应事件绑定。Wherein, the interactive element is bound to the corresponding response event. 7.根据权利要求1所述的方法,其特征在于,所述方法还包括:7. The method according to claim 1, characterized in that the method further comprises: 当所述待编辑动画片段的所述页面元素集包含有交互元素时,确定所述交互元素所绑定的响应事件以及所述响应事件所注册的事件对象;When the page element set of the animation clip to be edited includes an interactive element, determining a response event bound to the interactive element and an event object registered for the response event; 利用事件响应函数更新所述事件对象与所述交互元素的绑定关系:基于透明度阈值解绑所述事件对象与所述交互元素。The binding relationship between the event object and the interactive element is updated by using an event response function: the event object and the interactive element are unbound based on a transparency threshold. 8.一种动画生成装置,其特征在于,所述装置包括:8. An animation generation device, characterized in that the device comprises: 待编辑动画片段获取模块:用于响应于动画编辑指令,获取至少两个待编辑动画片段,每个所述待编辑动画片段的页面元素集包括至少一个页面元素;The module for acquiring the animation clip to be edited is used to acquire at least two animation clips to be edited in response to the animation editing instruction, wherein the page element set of each animation clip to be edited includes at least one page element; 页面元素配置模块:用于利用层叠样式表分别为每个所述待编辑动画片段对应的所述页面元素配置至少一个样式属性组,每个所述样式属性组包括至少一个样式属性值;A page element configuration module: configured to configure at least one style attribute group for each page element corresponding to each animation clip to be edited by using a cascading style sheet, wherein each style attribute group includes at least one style attribute value; 播放时间轴创建模块:用于利用所述层叠样式表为每个所述待编辑动画片段创建对应的播放时间轴,所述播放时间轴用于描述所述待编辑动画片段中对应不同所述样式属性组的各个所述页面元素的播放时间属性;A play time axis creation module: used to create a corresponding play time axis for each of the animation clips to be edited by using the cascading style sheet, wherein the play time axis is used to describe the play time attributes of each of the page elements corresponding to different style attribute groups in the animation clips to be edited; 目标动画片段生成模块:用于根据每个所述待编辑动画片段的所述播放时间轴、每个所述待编辑动画片段的所述页面元素集以及对应的所述页面元素集中各个所述页面元素对应的所述样式属性组得到至少两个目标动画片段,所述至少两个目标动画片段与所述至少两个待编辑动画片段一一对应,每一所述目标动画片段对应一个场景;A target animation clip generating module: used for obtaining at least two target animation clips according to the play time axis of each animation clip to be edited, the page element set of each animation clip to be edited, and the style attribute group corresponding to each page element in the corresponding page element set, wherein the at least two target animation clips correspond to the at least two animation clips to be edited one by one, and each target animation clip corresponds to one scene; 播放时间顺序标识设置模块:用于利用所述层叠样式表为每个所述目标动画片段设置对应的播放时间顺序标识;A play time sequence identifier setting module: used to set a corresponding play time sequence identifier for each target animation clip using the cascading style sheet; 目标动画生成模块:用于根据各个所述目标动画片段以及每个所述目标动画片段的所述播放时间顺序标识生成目标动画;A target animation generation module: used for generating a target animation according to each of the target animation clips and the play time sequence identifier of each of the target animation clips; 其中,所述装置还包括类标识设置模块,所述类标识设置模块:用于利用所述层叠样式表为所述目标动画片段设置与所述播放时间顺序标识对应的类标识,每个所述目标动画片段的所述类标识指示同一容器标识;The device further comprises a class identifier setting module, the class identifier setting module being used to set a class identifier corresponding to the play time sequence identifier for the target animation segment by using the cascading style sheet, wherein the class identifier of each target animation segment indicates the same container identifier; 相应的,所述目标动画生成模块:用于当样本动画片段对应的所述页面元素集包含交互元素时,利用所述层叠样式表将所述交互元素与关联动画片段对应的关联类标识进行绑定,所述关联动画片段为触发所述交互元素得到的响应结果,所述交互元素的触发条件为用户交互因素;根据所述交互元素与所述关联类标识之间的绑定关系生成所述样本动画片段对应的片段切换配置信息;根据各个所述目标动画片段、每个所述目标动画片段的所述播放时间顺序标识以及所述样本动画片段对应的片段切换配置信息生成所述目标动画,所述样本动画片段是所述至少两个目标动画片段中的任一动画片段,所述关联动画片段是剩余动画片段集中的任一动画片段,所述剩余动画片段集指示所述至少两个目标动画片段除所述样本动画片段之外的动画片段。Correspondingly, the target animation generation module is used for: when the page element set corresponding to the sample animation clip contains an interactive element, using the cascading style sheet to bind the interactive element to the associated class identifier corresponding to the associated animation clip, the associated animation clip is the response result obtained by triggering the interactive element, and the triggering condition of the interactive element is the user interaction factor; generating the fragment switching configuration information corresponding to the sample animation clip according to the binding relationship between the interactive element and the associated class identifier; generating the target animation according to each of the target animation clips, the playback time sequence identifier of each of the target animation clips and the fragment switching configuration information corresponding to the sample animation clip, the sample animation clip is any animation clip of the at least two target animation clips, the associated animation clip is any animation clip in the remaining animation clip set, and the remaining animation clip set indicates the animation clips of the at least two target animation clips other than the sample animation clip. 9.根据权利要求8所述的装置,其特征在于:9. The device according to claim 8, characterized in that: 所述装置还包括待播放时间顺序标识确定模块,所述待播放时间顺序标识确定模块:用于确定每个所述待编辑动画片段对应的待播放时间顺序标识;The device further comprises a to-be-played time sequence identifier determination module, the to-be-played time sequence identifier determination module being used to determine the to-be-played time sequence identifier corresponding to each of the to-be-edited animation clips; 相应的,所述页面元素配置模块:用于当所述至少两个所述待编辑动画片段的所述页面元素集包含有同一关联元素时,利用所述层叠样式表为所述关联元素设置样式属性初始值和样式属性增值;根据所述样式属性初始值、所述样式属性增值以及所述待编辑动画片段的所述待播放时间顺序标识得到所述待编辑动画片段对应的所述关联元素的样式属性值;Correspondingly, the page element configuration module is used for, when the page element sets of the at least two animation clips to be edited include the same associated element, using the cascading style sheet to set the style attribute initial value and the style attribute increment for the associated element; obtaining the style attribute value of the associated element corresponding to the animation clip to be edited according to the style attribute initial value, the style attribute increment and the to-be-played time sequence identifier of the animation clip to be edited; 其中,所述样式属性初始值指示所述关联元素在预期最早播放动画片段中的样式属性,所述预期最早播放动画片段为表征最早播放的所述待播放时间顺序标识对应的所述待编辑动画片段,所述样式属性增值指示所述关联元素在预期相邻播放动画片段之间的样式属性差异,所述预期相邻播放动画片段为表征相邻播放的所述待播放时间顺序标识对应的两个所述待编辑动画片段。Among them, the initial value of the style attribute indicates the style attribute of the associated element in the expected earliest played animation clip, the expected earliest played animation clip is the to-be-edited animation clip corresponding to the to-be-played time sequence identifier representing the earliest playback, and the style attribute increment indicates the style attribute difference of the associated element between the expected adjacent played animation clips, the expected adjacent played animation clips are the two to-be-edited animation clips corresponding to the to-be-played time sequence identifier representing the adjacent playback. 10.根据权利要求8所述的装置,其特征在于,所述装置还用于当所述待编辑动画片段的所述页面元素集包含有事件回调元素时,确定所述事件回调元素对应的事件回调时间点和回调事件;利用事件响应函数在事件对象注册所述回调事件;利用所述事件响应函数在所述事件回调时间点之前绑定所述事件对象与所述待编辑动画片段。10. The device according to claim 8 is characterized in that the device is also used to determine the event callback time point and callback event corresponding to the event callback element when the page element set of the animation segment to be edited contains an event callback element; register the callback event in the event object using an event response function; and bind the event object and the animation segment to be edited before the event callback time point using the event response function. 11.根据权利要求8所述的装置,其特征在于,所述页面元素配置模块:用于响应于元素配置指令,确定用于构建每个所述待编辑动画片段的至少一个显示对象以及所述显示对象对应的至少一个所述页面元素;利用所述层叠样式表为每个所述显示对象对应的所述页面元素设置所述样式属性组。11. The device according to claim 8 is characterized in that the page element configuration module: is used to determine at least one display object used to construct each of the animation segments to be edited and at least one of the page elements corresponding to the display object in response to an element configuration instruction; and uses the cascading style sheet to set the style attribute group for the page element corresponding to each of the display objects. 12.根据权利要求11所述的装置,其特征在于,所述播放时间轴创建模块:用于利用所述层叠样式表设置所述待编辑动画片段中所述至少一个所述显示对象的显示时间属性;根据所述至少一个所述显示对象的所述显示时间属性得到所述待编辑动画片段的所述播放时间轴;12. The device according to claim 11, characterized in that the play time axis creation module is used to: use the cascading style sheet to set the display time attribute of the at least one display object in the animation clip to be edited; and obtain the play time axis of the animation clip to be edited according to the display time attribute of the at least one display object; 其中,所述显示时间属性包括所述显示对象的出现时间点和出现时长。The display time attribute includes the appearance time point and appearance duration of the display object. 13.根据权利要求8所述的装置,其特征在于,所述装置还包括事件响应属性值设置模块,所述事件响应属性值设置模块:用于当所述待编辑动画片段的所述页面元素集包含有交互元素时,从所述交互元素的所述至少一个所述样式属性组中确定包括透明度属性值为零的目标样式属性组;利用所述层叠样式表将所述目标样式属性组中的事件响应属性值设置为空;13. The device according to claim 8, characterized in that the device further comprises an event response attribute value setting module, wherein the event response attribute value setting module is used to: when the page element set of the animation clip to be edited includes an interactive element, determine a target style attribute group including a transparency attribute value of zero from the at least one style attribute group of the interactive element; and set the event response attribute value in the target style attribute group to be empty by using the cascading style sheet; 其中,所述交互元素与对应的响应事件绑定。Wherein, the interactive element is bound to the corresponding response event. 14.根据权利要求8所述的装置,其特征在于,所述装置还包括绑定关系更新模块,所述绑定关系更新模块:用于当所述待编辑动画片段的所述页面元素集包含有交互元素时,确定所述交互元素所绑定的响应事件以及所述响应事件所注册的事件对象;利用事件响应函数更新所述事件对象与所述交互元素的绑定关系:基于透明度阈值解绑所述事件对象与所述交互元素。14. The device according to claim 8 is characterized in that the device also includes a binding relationship update module, and the binding relationship update module is used to: when the page element set of the animation segment to be edited includes an interactive element, determine the response event bound to the interactive element and the event object registered for the response event; use the event response function to update the binding relationship between the event object and the interactive element; and unbind the event object and the interactive element based on a transparency threshold. 15.一种电子设备,其特征在于,所述电子设备包括处理器和存储器,所述存储器中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由所述处理器加载并执行以实现如权利要求1-7任一所述的动画生成方法。15. An electronic device, characterized in that the electronic device includes a processor and a memory, the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the animation generation method as described in any one of claims 1-7. 16.一种计算机可读存储介质,其特征在于,所述存储介质中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由处理器加载并执行以实现如权利要求1-7任一所述的动画生成方法。16. A computer-readable storage medium, characterized in that the storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the animation generation method as described in any one of claims 1-7.
CN201910983051.3A 2019-10-16 2019-10-16 Animation generation method, device and medium Active CN112667942B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910983051.3A CN112667942B (en) 2019-10-16 2019-10-16 Animation generation method, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910983051.3A CN112667942B (en) 2019-10-16 2019-10-16 Animation generation method, device and medium

Publications (2)

Publication Number Publication Date
CN112667942A CN112667942A (en) 2021-04-16
CN112667942B true CN112667942B (en) 2024-12-10

Family

ID=75400298

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910983051.3A Active CN112667942B (en) 2019-10-16 2019-10-16 Animation generation method, device and medium

Country Status (1)

Country Link
CN (1) CN112667942B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113808237B (en) * 2021-09-18 2024-12-27 珠海金山数字网络科技有限公司 Animation generation method and device
CN113849164B (en) * 2021-09-26 2025-08-19 北京百度网讯科技有限公司 Data processing method, device, electronic equipment and memory
CN114332310A (en) * 2021-11-26 2022-04-12 杭州炽橙数字科技有限公司 A method and system for editing three-dimensional model animation
CN114491363A (en) * 2022-01-13 2022-05-13 海南车智易通信息技术有限公司 Browser page display method and browser
CN115512008A (en) * 2022-10-17 2022-12-23 中国工商银行股份有限公司 Animation generation method, device, computer equipment and storage medium
CN115618155B (en) * 2022-12-20 2023-03-10 成都泰盟软件有限公司 Method and device for generating animation, computer equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU1671701A (en) * 2000-02-28 2001-08-30 Canon Kabushiki Kaisha Object based animations with timelines
CN106168978A (en) * 2016-07-25 2016-11-30 腾讯科技(深圳)有限公司 The treating method and apparatus of pop-up in a kind of webpage

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7173623B2 (en) * 2003-05-09 2007-02-06 Microsoft Corporation System supporting animation of graphical display elements through animation object instances
US8164596B1 (en) * 2011-10-06 2012-04-24 Sencha, Inc. Style sheet animation creation tool with timeline interface
US9619913B2 (en) * 2013-06-03 2017-04-11 Microsoft Technology Licensing, Llc. Animation editing
CN105657518A (en) * 2016-02-04 2016-06-08 厦门幻世网络科技有限公司 Method and device for playing cartoons
US10503803B2 (en) * 2016-11-23 2019-12-10 Google Llc Animated snippets for search results
CN106709070B (en) * 2017-01-25 2020-06-23 腾讯科技(深圳)有限公司 Animation generation method and device and animation playing method and device
CN109359262B (en) * 2018-10-11 2020-09-04 广州酷狗计算机科技有限公司 Animation playing method, device, terminal and storage medium
CN109636887B (en) * 2018-11-29 2023-06-06 北京宇航系统工程研究所 A two-dimensional electronic technical drawing format conversion and vectorization interactive system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU1671701A (en) * 2000-02-28 2001-08-30 Canon Kabushiki Kaisha Object based animations with timelines
CN106168978A (en) * 2016-07-25 2016-11-30 腾讯科技(深圳)有限公司 The treating method and apparatus of pop-up in a kind of webpage

Also Published As

Publication number Publication date
CN112667942A (en) 2021-04-16

Similar Documents

Publication Publication Date Title
CN112667942B (en) Animation generation method, device and medium
US11620784B2 (en) Virtual scene display method and apparatus, and storage medium
US11481948B2 (en) Method, device and storage medium for generating animation group by synthesizing animation layers based on tree structure relation between behavior information and sub-behavior information
US9135228B2 (en) Presentation of document history in a web browsing application
JP7587063B2 (en) Application page display method, device and equipment
US12175576B2 (en) Method, apparatus, device and media for publishing video
US20100088624A1 (en) Animation tool
CN107992246A (en) Video editing method and device and intelligent terminal
US20150248722A1 (en) Web based interactive multimedia system
JP2014524623A (en) Template file processing method and apparatus
CN113326043A (en) Webpage rendering method, webpage manufacturing method and webpage rendering system
US9851874B2 (en) Personalized webpage feature touring system
AU2015376591A1 (en) Desktop sharing method and mobile terminal
CN103858137A (en) Remotely preconfiguring a computing device
KR102184162B1 (en) System and method for producing reactive webtoons
CN116437153A (en) Previewing method and device of virtual model, electronic equipment and storage medium
CN112799552A (en) Method and device for sharing promotion pictures and storage medium
CN117255219A (en) Comment processing method and device, electronic equipment and storage medium
CN114489404A (en) A page interaction method, apparatus, device and storage medium
CN114500731A (en) Advertisement display method and electronic equipment
CN118447173B (en) 3D digital twin display method, system, device and readable storage medium
CN115618155B (en) Method and device for generating animation, computer equipment and storage medium
CN118625972B (en) Page display method and device, electronic device, storage medium, computer program
Georgiev Tools for presenting 3D objects and virtual collections online
CN113033142B (en) Information flow display method, device, equipment and medium

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
GR01 Patent grant
GR01 Patent grant
TG01 Patent term adjustment
TG01 Patent term adjustment