Custom element dynamic effect implementation method and terminal
By splitting dynamic effects into rendering parameters, dynamic effect resources and visual resources, and using the recombination of these resources and the changes in rendering parameters to generate animation script files, the problem of lack of flexibility and reusability of dynamic effects display is solved. , realizes flexible configuration of dynamic effects and resource reuse.
Patent Information
- Application Number
- CN202411699425.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-02-18
AI Technical Summary
The prior art is difficult to achieve flexible allocation of dynamic effects and reuse of resources, resulting in lack of flexibility and reusability of dynamic effects display.
By splitting dynamic effects into rendering parameters, dynamic effect resources and visual resources, using the recombination of dynamic effect resources and visual resources and the changes in rendering parameters, an animation script file is generated to achieve flexible configuration of dynamic effects.
It realizes flexible configuration of dynamic effects and resource reuse, allowing users to customize the display of content, and managing resources through refinement will not affect the rendering effect of the front-end.
Smart Images

Figure CN119473266A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of page design, and in particular to a method and a terminal for realizing dynamic effects of custom elements. Background Art
[0002] Because most existing browsers have stopped supporting Flash (an animation player), the playback of dynamic effects usually relies on directly outputting videos in a single format, such as MP4 format; the entire dynamic effect is finally displayed as a non-interactive static video, the content of which cannot be dynamically adjusted or interactive, and the resources used cannot be reused.
[0003] Another part of the related technologies uses UI-based code to achieve dynamic effects; that is, the display of dynamic effects depends on the specific UI code implementation. Although this can achieve resource and dynamic reuse and adjustment, it requires independent coding for different needs, lacking reusability and flexibility. For example, in HTML5, each dynamic effect requires different code, and if the resources used are different, the same dynamic effect also needs to be coded separately. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a method and a terminal for realizing dynamic effects of custom elements, so as to realize flexible configuration of dynamic effects.
[0005] In order to solve the above technical problems, a technical solution adopted by the present invention is: A method for implementing a custom element dynamic effect, comprising the steps of: Acquire a dynamic effect resource and a visual resource, wherein the visual resource is stored in association with the first resource identifier; Get rendering parameters; Generate a dynamic effect script file according to the dynamic effect resources, visual resources and rendering parameters; If input information is received, the input information includes an input resource identifier and a replacement resource; a first resource identifier that matches the input resource identifier is recorded as a target resource identifier; Replacing the visual resource corresponding to the target resource identifier in the script file with the replacement resource to obtain an updated dynamic effect script file; Play and render according to the updated animation script file.
[0006] In order to solve the above technical problems, another technical solution adopted by the present invention is: A terminal for implementing dynamic effects of custom elements includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented: Acquire a dynamic effect resource and a visual resource, wherein the visual resource is stored in association with the first resource identifier; Get rendering parameters; Generate a dynamic effect script file according to the dynamic effect resources, visual resources and rendering parameters; If input information is received, the input information includes an input resource identifier and a replacement resource; a first resource identifier that matches the input resource identifier is recorded as a target resource identifier; Replacing the visual resource corresponding to the target resource identifier in the script file with the replacement resource to obtain an updated dynamic effect script file; Play and render according to the updated animation script file.
[0007] The beneficial effects of the present invention are: splitting the display of a complete motion effect into rendering parameters, dynamic effect resources and visual resources; if the demand for the motion effect changes, there is no need to rewrite the entire motion effect, but the new motion effect can be written by recombining the dynamic effect resources and visual resources and changing the rendering parameters. By managing the dynamic effect resources and visual resources separately, the visual resources can be replaced separately to display user-defined content. At the same time, by generating a script file separately for front-end playback and rendering, it is ensured that the detailed management of resources in the background will not affect the rendering effect of the front end. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Figure 1 A flowchart of the steps of a method for implementing dynamic effects of custom elements according to an embodiment of the present invention; Figure 2 A schematic diagram of the structure of a terminal for implementing dynamic effects of custom elements according to an embodiment of the present invention; Description of labels: 1. A terminal for realizing dynamic effects of custom elements; 2. A processor; 3. A memory. DETAILED DESCRIPTION
[0009] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in conjunction with the implementation modes and the accompanying drawings.
[0010] Please refer to Figure 1 , a method for implementing a custom element dynamic effect, comprising the steps of: Acquire a dynamic effect resource and a visual resource, wherein the visual resource is stored in association with the first resource identifier; Get rendering parameters; Generate a dynamic effect script file according to the dynamic effect resources, visual resources and rendering parameters; If input information is received, the input information includes an input resource identifier and a replacement resource; a first resource identifier that matches the input resource identifier is recorded as a target resource identifier; Replacing the visual resource corresponding to the target resource identifier in the script file with the replacement resource to obtain an updated dynamic effect script file; Play and render according to the updated animation script file.
[0011] From the above description, it can be seen that the beneficial effects of the present invention are: splitting the display of a complete motion effect into rendering parameters, dynamic effect resources and visual resources; if the demand for the motion effect changes, there is no need to rewrite the entire motion effect, but the new motion effect can be written by recombining the dynamic effect resources and visual resources and changing the rendering parameters. By managing the dynamic effect resources and visual resources separately, the visual resources can be replaced separately to display user-defined content. At the same time, the front-end playback and rendering can be performed by generating a script file separately, ensuring that the detailed management of resources in the background will not affect the rendering effect of the front end.
[0012] Furthermore, obtaining rendering parameters includes: Configuration information is received, and spatial layering, time axis position, and attribute information corresponding to each of the dynamic effect resources is obtained from the configuration information.
[0013] From the above description, we can know that for each dynamic effect resource, we set its corresponding spatial layer, time axis position and attribute information, and then we can render the dynamic effect resource in the corresponding spatial layer and time axis during rendering, so as to achieve the accurate restoration of the dynamic effect that we want to show in the final design. We can also add attribute information and modify its fixed attributes based on the dynamic effect resource to achieve more flexible and changeable dynamic effect editing.
[0014] Furthermore, the acquiring of the dynamic effect resource and the visual resource, wherein the visual resource is associated with the first resource identifier and stored, comprises: Obtain a dynamic effect design file, extract the dynamic effects with the same implementation process in the dynamic effect design file, and obtain a dynamic effect resource; Acquire visual resources generated by graphic editing software, and assign first resource identifiers to the visual resources with different contents; The obtaining of rendering parameters comprises: Obtaining the spatial layering and timeline position of each dynamic effect in the dynamic effect design file; The spatial layering and the timeline position are associated with the dynamic effect resources corresponding to the dynamic effect and saved to obtain rendering parameters corresponding to the dynamic effect design file.
[0015] From the above description, it can be seen that users can generate dynamic effect script files based on existing dynamic effect resources and visual resources in conjunction with rendering parameters; or when there are no dynamic effect resources available, the designed complete dynamic effect design files can be split to obtain reusable dynamic effect resources; and visual resources generated by graphic editing software can be obtained, so that when there are no existing resources that can be directly used, dynamic effects can be designed, and the completed dynamic effect design files can be split into dynamic effect resources for storage and reuse.
[0016] Furthermore, generating a dynamic effect script file according to the dynamic effect resources, visual resources and rendering parameters includes: Acquire association information between the dynamic effect resource and the visual resource; The spatial layering and time axis position corresponding to the dynamic effect resource are associated with the visual resource according to the association information, and the dynamic effect resource is associated with the visual resource to obtain a dynamic effect script file.
[0017] From the above description, it can be seen that since the dynamic effect itself only describes the dynamics, such as gradients, backgrounds, etc., it is also necessary to combine specific visual resources to achieve the complete display of the dynamic effect; visual resources are physical resources such as videos and pictures. Only by associating dynamic effect resources with visual resources can the complete display of the dynamic effect be achieved; at the same time, it is also necessary to associate the spatial layering and timeline position corresponding to the dynamic effect resources in the motion effect design file, so that multiple different dynamic effects can be displayed based on the visual resources in the display form of the motion effect design file, completing the combination of the motion effect design file and the visual resources, and converting it into a script form that the front end can recognize.
[0018] Furthermore, it also includes: If no input information is received, the animation script file is played and rendered.
[0019] From the above description, it can be seen that if no input information is received, the motion effect can be played and rendered directly according to the generated motion effect script file, that is, default visual resources are provided for the associated display of dynamic effect resources, so that the motion effect can be displayed normally without input replacement resources, and there will be no errors or other situations that affect the display effect.
[0020] A terminal for implementing dynamic effects of custom elements includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented: Acquire a dynamic effect resource and a visual resource, wherein the visual resource is stored in association with the first resource identifier; Get rendering parameters; Generate a dynamic effect script file according to the dynamic effect resources, visual resources and rendering parameters; If input information is received, the input information includes an input resource identifier and a replacement resource; a first resource identifier that matches the input resource identifier is recorded as a target resource identifier; Replacing the visual resource corresponding to the target resource identifier in the script file with the replacement resource to obtain an updated dynamic effect script file; Play and render according to the updated animation script file.
[0021] The beneficial effects of the present invention are: splitting the display of a complete motion effect into rendering parameters, dynamic effect resources and visual resources; if the demand for the motion effect changes, there is no need to rewrite the entire motion effect, but the new motion effect can be written by recombining the dynamic effect resources and visual resources and changing the rendering parameters. By managing the dynamic effect resources and visual resources separately, the visual resources can be replaced separately to display user-defined content. At the same time, by generating a script file separately for front-end playback and rendering, it is ensured that the detailed management of resources in the background will not affect the rendering effect of the front end.
[0022] Furthermore, obtaining rendering parameters includes: Configuration information is received, and spatial layering, time axis position, and attribute information corresponding to each of the dynamic effect resources is obtained from the configuration information.
[0023] From the above description, we can know that for each dynamic effect resource, we set its corresponding spatial layer, time axis position and attribute information, and then we can render the dynamic effect resource in the corresponding spatial layer and time axis during rendering, so as to achieve the accurate restoration of the dynamic effect that we want to show in the final design. We can also add attribute information and modify its fixed attributes based on the dynamic effect resource to achieve more flexible and changeable dynamic effect editing.
[0024] Furthermore, the acquiring of the dynamic effect resource and the visual resource, wherein the visual resource is associated with the first resource identifier and stored, comprises: Obtain a dynamic effect design file, extract the dynamic effects with the same implementation process in the dynamic effect design file, and obtain a dynamic effect resource; Acquire visual resources generated by graphic editing software, and assign first resource identifiers to the visual resources with different contents; The obtaining of rendering parameters comprises: Obtaining the spatial layering and timeline position of each dynamic effect in the dynamic effect design file; The spatial layering and the timeline position are associated with the dynamic effect resources corresponding to the dynamic effect and saved to obtain rendering parameters corresponding to the dynamic effect design file.
[0025] From the above description, it can be seen that users can generate dynamic effect script files based on existing dynamic effect resources and visual resources in conjunction with rendering parameters; or when there are no dynamic effect resources available, the designed complete dynamic effect design files can be split to obtain reusable dynamic effect resources; and visual resources generated by graphic editing software can be obtained, so that when there are no existing resources that can be directly used, dynamic effects can be designed, and the completed dynamic effect design files can be split into dynamic effect resources for storage and reuse.
[0026] Furthermore, generating a dynamic effect script file according to the dynamic effect resources, visual resources and rendering parameters includes: Acquire association information between the dynamic effect resource and the visual resource; The spatial layering and time axis position corresponding to the dynamic effect resource are associated with the visual resource according to the association information, and the dynamic effect resource is associated with the visual resource to obtain a dynamic effect script file.
[0027] From the above description, it can be seen that since the dynamic effect itself only describes the dynamics, such as gradients, backgrounds, etc., it is also necessary to combine specific visual resources to achieve the complete display of the dynamic effect; visual resources are physical resources such as videos and pictures. Only by associating dynamic effect resources with visual resources can the complete display of the dynamic effect be achieved; at the same time, it is also necessary to associate the spatial layering and timeline position corresponding to the dynamic effect resources in the motion effect design file, so that multiple different dynamic effects can be displayed based on the visual resources in the display form of the motion effect design file, completing the combination of the motion effect design file and the visual resources, and converting it into a script form that the front end can recognize.
[0028] Furthermore, it also includes: If no input information is received, the animation script file is played and rendered.
[0029] From the above description, it can be seen that if no input information is received, the motion effect can be played and rendered directly according to the generated motion effect script file, that is, default visual resources are provided for the associated display of dynamic effect resources, so that the motion effect can be displayed normally without input replacement resources, and there will be no errors or other situations that affect the display effect.
[0030] The above-mentioned method and terminal for realizing dynamic effects of custom elements of the present invention can be applied to the design of dynamic effects, especially dynamic effects in web pages and dynamic effects that need to display user-defined content, which are described below through specific implementation methods.
[0031] Please refer to Figure 1 , Embodiment 1 of the present invention is: A method for implementing a custom element dynamic effect, comprising the steps of: S1. Acquire dynamic effect resources and visual resources, wherein the visual resources are associated with a first resource identifier and stored, including steps S11-S12.
[0032] S11. Obtain a dynamic effect design file, extract the dynamic effects with the same implementation process in the dynamic effect design file, and obtain dynamic effect resources.
[0033] S12: Acquire visual resources generated by graphic editing software, and assign first resource identifiers to the visual resources with different contents.
[0034] In an optional implementation, the graphic editing software includes Photoshop, After Effects (Ae), and the like.
[0035] In an optional implementation, unified resource management can be performed on dynamic effect resources and visual resources through a cloud server. For example, dynamic effect resources are named according to the effects that can be ultimately presented. When the corresponding effects need to be achieved, designers can directly search for the corresponding dynamic effect resources for reuse without rewriting them. Visual resources can also be used in the same way, using the main body of the resources for easy retrieval.
[0036] S2, obtaining rendering parameters; In an optional implementation, S2 includes receiving configuration information, and obtaining spatial layering, time axis position, and attribute information corresponding to each of the dynamic effect resources from the configuration information.
[0037] In an optional implementation, the timeline position corresponding to the dynamic effect resource can be automatically generated by dragging the dynamic effect resource to the corresponding position on the timeline through visual editing in a timeline arrangement manner.
[0038] In an optional implementation, the spatial layering includes a Z-axis layer, and the Z-axis is along the normal direction of the display screen. In this way, as a user, the direction in which the user is looking is the normal direction of the screen. Setting the Z-axis in the normal direction of the screen can achieve the effect of distinguishing the near and far layers when viewed with the naked eye, increase the sense of hierarchy of the final displayed motion effect, and provide a richer design dimension.
[0039] In an optional implementation, S2 includes S21-S22.
[0040] S21, obtaining the spatial layering and time axis position of each dynamic effect in the dynamic effect design file.
[0041] That is, for the existing designed motion effect design files, they can be layered by space and decomposed according to the position of the timeline, that is, the timeline sequence, to obtain reusable dynamic effects; for example, the same dynamic effect has different presentation effects in different spatial layers and timeline positions, so this step will separately extract the factors of spatial layers and timeline positions to obtain reusable dynamic effects; the spatial layers and timeline positions are used as rendering parameters corresponding to the dynamic effects.
[0042] S22. Associate and save the spatial layering and the time axis position with the dynamic effect resources corresponding to the dynamic effect to obtain rendering parameters corresponding to the dynamic effect design file.
[0043] That is, for dynamic effects with the same essential implementation process, they are refined into dynamic effect resources. It is only necessary to record the spatial layering and timeline position of the dynamic effect resources to be rendered to reproduce the presentation effects designed by the dynamic effect design file. Dynamic effect resources can include different UI elements, such as background, foreground, special effects, etc.; the spatial hierarchy can be preset and bound to the Z-axis coordinate. For example, the preset spatial hierarchy includes the first level, corresponding to the Z-axis coordinate 10; the second level, corresponding to the Z-axis coordinate 0; the third level, corresponding to the Z-axis coordinate -10; then the accurate rendering position can be located according to the Z-axis coordinate during rendering; that is, the content at the viewing position close to the screen display direction on the Z-axis can be fully seen, and the content in the inner direction of the screen may be blocked by the content in the front row.
[0044] From this, it can be seen that if the design is directly carried out through the existing dynamic effect resources, the configuration information input from the outside can be received, and the spatial layering, time axis position and attribute information corresponding to each dynamic effect resource can be set according to the configuration information. For commonly used configuration information templates, the configuration information file can also be saved, and the corresponding configuration information file can be directly called when the same configuration requirements are met in the future. There is no need to configure the rendering parameters for each dynamic effect resource one-to-one, and the corresponding configuration file can be directly called for setting. If there are no dynamic effect resources yet, or the user has already designed dynamic effects through other design software, the designed dynamic effect design file can be converted into a multi-module management method by reading the rendering parameters of the dynamic effects in the designed dynamic effect design file, and the dynamic effect resources can be decoupled from the rendering parameters. If you only need to change the rendering parameters corresponding to a single dynamic effect resource in the future, you can directly get multiple different display effects, thereby realizing the reuse of dynamic effect resources.
[0045] S3, generating a dynamic effect script file according to the dynamic effect resources, visual resources and rendering parameters, including S31-S32.
[0046] S31. Obtain association information between the dynamic effect resource and the visual resource.
[0047] Dynamic effect resources refer to how to realize the content included in dynamic effects, such as background effects and gradient image effects, and do not involve specific visual resources. It can be understood that dynamic effect resources are the steps that need to be implemented, and visual resources are the objects corresponding to the steps. The two need to cooperate to achieve the complete display of dynamic effects.
[0048] Visual resources include pictures, videos and other specific forms of presentation.
[0049] S32. Associating the spatial layering and time axis position corresponding to the dynamic effect resource with the visual resource according to the association information, and associating the dynamic effect resource with the visual resource to obtain a dynamic effect script file.
[0050] In an optional implementation, the dynamic effect resources can be added to different layers according to the obtained spatial stratification through the timeline arrangement system, and the dynamic effect resources can be arranged and combined according to the timeline position. The attribute information of the dynamic effect resource can also be set, such as the second resource identifier, position, size, transparency, rotation angle, display start and end time, etc. That is, for the same dynamic effect resource, the final presentation effect can be changed by changing the attribute information.
[0051] S4, determine whether input information is received, if so, execute S41-S43, otherwise, execute S44; S41. The input information includes an input resource identifier and a replacement resource; a first resource identifier that matches the input resource identifier is recorded as a target resource identifier.
[0052] S42: Replace the visual resource corresponding to the target resource identifier in the script file with the replacement resource to obtain an updated dynamic effect script file.
[0053] In an optional implementation, the process between S41 and S42 includes: obtaining the first resource type of the visual resource corresponding to the target resource identifier, and determining whether the first resource type matches the second resource type of the replacement resource, for example, if they are the same or belong to the same general category, the first resource type matches the second resource type; if they match, S42 is executed, otherwise the user is prompted that the input format is inaccurate and the correct format is prompted before returning to S4, or the execution of S44 is directly jumped after the prompt. It can be seen that in the process of associating dynamic effect resources with visual resources, the dynamic effect resources include a type limitation on the adapted visual resources. For example, if the dynamic effect resource is a color gradient, only visual resources in the image format are adapted. If the user inputs data in other formats, it cannot be correctly read, thereby affecting the display effect. Therefore, a judgment step is added. If the second resource type of the input replacement resource does not match the first resource type, a display error will occur. Early judgment can avoid errors in the display process.
[0054] In an optional implementation, if the first resource type does not match the second resource type between S41 and S42, the second resource type can be converted to the first resource type; for example, if the first resource type to be displayed is a picture, and the user inputs text, the text can be imported into the white background to generate a picture as a replacement resource; for example, if the input is a video, the first frame of the video can be converted into a picture, etc. The user's freedom of customization is increased by automatically converting the format, thereby improving the user's experience; or in the window where the user writes the input information, the corresponding regular expression is obtained according to the target resource identifier input by the user, and the format of the uploaded data is restricted by the regular expression, directly avoiding the user from uploading replacement resources that do not match the first type of resource.
[0055] Among them, because each visual resource has a uniquely generated first resource identifier, when the user inputs custom content, the same first resource identifier can be directly obtained through the input resource identifier corresponding to the custom content to locate the target visual resource, and the target visual resource can be replaced with the input replacement resource, thereby meeting the user's personalized rendering needs. Among them, the input resource identifier can be obtained by the user after selecting the location of the content to be customized, and the first resource identifier of the visual resource closest to the user's selected location can be used as the input resource identifier; or the first resource identifier of the pre-set customizable visual resource can be directly provided to the user's input box for binding as the input resource identifier, which is not limited here.
[0056] In an optional implementation, the format of the animation script file is JSON, which includes the association between dynamic effect resources, visual effect resources, and their association with spatial levels, timeline positions and attribute information, which can be used to guide the display end to render the final animation effect. For example, the JSON file includes the animation duration (the duration of the display of the scheme corresponding to the entire animation script file, that is, the total duration of the animation appearing on the screen), the timeline position timeline (that is, the timeline position of each associated dynamic effect resource and visual effect resource); in the timeline position timeline, it includes the content to be displayed at each time point, where the key value is the time point, in milliseconds; the value value is a list, indicating the visual resource information and the corresponding spatial level and attribute information that need to be displayed at the same time; rendering parameter spatial level layer, attribute information such as display position pos (format is x, y, w, h, where w and h represent the width and height of the rectangular area respectively, and x and y represent the X-axis distance and Y-axis distance of the upper left corner of the rectangular area relative to the upper left corner of the screen respectively); it can also include the type of visual resource type, such as type picture, video, etc.
[0057] The visual resource is represented by a first resource identifier, which may be a preset sequence tag or an element name or other method that can uniquely represent the visual resource.
[0058] For example, the duration of an animation is 10 seconds, and it contains two elements A and B, where A is displayed from the 0th second to the 6th second and B is displayed from the 4th second to the 10th second. The duration of the animation is 10 seconds, and the start display time of A in the timeline is 0 seconds and the display duration is 6 seconds, while the start display time of B is 4 seconds and the display duration is 6 seconds.
[0059] S43, playing and rendering according to the updated animation script file.
[0060] This application ultimately determines the rendering method through a script file to achieve resource reuse and enhanced interactivity. In addition, during the development process, if the dynamic effect resources are not updated, the rendering parameters of the existing dynamic effect resources can be modified directly, or the relationship between the dynamic effect resources and the visual resources can be modified to adjust the dynamic effect. For example, the same dynamic effect of the gradient of the picture is realized; if it is realized by the MP4 video format of the prior art or encoded in HTML5, if it is necessary to replace the corresponding picture or change the timeline position corresponding to the dynamic effect, it is necessary to re-encode the picture, gradient effect and timeline position corresponding to the entire dynamic effect; and the steps in this embodiment only need to obtain the dynamic effect resource corresponding to the picture gradient. If the picture needs to be replaced, it only needs to be re-associated with another visual resource. If the timeline position needs to be adjusted, it only needs to modify its associated rendering parameters to complete the modification; after modifying the association, the script can be regenerated without rebuilding the entire code.
[0061] In addition, during the display process, the display end only needs to parse the script and dynamically present the dynamic effect resources and visual resources according to the time and space order in the rendering parameters. Since the rendering parameters, dynamic effect resources and visual resources are decoupled, the complexity of code maintenance is also reduced. Specifically, the desired dynamic effect can be achieved by rendering according to the Z-axis level and timeline position corresponding to each dynamic effect resource and combining it with its associated visual resources.
[0062] S44, play and render according to the motion effect script file. In the motion effect script file, there are already set dynamic effect resources and visual resources; in the absence of external input, the motion effect can be displayed according to the visual resources in the motion effect script file and the dynamic effect resources, and in the case of external input, the visual resources in the motion effect script file can be replaced according to the external input to realize the customization of the displayed content, that is, the UGC (User Generated Content) function; the user can flexibly choose whether to input data according to the needs, which will not affect whether the motion effect can be successfully displayed in the end. A content customizable solution is provided, and the user can replace the corresponding visual resources with customized content based on the original dynamic effect resources, realizing personalized settings and improving the interactive experience.
[0063] Please refer to Figure 2 , Embodiment 2 of the present invention is: A terminal 1 for realizing dynamic effects of customized elements includes a processor 2, a memory 3, and a computer program stored in the memory 3 and executable on the processor 2. When the processor 2 executes the computer program, each step in the first embodiment is realized.
[0064] In summary, the present invention provides a method and terminal for implementing dynamic effects of custom elements, by dividing the complete dynamic effect presentation into visual resources, dynamic effect resources and rendering parameters; visual resources are used as an intermediate layer, which can read user input to replace the default visual resources, so as to realize the display of user's customized content in the final dynamic effect presentation; and dynamic effect resources and rendering parameters are used as effect layers, so as to realize the reuse of dynamic effect resources. When the dynamic effect presentation needs to be changed, there is no need to rewrite the entire dynamic effect, and the dynamic effect resources can be directly obtained, and the dynamic effect presentation can be changed in conjunction with the change of rendering parameters, thereby improving the development efficiency. And the rendering parameters include spatial hierarchy, timeline position and attribute information; the spatial hierarchy provides richer usage scenarios for the use of dynamic effect resources, and the timeline position enables multiple dynamic effect resources to be presented in order in time; the attribute information can adjust the dynamic effect resources without modifying the dynamic effect resources themselves, thereby realizing an extensible, interactive and customizable dynamic effect presentation.
[0065] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for implementing dynamic effects of custom elements, characterized in that: Includes steps: Acquire a dynamic effect resource and a visual resource, wherein the visual resource is stored in association with the first resource identifier; Get rendering parameters; Generate a dynamic effect script file according to the dynamic effect resources, visual resources and rendering parameters; If input information is received, the input information includes an input resource identifier and a replacement resource; a first resource identifier that matches the input resource identifier is recorded as a target resource identifier; Replacing the visual resource corresponding to the target resource identifier in the script file with the replacement resource to obtain an updated dynamic effect script file; Play and render according to the updated animation script file.
2. A method for realizing dynamic effects of custom elements according to claim 1, characterized in that: The obtaining of rendering parameters comprises: Configuration information is received, and spatial layering, time axis position, and attribute information corresponding to each of the dynamic effect resources is obtained from the configuration information.
3. A method for realizing dynamic effects of custom elements according to claim 2, characterized in that: The acquiring of dynamic effect resources and visual resources, wherein the visual resources are associated with the first resource identifier and stored, comprises: Obtain a dynamic effect design file, extract the dynamic effects with the same implementation process in the dynamic effect design file, and obtain a dynamic effect resource; Acquire visual resources generated by graphic editing software, and assign first resource identifiers to the visual resources with different contents; The obtaining of rendering parameters comprises: Obtaining the spatial layering and timeline position of each dynamic effect in the dynamic effect design file; The spatial layering and the timeline position are associated with the dynamic effect resources corresponding to the dynamic effect and saved to obtain rendering parameters corresponding to the dynamic effect design file.
4. A method for realizing dynamic effects of custom elements according to claim 2, characterized in that: Generating the dynamic effect script file according to the dynamic effect resources, visual resources and rendering parameters includes: Acquire association information between the dynamic effect resource and the visual resource; The spatial layering and time axis position corresponding to the dynamic effect resource are associated with the visual resource according to the association information, and the dynamic effect resource is associated with the visual resource to obtain a dynamic effect script file.
5. A method for realizing dynamic effects of custom elements according to claim 1, characterized in that: Also includes: If no input information is received, the animation script file is played and rendered.
6. A terminal for implementing dynamic effects of custom elements, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the following steps are implemented: Acquire a dynamic effect resource and a visual resource, wherein the visual resource is stored in association with the first resource identifier; Get rendering parameters; Generate a dynamic effect script file according to the dynamic effect resources, visual resources and rendering parameters; If input information is received, the input information includes an input resource identifier and a replacement resource; a first resource identifier that matches the input resource identifier is recorded as a target resource identifier; Replacing the visual resource corresponding to the target resource identifier in the script file with the replacement resource to obtain an updated dynamic effect script file; Play and render according to the updated animation script file.
7. A terminal for realizing dynamic effects of custom elements according to claim 6, characterized in that: The obtaining of rendering parameters comprises: Configuration information is received, and spatial layering, time axis position, and attribute information corresponding to each of the dynamic effect resources is obtained from the configuration information.
8. A terminal for realizing dynamic effects of custom elements according to claim 6, characterized in that: The acquiring of dynamic effect resources and visual resources, wherein the visual resources are associated with the first resource identifier and stored, comprises: Obtain a dynamic effect design file, extract the dynamic effects with the same implementation process in the dynamic effect design file, and obtain a dynamic effect resource; Acquire visual resources generated by graphic editing software, and assign first resource identifiers to the visual resources with different contents; The obtaining of rendering parameters comprises: Obtaining the spatial layering and timeline position of each dynamic effect in the dynamic effect design file; The spatial layering and the timeline position are associated with the dynamic effect resources corresponding to the dynamic effect and saved to obtain rendering parameters corresponding to the dynamic effect design file.
9. A terminal for realizing dynamic effects of custom elements according to claim 7 or 8, characterized in that: Generating the dynamic effect script file according to the dynamic effect resources, visual resources and rendering parameters includes: Acquire association information between the dynamic effect resource and the visual resource; The spatial layering and time axis position corresponding to the dynamic effect resource are associated with the visual resource according to the association information, and the dynamic effect resource is associated with the visual resource to obtain a dynamic effect script file.
10. A terminal for realizing dynamic effects of custom elements according to claim 6, characterized in that: Also includes: If no input information is received, the animation script file is played and rendered.