Disclosure of Invention
The invention provides an animation multiplexing method and system for improving animation development efficiency.
The purpose of the invention is realized by the following technical scheme:
a method of animation multiplexing, comprising:
acquiring an animation file to be processed selected by a user, and recording the animation file as a first file;
acquiring an animation file with the same attribute as the first file after the previous processing, and recording the animation file as a second file;
the timeline for the second file is applied to the first file.
Further, the first file and the second file are csd files written by xml.
Further, the csd file includes object data and the timeline; the object data corresponds to at least one of the attributes.
Further, the time axis comprises frame data, time data and an animation list; the animation list includes an action of an object, and the frame data corresponds to an operation of an animation.
Further, the time axis comprises a plurality of sub-axes, and each sub-axis comprises the frame data and the time data; the animation list comprises a plurality of actions; each attribute corresponds to a sub-axis; the method of applying the time axis of the second file to the first file includes: and acquiring and applying the time axis of the second file corresponding to the attribute by the first file according to the mapping relation between the attribute and the sub-axis.
Further, the animation file comprises a structure tree, and the structure tree and the time axis share the same structure tree model; the animation file is mapped with the structure tree.
Further, the structure tree includes a header for a play operation of the animation file and a node for setting the attribute.
Further, the method for applying the time axis of the second file to the first file comprises the following steps:
selecting a node corresponding to the attribute needing to be applied to the first file in the second file;
synchronizing the selected node to the rendering zone;
the second file obtains nodes which can be synchronized from the rendering area;
and establishing a mapping relation with a time shaft corresponding to the first file according to the synchronized node.
Further, the frame data includes attribute frame data and node frame data controlling the attribute frame data.
A system for animation multiplexing, comprising:
the first acquisition means: the method comprises the steps of obtaining an animation file to be processed selected by a user and recording the animation file as a first file;
a second acquisition means: the animation file is used for acquiring the animation file which is processed in advance and has the same attribute as the first file, and is marked as a second file;
the application device comprises: for applying the time axis of the second file to the first file.
The invention synchronizes different animation files based on the attributes, and the animation files of different animation roles can be shared as long as the attributes are the same, thereby reducing a large amount of repeated labor and simply and conveniently realizing animation multiplexing.
Detailed Description
As shown in FIG. 1, the present invention discloses a method for multiplexing animation, comprising:
s11, acquiring the animation file to be processed selected by the user and recording as a first file;
s12, acquiring an animation file which is processed in advance and has the same attribute as the first file, and recording the animation file as a second file;
s13, applying the time axis of the second file to the first file.
As shown in fig. 2, the present invention also discloses a system for multiplexing animation, comprising:
the first acquisition means 1: the method comprises the steps of obtaining an animation file to be processed selected by a user and recording the animation file as a first file;
the second acquisition means 2: the animation file is used for acquiring the animation file which is processed in advance and has the same attribute as the first file, and is marked as a second file;
the application device 3: for applying the time axis of the second file to the first file.
The invention synchronizes different animation files based on the attributes, and the animation files of different animation roles can be shared as long as the attributes are the same, thereby reducing a large amount of repeated labor and simply and conveniently realizing animation multiplexing.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations as a sequential process, many of the operations can be performed in parallel, concurrently, or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
The term "computer device" or "computer" in this context refers to an intelligent electronic device that can execute predetermined processes such as numerical calculation and/or logic calculation by running predetermined programs or instructions, and may include a processor and a memory, wherein the processor executes a pre-stored instruction stored in the memory to execute the predetermined processes, or the predetermined processes are executed by hardware such as ASIC, FPGA, DSP, or a combination thereof. Computer devices include, but are not limited to, servers, personal computers, laptops, tablets, smart phones, and the like.
The computer equipment comprises user equipment and network equipment. Wherein the user equipment includes but is not limited to computers, smart phones, PDAs, etc.; the network device includes, but is not limited to, a single network server, a server group consisting of a plurality of network servers, or a Cloud Computing (Cloud Computing) based Cloud consisting of a large number of computers or network servers, wherein Cloud Computing is one of distributed Computing, a super virtual computer consisting of a collection of loosely coupled computers. Wherein the computer device can be operated alone to implement the invention, or can be accessed to a network and implement the invention through interoperation with other computer devices in the network. The network in which the computer device is located includes, but is not limited to, the internet, a wide area network, a metropolitan area network, a local area network, a VPN network, and the like.
It should be noted that the user equipment, the network device, the network, etc. are only examples, and other existing or future computer devices or networks may also be included in the scope of the present invention, and are included by reference.
The methods discussed below, some of which are illustrated by flow diagrams, may be implemented by hardware, software, firmware, middleware, microcode, hardware description languages, or any combination thereof. When implemented in software, firmware, middleware or microcode, the program code or code segments to perform the necessary tasks may be stored in a machine or computer readable medium such as a storage medium. The processor(s) may perform the necessary tasks.
Specific structural and functional details disclosed herein are merely representative and are provided for purposes of describing example embodiments of the present invention. The present invention may, however, be embodied in many alternate forms and should not be construed as limited to only the embodiments set forth herein.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of example embodiments. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used herein, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be noted that, in some alternative implementations, the functions/acts noted may occur out of the order noted in the figures. For example, two figures shown in succession may, in fact, be executed substantially concurrently, or the figures may sometimes be executed in the reverse order, depending upon the functionality/acts involved.
Key frame Animation (KeyFrame Animation)
The key frame Animation (KeyFrame Animation) is to prepare a set of time-related values for the attribute needing Animation effect, wherein the values are extracted from the frames with comparison key in the Animation sequence, and the values in other time frames can be calculated by using the key values and adopting a specific interpolation method, so that the smooth Animation effect is achieved.
Animation frame by frame
The Frame-By-Frame animation is a common animation form (Frame By Frame), and the principle thereof is to decompose animation actions in "continuous key frames", that is, draw different contents on each Frame of a time axis Frame By Frame, and continuously play the contents to form the animation. Because the frame sequence content of the frame-by-frame animation is different, not only the production is burdened, but also the final output file volume is large, but the advantages are obvious: the frame-by-frame animation has great flexibility, can represent almost any content to be represented, is similar to a playing mode of a movie, and is very suitable for performing fine animation. For example: sharp turns of the character or animal, waving of hair and clothing, walking, speaking, and delicate 3D effects, etc.
The invention is further described with reference to the drawings and the preferred embodiments.
A method of animation multiplexing, comprising:
acquiring an animation file to be processed selected by a user, and recording the animation file as a first file;
acquiring an animation file with the same attribute as the first file after the previous processing, and recording the animation file as a second file;
the timeline for the second file is applied to the first file.
The files for each animation are csd files written by xml. The csd file includes object data and a timeline (which may also be referred to as animation data); wherein the object corresponds to at least one attribute (e.g., zoom); the time axis includes frames corresponding to operations such as playing or stopping of an animation, time data, and an animation list capable of representing actions (running, jumping, etc.) of an object. The object data corresponds to at least one of the attributes.
The time axis comprises a plurality of sub-axes, and each sub-axis comprises the frame data and the time data; the animation list comprises a plurality of actions; each attribute corresponds to a sub-axis; the method of applying the time axis of the second file to the first file includes: and acquiring and applying the time axis of the second file corresponding to the attribute by the first file according to the mapping relation between the attribute and the sub-axis. The frame data includes attribute frame data and node frame data that controls the attribute frame data.
The animation file comprises a structure tree, and the structure tree and a time shaft share the same structure tree model; the animation file is mapped with the structure tree.
The data types of the structure tree are divided into two types, namely a node type and an attribute type.
The structttreemodel provides a function of whether the deleted data should be displayed on the interface, when the node attribute value is expanded, the node attribute value is displayed, and when the node attribute value is contracted, the node attribute is hidden.
The StructTreeModel caches the mapping between the nodes and TreeIter and is used for quickly searching the corresponding structure tree path through the nodes.
The structTreeModel represents a structure tree model and is responsible for mapping the operation model and the cache node
The structure tree shows the structure of the node tree and provides a method for operating on the node tree.
The structure tree includes a header for a play operation of the animation file and a node setting the attribute.
The structure tree is divided into an upper part and a lower part, wherein the upper part is the head part of the structure tree, and the lower part displays the node tree structure. The structure tree header is used to operate on the playing of the animation, such as start/stop playing, skip to the first/last frame, etc., controlled by the header (TreeHeader) class. The node tree part provides operations on the nodes, such as hiding/displaying the nodes, locking/unlocking the nodes, displaying the node attributes, dragging and changing the parent-child structure of the nodes and the like.
The main classes of the structure tree and their functions are shown in the following table:
the invention establishes various mapping relations through the structure tree model and the structure tree, and can realize the time shaft sharing of the same attribute in different animation files without programming. Specifically, the method comprises the following steps:
the method of applying the time axis of the second file to the first file includes:
selecting a node corresponding to the attribute needing to be applied to the first file in the second file;
synchronizing the selected node to the rendering zone;
the second file obtains nodes which can be synchronized from the rendering area;
and establishing a mapping relation with a time shaft corresponding to the first file according to the synchronized node.
The structure tree needs to synchronize the options with the rendering area, i.e. synchronize the currently selected nodes. When a node is selected in the structure tree, a message is required to be sent to inform a rendering area of refreshing options; when the item in the rendering area is changed, a message needs to be sent to inform the structure tree of refreshing the item. In order to avoid the situation of circularly sending the message, whether the message is sent by the user or not needs to be judged to judge whether the message needs to be processed or not.
The present embodiment also provides an editing panel of a time axis.
The timeline panel provides frame data editing functions including functions to delete frame data, add frame data, move frame data, copy/paste frame data, and the like. There are two types of frame data: node frame data and attribute frame data.
The node frame data is of a virtual type, the function of the node frame data is to conveniently control the attribute frame data, and one node frame data can contain a plurality of attribute frame data. The node frame data is operated on, which is equivalent to operating on all attribute frame data of the node frame data.
Node frame data is dynamically created. When an attribute frame data is created, the node frame data can be automatically created; when one node frame data is created manually, one frame data is created for all the displayed attribute frame data of the node. Since the node frame data is modeled, it is not exported into the data.
The attribute frame data is a real type that corresponds to the value of the attribute of the node in the frame data. Attribute frame data may be exported into the data. The node has a plurality of attributes, and the animation is displayed only when attribute frame data exists on the time axis.
In another embodiment of the present invention, a system for multiplexing moving pictures is provided, which can implement the above-mentioned method. The system comprises:
the first acquisition means: the method comprises the steps of obtaining an animation file to be processed selected by a user and recording the animation file as a first file;
a second acquisition means: the animation file is used for acquiring the animation file which is processed in advance and has the same attribute as the first file, and is marked as a second file;
the application device comprises: for applying the time axis of the second file to the first file.
The foregoing is a more detailed description of the invention in connection with specific preferred embodiments and it is not intended that the invention be limited to these specific details. For those skilled in the art to which the invention pertains, several simple deductions or substitutions can be made without departing from the spirit of the invention, and all shall be considered as belonging to the protection scope of the invention.